/*
    KADOSYS Barbearias - estilos base
    Segue a mesma identidade visual (dark, gradiente azul/roxo, glass
    cards) do site institucional e do KADOSYS Igrejas, num arquivo bem
    mais enxuto - este app ainda esta em fase inicial.
*/

:root {
    --bg-dark: #0F172A;
    --bg-dark-2: #111827;
    --primary: #3B82F6;
    --accent: #8B5CF6;
    --white: #FFFFFF;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --text: #E5E7EB;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --radius: 16px;
    --transition: all 0.2s ease;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
}

a {
    color: var(--primary);
    text-decoration: none;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
}

.btn-k {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-k-grad {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: var(--white);
}

.btn-k-grad:hover {
    filter: brightness(1.1);
    color: var(--white);
}

/* ---- Auth (login) ------------------------------------------------- */

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
}

.auth-brand {
    font-weight: 800;
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.auth-subtitle {
    color: var(--gray-400);
    margin: 0 0 1.75rem;
    font-size: 0.9rem;
}

.form-field {
    margin-bottom: 1.1rem;
}

.form-field label {
    display: block;
    font-size: 0.85rem;
    color: var(--gray-400);
    margin-bottom: 0.4rem;
}

.form-field input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.5);
    color: var(--text);
    font-size: 0.95rem;
}

.form-field input:focus {
    outline: none;
    border-color: var(--primary);
}

.auth-alert {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
}

.auth-alert.error {
    background: rgba(239, 68, 68, 0.12);
    color: #FCA5A5;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

/* ---- Dashboard ------------------------------------------------------ */

.dashboard-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.dashboard-topbar .brand {
    font-weight: 800;
}

.dashboard-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.dashboard-eyebrow {
    color: var(--gray-400);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.3rem;
}

.dashboard-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 0 2rem;
}

.modulo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.modulo-card {
    padding: 1.5rem;
    position: relative;
}

.modulo-card .icone {
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
}

.modulo-card h3 {
    font-size: 1.05rem;
    margin: 0 0 0.35rem;
}

.modulo-card p {
    color: var(--gray-400);
    font-size: 0.85rem;
    margin: 0;
}

.modulo-card .badge-em-breve {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--gray-400);
    background: rgba(156, 163, 175, 0.12);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--gray-400);
    border-radius: 999px;
    padding: 0.5rem 1.1rem;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-logout:hover {
    color: var(--white);
    border-color: var(--primary);
}

/* ---- Shell do painel (sidebar + topbar) ------------------------------ */

.dash-shell {
    display: flex;
    min-height: 100vh;
}

.dash-sidebar {
    width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-dark-2);
    border-right: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: var(--transition);
    z-index: 20;
}

.dash-sidebar-brand {
    padding: 1.5rem 1.25rem 1rem;
    font-weight: 800;
    font-size: 1.1rem;
}

.dash-nav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.5rem 0.75rem;
    flex: 1;
}

.dash-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    color: var(--gray-400);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.dash-nav-link .icone {
    font-size: 1rem;
    width: 1.25rem;
    text-align: center;
}

.dash-nav-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.dash-nav-link.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(139, 92, 246, 0.16));
    color: var(--white);
}

.dash-sidebar-footer {
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid var(--glass-border);
}

.dash-sidebar-footer .barbearia-nome {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-sidebar-footer .usuario-nome {
    font-size: 0.78rem;
    color: var(--gray-500);
    margin: 0 0 0.75rem;
}

.dash-main {
    flex: 1;
    min-width: 0;
}

.dash-topbar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    background: var(--bg-dark);
    z-index: 15;
}

.sidebar-toggle-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text);
    border-radius: 8px;
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.1rem;
    cursor: pointer;
}

.sidebar-overlay {
    display: none;
}

@media (max-width: 860px) {
    .dash-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
    }

    .dash-sidebar.aberta {
        transform: translateX(0);
        box-shadow: 20px 0 40px rgba(0, 0, 0, 0.4);
    }

    .dash-topbar {
        display: flex;
    }

    .sidebar-overlay.aberta {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 19;
    }
}

/* ---- Cabecalho de pagina / paineis ------------------------------------ */

.dash-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
}

.dash-page-head .dashboard-title {
    margin-bottom: 0.3rem;
}

.dash-page-subtitle {
    color: var(--gray-400);
    font-size: 0.9rem;
    margin: 0;
}

.dash-panel {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.dash-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.dash-panel-head h2 {
    font-size: 1.1rem;
    margin: 0;
}

.dash-panel-head p {
    color: var(--gray-400);
    font-size: 0.85rem;
    margin: 0.25rem 0 0;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    padding: 1.25rem 1.5rem;
}

.kpi-card .kpi-label {
    color: var(--gray-400);
    font-size: 0.8rem;
    margin: 0 0 0.4rem;
}

.kpi-card .kpi-valor {
    font-size: 1.6rem;
    font-weight: 800;
}

/* ---- Tabelas/listas CRUD ---------------------------------------------- */

.crud-search {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.crud-search input {
    flex: 1;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.5);
    color: var(--text);
    font-size: 0.9rem;
}

.crud-empty {
    text-align: center;
    color: var(--gray-500);
    padding: 3rem 1rem;
    font-size: 0.9rem;
}

.crud-table-wrapper {
    overflow-x: auto;
}

.crud-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.crud-table th {
    text-align: left;
    color: var(--gray-500);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
}

.crud-table td {
    padding: 0.8rem 0.85rem;
    border-bottom: 1px solid var(--glass-border);
    vertical-align: middle;
}

.crud-table tr:last-child td {
    border-bottom: none;
}

.crud-table .text-dim {
    color: var(--gray-500);
}

.actions-col {
    display: flex;
    gap: 0.4rem;
    justify-content: flex-end;
}

.crud-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.crud-icon-btn:hover {
    color: var(--white);
    border-color: var(--primary);
}

.crud-icon-btn.danger:hover {
    color: #FCA5A5;
    border-color: rgba(239, 68, 68, 0.5);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.ok {
    background: rgba(34, 197, 94, 0.14);
    color: #86EFAC;
}

.status-badge.dim {
    background: rgba(156, 163, 175, 0.14);
    color: var(--gray-400);
}

.status-badge.warn {
    background: rgba(245, 158, 11, 0.14);
    color: #FCD34D;
}

.status-badge.danger {
    background: rgba(239, 68, 68, 0.14);
    color: #FCA5A5;
}

.status-badge.info {
    background: rgba(59, 130, 246, 0.14);
    color: #93C5FD;
}

.crud-pagination {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.crud-pagination a,
.crud-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1rem;
    height: 2.1rem;
    padding: 0 0.5rem;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--gray-400);
    border: 1px solid transparent;
}

.crud-pagination a:hover {
    border-color: var(--glass-border);
    color: var(--text);
}

.crud-pagination span.atual {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: var(--white);
    font-weight: 700;
}

/* ---- Formularios CRUD --------------------------------------------------- */

.crud-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.1rem 1.25rem;
}

.crud-field-full {
    grid-column: 1 / -1;
}

.form-field select,
.form-field textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.5);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
}

.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.crud-form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.crud-checkbox-field {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.crud-checkbox-field input {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--primary);
}

/* ---- Toggle switch ------------------------------------------------------ */

.toggle-switch-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .slider {
    position: absolute;
    inset: 0;
    background: rgba(156, 163, 175, 0.25);
    border-radius: 999px;
    cursor: pointer;
    transition: var(--transition);
}

.toggle-switch .slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: var(--white);
    border-radius: 50%;
    transition: var(--transition);
}

.toggle-switch input:checked + .slider {
    background: var(--primary);
}

.toggle-switch input:checked + .slider::before {
    transform: translateX(20px);
}
