:root {
    --primary: #2563eb;
    --primary-light: #dbeafe;
    --bg: #f1f5f9;
    --sidebar-bg: rgba(255, 255, 255, 0.8);
    --surface: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --glass: blur(12px) saturate(180%);
    --col-width: 150px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    overflow-x: hidden;
}

h1, h2, h3, .logo span {
    font-family: 'Outfit', sans-serif;
}

/* Layout */
#app {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    background: var(--sidebar-bg);
    backdrop-filter: var(--glass);
    border-right: 1px solid var(--border);
    padding: 24px;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    color: var(--primary);
}

.logo i {
    font-size: 24px;
}

.logo span {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-links {
    list-style: none;
    flex-grow: 1;
}

.nav-links li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    margin-bottom: 8px;
    font-weight: 500;
}

.nav-links li:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.nav-links li.active {
    background-color: var(--primary);
    color: white;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

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

.user-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.user-info span {
    font-weight: 600;
    font-size: 14px;
}

.user-info small {
    font-size: 12px;
    color: var(--text-muted);
}

#logoutBtn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

#logoutBtn:hover {
    color: #ef4444;
    background: #fee2e2;
}

.sidebar-clinic {
    margin: 20px 0;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    border-radius: var(--radius-md);
    color: white;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    animation: fadeIn 0.5s ease-out;
}

.sidebar-clinic small {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
    font-weight: 600;
}

.sidebar-clinic span {
    font-size: 15px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Landing Page Styles */
.landing-page {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    min-height: 100vh;
    color: var(--text);
    overflow-x: hidden;
    overflow-y: auto;
}

.landing-nav {
    display: flex;
    justify-content: space-between;
    padding: 24px 8%;
    align-items: center;
    position: sticky;
    top: 0;
    background: rgba(248, 250, 252, 0.8);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.hero-section {
    display: flex;
    align-items: center;
    padding: 80px 8%;
    gap: 60px;
    max-width: 1400px;
    margin: 0 auto;
}

.hero-content {
    flex: 1;
}

.badge {
    background: #e0e7ff;
    color: #4338ca;
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    display: inline-block;
}

.hero-content h1 {
    font-size: 52px;
    line-height: 1.1;
    margin-bottom: 24px;
    color: #1e293b;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 32px;
    line-height: 1.6;
}

.hero-btns {
    display: flex;
    gap: 16px;
}

.hero-visual {
    flex: 1;
    position: relative;
}

.hero-img {
    width: 100%;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.floating-card {
    position: absolute;
    background: white;
    padding: 16px 24px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10;
    animation: float 3s ease-in-out infinite;
}

.floating-card i {
    color: var(--primary);
    font-size: 20px;
}

.floating-card span {
    font-weight: 600;
    font-size: 14px;
}

.floating-card.c1 { top: -20px; left: -20px; }
.floating-card.c2 { bottom: 40px; right: -30px; animation-delay: 1.5s; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
    padding: 100px 8%;
    background: white;
}

.feature-card {
    padding: 40px;
    border-radius: 20px;
    background: #f8fafc;
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-10px);
}

.feature-card i {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 24px;
}

.feature-card h3 {
    margin-bottom: 12px;
    color: #1e293b;
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    padding: 10px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ghost:hover {
    background: #f1f5f9;
}

/* Super Admin Styles */
.clinic-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.clinic-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.clinic-info h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    color: var(--text);
}

.clinic-info p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

.clinic-actions {
    display: flex;
    gap: 10px;
}

.super-admin-only.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 968px) {
    .hero-section {
        flex-direction: column;
        padding-top: 40px;
        text-align: center;
    }
    .hero-btns {
        justify-content: center;
    }
    .hero-content h1 {
        font-size: 36px;
    }
}


.content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    padding: 24px 32px;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.top-bar h1 {
    font-size: 24px;
    font-weight: 600;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.date-picker {
    display: flex;
    align-items: center;
    gap: 16px;
    background-color: var(--bg);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
}

.date-picker button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.date-picker button:hover {
    color: var(--primary);
}

.date-input-wrapper {
    position: relative;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.date-input-wrapper:hover {
    background: var(--border);
}

#hiddenDatePicker {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.btn-secondary {
    background-color: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 8px;
}

.btn-secondary:hover {
    background-color: var(--bg);
    border-color: var(--primary);
    color: var(--primary);
}

#currentDateDisplay {
    font-weight: 500;
    min-width: 160px;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: filter 0.2s;
}

.btn-primary:hover {
    filter: brightness(1.1);
}

.filters select {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background-color: var(--surface);
    color: var(--text-main);
    font-size: 14px;
    cursor: pointer;
}

/* Agenda Grid - Responsive & Complex */
#viewContent {
    flex-grow: 1;
    overflow: auto;
    padding: 20px;
}

.agenda-grid {
    display: grid;
    grid-template-columns: 80px 1fr; /* Time col + Professionals grid */
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    min-width: 1000px;
    position: relative;
}

.time-column {
    border-right: 1px solid var(--border);
    padding-top: 60px; /* Offset for prof header */
}

.time-slot {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-muted);
    border-bottom: 1px dashed var(--border);
}

.professionals-grid {
    display: flex;
    overflow-x: auto;
}

.professional-col {
    flex: 1;
    min-width: var(--col-width);
    border-right: 1px solid var(--border);
}

.prof-header {
    height: 60px;
    background-color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    position: sticky;
    top: 0;
    z-index: 5;
    border-bottom: 1px solid var(--border);
}

.appointments-container {
    position: relative;
    height: 720px; /* 12 hours * 60px */
}

.appointment-card {
    position: absolute;
    left: 4px;
    right: 4px;
    background-color: #dbeafe; /* Blue for scheduled */
    border-left: 4px solid #3b82f6;
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    font-size: 12px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.appointment-card:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
    z-index: 10;
}

.appointment-card.scheduled {
    background-color: #dbeafe;
    border-left-color: #3b82f6;
}

.appointment-card.confirmed {
    background-color: #dbeafe;
    border-left-color: #3b82f6;
}

.appointment-card.present {
    background-color: #dcfce7; /* Green for present */
    border-left-color: #22c55e;
}

.appointment-card.absent {
    background-color: #fee2e2;
    border-left-color: #ef4444;
}

.appointment-card.absent_notice {
    background-color: #ffedd5;
    border-left-color: #f59e0b;
}

.appointment-card.cancelled_prof {
    background-color: #f3e8ff;
    border-left-color: #7c3aed;
}

.appointment-card .time {
    font-weight: 700;
    margin-bottom: 2px;
    display: block;
}

.appointment-card .patient {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    transition: opacity 0.3s;
}

.modal {
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    max-height: 90vh; /* Don't exceed viewport height */
    overflow: hidden; /* Ensure border-radius is respected */
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.modal-body {
    padding: 24px;
    overflow-y: auto; /* Enable scrolling */
    flex-grow: 1;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-family: inherit;
    font-size: 14px;
}

.hidden {
    display: none !important;
}

/* Login Screen */
.login-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    overflow-y: auto;
    padding: 40px 20px;
}

.login-card {
    background: white;
    padding: 48px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    box-sizing: border-box;
}

.login-card h2 {
    margin-bottom: 8px;
    font-size: 24px;
}

.login-card p {
    color: var(--text-muted);
    margin-bottom: 32px;
}

.prof-login-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.prof-login-btn {
    background: #f8fafc;
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.prof-login-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.admin-only {
    display: flex; /* Will be toggled by JS */
}

/* Professional View Overrides */
#app.professional-view .admin-only {
    display: none !important;
}

/* Hamburguer Button - Oculto no desktop */
.menu-toggle-btn {
    display: none !important;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    align-items: center;
    justify-content: center;
}

.menu-toggle-btn:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

/* Grid de duas colunas padrão */
.grid-2-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Cabeçalho de visualização padrão */
.view-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 20px;
}

/* Coluna de horários com fixação inteligente */
.time-column {
    position: sticky;
    left: 0;
    background-color: var(--surface) !important;
    z-index: 10;
    border-right: 1px solid var(--border);
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.03);
}

/* Responsividade Geral */
@media (max-width: 768px) {
    #app {
        grid-template-columns: 1fr;
        position: relative;
        height: 100vh;
        overflow: hidden;
    }

    .content {
        position: relative;
        height: 100vh;
        overflow-y: auto;
    }

    /* Barra Lateral Off-Canvas */
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 260px;
        z-index: 1000;
        background: var(--surface);
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: var(--glass);
        box-shadow: var(--shadow-lg);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        flex-direction: column;
    }

    #app.sidebar-open .sidebar {
        left: 0;
    }

    /* Overlay escuro de desfoque ao abrir o menu lateral */
    #app.sidebar-open .content::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.4);
        backdrop-filter: blur(4px);
        z-index: 999;
        animation: fadeIn 0.2s ease-out;
    }

    /* Botão Hambúrguer Visível apenas no mobile */
    .menu-toggle-btn {
        display: flex !important;
        margin-right: 12px;
    }

    /* Ajustes na Barra Superior */
    .top-bar {
        padding: 16px 20px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .top-bar h1 {
        font-size: 20px;
        flex-grow: 1;
        margin: 0;
    }

    .top-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: space-between;
    }

    .zoom-controls {
        display: none !important; /* Esconder zoom no celular */
    }

    .date-picker {
        width: 100%;
        justify-content: space-between;
        padding: 6px 12px;
        margin: 0;
    }

    #currentDateDisplay {
        min-width: unset;
        flex-grow: 1;
        font-size: 14px;
    }

    #agendaSearchContainer {
        max-width: 100% !important;
        width: 100%;
        margin: 0;
    }

    .filters {
        flex-grow: 1;
        width: 100%;
        margin: 0;
    }

    .filters select {
        width: 100%;
        padding: 10px 14px;
        font-size: 14px;
    }

    #addAppointmentBtn {
        width: 100%;
        justify-content: center;
        padding: 12px;
        font-size: 14px;
        margin: 0;
    }

    /* Ajuste de Margens e Padding de Conteúdo */
    #viewContent {
        padding: 12px;
    }

    /* Modais Responsivos */
    .modal {
        width: 95%;
        max-height: 95vh;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-header {
        padding: 16px 20px;
    }

    /* Ajustes na Tela de Login */
    .login-screen {
        padding: 16px;
    }

    .login-card {
        padding: 24px 16px;
        max-width: 100%;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }

    .login-card h2 {
        font-size: 20px;
    }

    .login-card p {
        margin-bottom: 20px;
    }

    .prof-login-list {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .prof-login-btn {
        padding: 14px;
        font-size: 14px;
    }
}

/* Responsividade para telas muito pequenas */
@media (max-width: 576px) {
    /* Empilhamento de Grids e Cabeçalhos */
    .grid-2-cols {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .view-header-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 16px;
    }

    .view-header-row h3 {
        text-align: center;
        font-size: 18px;
    }

    .view-header-row button {
        width: 100%;
        justify-content: center;
    }

    /* Ocultar elementos desnecessários da Landing Page no mobile */
    .floating-card {
        display: none !important;
    }
}
.checkbox-container {
    background: #f8fafc;
    border: 1px solid var(--border);
    padding: 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-container:has(input:checked) {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.checkbox-container input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.badge-insurance {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.patient-name-link:hover {
    text-decoration: underline;
    filter: brightness(0.8);
}

.prof-report-link:hover {
    text-decoration: underline;
    filter: brightness(0.8);
}

.phone-link:hover {
    color: #128c7e !important;
    text-decoration: underline;
}

/* Searchable Select Autocomplete Dropdown Component */
.searchable-select-container {
    position: relative;
    width: 100%;
}

.searchable-select-trigger {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.searchable-select-input {
    width: 100%;
    padding: 10px 40px 10px 14px !important;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: var(--surface);
    color: var(--text-main);
}

.searchable-select-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.searchable-select-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: transform 0.2s ease;
    font-size: 12px;
}

.searchable-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 220px;
    overflow-y: auto;
    animation: slideDown 0.15s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.searchable-select-options {
    padding: 4px;
}

.searchable-select-option {
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
    color: var(--text-main);
}

.searchable-select-option:hover,
.searchable-select-option.active {
    background-color: var(--primary-light);
    color: var(--primary);
    font-weight: 500;
}

.searchable-select-option.selected {
    background-color: var(--primary);
    color: white;
    font-weight: 600;
}

.searchable-select-no-results {
    padding: 12px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

/* =====================================================
   LOADING SCREEN - Aparece imediatamente ao carregar
   ===================================================== */
#loadingScreen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    gap: 20px;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#loadingScreen.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary);
    animation: loadPulse 1.8s ease-in-out infinite;
}

.loading-logo i {
    font-size: 36px;
}

.loading-logo span {
    font-family: 'Outfit', sans-serif;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    animation: loadPulse 1.8s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes loadPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* =====================================================
   ANIMAÇÕES DE ENTRADA
   ===================================================== */
@keyframes slideUpIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.login-card {
    animation: fadeInScale 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.login-card-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 0;
    color: var(--text-muted);
    font-size: 14px;
}

.login-card-loading .loading-spinner {
    width: 28px;
    height: 28px;
    border-width: 2px;
}

/* Skeleton shimmer para estado de carregamento */
@keyframes shimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.skeleton {
    background: linear-gradient(90deg, #f0f4f8 25%, #e2e8f0 50%, #f0f4f8 75%);
    background-size: 800px 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 8px;
}

/* Custom Multi-Select Dropdown for Professionals */
.multiselect-container {
    position: relative;
    display: inline-block;
    min-width: 220px;
}

.multiselect-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.multiselect-trigger:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.multiselect-selected-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
    max-width: 180px;
}

.multiselect-arrow {
    color: var(--text-muted);
    font-size: 12px;
    transition: transform 0.2s ease;
}

.multiselect-container:has(.multiselect-dropdown:not(.hidden)) .multiselect-arrow {
    transform: rotate(180deg);
}

.multiselect-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 280px;
    overflow-y: auto;
    animation: slideDown 0.15s ease-out;
}

/* Custom Scrollbar for Dropdown to match image */
.multiselect-dropdown::-webkit-scrollbar {
    width: 8px;
}

.multiselect-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.multiselect-dropdown::-webkit-scrollbar-thumb {
    background: #a1a1aa;
    border-radius: 4px;
}

.multiselect-dropdown::-webkit-scrollbar-thumb:hover {
    background: #71717a;
}

.multiselect-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #1e293b;
    transition: background-color 0.15s;
    border-bottom: 1px solid #f1f5f9;
}

.multiselect-option:hover {
    background-color: #f8fafc;
}

.multiselect-option:last-child {
    border-bottom: none;
}

.multiselect-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    border: 1.5px solid #cbd5e1;
    border-radius: 3px;
    cursor: pointer;
    accent-color: var(--primary);
    transition: border-color 0.15s, background-color 0.15s;
}

.multiselect-option label {
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
}

/* ─── Skeleton Loader (stale-while-revalidate) ───────────────────────────── */
/* Exibido na grade de agenda enquanto os dados chegam do Firestore.          */
/* Remove a sensação de "travamento" — a UI aparece imediatamente.           */

@keyframes skeleton-shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position:  600px 0; }
}

.skeleton {
    background: linear-gradient(
        90deg,
        #e2e8f0 25%,
        #f1f5f9 50%,
        #e2e8f0 75%
    );
    background-size: 1200px 100%;
    animation: skeleton-shimmer 1.4s infinite linear;
    border-radius: var(--radius-sm);
}

/* Card fantasma dentro das colunas */
.skeleton-card {
    position: absolute;
    left: 4px;
    right: 4px;
    border-radius: var(--radius-sm);
    opacity: 0.7;
}

/* Texto fantasma no cabeçalho da coluna */
.skeleton-text {
    display: block;
    border-radius: 4px;
}

/* Grade de agenda no estado skeleton: opacidade reduzida */
.skeleton-grid {
    opacity: 0.85;
    pointer-events: none; /* evita cliques acidentais durante load */
}

/* Hora lateral levemente apagada no skeleton */
.skeleton-time {
    color: #cbd5e1;
}
/* ──────────────────────────────────────────────────────────────────────────── */
