:root {
            --primary: #0ea5e9;
            --primary-light: #e0f2fe;
            --primary-hover: #0284c7;
            --secondary: #f59e0b;
            --bg-color: #f8fafc;
            --surface: #ffffff;
            --text-main: #334155;
            --text-muted: #94a3b8;
            --border-color: #f1f5f9;
            --border-radius: 24px;
            --card-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.05);
        }

        [x-cloak] { display: none !important; }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Outfit', sans-serif;
        }

        body {
            background-color: var(--bg-color);
            color: var(--text-main);
            display: flex;
            height: 100vh;
            overflow: hidden;
        }

        .sidebar {
            width: 280px;
            background-color: var(--surface);
            padding: 32px 24px;
            display: flex;
            flex-direction: column;
            border-right: 1px solid var(--border-color);
            overflow: hidden;
            height: 100vh;
            flex-shrink: 0;
            max-height: 100vh;
        }

        .brand {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 48px;
            padding: 0 12px;
            flex-shrink: 0;
        }

                .nav-menu {
            list-style: none;
            display: block; /* Removendo flex para evitar bugs de calculo de height nos filhos */
            flex: 1 1 auto;
            min-height: 0;
            overflow-y: auto;
            overflow-x: hidden;
            padding-bottom: 24px;
        }

        .nav-menu > li {
            margin-bottom: 8px;
        }

        .nav-menu a {
            display: flex;
            align-items: center;
            gap: 16px;
            padding: 16px;
            text-decoration: none;
            color: var(--text-muted);
            border-radius: 16px;
            font-weight: 500;
            transition: all 0.3s;
        }

        .nav-menu a:hover,
        .nav-menu a.active {
            background-color: var(--primary);
            color: white;
            box-shadow: 0 10px 20px -5px rgba(14, 165, 233, 0.3);
        }

        /* Estilos do Submenu Sanfona (Accordion) */
        .nav-menu ul {
            list-style: none;
            padding-left: 0;
        }

        .nav-submenu {
            display: none;
            margin-top: 4px;
            padding-left: 24px;
        }

        .nav-submenu.open {
            display: block;
        }

        .dropdown-toggle {
            justify-content: space-between;
            cursor: pointer;
        }

        .caret-icon {
            font-size: 12px;
            transition: transform 0.3s ease;
            margin-left: auto;
            width: auto !important;
        }

        .dropdown-toggle.open .caret-icon {
            transform: rotate(180deg);
        }

        .nav-submenu.level-2 {
            padding-left: 16px;
        }

        .nav-submenu a {
            font-size: 14px;
            padding: 10px 16px;
        }

        .main-content {
            flex: 1;
            padding: 40px 48px;
            overflow-y: auto;
        }

        header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 48px;
        }

        .page-title h1 {
            font-size: 32px;
            font-weight: 700;
            color: #0f172a;
            margin-bottom: 8px;
            letter-spacing: -0.5px;
        }

        .page-title p {
            color: var(--text-muted);
            font-size: 16px;
        }

        .btn-primary {
            background-color: var(--primary);
            color: white;
            border: none;
            padding: 16px 24px;
            border-radius: 16px;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .btn-primary:hover {
            background-color: var(--primary-hover);
            transform: translateY(-2px);
        }

        .btn-outline {
            background-color: transparent;
            color: var(--text-muted);
            border: 1px solid #cbd5e1;
            padding: 16px 24px;
            border-radius: 16px;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }

        .btn-outline:hover {
            background-color: #f1f5f9;
            color: var(--text-main);
            transform: translateY(-2px);
        }


        .card {
            background-color: var(--surface);
            border-radius: var(--border-radius);
            padding: 32px;
            box-shadow: var(--card-shadow);
            border: 1px solid var(--border-color);
        }

        table {
            width: 100%;
            border-collapse: collapse;
        }

        th {
            text-align: left;
            padding: 16px;
            color: var(--text-muted);
            font-weight: 600;
            font-size: 14px;
            border-bottom: 2px solid var(--border-color);
        }

        td {
            padding: 20px 16px;
            border-bottom: 1px solid var(--border-color);
            font-size: 15px;
            vertical-align: middle;
        }

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

        .client-info {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: var(--primary-light);
            color: var(--primary);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
        }

        .client-name {
            font-weight: 600;
            color: #0f172a;
        }

        .client-phone {
            font-size: 13px;
            color: var(--text-muted);
        }

        .pet-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background-color: #f1f5f9;
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 13px;
            font-weight: 500;
            color: #475569;
            margin-right: 8px;
        }

        .action-btn {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            padding: 8px;
            border-radius: 8px;
            transition: 0.2s;
        }

        .action-btn:hover {
            background-color: #f1f5f9;
            color: var(--primary);
        }

        .dropdown-item {
            display: block;
            width: 100%;
            text-align: left;
            padding: 10px 16px;
            background: none;
            border: none;
            font-size: 14px;
            font-weight: 500;
            color: var(--text-main);
            cursor: pointer;
            border-radius: 8px;
            transition: all 0.2s;
        }

        .dropdown-item:hover {
            background-color: #f1f5f9;
        }
        
        .dropdown-item.text-danger {
            color: #ef4444;
        }
        
        .dropdown-item.text-danger:hover {
            background-color: #fee2e2;
        }

        .dropdown-item.text-success {
            color: #10b981;
        }
        
        .dropdown-item.text-success:hover {
            background-color: #d1fae5;
        }

        .dropdown-item.text-warning {
            color: #f59e0b;
        }

        .dropdown-item.text-warning:hover {
            background-color: #fef3c7;
        }

        .legenda-status {
            background-color: var(--surface);
            border-radius: var(--border-radius);
            padding: 24px;
            box-shadow: var(--card-shadow);
            border: 1px solid var(--border-color);
            margin-top: 24px;
            max-width: 300px;
        }

        .legenda-status h4 {
            margin-bottom: 16px;
            font-size: 16px;
            color: #0f172a;
        }

        .legenda-item {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 10px;
            font-size: 14px;
            color: var(--text-main);
            font-weight: 500;
        }

        .legenda-dot {
            width: 12px;
            height: 12px;
            border-radius: 50%;
        }

        .input-group {
            position: relative;
            display: flex;
            align-items: center;
        }

        .input-group i {
            position: absolute;
            right: 12px;
            color: var(--text-muted);
            cursor: pointer;
        }

        .input-group i:hover {
            color: var(--primary);
        }

        input:read-only {
            background-color: #f1f5f9;
            cursor: not-allowed;
        }

        @media (max-width: 768px) {
            body {
                flex-direction: column;
                overflow: auto;
            }

            .sidebar {
                position: fixed;
                left: -100%;
                top: 0;
                z-index: 1000;
                width: 85%;
                max-width: 320px;
                height: 100vh;
                transition: left 0.3s ease;
                box-shadow: 4px 0 15px rgba(0,0,0,0.1);
            }

            .sidebar.drawer-open {
                left: 0;
            }

            .brand img {
                height: 60px !important;
            }

            .nav-menu {
                padding-bottom: 80px; /* Facilita tocar no último item no celular */
            }

            .main-content {
                padding: 16px;
                overflow: visible;
                width: 100%;
            }

            header {
                flex-direction: column;
                align-items: flex-start;
                gap: 16px;
                margin-bottom: 24px;
            }

            .page-title h1 {
                font-size: 24px;
            }

            /* Adaptação dos Formulários em Celulares */
            form[style*="display: flex"] {
                flex-direction: column !important;
                align-items: stretch !important;
                gap: 16px !important;
            }

            form > div {
                width: 100% !important;
                min-width: 0 !important;
                flex: none !important;
            }

            input, select, button {
                min-height: 44px; /* Área mínima de toque */
            }

            /* Modais em celular */
            div[style*="max-width: 700px"] {
                width: 95% !important;
                max-height: 90vh !important;
                margin: 0 auto;
                padding: 16px !important;
            }

            /* Adaptação das Tabelas */
            .card {
                overflow-x: auto;
                padding: 16px;
            }

            table {
                min-width: 600px; /* Força rolagem horizontal antes de esmagar conteúdo */
            }
        }

        /* FullCalendar Customizations */
        .fc .fc-button-primary {
            background-color: var(--primary);
            border-color: var(--primary);
            border-radius: 8px;
            font-weight: 500;
            padding: 6px 16px;
            box-shadow: none !important;
        }

        .fc .fc-button-primary:hover,
        .fc .fc-button-primary:not(:disabled).fc-button-active,
        .fc .fc-button-primary:not(:disabled):active {
            background-color: var(--primary-hover);
            border-color: var(--primary-hover);
        }

        .fc .fc-button-primary:disabled {
            background-color: #94a3b8;
            border-color: #94a3b8;
        }

        /* Aumentar a altura das linhas da agenda em 50% (padrão é ~1.5em, mudando para 2.25em) */
        .fc-timegrid-slot {
            height: 2.25em !important;
        }

/* =========================================================
   LOGIN PAGE E DASHBOARD (RECUPERADOS)
   ========================================================= */

/* --- LOGIN PAGE --- */
.login-container {
    width: 100%;
    max-width: 420px;
    margin: auto;
    background-color: var(--surface);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}
.login-container .brand {
    justify-content: center;
    margin-bottom: 24px;
}
.login-container form {
    display: flex;
    flex-direction: column;
}
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-main);
}
.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
    font-size: 14px;
}
.alert-error {
    background-color: #fee2e2;
    color: #b91c1c;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-success {
    background-color: #d1fae5;
    color: #047857;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- DASHBOARD INDEX --- */
.agenda-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}
.card {
    background-color: var(--surface);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}
.dashboard-card {
    display: flex;
    align-items: center;
    gap: 16px;
}
.card-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background-color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
.card-info h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}
.card-info p {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
}
.grid-container {
    background-color: var(--surface);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}
.grid-row {
    display: grid;
    grid-template-columns: 80px 2fr 1fr 1fr 150px;
    gap: 16px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}
.grid-row:last-child {
    border-bottom: none;
}
.time {
    font-weight: 700;
    color: var(--primary);
    font-size: 18px;
}
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.bg-wait {
    background-color: #fef3c7;
    color: #d97706;
}
.bg-done {
    background-color: #d1fae5;
    color: #047857;
}

@media (max-width: 768px) {
    .grid-row {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 16px;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        margin-bottom: 12px;
    }
}

/* =========================================================
   AGENDA MOBILE CORRECTIONS
   ========================================================= */
@media (max-width: 768px) {
    /* Menu Agenda Topo */
    .agenda-header-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 16px !important;
    }
    
    .agenda-header-actions > div:first-child {
        width: 100%;
        justify-content: space-between;
    }
    
    .agenda-header-actions select {
        flex: 1;
        width: 100%;
    }

    .agenda-action-buttons {
        width: 100%;
        display: flex;
        gap: 8px !important;
    }

    .agenda-action-buttons button {
        flex: 1;
        padding: 10px 8px !important;
        font-size: 13px !important;
        white-space: nowrap;
    }

    /* FullCalendar - Mobile Fixes */
    .fc .fc-header-toolbar {
        flex-direction: column;
        gap: 16px;
        margin-bottom: 24px !important;
    }
    
    .fc .fc-toolbar-chunk {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        width: 100%;
    }
    
    .fc .fc-toolbar-title {
        font-size: 18px !important;
        text-align: center;
    }

    .fc .fc-button {
        padding: 6px 12px !important;
        font-size: 13px !important;
        height: auto !important;
    }
    
    .fc-button-group {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Aumentar altura do grid no mobile */
    .fc .fc-view-harness {
        min-height: 650px !important;
    }
    .fc .fc-scroller-liquid-absolute {
        position: relative !important;
    }
}

/* =========================================================
   FILTER TABS (CHIPS DE NAVEGAÇÃO E FILTROS)
   ========================================================= */
.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.filter-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 20px;
    background-color: var(--surface);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.filter-tab:hover {
    background-color: #f8fafc;
    color: var(--text-main);
    border-color: #cbd5e1;
}

.filter-tab.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(14, 165, 233, 0.2);
}

/* Scroll horizontal suave no mobile para filtros */
@media (max-width: 768px) {
    .filter-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 12px;
        margin-bottom: 16px;
        gap: 8px;
    }
    
    .filter-tabs::-webkit-scrollbar {
        height: 4px;
        display: none; /* Esconde a barra para ficar clean */
    }
    
    .filter-tabs::-webkit-scrollbar-thumb {
        background: #e2e8f0;
        border-radius: 4px;
    }
}

/* =========================================================
   MODAIS GLOBAIS
   ========================================================= */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--surface);
    border-radius: var(--border-radius);
    padding: 32px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: 20px;
    color: #0f172a;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.2s;
}

.close-btn:hover {
    color: #ef4444;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-main);
    background-color: #f8fafc;
    transition: all 0.2s;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    background-color: var(--surface);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Tabelas e Modais Específicas */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.table-container {
    background-color: var(--surface);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.agenda-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

/* =========================================================
   BOTAO SECUNDARIO (RESTAURADO)
   ========================================================= */
.btn-secondary {
    background-color: var(--surface);
    color: var(--text-main);
    border: 1px solid #cbd5e1;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    white-space: nowrap;
}

.btn-secondary:hover {
    background-color: #f8fafc;
    border-color: #94a3b8;
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: translateY(0);
}
