/* === RESET E VARIÁVEIS === */
:root {
    --primary-bg      : #0f0f0f;
    --secondary-bg    : #1a1a1a;
    --glass-bg        : rgba(255, 255, 255, 0.1);
    --glass-border    : rgba(255, 255, 255, 0.2);
    --glass-shadow    : 0 8px 32px rgba(0, 0, 0, 0.3);
    --text-primary    : #ffffff;
    --text-secondary  : rgba(255, 255, 255, 0.7);
    --text-muted      : rgba(255, 255, 255, 0.7);
    --accent-green    : #00d4aa;
    --accent-blue     : #0c69b0;
    --accent-purple   : #8b5cf6;
    --gradient-primary: linear-gradient(135deg, #00d4aa 0%, #0c69b0 100%);
    --gradient-accent : linear-gradient(135deg, #8b5cf6 0%, #00d4aa 100%);
    --primary-color   : var(--accent-green); /* Using existing accent-green */
    --primary-dark    : var(--accent-blue);  /* Using existing accent-blue */
    --bg-color        : var(--primary-bg);
    --bg-secondary    : var(--secondary-bg);
    --card-bg         : var(--secondary-bg);
    --text-color      : var(--text-primary);
    --border-color    : var(--glass-border);
    --hover-color     : rgba(255, 255, 255, 0.1);
    --error-color     : #dc2626;
    --logo-bg         : #ffffff;
}

.light-theme {
    --primary-bg    : #f8fafc;
    --secondary-bg  : #ffffff;
    --glass-bg      : rgba(255, 255, 255, 0.8);
    --glass-border  : rgba(255, 255, 255, 0.3);
    --glass-shadow  : 0 8px 32px rgba(0, 0, 0, 0.1);
    --text-primary  : #1a1a1a;
    --text-secondary: rgba(26, 26, 26, 0.7);
    --text-muted    : rgba(26, 26, 26, 0.7);
    --primary-color : #3b82f6;
    --primary-dark  : #2563eb;
    --bg-color      : var(--primary-bg);
    --bg-secondary  : var(--secondary-bg);
    --card-bg       : var(--secondary-bg);
    --text-color    : var(--text-primary);
    --border-color  : #e2e8f0;
    --hover-color   : #f1f5f9;
    --error-color   : #ef4444;
    --logo-bg       : #0f0f0f;
}

.doutordm2-dark {
    --primary-bg      : #212314; /* PRETO */
    --secondary-bg    : #075C57; /* VERDE */
    --glass-bg        : rgba(7, 92, 87, 0.2);
    --glass-border    : rgba(205, 215, 98, 0.3);
    --glass-shadow    : 0 8px 32px rgba(0, 0, 0, 0.5);
    --text-primary    : #ffffff;
    --text-secondary  : rgba(255, 255, 255, 0.7);
    --accent-green    : #00A19A; /* CIANO */
    --accent-blue     : #075C57; /* VERDE */
    --accent-yellow   : #CDD762; /* LIMÃO */
    --gradient-primary: linear-gradient(135deg, #00A19A 0%, #075C57 100%);
    --gradient-accent : linear-gradient(135deg, #CDD762 0%, #00A19A 100%);
    --primary-color   : var(--accent-green);
    --primary-dark    : var(--accent-blue);
    --bg-color        : var(--primary-bg);
    --bg-secondary    : var(--secondary-bg);
    --text-color      : var(--text-primary);
    --border-color    : var(--glass-border);
    --hover-color     : rgba(255, 255, 255, 0.1);
    --error-color     : #dc2626;
    --logo-bg         : #ffffff;
    color-scheme: dark;
}


* {
    margin    : 0;
    padding   : 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background : var(--primary-bg);
    color      : var(--text-primary);
    min-height : 100vh;
    transition : all 0.3s ease;
    position   : relative;
}

/* Prevenir scroll quando menu mobile está aberto */
body.menu-open {
    overflow: hidden;
    height  : 100vh;
}

/* === FORM CONTROLS (DARK THEME NATIVE SELECT POPUP) === */
body.dark-theme {
    /* Hint browsers to render native controls with dark surfaces */
    color-scheme: dark;
}

body.dark-theme select,
body.dark-theme select option,
body.dark-theme select optgroup,
body.doutordm2-dark select,
body.doutordm2-dark select option,
body.doutordm2-dark select optgroup,
body.healthz-dark select,
body.healthz-dark select option,
body.healthz-dark select optgroup {
    background-color: var(--primary-bg) !important;
    color: var(--text-primary) !important;
}

body.dark-theme select option:checked,
body.dark-theme select option:hover,
body.dark-theme select option:focus,
body.doutordm2-dark select option:checked,
body.doutordm2-dark select option:hover,
body.doutordm2-dark select option:focus,
body.healthz-dark select option:checked,
body.healthz-dark select option:hover,
body.healthz-dark select option:focus {
    background-color: rgba(0, 212, 170, 0.15) !important; /* accent-green wash */
    color: var(--text-primary) !important;
}

body.light-theme select,
body.light-theme select option,
body.light-theme select optgroup {
    background-color: #ffffff !important;
    color: #1a1a1a !important;
}

body.light-theme select option:checked,
body.light-theme select option:hover,
body.light-theme select option:focus {
    background-color: #e2e8f0 !important;
    color: #1a1a1a !important;
}

body.dark-theme .select2-container--default .select2-selection--single,
body.doutordm2-dark .select2-container--default .select2-selection--single,
body.healthz-dark .select2-container--default .select2-selection--single,
body.dark-theme .select2-container--default .select2-selection--multiple,
body.doutordm2-dark .select2-container--default .select2-selection--multiple,
body.healthz-dark .select2-container--default .select2-selection--multiple {
    background-color: var(--primary-bg) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: var(--text-primary) !important;
}

body.dark-theme .select2-container--default .select2-selection__rendered,
body.doutordm2-dark .select2-container--default .select2-selection__rendered,
body.healthz-dark .select2-container--default .select2-selection__rendered {
    color: var(--text-primary) !important;
}

body.dark-theme .select2-container--default .select2-selection__placeholder,
body.doutordm2-dark .select2-container--default .select2-selection__placeholder,
body.healthz-dark .select2-container--default .select2-selection__placeholder {
    color: rgba(255, 255, 255, 0.65) !important;
}

body.dark-theme .select2-container--default .select2-selection--single .select2-selection__arrow b,
body.doutordm2-dark .select2-container--default .select2-selection--single .select2-selection__arrow b,
body.healthz-dark .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #ffffff transparent transparent transparent !important;
}

body.dark-theme .select2-dropdown,
body.doutordm2-dark .select2-dropdown,
body.healthz-dark .select2-dropdown,
body.dark-theme .select2-container--default .select2-results__option,
body.doutordm2-dark .select2-container--default .select2-results__option,
body.healthz-dark .select2-container--default .select2-results__option {
    background-color: #181a18 !important;
    color: var(--text-primary) !important;
}

body.dark-theme .select2-container--default .select2-results__option--highlighted[aria-selected],
body.doutordm2-dark .select2-container--default .select2-results__option--highlighted[aria-selected],
body.healthz-dark .select2-container--default .select2-results__option--highlighted[aria-selected],
body.dark-theme .select2-container--default .select2-results__option[aria-selected="true"],
body.doutordm2-dark .select2-container--default .select2-results__option[aria-selected="true"],
body.healthz-dark .select2-container--default .select2-results__option[aria-selected="true"] {
    background-color: rgba(0, 212, 170, 0.15) !important;
    color: var(--text-primary) !important;
}

body.dark-theme .select2-search__field,
body.doutordm2-dark .select2-search__field,
body.healthz-dark .select2-search__field {
    background-color: #1b1f1b !important;
    color: var(--text-primary) !important;
}

body.dark-theme .select2-search__field::placeholder,
body.doutordm2-dark .select2-search__field::placeholder,
body.healthz-dark .select2-search__field::placeholder {
    color: rgba(255, 255, 255, 0.55) !important;
}

/* === BACKGROUND ANIMADO === */
.bg-animation {
    position: fixed;
    top     : 0;
    left    : 0;
    width   : 100%;
    height  : 100%;
    z-index : -1;
    overflow: hidden;
}

.bg-shape {
    position     : absolute;
    border-radius: 50%;
    background   : var(--gradient-primary);
    opacity      : 0.1;
    animation    : float 20s infinite linear;
}

.shape-1 {
    width          : 300px;
    height         : 300px;
    top            : -150px;
    left           : -150px;
    animation-delay: 0s;
}

.shape-2 {
    width          : 200px;
    height         : 200px;
    bottom         : -100px;
    right          : 20%;
    animation-delay: -5s;
}

.shape-3 {
    width          : 150px;
    height         : 150px;
    top            : 30%;
    right          : -75px;
    animation-delay: -10s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

/* === LAYOUT PRINCIPAL === */
.main-container {
    max-width: 1400px;
    margin   : 0 auto;
    padding  : 2rem;
    flex     : 1;
    width    : 100%;
}

.dashboard-header {
    display        : flex;
    justify-content: space-between;
    align-items    : flex-start;
    margin-bottom  : 2rem;
}

.welcome-title {
    font-size    : 2.5rem;
    font-weight  : 700;
    margin-bottom: 0.5rem;
}

.gradient-text {
    background             : var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip        : text;
}

.welcome-subtitle {
    color    : var(--text-secondary);
    font-size: 1.1rem;
}

.header-actions {
    display    : flex;
    align-items: center;
    gap        : 1rem;
}

.date-display {
    background     : var(--glass-bg);
    backdrop-filter: blur(20px);
    border         : 1px solid var(--glass-border);
    padding        : 0.75rem 1.5rem;
    border-radius  : 50px;
    display        : flex;
    align-items    : center;
    gap            : 0.5rem;
    font-weight    : 500;
}

.theme-toggle {
    background     : var(--glass-bg);
    backdrop-filter: blur(20px);
    border         : 1px solid var(--glass-border);
    width          : 50px;
    height         : 50px;
    border-radius  : 50%;
    display        : flex;
    align-items    : center;
    justify-content: center;
    cursor         : pointer;
    transition     : all 0.3s ease;
    font-size      : 1.2rem;
}

.theme-toggle:hover {
    transform   : scale(1.1);
    border-color: var(--accent-green);
}

/* === STATS CARDS === */
.stats-grid {
    display              : grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap                  : 1.5rem;
    margin-bottom        : 2rem;
}

.stat-card {
    background     : var(--glass-bg);
    backdrop-filter: blur(20px);
    border         : 1px solid var(--glass-border);
    border-radius  : 20px;
    padding        : 1.5rem;
    display        : flex;
    align-items    : center;
    gap            : 1rem;
    transition     : all 0.3s ease;
    box-shadow     : var(--glass-shadow);
}

.stat-card:hover {
    transform   : translateY(-5px);
    border-color: var(--accent-green);
}

.stat-icon {
    width          : 60px;
    height         : 60px;
    background     : var(--gradient-primary);
    border-radius  : 15px;
    display        : flex;
    align-items    : center;
    justify-content: center;
    font-size      : 1.5rem;
}

.stat-content {
    flex: 1;
}

.stat-number {
    display      : block;
    font-size    : 2rem;
    font-weight  : 700;
    margin-bottom: 0.25rem;
}

.stat-label {
    color      : var(--text-secondary);
    font-size  : 0.9rem;
    font-weight: 500;
}

.stat-trend {
    padding      : 0.5rem 1rem;
    border-radius: 20px;
    font-size    : 0.8rem;
    font-weight  : 600;
    display      : flex;
    align-items  : center;
    gap          : 0.25rem;
}

.stat-trend.up {
    background: rgba(0, 212, 170, 0.2);
    color     : var(--accent-green);
}

.stat-trend.down {
    background: rgba(239, 68, 68, 0.2);
    color     : #ef4444;
}

/* === LAYOUT GRID === */
.main-grid {
    display              : grid;
    grid-template-columns: 1fr 400px;
    gap                  : 2rem;
}

/* === GLASS CARDS === */
.glass-card {
    background     : var(--glass-bg);
    backdrop-filter: blur(20px);
    border         : 1px solid var(--glass-border);
    border-radius  : 20px;
    padding        : 1.5rem;
    margin-bottom  : 2rem;
    box-shadow     : var(--glass-shadow);
}

.card-header {
    display        : flex;
    justify-content: space-between;
    align-items    : center;
    margin-bottom  : 1.5rem;
}

.card-title {
    font-size  : 1.25rem;
    font-weight: 600;
    display    : flex;
    align-items: center;
    gap        : 0.5rem;
}

.appointments-list {
    display       : flex;
    flex-direction: column;
    gap           : 1rem;
}

/* Scrollbar customizado premium para a section de consultas */
.next-appointments-section {
    max-height    : 530px;
    overflow-y    : auto;
    padding-right : 6px;
}
.next-appointments-section::-webkit-scrollbar {
    width: 6px;
}
.next-appointments-section::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}
.next-appointments-section::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}
.next-appointments-section::-webkit-scrollbar-thumb:hover {
    background: var(--accent-green);
}

.appointment-item {
    display      : flex;
    align-items  : center;
    gap          : 1rem;
    padding      : 1rem;
    background   : rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    transition   : all 0.3s ease;
}

.appointment-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform : translateX(5px);
}

.appointment-time {
    text-align: center;
    min-width : 60px;
}

.time {
    display    : block;
    font-size  : 1.1rem;
    font-weight: 600;
    color      : var(--accent-green);
}

.date {
    display  : block;
    font-size: 0.8rem;
    color    : var(--text-secondary);
}

.appointment-info {
    display    : flex;
    align-items: center;
    gap        : 1rem;
    flex       : 1;
}

.patient-avatar {
    width          : 40px;
    height         : 40px;
    background     : var(--gradient-primary);
    border-radius  : 50%;
    display        : flex;
    align-items    : center;
    justify-content: center;
    font-weight    : 600;
    font-size      : 0.9rem;
}

.patient-name {
    font-weight  : 600;
    margin-bottom: 0.25rem;
}

.appointment-meta {
    font-size: 0.8rem;
    color    : var(--text-secondary);
}

.doctor {
    font-weight: 500;
}

.appointment-actions {
    display: flex;
    gap    : 0.5rem;
}

.btn-icon {
    background     : rgba(255, 255, 255, 0.1);
    border         : 1px solid var(--glass-border);
    width          : 35px;
    height         : 35px;
    border-radius  : 10px;
    display        : flex;
    align-items    : center;
    justify-content: center;
    cursor         : pointer;
    transition     : all 0.3s ease;
    color          : var(--text-secondary);
}

.btn-icon:hover {
    background: var(--accent-green);
    color     : white;
    transform : scale(1.1);
}

.btn-icon.btn-whatsapp {
    background: rgba(37, 211, 102, 0.15);
    border-color: rgba(37, 211, 102, 0.3);
    color: #25d366;
}

.btn-icon.btn-whatsapp:hover {
    background: #25d366;
    color: white;
    border-color: #25d366;
}

.btn-icon.btn-whatsapp:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-close {
    background     : rgba(255, 255, 255, 0.2);
    color          : white;
    border         : none;
    padding        : 10px 20px;
    border-radius  : 8px;
    cursor         : pointer;
    float          : right;
    margin-top     : 20px;
    transition     : all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform : translateY(-2px);
}

.no-events {
    text-align: center;
    color     : var(--text-secondary);
    font-style: italic;
    padding   : 20px;
}

/* === TAREFAS === */
.tasks-list {
    display       : flex;
    flex-direction: column;
    gap           : 1rem;
}

.task-item {
    display      : flex;
    align-items  : center;
    gap          : 1rem;
    padding      : 1rem;
    background   : rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    transition   : all 0.3s ease;
}

.task-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.task-item.completed .task-text {
    text-decoration: line-through;
    opacity        : 0.6;
}

.checkbox-container {
    display : block;
    position: relative;
    cursor  : pointer;
}

.checkbox-container input {
    display: none;
}

.checkmark {
    width          : 20px;
    height         : 20px;
    border         : 2px solid var(--glass-border);
    border-radius  : 6px;
    display        : flex;
    align-items    : center;
    justify-content: center;
    transition     : all 0.3s ease;
}

.checkbox-container input:checked+.checkmark {
    background  : var(--accent-green);
    border-color: var(--accent-green);
}

.checkbox-container input:checked+.checkmark::after {
    content    : '✓';
    color      : white;
    font-size  : 12px;
    font-weight: bold;
}

.task-content {
    flex           : 1;
    display        : flex;
    justify-content: space-between;
    align-items    : center;
}

.task-text {
    font-weight: 500;
}

.task-priority,
.task-status {
    font-size    : 0.7rem;
    padding      : 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight  : 600;
}

.task-priority.high {
    background: rgba(239, 68, 68, 0.2);
    color     : #ef4444;
}

.task-priority.medium {
    background: rgba(245, 158, 11, 0.2);
    color     : #f59e0b;
}

.task-status {
    background: rgba(0, 212, 170, 0.2);
    color     : var(--accent-green);
}

.task-actions i {
    cursor       : pointer;
    padding      : 0.5rem;
    border-radius: 8px;
    transition   : all 0.3s ease;
    opacity      : 0;
}

.task-item:hover .task-actions i {
    opacity: 1;
}

.task-actions i:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* === BOTÕES === */
.btn-primary,
.btn-secondary {
    padding      : 0.75rem 1.5rem;
    border       : none;
    border-radius: 12px;
    font-weight  : 600;
    cursor       : pointer;
    transition   : all 0.3s ease;
    display      : inline-flex;
    align-items  : center;
    gap          : 0.5rem;
}

.btn-primary {
    background: var(--gradient-primary);
    color     : white;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color     : var(--text-primary);
    border    : 1px solid var(--glass-border);
}

.btn-primary:hover,
.btn-secondary:hover {
    transform: translateY(-2px);
}

/* === FILTROS === */
.filter-select {
    background   : rgba(255, 255, 255, 0.1);
    border       : 1px solid var(--glass-border);
    border-radius: 10px;
    padding      : 0.5rem 1rem;
    color        : var(--text-primary);
    font-family  : 'Inter', sans-serif;
}

.filter-select:focus {
    outline     : none;
    border-color: rgba(255, 255, 255, 0.5);
    background  : rgba(255, 255, 255, 0.15);
}


/* === MÉTRICAS === */
.metrics-grid {
    display              : grid;
    grid-template-columns: 1fr 1fr;
    gap                  : 1rem;
}

.metric-item {
    text-align   : center;
    padding      : 1.5rem;
    background   : rgba(255, 255, 255, 0.05);
    border-radius: 15px;
}

.metric-value {
    display      : block;
    font-size    : 1.5rem;
    font-weight  : 700;
    margin-bottom: 0.5rem;
    color        : var(--accent-green);
}

.metric-label {
    font-size: 0.8rem;
    color    : var(--text-secondary);
}

/* === AÇÕES RÁPIDAS === */
.quick-actions-grid {
    display              : grid;
    grid-template-columns: 1fr 1fr;
    gap                  : 1rem;
}

.quick-action {
    background    : rgba(255, 255, 255, 0.05);
    border        : 1px solid var(--glass-border);
    border-radius : 15px;
    padding       : 1.5rem 1rem;
    display       : flex;
    flex-direction: column;
    align-items   : center;
    gap           : 0.5rem;
    cursor        : pointer;
    transition    : all 0.3s ease;
    color         : var(--text-primary);
    font-family   : 'Inter', sans-serif;
}

.quick-action:hover {
    background  : rgba(255, 255, 255, 0.1);
    border-color: var(--accent-green);
    transform   : translateY(-2px);
}

.quick-action i {
    font-size: 1.5rem;
    color    : var(--accent-green);
}

/* === ESTADO VAZIO === */
.empty-state {
    text-align: center;
    padding   : 3rem;
    color     : var(--text-secondary);
}

.empty-state i {
    font-size    : 3rem;
    margin-bottom: 1rem;
    opacity      : 0.5;
}

/* === CHART === */
.chart-container {
    height    : 200px;
    margin-top: 1rem;
}

/* === RESPONSIVO === */
@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .right-column {
        display              : grid;
        grid-template-columns: 1fr 1fr;
        gap                  : 2rem;
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: 1rem;
    }

    .dashboard-header {
        flex-direction: column;
        gap           : 1rem;
    }

    .welcome-title {
        font-size: 2rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .right-column {
        grid-template-columns: 1fr;
    }

    .metrics-grid,
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* === HEADER MODERNO === */
.modern-header {
    background     : var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom  : 1px solid var(--glass-border);
    position       : sticky;
    top            : 0;
    z-index        : 1000;
    transition     : all 0.3s ease;
    width          : 100%;
}

/* Smooth scroll no html */
html {
    scroll-behavior: smooth;
}

/* Prevenir overflow horizontal */
body {
    overflow-x: hidden;
}

.header-content {
    max-width      : 1400px;
    margin         : 0 auto;
    padding        : 0.75rem 1.5rem;
    display        : flex;
    flex-wrap      : nowrap;
    justify-content: space-between;
    align-items    : center;
    gap            : 0.75rem;
}

.logo-section {
    display    : flex;
    align-items: center;
    flex-shrink: 0;
    min-width  : 0;
}

.logo-link {
    display        : flex;
    align-items    : center;
    gap            : 0.4rem;
    font-size      : 1.5rem;
    font-weight    : 700;
    color          : var(--text-primary);
    text-decoration: none;
    transition     : all 0.3s ease;
}

.logo-link i {
    color    : var(--accent-green);
    font-size: 1.7rem;
}

.logo-link:hover {
    transform: scale(1.05);
}

.user-welcome {
    margin-left   : 0.75rem;
    display       : flex;
    flex-direction: column;
    gap           : 0.1rem;
}

.company-code {
    font-size    : 0.65rem;
    background   : var(--gradient-primary);
    padding      : 0.15rem 0.5rem;
    border-radius: 10px;
    font-weight  : 600;
    color        : white;
}

.welcome-text {
    font-size  : 0.75rem;
    color      : var(--text-secondary);
    white-space: nowrap;
}

/* === NAVEGAÇÃO MODERNA === */
.modern-nav {
    display    : flex;
    align-items: center;
    flex-shrink: 1;
    flex-grow  : 0;
    min-width  : 0;
    gap        : 0.75rem;
    justify-content: space-between;
}

.nav-menu {
    display   : flex;
    gap       : 0.25rem;
    list-style: none;
    margin    : 0;
    padding   : 0;
    flex-shrink: 1;
    flex-wrap : nowrap;
    min-width  : 0;
    overflow  : visible;
}

.nav-link {
    display        : flex;
    align-items    : center;
    gap            : 0.35rem;
    padding        : 0.55rem 0.75rem;
    color          : var(--text-secondary);
    text-decoration: none;
    border-radius  : 10px;
    transition     : all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight    : 500;
    font-size      : 0.85rem;
    position       : relative;
    white-space    : nowrap;
    cursor         : pointer;
    user-select    : none;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color     : var(--text-primary);
    transform : translateY(-1px);
}

.nav-link:active {
    transform: translateY(0);
}

.nav-link.active {
    background: var(--gradient-primary);
    color     : white;
    box-shadow: 0 4px 15px rgba(12, 105, 176, 0.3);
}

.nav-link i {
    font-size : 0.95rem;
    width     : 16px;
    text-align: center;
    flex-shrink: 0;
}

.dropdown-icon {
    font-size : 0.8rem;
    transition: transform 0.3s ease;
}

/* === SUBMENU MODERNO === */
.has-submenu {
    position: relative;
}

.has-submenu:hover .dropdown-icon {
    transform: rotate(180deg);
}

.submenu {
    position       : absolute;
    top            : 100%;
    left           : 0;
    background     : rgba(55, 65, 81, 0.95);
    backdrop-filter: blur(30px);
    border         : 1px solid rgba(75, 85, 99, 0.5);
    border-radius  : 15px;
    min-width      : 220px;
    padding        : 0.5rem;
    box-shadow     : var(--glass-shadow);
    opacity        : 0;
    visibility     : hidden;
    transform      : translateY(10px);
    transition     : all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index        : 1000;
    list-style     : none;
}

/* MEGA MENU - 2 Colunas para menus grandes (ex: Empresa)
   Apenas em desktop para evitar quebras em telas pequenas */
@media (min-width: 769px) {
    .submenu.submenu-columns {
        min-width: 480px;
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 0 1rem;
        padding: 1rem;
    }

    .submenu.submenu-columns .menu-separator {
        grid-column: span 2;
    }

    .submenu.submenu-columns .submenu-header {
        grid-column: span 2;
    }
}

.has-submenu:hover .submenu {
    opacity   : 1;
    visibility: visible;
    transform : translateY(0);
}

/* Labels funcionam como botões clicáveis */
.has-submenu label.nav-link {
    cursor: pointer;
    user-select: none;
}

.submenu-link {
    display        : block;
    padding        : 0.75rem 1rem;
    color          : var(--text-primary);
    text-decoration: none;
    border-radius  : 8px;
    transition     : all 0.3s ease;
    font-size      : 0.9rem;
    font-weight    : 500;
}

.submenu-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color     : var(--text-primary);
    transform : translateX(5px);
}

.menu-separator {
    height    : 1px;
    background: rgba(75, 85, 99, 0.5);
    /* Separador cinza */
    margin    : 0.4rem 0;
    list-style: none;
}

/* === SUBMENU ANINHADO (nível 2) === */
.submenu-nested {
    position: relative;
}

.submenu-parent-label {
    display        : flex;
    align-items    : center;
    gap            : 0.5rem;
    cursor         : pointer;
    user-select    : none;
    width          : 100%;
    padding        : 0.75rem 1rem;
    color          : var(--text-primary);
    border-radius  : 8px;
    font-size      : 0.9rem;
    font-weight    : 500;
    transition     : all 0.3s ease;
}

.submenu-parent-label:hover {
    background: rgba(255, 255, 255, 0.1);
    transform : translateX(5px);
}

.submenu-parent-label .dropdown-icon {
    margin-left: auto;
    transition : transform 0.3s ease;
    font-size  : 0.7rem;
}

.submenu-level2 {
    position  : static;
    opacity   : 1;
    visibility: hidden;
    max-height: 0;
    overflow  : hidden;
    padding   : 0 0 0 1rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    transition: max-height 0.3s ease, visibility 0s 0.3s;
    list-style: none;
}

.submenu-nested input.submenu-toggle:checked ~ .submenu-level2 {
    visibility: visible;
    max-height: 200px;
    transition: max-height 0.3s ease;
}

.submenu-nested input.submenu-toggle:checked ~ .submenu-parent-label .dropdown-icon {
    transform: rotate(180deg);
}

.submenu-nested input.submenu-toggle {
    display: none;
}

/* === CONTROLES DO HEADER === */
.header-controls {
    display    : flex;
    align-items: center;
    gap        : 0.5rem;
    flex-shrink: 1;
    flex-wrap  : nowrap;
    min-width  : fit-content;
}

.theme-toggle,
.logout-btn {
    width          : 40px;
    height         : 40px;
    min-width      : 40px;
    border-radius  : 10px;
    background     : rgba(255, 255, 255, 0.1);
    border         : 1px solid var(--glass-border);
    color          : var(--text-primary);
    cursor         : pointer;
    transition     : all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display        : flex;
    align-items    : center;
    justify-content: center;
    flex-shrink    : 0;
}

.theme-toggle i,
.logout-btn i {
    font-size: 1rem;
}

.theme-toggle:hover,
.logout-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform : translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.theme-toggle:active,
.logout-btn:active {
    transform: translateY(0);
}

.logout-btn {
    color: #ef4444;
}

.logout-btn:hover {
    background  : rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

/* === BOTÃO AGENDAR CONSULTA === */
.btn-schedule-appointment {
    background   : var(--primary-color);
    color        : white;
    border       : none;
    padding      : 0.6rem 1rem;
    border-radius: 10px;
    font-weight  : 600;
    font-size    : 0.9rem;
    cursor       : pointer;
    transition   : all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display      : flex;
    align-items  : center;
    justify-content: center;
    gap          : 0.4rem;
    white-space  : nowrap;
    box-shadow   : 0 4px 15px rgba(0, 212, 170, 0.3);
    flex-shrink  : 0;
}

.btn-schedule-appointment i {
    font-size: 1rem;
}

.btn-schedule-appointment:hover {
    background: var(--primary-dark);
    transform : translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn-schedule-appointment:active {
    transform : translateY(0);
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.3);
}

/* === BARRA DA EMPRESA === */
.company-bar {
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--glass-border);
    padding   : 0.5rem 0;
    overflow  : hidden;
}

.company-info {
    max-width : 1400px;
    margin    : 0 auto;
    padding   : 0 2rem;
    text-align: center;
}

.company-badge {
    background   : rgba(255, 255, 255, 0.1);
    padding      : 0.4rem 1rem;
    border-radius: 20px;
    font-size    : 0.8rem;
    color        : var(--text-secondary);
    font-weight  : 500;
    display      : inline-block;
    transition   : all 0.3s ease;
}

.company-badge:hover {
    background: rgba(255, 255, 255, 0.15);
    transform : translateY(-1px);
}

/* === LINK DE LOGOUT === */
.logout-link {
    color: #ef4444 !important;
}

.logout-link:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    color     : #ef4444 !important;
}

/* === MENU TOGGLE (MOBILE) === */
.menu-toggle {
    display   : none; /* Será exibido apenas no mobile via media query */
    background: none;
    border    : none;
    color     : var(--text-primary);
    font-size : 1.2rem;
    cursor    : pointer;
    padding   : 0;
}

/* Hide checkboxes visualmente mas mantê-los funcionais */
.menu-toggle-checkbox,
.submenu-toggle {
    position      : absolute;
    opacity       : 0;
    width         : 1px;
    height        : 1px;
    pointer-events: auto; /* Permitir cliques no label */
    clip          : rect(0,0,0,0);
    overflow      : hidden;
}

/* === FOOTER MODERNO - CORRIGIDO === */
.modern-footer {
    background     : var(--glass-bg);
    backdrop-filter: blur(20px);
    border-top     : 1px solid var(--glass-border);
    margin-top     : 3rem;
    position       : relative;
    z-index        : 100;
}

.footer-content {
    max-width      : 1400px;
    margin         : 0 auto;
    padding        : 1.5rem 2rem;
    display        : flex;
    justify-content: space-between;
    align-items    : center;
    gap            : 2rem;
}

.footer-info {
    display    : flex;
    align-items: center;
    gap        : 1.5rem;
}

.copyright {
    color    : var(--text-secondary);
    margin   : 0;
    font-size: 0.9rem;
}

.brand {
    color      : var(--accent-green);
    font-weight: 600;
}

.version-badge {
    background   : rgba(255, 255, 255, 0.1);
    padding      : 0.4rem 0.8rem;
    border-radius: 20px;
    font-size    : 0.8rem;
    color        : var(--text-secondary);
    display      : flex;
    align-items  : center;
    gap          : 0.5rem;
    font-weight  : 500;
}

.footer-links {
    display: flex;
    gap    : 1.5rem;
}

.footer-link {
    color          : var(--text-secondary);
    text-decoration: none;
    font-size      : 0.9rem;
    transition     : all 0.3s ease;
    padding        : 0.5rem 0;
    position       : relative;
}

.footer-link::after {
    content   : '';
    position  : absolute;
    bottom    : 0;
    left      : 0;
    width     : 0;
    height    : 2px;
    background: var(--accent-green);
    transition: width 0.3s ease;
}

.footer-link:hover::after {
    width: 100%;
}

/* === RESPONSIVIDADE DO HEADER (CABER EM TELAS DE 15") === */
@media (max-width: 1440px) {
    .header-content {
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    .logo-section img {
        max-height: 32px !important;
    }

    img[src$="horizontal_doutordm2.png"],
    img[alt="DOUTORDM2"] {
        max-height: 60px !important;
        width: auto !important;
    }

    .nav-link {
        padding: 0.5rem 0.5rem;
        font-size: 0.75rem;
        gap: 0.25rem;
    }

    .nav-menu {
        gap: 0.1rem;
    }

    .user-welcome {
        display: none; /* Esconder saudação em telas médias para poupar espaço */
    }
}

@media (max-width: 1366px) {
    .nav-link span {
        display: none;
    }

    .agendar-btn span {
        display: none;
    }

    .agendar-btn {
        width: 40px;
        height: 40px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Fallback para telas menores antes do breakpoint mobile */
@media (max-width: 1100px) {
    .modern-nav {
        gap: 0.25rem;
    }
}

/* Fallback para telas ainda menores antes do breakpoint mobile */
@media (max-width: 1200px) {
    .nav-link span {
        display: none; /* Mostrar apenas ícones se o espaço for muito curto */
    }

    .nav-link {
        padding: 0.5rem;
    }
}

/* === CORREÇÃO VISIBILIDADE BOTÃO TEMA CLARO === */
.light-theme .theme-toggle,
.doutordm2-light .theme-toggle {
    background: rgba(0, 0, 0, 0.05) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    color: #1a1a1a !important;
}

.light-theme .theme-toggle:hover,
.doutordm2-light .theme-toggle:hover {
    background: rgba(0, 0, 0, 0.1) !important;
    border-color: var(--accent-green) !important;
}

/* Garantir que o ícone do sol seja visível */
.light-theme .theme-toggle i,
.doutordm2-light .theme-toggle i {
    color: #1a1a1a !important;
}

/* === RESPONSIVIDADE DO FOOTER === */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align    : center;
        gap           : 1rem;
        padding       : 1.5rem 1rem;
    }

    .footer-info {
        flex-direction: column;
        gap           : 1rem;
    }

    .footer-links {
        justify-content: center;
        flex-wrap      : wrap;
        gap            : 1rem;
    }
}

@media (max-width: 480px) {
    .footer-links {
        flex-direction: column;
        gap           : 0.5rem;
    }

    .version-badge {
        font-size: 0.75rem;
        padding  : 0.3rem 0.6rem;
    }
}

/* === PÁGINA DE MÉDICOS === */
.page-header {
    display        : flex;
    justify-content: space-between;
    align-items    : flex-start;
    margin-bottom  : 2rem;
    gap            : 2rem;
}

.header-content {
    flex: 1;
}

.page-title {
    font-size    : 2.2rem;
    font-weight  : 700;
    margin-bottom: 0.5rem;
    display      : flex;
    align-items  : center;
    gap          : 1rem;
}

.page-title i {
    color    : var(--accent-green);
    font-size: 2.5rem;
}

.page-description {
    color    : var(--text-secondary);
    font-size: 1.1rem;
    margin   : 0;
}

.header-actions {
    display  : flex;
    gap      : 1rem;
    flex-wrap: wrap;
}

/* === TABELA MODERNA === */
.modern-table {
    background     : var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius  : 20px;
    overflow       : hidden;
    border         : 1px solid var(--glass-border);
}

.search-box {
    position : relative;
    min-width: 300px;
}

.search-box i {
    position : absolute;
    left     : 1rem;
    top      : 50%;
    transform: translateY(-50%);
    color    : var(--text-secondary);
}

.search-box input {
    width        : 100%;
    padding      : 0.75rem 1rem 0.75rem 3rem;
    background   : rgba(255, 255, 255, 0.1);
    border       : 1px solid var(--glass-border);
    border-radius: 12px;
    color        : #333333;
    font-family  : 'Inter', sans-serif;
    transition   : all 0.3s ease;
}

.search-box input:focus {
    outline     : none;
    border-color: var(--accent-green);
    box-shadow  : 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.search-box input::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

/* Tema dark - garantir contraste no input de pesquisa */
body.dark-theme .search-box input,
.dark-theme .search-box input {
    background: rgba(0, 0, 0, 0.4) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

body.dark-theme .search-box input::placeholder,
.dark-theme .search-box input::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
}

body.dark-theme .search-box input:focus,
.dark-theme .search-box input:focus {
    background: rgba(0, 0, 0, 0.5) !important;
    border-color: var(--accent-green) !important;
}

/* === ESTILOS DA TABELA === */
.modern-datatable {
    width          : 100%;
    border-collapse: collapse;
}

/* === CORREÇÃO DO CABEÇALHO === */
.modern-datatable thead th {
    background   : rgba(0, 0, 0, 0.3) !important;
    /* Fundo mais escuro para cabeçalho */
    color        : #ffffff !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.modern-datatable tbody td {
    color        : #e0e0e0 !important;
    /* Cinza mais escuro para melhor legibilidade */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.modern-datatable tbody tr {
    background: rgba(0, 0, 0, 0.2) !important;
    /* Fundo mais escuro para linhas */
}

.modern-datatable tbody tr:hover {
    background: rgba(0, 0, 0, 0.3) !important;
    /* Fundo mais escuro no hover */
}

.modern-datatable tbody tr:hover td {
    color      : #ffffff;
    /* Branco puro no hover */
    font-weight: 500;
    background : rgba(255, 255, 255, 0.05) !important;
}

/* Ajustar a cor de textos secundários */
.contact-item,
.badge-info,
.user-details .text-muted {
    color: var(--text-secondary) !important;
}


/* ==/* Visualização Grade Estilo Google Calendar - REFINADO */
.grade-view {
    display: none;
}

.grade-view.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.grade-container {
    background: var(--glass-bg);
    border-radius: 12px;
    border: 1px solid var(--grid-col-border);
    margin: 10px;
    height: calc(100vh - 250px);
    min-height: 500px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: var(--glass-shadow);
}

.grade-header-row {
    display: grid;
    grid-template-columns: 80px 1fr;
    background: rgba(255, 255, 255, 0.12);
    border-bottom: 2px solid var(--grid-col-border);
    z-index: 20;
}

.timeline-corner {
    border-right: 2px solid var(--grid-col-border);
}

.grade-professionals-header {
    display: flex;
    overflow: hidden; /* Sincronizado via JS */
}

.prof-header-col {
    flex: 0 0 150px;
    padding: 10px 5px;
    text-align: center;
    border-right: 1px solid var(--grid-col-border);
    font-weight: 700;
    font-size: 0.85em;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grade-body-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    scrollbar-width: thin;
}

.grade-body-grid {
    display: grid;
    grid-template-columns: 80px 1fr;
    position: relative;
}

.timeline-col {
    border-right: 2px solid var(--grid-col-border);
    background: rgba(255, 255, 255, 0.03);
}

.time-marker {
    height: 60px; /* 1 hora = 60px */
    position: relative;
    border-bottom: 1px solid var(--grid-col-border);
}

.time-marker span {
    position: absolute;
    top: -10px;
    right: 10px;
    font-size: 0.75em;
    color: var(--text-secondary);
    font-weight: 700;
}

.grade-columns-container {
    display: flex;
    position: relative;
    overflow-x: auto; /* Scroll horizontal principal */
    background-image:
        linear-gradient(var(--grid-line-color) 1px, transparent 1px);
    background-size: 100% 60px; /* Linhas das horas */
}

/* Linhas de Meia Hora */
.grade-columns-container::after {
    content: '';
    position: absolute;
    top: 30px;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: linear-gradient(var(--grid-line-sub-color) 1px, transparent 1px);
    background-size: 100% 60px;
    pointer-events: none;
    z-index: 1;
}

:root {
    --grid-line-color: rgba(255, 255, 255, 0.15);
    --grid-line-sub-color: rgba(255, 255, 255, 0.05);
    --grid-col-border: rgba(255, 255, 255, 0.1);
}

body.light-theme, .light-theme,
body.doutordm2-light, .doutordm2-light,
body.healthz-light, .healthz-light {
    --grid-line-color: rgba(0, 0, 0, 0.06);
    --grid-line-sub-color: rgba(0, 0, 0, 0.03);
    --grid-col-border: rgba(0, 0, 0, 0.07);
}

.grade-prof-column {
    flex: 0 0 150px;
    position: relative;
    border-right: 1px solid var(--grid-col-border);
    min-height: 840px; /* 14 horas * 60px */
    background: transparent;
}

/* Blocos de Evento */
.calendar-event-block {
    position: absolute;
    left: 4px;
    right: 10px;
    border-radius: 4px;
    padding: 6px 10px;
    color: white;
    font-size: 0.8em;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 15;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    min-height: 54px;
}

.calendar-event-block.status-cancelada {
    z-index: 5 !important;
    opacity: 0.55 !important;
}

.calendar-event-block.status-cancelada:hover {
    z-index: 50 !important;
    opacity: 1 !important;
}

.calendar-event-block:hover {
    z-index: 50;
    transform: scale(1.03);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    filter: brightness(1.2);
    overflow: visible;
    height: auto !important;
}

.event-block-time {
    font-weight: 800;
    font-size: 0.85em;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.event-block-patient {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-block-type {
    opacity: 0.9;
    font-size: 0.8em;
    font-style: italic;
}

/* Indicador de Agora */
.now-indicator {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: #ff3b30;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 0 4px rgba(255, 59, 48, 0.5);
}

.now-indicator::before {
    content: '';
    position: absolute;
    left: -6px;
    top: -5px;
    width: 12px;
    height: 12px;
    background: #ff3b30;
    border-radius: 50%;
    border: 2px solid white;
}

/* Slots de Trabalho (Grade do Profissional) */
.work-slot-bg {
    position: absolute;
    left: 0;
    right: 0;
    background: rgba(0, 212, 170, 0.06);
    border-top: 1px solid rgba(0, 212, 170, 0.15);
    border-bottom: 1px solid rgba(0, 212, 170, 0.15);
    z-index: 2;
    pointer-events: all;
}

.work-slot-bg:hover {
    background: rgba(0, 212, 170, 0.1);
}

/* Cores de Eventos Baseadas no Tipo */
.calendar-event-block.emergencia { background: linear-gradient(135deg, #ff4d4d, #b30000); border-left: 4px solid #fff; }
.calendar-event-block.consulta   { background: linear-gradient(135deg, #007aff, #0056b3); border-left: 4px solid #fff; }
.calendar-event-block.retorno    { background: linear-gradient(135deg, #34c759, #1e7e34); border-left: 4px solid #fff; }
.calendar-event-block.exame      { background: linear-gradient(135deg, #af52de, #763e99); border-left: 4px solid #fff; }
.calendar-event-block.cirurgia   { background: linear-gradient(135deg, #ff9500, #cc7a00); border-left: 4px solid #fff; }

.loading-grade {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: var(--text-secondary);
    gap: 15px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsividade Especializada para Grade */
@media (max-width: 1200px) {
    .prof-header-col,
    .grade-prof-column {
        flex: 0 0 130px;
    }
}

@media (max-width: 768px) {
    .grade-container {
        height: calc(100vh - 300px);
    }
    .prof-header-col,
    .grade-prof-column {
        flex: 0 0 110px;
    }
    .timeline-col, .grade-header-row {
        grid-template-columns: 60px 1fr;
    }
}

.user-info {
    display    : flex;
    align-items: center;
    gap        : 0.75rem;
}

.user-avatar {
    width          : 40px;
    height         : 40px;
    background     : var(--gradient-primary);
    border-radius  : 50%;
    display        : flex;
    align-items    : center;
    justify-content: center;
    font-weight    : 700;
    color          : white;
    font-size      : 0.9rem;
}

.user-details strong {
    color      : var(--text-primary);
    font-weight: 600;
}

.badge-id,
.badge-info,
.badge-crm {
    padding      : 0.3rem 0.6rem;
    border-radius: 8px;
    font-size    : 0.8rem;
    font-weight  : 600;
}

.badge-id {
    background: rgba(139, 92, 246, 0.2);
    color     : var(--accent-purple);
}

/* === CORREÇÃO DOS BADGES === */
.badge-info {
    background: rgba(255, 255, 255, 0.15) !important;
    color     : #d0d0d0 !important;
    /* Texto mais claro nos badges */
    border    : 1px solid rgba(255, 255, 255, 0.1) !important;
}

.badge-crm {
    background: rgba(0, 212, 170, 0.25) !important;
    /* Verde mais forte */
    color     : #ffffff !important;
}

.specialty-badge {
    background: rgba(12, 105, 176, 0.4) !important;
    /* Azul mais forte */
    color     : #ffffff !important;
}

.contact-info {
    display       : flex;
    flex-direction: column;
    gap           : 0.3rem;
}

/* === CORREÇÃO DAS INFORMAÇÕES DE CONTATO === */
/* Melhor contraste para informações de contato */
.contact-item {
    color: #b0b0b0 !important;
    /* Cinza mais escuro */
}

.contact-item i {
    color: var(--accent-green) !important;
}

.text-primary {
    color      : var(--text-primary) !important;
    font-weight: 500;
}

/* === BOTÕES DE AÇÃO MODERNOS === */
.action-buttons-modern {
    display        : flex;
    gap            : 0.5rem;
    justify-content: center;
}

.btn-action {
    width          : 35px;
    height         : 35px;
    border         : none;
    border-radius  : 10px;
    display        : flex;
    align-items    : center;
    justify-content: center;
    cursor         : pointer;
    transition     : all 0.3s ease;
    font-size      : 0.9rem;
}

.edit-btn {
    background: rgba(245, 158, 11, 0.2);
    color     : #f59e0b;
}

.edit-btn:hover {
    background: #f59e0b;
    color     : white;
    transform : scale(1.1);
}

.delete-btn {
    background: rgba(239, 68, 68, 0.2);
    color     : #ef4444;
}

.delete-btn:hover {
    background: #ef4444;
    color     : white;
    transform : scale(1.1);
}

.view-btn {
    padding    : 10px 20px;
    border     : none;
    background : transparent;
    color      : var(--text-primary);
    cursor     : pointer;
    transition : all 0.3s ease;
    font-weight: 500;
}

.view-btn:hover {
    background: var(--primary-blue);
    color     : white;
    transform : scale(1.1);
}

.view-btn.active {
    background: rgba(255, 255, 255, 0.2);
}

/* Estilo específico para o botão de visualização na tabela (mais destacado) */
.btn-action.view-btn {
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    color: #ffffff;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(59,130,246,0.14);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.btn-action.view-btn i {
    color: #ffffff;
    font-size: 1rem;
}

.btn-action.view-btn:hover {
    transform: scale(1.12);
    box-shadow: 0 12px 30px rgba(59,130,246,0.22);
    color: #ffffff;
}

.btn-action.view-btn:focus {
    outline: 2px solid rgba(59,130,246,0.2);
    outline-offset: 2px;
}

.delete-form {
    display: inline;
    margin : 0;
}

/* === RODAPÉ DA TABELA === */
.table-footer {
    display        : flex;
    justify-content: space-between;
    align-items    : center;
    padding        : 1.5rem;
    border-top     : 1px solid var(--glass-border);
    background     : rgba(255, 255, 255, 0.05);
}

.table-info {
    color    : var(--text-secondary);
    font-size: 0.9rem;
}

.btn-export {
    background   : rgba(255, 255, 255, 0.1);
    border       : 1px solid var(--glass-border);
    color        : var(--text-primary);
    padding      : 0.6rem 1.2rem;
    border-radius: 10px;
    cursor       : pointer;
    transition   : all 0.3s ease;
    display      : flex;
    align-items  : center;
    gap          : 0.5rem;
    font-size    : 0.9rem;
    font-weight  : 500;
}

.btn-export:hover {
    background: var(--accent-green);
    color     : white;
    transform : translateY(-1px);
}

.btn-edit {
    background: rgba(52, 152, 219, 0.2);
    color     : #3498db;
}

.btn-edit:hover {
    background: rgba(52, 152, 219, 0.3);
    transform : translateY(-2px);
}

.btn-delete {
    background: rgba(231, 76, 60, 0.2);
    color     : #e74c3c;
}

.btn-delete:hover {
    background: rgba(231, 76, 60, 0.3);
    transform : translateY(-2px);
}


/* === ESTADO VAZIO DA TABELA === */
.empty-state-table {
    text-align: center;
    padding   : 3rem;
    color     : var(--text-secondary);
}

.empty-state-table i {
    font-size    : 4rem;
    margin-bottom: 1rem;
    opacity      : 0.5;
}

.empty-state-table h3 {
    color        : var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state-table p {
    margin-bottom: 1.5rem;
}

/* === RESPONSIVIDADE === */
@media (max-width: 1024px) {
    .page-header {
        flex-direction: column;
        align-items   : stretch;
    }

    .header-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 1.8rem;
    }

    .search-box {
        min-width : 100%;
        margin-top: 1rem;
    }

    .table-footer {
        flex-direction: column;
        gap           : 1rem;
        text-align    : center;
    }

    .action-buttons-modern {
        flex-wrap      : wrap;
        justify-content: center;
    }

    .modern-datatable thead th:nth-child(4),
    .modern-datatable thead th:nth-child(5),
    .modern-datatable tbody td:nth-child(4),
    .modern-datatable tbody td:nth-child(5) {
        display: none;
    }
}

@media (max-width: 480px) {
    .header-actions {
        flex-direction: column;
    }

    .header-actions .btn-modern {
        width          : 100%;
        justify-content: center;
    }

    .user-info {
        flex-direction: column;
        text-align    : center;
        gap           : 0.5rem;
    }

    .contact-item {
        font-size: 0.8rem;
    }
}

/* === CORREÇÃO PARA TEMA CLARO === */
.light-theme .modern-datatable tbody td,
.doutordm2-light .modern-datatable tbody td {
    color: #1e293b !important; /* Slate 800 */
}

.light-theme .modern-datatable tbody tr:nth-child(odd),
.doutordm2-light .modern-datatable tbody tr:nth-child(odd) {
    background: #ffffff !important;
}

.light-theme .modern-datatable tbody tr:nth-child(even),
.doutordm2-light .modern-datatable tbody tr:nth-child(even) {
    background: #f1f5f9 !important; /* Slate 100 */
}

.light-theme .modern-datatable tbody tr:hover,
.doutordm2-light .modern-datatable tbody tr:hover {
    background: #e2e8f0 !important; /* Slate 200 */
}

.light-theme .user-details strong {
    color: #0f172a !important; /* Slate 900 */
}

.light-theme .modern-datatable thead th,
.doutordm2-light .modern-datatable thead th {
    background: #e2e8f0 !important;
    color     : #0f172a !important;
    border-bottom: 2px solid #cbd5e1 !important;
}

.light-theme .contact-item {
    color: #475569 !important; /* Slate 600 */
}

.light-theme .badge-info {
    background: #f1f5f9;
    color     : #1e293b !important;
    border    : 1px solid #cbd5e1;
}

/* Zebra stripes para o tema escuro (padrão) */
.modern-datatable tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
}

/* === PAGINAÇÃO DATATABLES - TEMA ESCURO === */
/* === ESTILOS ESPECÍFICOS PARA DATATABLES PAGINATION === */
/* === CORREÇÕES ESPECÍFICAS PARA PAGINAÇÃO DO DATATABLES === */
.dataTables_wrapper {
    color     : var(--text-primary);
    margin-top: 1rem;
}

.dataTables_info {
    color    : var(--text-secondary) !important;
    font-size: 0.9rem;
    padding  : 0.5rem 0 !important;
}

.dataTables_paginate {
    margin-top: 1rem !important;
}

.dataTables_paginate .paginate_button {
    background   : rgba(255, 255, 255, 0.1) !important;
    border       : 1px solid var(--glass-border) !important;
    color        : var(--text-primary) !important;
    border-radius: 8px !important;
    margin       : 0 3px !important;
    padding      : 0.5rem 1rem !important;
    transition   : all 0.3s ease !important;
    cursor       : pointer !important;
}

.dataTables_paginate .paginate_button:hover {
    background     : var(--accent-green) !important;
    color          : white !important;
    border-color   : var(--accent-green) !important;
    transform      : translateY(-2px);
    text-decoration: none !important;
}

.dataTables_paginate .paginate_button.current {
    background  : var(--gradient-primary) !important;
    color       : white !important;
    border-color: var(--accent-green) !important;
}

.dataTables_paginate .paginate_button.disabled,
.dataTables_paginate .paginate_button.disabled:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color     : var(--text-secondary) !important;
    cursor    : not-allowed !important;
    transform : none !important;
    opacity   : 0.5 !important;
}

/* =============================================================
   Bootstrap-style pagination — gerada pelo DT_bootstrap.js
   Estrutura: .dataTables_paginate.paging_bootstrap.pagination
                > ul > li[.prev|.next|.active|.disabled] > a
   Funciona para todos os temas via variáveis CSS.
   ============================================================= */

/* Wrapper externo — faixa pill com glass */
.dataTables_paginate.paging_bootstrap.pagination {
    display        : inline-flex !important;
    align-items    : center;
    background     : var(--glass-bg);
    border         : 1px solid var(--glass-border);
    border-radius  : 14px;
    padding        : 4px 6px;
    gap            : 0;
    backdrop-filter: blur(8px);
    box-shadow     : 0 2px 12px rgba(0, 0, 0, 0.12);
    margin-top     : 0.5rem;
}

/* Lista interna */
.dataTables_paginate.paging_bootstrap.pagination ul {
    display    : flex;
    align-items: center;
    gap        : 3px;
    margin     : 0;
    padding    : 0;
    list-style : none;
}

.dataTables_paginate.paging_bootstrap.pagination ul li {
    margin: 0;
}

/* Botão base */
.dataTables_paginate.paging_bootstrap.pagination ul li a {
    display        : inline-flex;
    align-items    : center;
    justify-content: center;
    min-width      : 36px;
    height         : 36px;
    padding        : 0 12px;
    border-radius  : 10px;
    font-size      : 0.875rem;
    font-weight    : 500;
    line-height    : 1;
    color          : var(--text-secondary) !important;
    background     : transparent !important;
    border         : 1px solid transparent !important;
    text-decoration: none !important;
    transition     : background 0.18s ease, color 0.18s ease,
                     border-color 0.18s ease, transform 0.1s ease,
                     box-shadow 0.18s ease;
    white-space    : nowrap;
}

/* Hover */
.dataTables_paginate.paging_bootstrap.pagination ul li a:hover {
    background  : var(--glass-border) !important;
    border-color: var(--glass-border) !important;
    color       : var(--text-primary) !important;
    transform   : translateY(-1px);
}

/* Página activa */
.dataTables_paginate.paging_bootstrap.pagination ul li.active a {
    background  : var(--gradient-primary) !important;
    border-color: transparent !important;
    color       : #ffffff !important;
    font-weight : 700;
    box-shadow  : 0 4px 14px rgba(0, 0, 0, 0.2);
    transform   : none;
}

/* Anterior / Próximo — destaque leve */
.dataTables_paginate.paging_bootstrap.pagination ul li.prev a,
.dataTables_paginate.paging_bootstrap.pagination ul li.next a {
    color      : var(--text-primary) !important;
    font-weight: 600;
    padding    : 0 14px;
}

.dataTables_paginate.paging_bootstrap.pagination ul li.prev a:hover,
.dataTables_paginate.paging_bootstrap.pagination ul li.next a:hover {
    background  : var(--accent-green) !important;
    border-color: var(--accent-green) !important;
    color       : #ffffff !important;
}

/* Separador prev / números / next */
.dataTables_paginate.paging_bootstrap.pagination ul li.prev {
    margin-right: 4px;
}

.dataTables_paginate.paging_bootstrap.pagination ul li.next {
    margin-left: 4px;
}

/* Desabilitado */
.dataTables_paginate.paging_bootstrap.pagination ul li.disabled a,
.dataTables_paginate.paging_bootstrap.pagination ul li.disabled a:hover {
    opacity       : 0.38 !important;
    pointer-events: none !important;
    cursor        : default !important;
    transform     : none !important;
    background    : transparent !important;
    box-shadow    : none !important;
}

/* Tema claro — ajuste de contraste */
.light-theme .dataTables_paginate.paging_bootstrap.pagination {
    background: rgba(255, 255, 255, 0.85);
    border    : 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.light-theme .dataTables_paginate.paging_bootstrap.pagination ul li a {
    color: #4a5568 !important;
}

.light-theme .dataTables_paginate.paging_bootstrap.pagination ul li a:hover {
    background  : #edf2f7 !important;
    border-color: #cbd5e0 !important;
    color       : #1a1a1a !important;
}

/* Responsivo */
@media (max-width: 576px) {
    .dataTables_paginate.paging_bootstrap.pagination {
        padding      : 3px 4px;
        border-radius: 12px;
    }

    .dataTables_paginate.paging_bootstrap.pagination ul li a {
        min-width    : 32px;
        height       : 32px;
        padding      : 0 9px;
        border-radius: 8px;
        font-size    : 0.82rem;
    }

    .dataTables_paginate.paging_bootstrap.pagination ul li.prev a,
    .dataTables_paginate.paging_bootstrap.pagination ul li.next a {
        padding: 0 10px;
    }
}

/* Estilo para os botões anterior/próximo */
.dataTables_paginate .paginate_button.previous,
.dataTables_paginate .paginate_button.next {
    font-weight: 600 !important;
}

/* Responsive details (DataTables Responsive child rows) */
.dark-theme table.dt-responsive-details {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
}

.dark-theme table.dt-responsive-details td {
    padding: 8px 12px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dark-theme table.dt-responsive-details tr:last-child td {
    border-bottom: none;
}

.dark-theme table.dt-responsive-details .dt-custom-details td,
.dark-theme table.dt-responsive-details .dt-custom-details {
    background: rgba(255, 255, 255, 0.03);
}

.light-theme table.dt-responsive-details {
    width: 100%;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.light-theme table.dt-responsive-details td {
    padding: 8px 12px;
    color: #4a5568;
    border-bottom: 1px solid #edf2f7;
}

.light-theme table.dt-responsive-details tr:last-child td {
    border-bottom: none;
}

.light-theme table.dt-responsive-details .dt-custom-details td,
.light-theme table.dt-responsive-details .dt-custom-details {
    background: #f8fafc;
}

/* Container da paginação */
.dataTables_paginate.paging_simple_numbers {
    padding: 0.5rem 0 !important;
}

/* Input de busca e select */
.dataTables_filter input,
.dataTables_length select {
    background   : rgba(255, 255, 255, 0.1) !important;
    border       : 1px solid var(--glass-border) !important;
    color        : var(--text-primary) !important;
    border-radius: 8px !important;
    padding      : 0.5rem !important;
    margin-left  : 0.5rem !important;
}

.dataTables_filter input:focus,
.dataTables_length select:focus {
    outline     : none !important;
    border-color: var(--accent-green) !important;
    box-shadow  : 0 0 0 2px rgba(0, 212, 170, 0.1) !important;
}

.dataTables_filter label,
.dataTables_length label {
    color      : var(--text-primary) !important;
    font-weight: 500 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.dataTables_filter label::before {
    content: '\f002';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: var(--text-secondary);
}

/* Tema dark - DataTables */
.dark-theme .dataTables_filter input,
.dark-theme .dataTables_length select {
    background   : rgba(0, 0, 0, 0.4) !important;
    border       : 1px solid rgba(255, 255, 255, 0.2) !important;
    color        : #ffffff !important;
}

.dark-theme .dataTables_length select option {
    background: #2c2c2c !important;
    color: #ffffff !important;
}

.dark-theme .dataTables_filter label,
.dark-theme .dataTables_length label {
    color: #6c757d !important;
}

.dark-theme .dataTables_filter label::before {
    color: #6c757d !important;
}

.dark-theme .dataTables_filter input::placeholder {
    color: rgba(0, 0, 0, 0.5) !important;
}

/* === CORREÇÃO DE LAYOUT GERAL === */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    padding: 0.5rem 0 !important;
}

/* === RESPONSIVIDADE === */
@media (max-width: 768px) {

    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: center !important;
        float     : none !important;
        width     : 100% !important;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        text-align   : center !important;
        margin-bottom: 1rem !important;
    }

    .dataTables_paginate .paginate_button {
        padding  : 0.4rem 0.8rem !important;
        margin   : 0 2px !important;
        font-size: 0.85rem !important;
    }
}

/* === BOTÕES DE AÇÃO DESTACADOS === */
.header-actions .btn-modern {
    background     : rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border         : 1px solid rgba(255, 255, 255, 0.25);
    color          : var(--text-primary);
    padding        : 0.85rem 1.75rem;
    border-radius  : 14px;
    font-weight    : 600;
    cursor         : pointer;
    transition     : all 0.3s ease;
    display        : inline-flex;
    align-items    : center;
    gap            : 0.75rem;
    font-family    : 'Inter', sans-serif;
    font-size      : 0.95rem;
    position       : relative;
    overflow       : hidden;
}

.header-actions .btn-modern::before {
    content   : '';
    position  : absolute;
    top       : 0;
    left      : -100%;
    width     : 100%;
    height    : 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.header-actions .btn-modern:hover::before {
    left: 100%;
}

.header-actions .btn-modern:hover {
    transform   : translateY(-3px);
    border-color: var(--accent-green);
    box-shadow  : 0 10px 30px rgba(0, 212, 170, 0.25);
}

.header-actions .btn-modern.btn-accent {
    background: var(--gradient-primary);
    color     : white;
    border    : 1px solid rgba(0, 212, 170, 0.4);
    box-shadow: 0 6px 20px rgba(0, 212, 170, 0.3);
}

.header-actions .btn-modern.btn-accent:hover {
    background: var(--gradient-accent);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
    transform : translateY(-3px) scale(1.02);
}

.header-actions .btn-modern i {
    font-size : 1.1rem;
    transition: all 0.3s ease;
}

.header-actions .btn-modern:hover i {
    transform: scale(1.2);
}

.header-actions .btn-modern.btn-accent i {
    color      : rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* calendar ** agenda completa **/
.calendar-header {
    background     : linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color          : var(--text-primary);
    padding        : 14px 20px;
    display        : flex;
    justify-content: space-between;
    align-items    : center;
    flex-wrap      : wrap;
    gap            : 15px;
    border-radius  : 12px;
    margin-bottom  : 16px;
}

.calendar-title {
    font-size  : 1.8em;
    font-weight: 600;
    margin     : 0;
    display    : flex;
    align-items: center;
    gap        : 12px;
}

.calendar-title i {
    font-size: 1.4em;
}

.calendar-controls {
    display        : flex;
    justify-content: space-between;
    align-items    : center;
    flex-wrap      : wrap;
    gap            : 15px;
    width          : 100%;
}

.calendar-nav {
    display    : flex;
    gap        : 8px;
    align-items: center;
}

.calendar-nav-btn {
    background     : rgba(255, 255, 255, 0.2);
    border         : none;
    color          : white;
    padding        : 10px 14px;
    border-radius  : 8px;
    cursor         : pointer;
    transition     : all 0.3s ease;
    backdrop-filter: blur(10px);
}

.calendar-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform : translateY(-2px);
}

.current-month {
    font-size      : 1.3em;
    font-weight    : 500;
    min-width      : 220px;
    text-align     : center;
    padding        : 8px 16px;
    background     : rgba(255, 255, 255, 0.1);
    border-radius  : 8px;
    backdrop-filter: blur(10px);
}

.calendar-filters {
    display    : flex;
    gap        : 15px;
    align-items: center;
    flex-wrap  : wrap;
}

.view-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.calendar-grid {
    padding: 25px;
}

/* Visualização Mês */
.month-view {
    display: none;
}

.month-view.active {
    display: block;
}

.weekdays-header {
    display              : grid;
    grid-template-columns: repeat(7, 1fr);
    gap                  : 1px;
    background           : rgba(255, 255, 255, 0.05);
    border-radius        : 12px 12px 0 0;
    overflow             : hidden;
    margin-bottom        : 1px;
}

.weekday {
    padding        : 18px 12px;
    text-align     : center;
    font-weight    : 600;
    color          : var(--text-primary);
    background     : rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border-bottom  : 1px solid rgba(255, 255, 255, 0.1);
}

.days-grid {
    display              : grid;
    grid-template-columns: repeat(7, 1fr);
    gap                  : 1px;
    background           : rgba(255, 255, 255, 0.05);
    border-radius        : 0 0 12px 12px;
    overflow             : hidden;
}

.calendar-day {
    min-height     : 140px;
    background     : rgba(255, 255, 255, 0.05);
    padding        : 12px;
    border         : 1px solid rgba(255, 255, 255, 0.1);
    position       : relative;
    transition     : all 0.3s ease;
    backdrop-filter: blur(10px);
}

.calendar-day:hover {
    background: rgba(255, 255, 255, 0.08);
    transform : translateY(-2px);
}

.calendar-day.other-month {
    background: rgba(255, 255, 255, 0.02);
    color     : rgba(255, 255, 255, 0.4);
}

.calendar-day.today {
    background: rgba(12, 105, 176, 0.2);
    border    : 2px solid var(--primary-color);
}

.day-number {
    font-weight  : 600;
    margin-bottom: 8px;
    color        : var(--text-primary);
    font-size    : 1.1em;
}

.day-events {
    max-height: 100px;
    overflow-y: auto;
}

.event-item {
    background     : var(--primary-color);
    color          : white;
    padding        : 6px 10px;
    margin         : 3px 0;
    border-radius  : 6px;
    font-size      : 0.8em;
    cursor         : pointer;
    transition     : all 0.3s ease;
    backdrop-filter: blur(10px);
    border         : 1px solid rgba(255, 255, 255, 0.2);
}

.event-item:hover {
    transform : translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.event-item.emergencia {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.event-item.consulta {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.event-item.retorno {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.event-item.exame {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.event-item.cirurgia {
    background: linear-gradient(135deg, #e67e22, #d35400);
}

/* Visualização Semana */
.week-view {
    display: none;
}

.week-view.active {
    display: block;
}

.week-grid {
    display              : grid;
    grid-template-columns: 100px repeat(7, 1fr);
    gap                  : 1px;
    background           : rgba(255, 255, 255, 0.05);
    border-radius        : 12px;
    overflow             : hidden;
}

.time-slot {
    background     : rgba(255, 255, 255, 0.08);
    padding        : 15px;
    text-align     : center;
    font-weight    : 600;
    color          : var(--text-primary);
    border-bottom  : 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.week-day {
    background     : rgba(255, 255, 255, 0.08);
    padding        : 15px;
    text-align     : center;
    font-weight    : 600;
    color          : var(--text-primary);
    border-bottom  : 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.week-hour {
    background     : rgba(255, 255, 255, 0.05);
    padding        : 8px;
    text-align     : center;
    font-size      : 0.85em;
    color          : var(--text-secondary);
    border-bottom  : 1px solid rgba(255, 255, 255, 0.05);
    min-height     : 60px;
    display        : flex;
    flex-direction : column;
    justify-content: flex-start;
    align-items    : center;
}

.week-event {
    background     : var(--primary-color);
    color          : white;
    padding        : 6px 10px;
    margin         : 2px;
    border-radius  : 6px;
    font-size      : 0.75em;
    cursor         : pointer;
    transition     : all 0.3s ease;
    width          : 95%;
    backdrop-filter: blur(10px);
    border         : 1px solid rgba(255, 255, 255, 0.2);
}

.week-event:hover {
    transform : translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Drag-and-drop */
.week-event[draggable="true"] { cursor: grab; }
.week-event.dragging           { opacity: 0.3; cursor: grabbing; }
.week-hour.drag-over           { background: rgba(0, 122, 255, 0.15); outline: 2px dashed rgba(0, 122, 255, 0.6); border-radius: 4px; }

.event-modal {
    display        : none;
    position       : fixed;
    top            : 0;
    left           : 0;
    width          : 100%;
    height         : 100%;
    background     : rgba(0, 0, 0, 0.7);
    z-index        : 1000;
    justify-content: center;
    align-items    : center;
    backdrop-filter: blur(5px);
}

.event-modal-content {
    background     : var(--glass-bg);
    backdrop-filter: blur(20px);
    border         : 1px solid var(--glass-border);
    padding        : 30px;
    border-radius  : 16px;
    max-width      : 500px;
    width          : 90%;
    max-height     : 80vh;
    overflow-y     : auto;
    box-shadow     : var(--glass-shadow);
    color          : var(--text-primary);
}

.event-modal h3 {
    margin-top   : 0;
    color        : var(--text-primary);
    font-size    : 1.5em;
    margin-bottom: 20px;
    display      : flex;
    align-items  : center;
    gap          : 10px;
}

.event-detail {
    margin       : 15px 0;
    padding      : 15px;
    background   : rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border       : 1px solid rgba(255, 255, 255, 0.1);
}

.event-detail strong {
    color        : var(--text-primary);
    display      : inline-block;
    margin-bottom: 5px;
}



.view-toggle {
    display        : flex;
    background     : rgba(255, 255, 255, 0.1);
    border-radius  : 8px;
    overflow       : hidden;
    backdrop-filter: blur(10px);
}



/* Scrollbar personalizado */
.day-events::-webkit-scrollbar {
    width: 4px;
}

.day-events::-webkit-scrollbar-track {
    background   : rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.day-events::-webkit-scrollbar-thumb {
    background   : rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.day-events::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
    .calendar-header {
        flex-direction: column;
        align-items   : stretch;
        padding       : 20px;
    }

    .calendar-controls {
        justify-content: center;
    }

    .calendar-filters {
        justify-content: center;
    }

    .week-grid {
        grid-template-columns: 80px repeat(7, 1fr);
        font-size            : 0.8em;
    }

    .calendar-day {
        min-height: 120px;
        padding   : 8px;
    }

    .current-month {
        min-width: auto;
        font-size: 1.1em;
    }
}

.stats-grid {
    display              : grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap                  : 20px;
    margin-bottom        : 25px;
}

.stat-card {
    background     : var(--glass-bg);
    backdrop-filter: blur(10px);
    border         : 1px solid var(--glass-border);
    border-radius  : 12px;
    padding        : 25px;
    display        : flex;
    align-items    : center;
    gap            : 20px;
    transition     : all 0.3s ease;
}

.stat-card:hover {
    transform : translateY(-5px);
    box-shadow: var(--glass-shadow);
}

.stat-icon {
    width          : 60px;
    height         : 60px;
    border-radius  : 12px;
    background     : linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display        : flex;
    align-items    : center;
    justify-content: center;
    font-size      : 1.5em;
    color          : white;
}

.stat-content {
    flex: 1;
}

.stat-number {
    display      : block;
    font-size    : 2em;
    font-weight  : 700;
    color        : var(--text-primary);
    line-height  : 1;
    margin-bottom: 5px;
}

.stat-label {
    color      : var(--text-secondary);
    font-size  : 0.9em;
    font-weight: 500;
}

.form-grid {
    display              : grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap                  : 1.5rem;
}

.form-group {
    display       : flex;
    flex-direction: column;
    gap           : 0.5rem;
}

.form-label {
    font-weight: 500;
    color      : var(--text-primary);
    font-size  : 0.95rem;
}

.form-control {
    padding        : 0.875rem 1rem;
    background     : rgba(255, 255, 255, 0.08);
    border         : 1px solid rgba(255, 255, 255, 0.15);
    border-radius  : 10px;
    color          : var(--text-primary);
    font-size      : 0.95rem;
    transition     : all 0.3s ease;
    backdrop-filter: blur(10px);
}

/* Correção para selects - manter o estilo glassmorphism */
.form-control option {
    background: rgba(30, 30, 40, 0.95) !important;
    color     : var(--text-primary) !important;
    padding   : 10px;
}

/* Para navegadores Webkit (Chrome, Safari) */
.form-control::-webkit-scrollbar {
    width: 8px;
}

.form-control::-webkit-scrollbar-track {
    background   : rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.form-control::-webkit-scrollbar-thumb {
    background   : rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

/* Para Firefox */
.form-control {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
}

/* Garantir que os selects tenham o mesmo estilo */
select.form-control {
    appearance         : none;
    -webkit-appearance : none;
    -moz-appearance    : none;
    background-image   : url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat  : no-repeat;
    background-position: right 1rem center;
    background-size    : 12px;
    padding-right      : 2.5rem;
}

.form-control:focus {
    outline     : none;
    border-color: var(--primary-color);
    background  : rgba(255, 255, 255, 0.12);
    box-shadow  : 0 0 0 3px rgba(74, 144, 226, 0.1);
}


.invalido {
    border          : 2px solid #e74c3c !important;
    background-color: var(--bg-color, #ffffff) !important;
    color           : var(--text-color, #333333) !important;
}

.valido {
    border          : 2px solid #27ae60 !important;
    background-color: var(--bg-color, #ffffff) !important;
    color           : var(--text-color, #333333) !important;
}

.feedback-message {
    font-size : 0.875rem;
    margin-top: 0.25rem;
    color     : #333333;
}

.feedback-message:not(:empty) {
    padding      : 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.dark-theme .invalido {
    border          : 2px solid #e74c3c !important;
    background-color: var(--bg-color, #1e1e1e) !important;
    color           : var(--text-color, #ffffff) !important;
}

.dark-theme .valido {
    border          : 2px solid #27ae60 !important;
    background-color: var(--bg-color, #1e1e1e) !important;
    color           : var(--text-color, #ffffff) !important;
}

.dark-theme .feedback-message {
    color: #ffffff;
}

.form-group-inline {
    display    : flex;
    gap        : 10px;
    align-items: flex-end;
}

.form-group-inline .form-control {
    flex: 1;
}

/* Notificações modernas */
.notification {
    position     : fixed;
    top          : 20px;
    right        : 20px;
    padding      : 15px 20px;
    border-radius: 8px;
    color        : white;
    font-weight  : 500;
    z-index      : 10000;
    box-shadow   : 0 4px 12px rgba(0, 0, 0, 0.15);
    transform    : translateX(400px);
    opacity      : 0;
    transition   : all 0.3s ease;
    max-width    : 400px;
    display      : flex;
    align-items  : center;
    gap          : 10px;
}

.notification.show {
    transform: translateX(0);
    opacity  : 1;
}

.notification.success {
    background : linear-gradient(135deg, #27ae60, #2ecc71);
    border-left: 4px solid #219653;
}

.notification.error {
    background : linear-gradient(135deg, #e74c3c, #ff6b6b);
    border-left: 4px solid #c0392b;
}

.notification.warning {
    background : linear-gradient(135deg, #f39c12, #f1c40f);
    border-left: 4px solid #e67e22;
}

.notification.info {
    background : linear-gradient(135deg, #3498db, #2980b9);
    border-left: 4px solid #2980b9;
}

.notification .icon {
    font-size: 1.2em;
}

.notification .close-btn {
    background     : none;
    border         : none;
    color          : white;
    font-size      : 1.2em;
    cursor         : pointer;
    margin-left    : auto;
    padding        : 0;
    width          : 20px;
    height         : 20px;
    display        : flex;
    align-items    : center;
    justify-content: center;
}

/* Loading spinner */
.loading-spinner {
    display         : inline-block;
    width           : 20px;
    height          : 20px;
    border          : 3px solid #ffffff;
    border-radius   : 50%;
    border-top-color: transparent;
    animation       : spin 1s ease-in-out infinite;
    margin-right    : 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Botão com estado de loading */
.btn-loading {
    position: relative;
    color   : transparent !important;
}

.btn-loading::after {
    content         : '';
    position        : absolute;
    width           : 20px;
    height          : 20px;
    top             : 50%;
    left            : 50%;
    margin-left     : -10px;
    margin-top      : -10px;
    border          : 2px solid #ffffff;
    border-radius   : 50%;
    border-top-color: transparent;
    animation       : spin 1s ease-in-out infinite;
}

textarea.form-control {
    resize    : vertical;
    min-height: 120px;
}

select.form-control {
    cursor: pointer;
}

.form-actions {
    display        : flex;
    gap            : 1rem;
    justify-content: flex-end;
    margin-top     : 1rem;
    padding-top    : 1.5rem;
    border-top     : 2px solid rgba(255, 255, 255, 0.1);
}

.btn-modern {
    display        : flex;
    align-items    : center;
    gap            : 0.5rem;
    padding        : 0.875rem 1.5rem;
    border         : none;
    border-radius  : 10px;
    font-weight    : 500;
    font-size      : 0.95rem;
    cursor         : pointer;
    transition     : all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color     : white;
}

.btn-primary:hover {
    transform : translateY(-2px);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color     : var(--text-primary);
    border    : 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform : translateY(-2px);
}

.btn-add-record {
    background     : linear-gradient(135deg, #27ae60, #229954);
    color          : white;
    padding        : 0.875rem 1.5rem;
    border-radius  : 10px;
    text-decoration: none;
    display        : inline-flex;
    align-items    : center;
    gap            : 0.5rem;
    font-weight    : 500;
    transition     : all 0.3s ease;
}

.btn-add-record:hover {
    transform : translateY(-2px);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.3);
}

@media (max-width: 768px) {
    .patient-info-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        gap           : 1rem;
        align-items   : flex-start;
    }

    .record-header {
        flex-direction: column;
        gap           : 0.5rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn-modern {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn-modern {
        justify-content: center;
    }

    .modern-table {
        font-size: 0.85rem;
    }

    .modern-table th,
    .modern-table td {
        padding: 0.75rem 0.5rem;
    }

    .action-buttons {
        flex-direction: column;
        gap           : 0.25rem;
    }

    .btn-action {
        width : 32px;
        height: 32px;
    }
}

.grade-container {
    display       : flex;
    flex-direction: column;
    gap           : 2rem;
}

.form-section {
    background     : rgba(255, 255, 255, 0.05);
    border         : 1px solid rgba(255, 255, 255, 0.1);
    border-radius  : 16px;
    padding        : 2rem;
    backdrop-filter: blur(10px);
}

.section-header {
    display       : flex;
    align-items   : center;
    gap           : 0.75rem;
    font-size     : 1.25rem;
    font-weight   : 600;
    color         : var(--text-primary);
    margin-bottom : 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom : 2px solid rgba(255, 255, 255, 0.1);
}

.section-header i {
    color    : var(--primary-color);
    font-size: 1.1rem;
}

.table-container {
    background     : rgba(255, 255, 255, 0.05);
    border         : 1px solid rgba(255, 255, 255, 0.1);
    border-radius  : 16px;
    padding        : 2rem;
    backdrop-filter: blur(10px);
    overflow-x     : auto;
}

/* === Ajuste de contraste específico para sagrade.php === */
.table-container.sagrade-table {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.table-container.sagrade-table .modern-datatable thead,
.table-container.sagrade-table .modern-table thead {
    background: rgba(255, 255, 255, 0.12);
}
.table-container.sagrade-table .modern-datatable tbody tr,
.table-container.sagrade-table .modern-table tbody tr {
    background: rgba(0, 0, 0, 0.2) !important;
}
.table-container.sagrade-table .modern-datatable tbody td,
.table-container.sagrade-table .modern-table tbody td {
    color: var(--text-primary) !important;
    background: transparent !important;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}
.table-container.sagrade-table .modern-datatable tbody td:first-child,
.table-container.sagrade-table .modern-table tbody td:first-child {
    /* Garantir mesma cor de fundo na primeira coluna */
    background: rgba(0, 0, 0, 0.2) !important;
}
.table-container.sagrade-table .status-badge {
    color: #ffffff;
}

/* === RESPONSIVIDADE ESPECÍFICA PARA SAGRADES === */
@media (max-width: 480px) {
    .table-container.sagrade-table .modern-datatable thead th:nth-child(2),
    .table-container.sagrade-table .modern-datatable tbody td:nth-child(2),
    .table-container.sagrade-table .modern-datatable thead th:nth-child(3),
    .table-container.sagrade-table .modern-datatable tbody td:nth-child(3) {
        display: none;
    }

    .table-container.sagrade-table .modern-datatable td,
    .table-container.sagrade-table .modern-datatable th,
    .table-container.sagrade-table .modern-table td,
    .table-container.sagrade-table .modern-table th {
        padding: 0.6rem;
        font-size: 0.9rem;
    }

    .table-container.sagrade-table .user-avatar.small {
        width: 30px;
        height: 30px;
    }

    .table-container.sagrade-table .action-buttons {
        gap: 0.25rem;
    }

    .table-container.sagrade-table .btn-action {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 412px) {
    .table-container.sagrade-table .modern-datatable thead th:nth-child(4),
    .table-container.sagrade-table .modern-datatable tbody td:nth-child(4),
    .table-container.sagrade-table .modern-datatable thead th:nth-child(5),
    .table-container.sagrade-table .modern-datatable tbody td:nth-child(5) {
        display: none;
    }

    .table-container.sagrade-table .modern-datatable thead th:nth-child(1),
    .table-container.sagrade-table .modern-datatable tbody td:nth-child(1) {
        min-width: 120px;
    }
}

.modern-table {
    width          : 100%;
    border-collapse: collapse;
    margin-top     : 1rem;
}

.modern-table thead {
    background: rgba(255, 255, 255, 0.08);
}

.modern-table th {
    padding      : 1rem;
    text-align   : left;
    font-weight  : 600;
    color        : var(--text-primary);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.modern-table td {
    padding      : 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color        : var(--text-secondary);
}

.modern-table tbody tr {
    transition: all 0.3s ease;
}

.modern-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.status-badge {
    padding      : 0.25rem 0.75rem;
    border-radius: 20px;
    font-size    : 0.8rem;
    font-weight  : 500;
}

.status-active {
    background: rgba(39, 174, 96, 0.2);
    color     : #27ae60;
    border    : 1px solid rgba(39, 174, 96, 0.3);
}

.status-inactive {
    background: rgba(231, 76, 60, 0.2);
    color     : #e74c3c;
    border    : 1px solid rgba(231, 76, 60, 0.3);
}

.action-buttons {
    display: flex;
    gap    : 0.5rem;
}


.empty-state {
    text-align: center;
    padding   : 3rem 2rem;
    color     : var(--text-secondary);
}

A .empty-state i {
    font-size    : 3rem;
    margin-bottom: 1rem;
    opacity      : 0.5;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color        : var(--text-primary);
}


.header-controls {
    display    : flex;
    align-items: center;
    gap        : 15px;
    margin-left: auto;
    padding    : 0 10px;
}

.theme-toggle,
.logout-btn {
    width          : 44px;
    height         : 44px;
    border-radius  : 50%;
    border         : 2px solid var(--border-color);
    background     : transparent;
    color          : var(--text-color);
    cursor         : pointer;
    display        : flex;
    align-items    : center;
    justify-content: center;
    transition     : all 0.3s ease;
    text-decoration: none;
}

.theme-toggle:hover,
.logout-btn:hover {
    background  : var(--hover-color);
    border-color: var(--primary-color);
    transform   : translateY(-2px);
}

.logout-btn {
    border-color: var(--error-color);
    color       : var(--error-color);
}

.logout-btn:hover {
    background: var(--error-color);
    color     : white;
}

.btn-schedule-appointment {
    background   : var(--primary-color);
    color        : white;
    border       : none;
    padding      : 10px 20px;
    border-radius: 25px;
    cursor       : pointer;
    display      : flex;
    align-items  : center;
    gap          : 8px;
    transition   : all 0.3s ease;
    font-weight  : 600;
}

.btn-schedule-appointment:hover {
    background: var(--primary-dark);
    transform : translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ... seu CSS atual ... */

/* === RESPONSIVIDADE MONITORES GRANDES (>1600px) === */
@media (min-width: 1600px) {
    .header-content {
        max-width: 1600px;
        gap      : 2rem;
    }

    .modern-nav {
        gap: 1.5rem;
    }

    .nav-menu {
        gap: 0.25rem;
    }

    .nav-link {
        display: flex;
        gap: 0.2rem;
        font-size: 0.7rem;
        padding  : 0.45rem 0.5rem;
        min-width: auto; /* permite largura variada */
        box-sizing: border-box;
        overflow: visible; /* deixar texto visível */
        white-space: nowrap; /* mantém em uma linha */
    }

    .nav-link i {
        font-size: 0.8rem;
        width: 18px;
        flex-shrink: 0;
    }

    .nav-link span {
        display: inline-block;
        max-width: none; /* não limitar */
        overflow: visible;
        text-overflow: clip;
        vertical-align: middle;
    }

    .nav-menu li {
        min-width: 0; /* não forçar largura fixa */
        flex-shrink: 1;
    }

    /* Garante que o item ativo (Dashboard) tenha espaço mínimo */
    .nav-link.active {
        min-width: 140px;
        padding-left: 0.6rem;
        padding-right: 0.6rem;
    }

    /* Evita que a logo encolha em telas grandes */
    .logo-section {
        flex-shrink: 0;
        min-width: auto;
    }

    .header-controls {
        gap: 1.5rem;
    }

    .btn-schedule-appointment {
        padding  : 0.5rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* === RESPONSIVIDADE MONITORES ULTRA GRANDES (>=1920px) === */
@media (min-width: 1920px) {
    .header-content {
        max-width: 1800px;
    }
}

/* === RESPONSIVIDADE MONITORES MÉDIOS (1200px - 1599px) === */
@media (min-width: 1200px) and (max-width: 1599px) {
    .header-content {
        padding: 0.75rem 1rem;
        gap    : 0.5rem;
    }

    .logo-section {
        max-width: 280px;
    }

    .logo-link {
        font-size: 1.4rem;
    }

    .logo-link i {
        font-size: 1.6rem;
    }

    .user-welcome {
        margin-left: 0.5rem;
    }

    .welcome-text {
        font-size: 0.7rem;
        max-width: 120px;
    }

    .company-code {
        font-size: 0.6rem;
    }

    .nav-menu {
        gap: 0.2rem;
    }

    .nav-link {
        padding  : 0.5rem 0.7rem;
        font-size: 0.8rem;
    }

    .nav-link i {
        font-size: 0.9rem;
        width: 18px;
    }

    .nav-link span {
        display: inline;
    }

    .header-controls {
        gap: 0.5rem;
    }

    .theme-toggle,
    .logout-btn {
        width: 38px;
        height: 38px;
    }

    .btn-schedule-appointment {
        padding  : 0.5rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* === RESPONSIVIDADE MONITORES PEQUENOS (1025px - 1199px) === */
@media (min-width: 1025px) and (max-width: 1199px) {
    .header-content {
        padding: 0.75rem 1rem;
        gap    : 0.5rem;
    }

    .logo-section {
        max-width: 250px;
    }

    .logo-link {
        font-size: 1.3rem;
    }

    .logo-link i {
        font-size: 1.5rem;
    }

    .user-welcome {
        margin-left: 0.4rem;
    }

    .welcome-text {
        font-size: 0.65rem;
        max-width: 100px;
    }

    .company-code {
        font-size: 0.55rem;
        padding  : 0.1rem 0.3rem;
    }

    .nav-menu {
        gap: 0.15rem;
    }

    .nav-link {
        padding  : 0.5rem 0.65rem;
        font-size: 0.75rem;
    }

    .nav-link i {
        font-size: 0.85rem;
        width: 16px;
    }

    .header-controls {
        gap: 0.4rem;
    }

    .theme-toggle,
    .logout-btn {
        width: 36px;
        height: 36px;
    }

    .theme-toggle i,
    .logout-btn i {
        font-size: 0.9rem;
    }

    .btn-schedule-appointment {
        padding  : 0.5rem 0.7rem;
        font-size: 0.75rem;
    }
}

/* === RESPONSIVIDADE TABLETS (769px - 1024px) === */
@media (max-width: 1024px) and (min-width: 769px) {
    .header-content {
        padding: 1rem 1.5rem;
        gap    : 1.5rem;
    }

    .nav-menu {
        gap: 0.25rem;
    }

    .nav-link {
        padding  : 0.65rem 1rem;
        font-size: 0.9rem;
    }

    .btn-schedule-appointment {
        padding  : 0.65rem 1.2rem;
        font-size: 0.9rem;
    }

    .user-welcome {
        margin-left: 0.75rem;
    }

    .welcome-text {
        font-size: 0.75rem;
    }

    .company-code {
        font-size: 0.65rem;
        padding  : 0.15rem 0.5rem;
    }
}

/* === HEADER MOBILE RESPONSIVO (até 768px) === */
@media (max-width: 768px) {
    .modern-header {
        position: relative;
    }

    .header-content {
        flex-wrap      : wrap;
        padding        : 0.5rem 0.5rem;
        gap            : 0.5rem;
        justify-content: flex-start;
        position       : relative;
    }

    /* Logo e boas-vindas ocupam linha completa */
    .logo-section {
        flex           : 1 1 100%;
        width          : 100%;
        max-width      : 100%;
        display        : flex;
        justify-content: space-between;
        align-items    : center;
        margin-bottom  : 0;
        min-width      : 0;
        overflow       : hidden;
    }

    .logo {
        display       : flex;
        flex-direction: row;
        align-items   : center;
        gap           : 0.4rem;
        flex-shrink   : 1;
        min-width     : 0;
        max-width     : 100%;
    }

    .logo-link {
        font-size  : 1.1rem;
        white-space: nowrap;
        overflow   : visible;
        text-overflow: clip;
    }

    .logo-link img {
        max-height: 55px;
        width: auto;
        display: inline-block;
        vertical-align: middle;
    }

    .logo-link i {
        font-size  : 1.3rem;
        flex-shrink: 0;
    }

    /* Boas-vindas ajustado para mobile */
    .user-welcome {
        margin-left   : 0;
        text-align    : right;
        flex-direction: column;
        gap           : 0.15rem;
        align-items   : flex-end;
        flex-shrink   : 1;
        max-width     : 40%;
        overflow      : hidden;
    }

    .welcome-text {
        font-size  : 0.6rem;
        white-space: nowrap;
        overflow   : hidden;
        text-overflow: ellipsis;
        max-width  : 130px;
    }

    .company-code {
        font-size: 0.55rem;
        padding  : 0.1rem 0.3rem;
    }

    /* Navegação mobile - segunda linha */
    .modern-nav {
        flex           : 1 1 100%;
        width          : 100%;
        display        : flex;
        justify-content: space-between;
        align-items    : center;
        position       : relative;
        min-width      : 0;
        overflow       : visible;
    }

    /* Botão hamburger - IMPORTANTE: é um label, não um button */
    .menu-toggle {
        display        : flex !important;
        background     : rgba(255, 255, 255, 0.1);
        border         : 1px solid var(--glass-border);
        border-radius  : 6px;
        width          : 32px;
        height         : 32px;
        min-width      : 32px;
        align-items    : center;
        justify-content: center;
        cursor         : pointer;
        color          : var(--text-primary);
        transition     : all 0.3s ease;
        z-index        : 1002;
        flex-shrink    : 0;
        padding        : 0;
        margin-right   : 0.3rem;
        user-select    : none;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
        position       : relative;
    }

    .menu-toggle i {
        font-size: 0.85rem;
        pointer-events: none; /* Permite click passar para o label */
    }

    .menu-toggle:active {
        background: rgba(255, 255, 255, 0.25);
        transform : scale(0.95);
    }

    /* Menu fullscreen mobile */
    .nav-menu {
        display        : none;
        position       : fixed;
        top            : 0;
        left           : 0;
        width          : 100%;
        height         : 100vh;
        background     : var(--bg-color);
        backdrop-filter: blur(20px);
        flex-direction : column;
        padding        : 80px 1.25rem 30px;
        z-index        : 1001;
        overflow-y     : auto;
        box-shadow     : none;
        margin         : 0;
        gap            : 0.5rem;
    }

    .nav-menu li {
        width : 100%;
        margin: 0;
    }

    .nav-link {
        width          : 100%;
        padding        : 1rem 1.25rem;
        border-radius  : 12px;
        display        : flex;
        justify-content: flex-start;
        align-items    : center;
        gap            : 0.75rem;
        font-size      : 1rem;
        border         : 1px solid rgba(255, 255, 255, 0.1);
        cursor         : pointer;
        user-select    : none;
        -webkit-tap-highlight-color: transparent;
    }

    /* Texto do nav-link deve ser exibido no mobile (sobrescreve ocultação de tablets com alta especificidade) */
    .nav-menu .nav-link span {
        display  : block !important;
        flex-grow: 1;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .nav-link i:first-child {
        font-size: 1.2rem;
        width    : 24px;
    }

    /* Labels funcionam como botões no mobile */
    .has-submenu label.nav-link {
        cursor         : pointer;
        display        : flex !important;
        justify-content: space-between !important;
        align-items    : center !important;
    }

    /* Garantir que dropdown icon seja SEMPRE visível em labels no mobile */
    .has-submenu label.nav-link .dropdown-icon {
        display   : inline-block !important;
        font-size : 0.9rem !important;
        margin-left: auto !important;
        flex-shrink: 0 !important;
        transition : transform 0.3s ease !important;
    }

    /* Submenus mobile - HIDDEN por padrão - Reforçado */
    .nav-menu .has-submenu .submenu {
        position     : static !important;
        width        : 100% !important;
        box-shadow   : none !important;
        background   : rgba(255, 255, 255, 0.05) !important;
        margin       : 0.5rem 0 0 0 !important;
        display      : none !important; /* Esconde o bloco */
        padding      : 0 !important;
        border-radius: 10px !important;
        overflow     : hidden !important;
        max-height   : 0 !important;
        opacity      : 0 !important;
        visibility   : hidden !important;
        transition   : all 0.3s ease !important;
        transform    : none !important;
    }

    /* MOSTRAR submenu quando checkbox está marcado no mobile */
    .nav-menu .has-submenu input.submenu-toggle:checked ~ ul.submenu {
        display    : block !important;
        max-height : 2000px !important;
        opacity    : 1 !important;
        visibility : visible !important;
        padding    : 0.5rem 0 !important;
    }

    /* Rotacionar ícone do dropdown quando submenu aberto no mobile */
    .nav-menu .has-submenu input.submenu-toggle:checked ~ label.nav-link .dropdown-icon {
        transform: rotate(180deg) !important;
    }

    /* Highlight do label quando submenu aberto no mobile */
    .nav-menu .has-submenu input.submenu-toggle:checked ~ label.nav-link {
        background: rgba(255, 255, 255, 0.08) !important;
    }

    /* Garantir que o ícone dropdown seja visível no mobile */
    .nav-menu .has-submenu .dropdown-icon {
        display    : inline-block !important;
        margin-left: auto !important;
        transition : transform 0.3s ease !important;
    }

    .submenu-link {
        padding      : 0.875rem 1.25rem 0.875rem 3rem;
        font-size    : 0.9rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        display      : flex;
        align-items  : center;
        gap          : 0.5rem;
    }

    .submenu-link:last-child {
        border-bottom: none;
    }

    .menu-separator {
        height    : 1px;
        background: rgba(255, 255, 255, 0.1);
        margin    : 0.5rem 1.25rem;
    }

    /* Controles do header (tema, logout, agendar) */
    .header-controls {
        display         : flex;
        align-items     : flex-end;
        gap             : 0.4rem;
        flex-shrink     : 0;
        flex-wrap       : wrap;
        margin-left     : auto;
        padding-left    : 0.4rem;
        max-width       : 160px;
        justify-content : flex-end;
    }

    .theme-toggle,
    .logout-btn {
        width          : 36px;
        height         : 36px;
        min-width      : 36px;
        border         : 1px solid var(--glass-border);
        background     : rgba(255, 255, 255, 0.1);
        border-radius  : 6px;
        display        : flex;
        align-items    : center;
        justify-content: center;
        flex-shrink    : 0;
        padding        : 0;
        position       : relative;
        z-index        : 10;
    }

    .theme-toggle i,
    .logout-btn i {
        font-size: 0.95rem;
    }

    /* Botão agendar - segunda linha, largura total */
    .btn-schedule-appointment {
        padding        : 0.5rem 0.75rem;
        width          : 100%;
        height         : auto;
        min-height     : 40px;
        min-width      : 100%;
        border-radius  : 6px;
        display        : flex;
        align-items    : center;
        justify-content: center;
        gap            : 0.5rem;
        flex-shrink    : 0;
        position       : relative;
        z-index        : 10;
        flex-basis     : 100%;
        white-space    : nowrap;
    }

    .btn-schedule-appointment span {
        display   : inline-block;
        font-size : 0.85rem;
    }

    .btn-schedule-appointment i {
        margin   : 0;
        font-size: 0.9rem;
    }

    /* Barra de empresa */
    .company-bar {
        padding: 0.5rem 1rem;
    }

    .company-info {
        padding: 0 1rem;
    }

    .company-badge {
        font-size    : 0.7rem;
        padding      : 0.3rem 0.75rem;
        display      : block;
        overflow     : hidden;
        text-overflow: ellipsis;
        white-space  : nowrap;
    }
}

/* === AJUSTE ESPECÍFICO PARA MOBILE 412px (Galaxy A51) === */
@media (max-width: 412px) {
    .header-controls {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-end;
        gap: 0.6rem;
        padding: 0 1rem;
        width: 100%;
        margin-top: 0.25rem;
    }

    /* Ícones na linha superior, alinhados à direita (perto do hamburger) */
    .theme-toggle,
    .logout-btn {
        order: 1;
        width: 40px;
        height: 40px;
        min-width: 40px;
        flex: 0 0 auto;
        margin-left: 0.35rem;
        border-radius: 6px;
    }

    /* Garanta espaço entre o hamburger (esquerda) e os ícones (direita) */
    .menu-toggle {
        order: 0;
        margin-right: 0.5rem;
    }

    /* Botão 'Agendar' em linha exclusiva abaixo, centralizado e maior */
    .btn-schedule-appointment {
        order: 2;
        flex-basis: 100%;
        width: calc(100% - 2rem);
        max-width: 460px;
        margin: 0.5rem auto 0; /* centralizar */
        padding: 0.75rem 0.9rem;
        min-height: 48px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.92rem; /* ligeiramente menor para caber */
        box-shadow: var(--sombra);
        box-sizing: border-box; /* garantir padding dentro da largura */
        white-space: normal; /* permitir quebra se necessário */
        word-break: break-word; /* evitar overflow do texto */
        text-align: center;
    }

    /* Pequeno ajuste para evitar que o ícone do botão fique grande demais */
    .btn-schedule-appointment i {
        font-size: 1rem;
        margin-right: 0.45rem;
        flex-shrink: 0;
    }
}

/* === TELAS MUITO PEQUENAS (até 480px) === */
@media (max-width: 480px) {
    .header-content {
        padding: 0.5rem 0.5rem;
        gap    : 0.4rem;
    }

    .logo-link {
        font-size: 1.1rem;
        gap      : 0.3rem;
    }

    .logo-link i {
        font-size: 1.3rem;
    }

    /* Simplifica boas-vindas */
    .user-welcome {
        max-width: 120px;
    }

    .welcome-text {
        font-size    : 0.6rem;
        max-width    : 120px;
        overflow     : hidden;
        text-overflow: ellipsis;
    }

    .company-code {
        font-size: 0.55rem;
        padding  : 0.1rem 0.3rem;
    }

    /* Controles menores */
    .header-controls {
        gap: 0.3rem;
    }

    .menu-toggle,
    .theme-toggle,
    .logout-btn {
        width    : 32px;
        height   : 32px;
        min-width: 32px;
    }

    .btn-schedule-appointment {
        width: auto;
        height: auto;
        padding: 0.5rem 1rem;
        min-width: 0;
        font-size: 0.85rem;
    }

    .menu-toggle i,
    .theme-toggle i,
    .logout-btn i,
    .btn-schedule-appointment i {
        font-size: 0.85rem;
    }

    .nav-menu {
        padding: 70px 1rem 20px;
    }

    .nav-link {
        padding: 0.875rem 1rem;
    }

    .submenu-link {
        padding: 0.75rem 1rem 0.75rem 2.5rem;
    }

    .company-badge {
        font-size: 0.65rem;
        padding  : 0.25rem 0.6rem;
    }
}

/* === TELAS EXTRA PEQUENAS (até 360px) === */
@media (max-width: 360px) {
    .logo-link {
        font-size: 1.1rem;
    }

    .logo-link i {
        font-size: 1.35rem;
    }

    .user-welcome {
        display: none;
    }

    .header-controls {
        gap: 0.25rem;
    }

    .menu-toggle,
    .theme-toggle,
    .logout-btn {
        width : 36px;
        height: 36px;
    }

    .btn-schedule-appointment {
        width: auto;
        height: auto;
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }

    .menu-toggle i,
    .theme-toggle i,
    .logout-btn i,
    .btn-schedule-appointment i {
        font-size: 0.95rem;
    }
}

/* === ANIMAÇÕES PARA O MENU MOBILE === */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity  : 0;
    }

    to {
        transform: translateX(0);
        opacity  : 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity  : 1;
    }

    to {
        transform: translateX(100%);
        opacity  : 0;
    }
}

.nav-menu.active {
    animation: slideInRight 0.3s ease-out;
}

.nav-menu:not(.active) {
    animation: slideOutRight 0.3s ease-out;
}


/* === CORREÇÕES ESPECÍFICAS PARA SAPACIENTE.PHP MOBILE === */
@media (max-width: 768px) {

    /* Header da página */
    .page-header {
        flex-direction: column;
        gap           : 1rem;
    }

    .header-actions {
        justify-content: center;
        flex-wrap      : wrap;
        gap            : 0.75rem;
    }

    .header-actions .btn-modern {
        flex           : 1;
        min-width      : 140px;
        justify-content: center;
    }

    /* Search box */
    .search-box {
        min-width : 100%;
        margin-top: 1rem;
    }

    .card-header {
        flex-direction: column;
        align-items   : stretch;
        gap           : 1rem;
    }

    /* Tabela */
    .table-container {
        padding   : 1rem;
        overflow-x: auto;
    }

    .modern-datatable {
        min-width: 800px;
    }

    /* DataTables mobile */
    .dataTables_filter input {
        width      : 100% !important;
        margin-left: 0 !important;
        margin-top : 0.5rem;
    }

    /* Footer da tabela */
    .table-footer {
        flex-direction: column;
        gap           : 1rem;
        text-align    : center;
    }

    /* Ações */
    .action-buttons-modern {
        flex-direction: column;
        gap           : 0.25rem;
    }

    .btn-action {
        width : 32px;
        height: 32px;
    }
}

/* === MENU MOBILE COM CSS PURO (SEM JAVASCRIPT) === */
/* Checkboxes já estão definidos na seção MENU TOGGLE acima */

/* Desktop - manter hover normal */
@media (min-width: 769px) {
    .has-submenu:hover .submenu {
        display   : block;
        opacity   : 1;
        visibility: visible;
        transform : translateY(0);
    }

    .has-submenu:hover .dropdown-icon {
        transform: rotate(180deg);
    }
}

/* Mobile - controle via checkbox */
@media (max-width: 768px) {
    /* Mostrar menu quando checkbox principal está marcado */
    .modern-nav input#menu-toggle.menu-toggle-checkbox:checked ~ ul.nav-menu {
        display  : flex !important;
        animation: slideInFromTop 0.3s ease-out forwards;
    }

    /* Fallback mais genérico */
    input.menu-toggle-checkbox:checked ~ ul.nav-menu {
        display  : flex !important;
    }

    /* Mudar ícone do hamburger para X quando menu aberto */
    .menu-toggle-checkbox:checked ~ label.menu-toggle i::before {
        content: "\f00d" !important;
    }

    /* Rotacionar background do botão quando menu aberto */
    .menu-toggle-checkbox:checked ~ label.menu-toggle {
        background  : rgba(255, 255, 255, 0.15) !important;
        border-color: rgba(255, 255, 255, 0.3) !important;
    }

    /* Prevenir scroll do body quando menu está aberto */
    body:has(.menu-toggle-checkbox:checked) {
        overflow: hidden;
    }
}

/* === ANIMAÇÕES SUAVES PARA MENU MOBILE === */
@keyframes slideInFromTop {
    from {
        opacity  : 0;
        transform: translateY(-20px);
    }
    to {
        opacity  : 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity       : 0;
        max-height    : 0;
        transform     : translateY(-10px);
    }
    to {
        opacity       : 1;
        max-height    : 1000px;
        transform     : translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* === AJUSTES DESKTOP E WIDESCREEN === */

/* === AJUSTES PARA NOTEBOOKS 15" (1024px - 1366px) === */
@media (min-width: 1024px) and (max-width: 1366px) {
    .header-content {
        max-width: 100%;
        padding  : 0.875rem 1.25rem;
        gap      : 1rem;
    }

    .logo-link {
        font-size: 1.5rem;
    }

    .logo-link i {
        font-size: 1.75rem;
    }

    .user-welcome {
        margin-left: 0.5rem;
    }

    .welcome-text {
        font-size: 0.7rem;
    }

    .company-code {
        font-size: 0.65rem;
        padding  : 0.15rem 0.5rem;
    }

    /* Reduzir espaçamento do menu */
    .nav-menu {
        gap: 0.25rem;
    }

    .nav-link {
        padding  : 0.6rem 0.8rem;
        font-size: 0.85rem;
        gap      : 0.4rem;
    }

    .nav-link i {
        font-size: 1rem;
        width    : 18px;
    }

    .nav-link span {
        font-size: 0.85rem;
    }

    /* Compactar controles do header */
    .header-controls {
        gap: 0.5rem;
    }

    .theme-toggle,
    .logout-btn {
        width : 38px;
        height: 38px;
    }

    .btn-schedule-appointment {
        padding  : 0.6rem 1rem;
        font-size: 0.85rem;
        gap      : 0.4rem;
        white-space: nowrap;
    }

    .btn-schedule-appointment i {
        font-size: 0.95rem;
    }
}

/* === AJUSTE CRÍTICO PARA NOTEBOOKS PEQUENOS (1024px - 1280px) === */
@media (min-width: 1024px) and (max-width: 1280px) {
    .header-content {
        padding: 0.75rem 1rem;
        gap    : 0.75rem;
    }

    .logo-link {
        font-size: 1.4rem;
    }

    .logo-link i {
        font-size: 1.6rem;
    }

    .user-welcome {
        margin-left: 0.35rem;
    }

    .welcome-text {
        font-size  : 0.65rem;
        max-width  : 150px;
        overflow   : hidden;
        text-overflow: ellipsis;
    }

    /* Menu ainda mais compacto */
    .nav-menu {
        gap: 0.2rem;
    }

    .nav-link {
        padding: 0.55rem 0.7rem;
    }

    /* Botão agendar em modo compacto */
    .btn-schedule-appointment {
        padding  : 0.55rem 0.85rem;
        font-size: 0.8rem;
    }
}

/* === NOTEBOOKS 15" RESOLUÇÃO CRÍTICA (1150px - 1280px) === */
@media (min-width: 1150px) and (max-width: 1280px) {
    /* Forçar visibilidade dos controles */
    .header-controls {
        display       : flex !important;
        flex-shrink   : 0 !important;
        min-width     : fit-content !important;
        gap           : 0.4rem;
    }

    /* Reduzir ainda mais o nav-menu se necessário */
    .nav-link {
        padding  : 0.5rem 0.65rem;
        font-size: 0.8rem;
    }

    .nav-link span {
        font-size: 0.8rem;
    }

    /* Garantir que botões sejam sempre visíveis */
    .theme-toggle,
    .logout-btn {
        width       : 36px;
        height      : 36px;
        flex-shrink : 0 !important;
    }

    .btn-schedule-appointment {
        padding    : 0.5rem 0.75rem;
        font-size  : 0.75rem;
        flex-shrink: 0 !important;
    }
}

/* === NOTEBOOKS MÉDIOS (1367px - 1440px) === */
@media (min-width: 1367px) and (max-width: 1440px) {
    .header-content {
        max-width: 100%;
        padding  : 1rem 1.5rem;
        gap      : 1.5rem;
    }

    .nav-menu {
        gap: 0.35rem;
    }

    .nav-link {
        padding  : 0.65rem 0.95rem;
        font-size: 0.9rem;
    }

    .header-controls {
        gap: 0.6rem;
    }

    .theme-toggle,
    .logout-btn {
        width : 42px;
        height: 42px;
    }

    .btn-schedule-appointment {
        padding  : 0.65rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* === DESKTOPS GRANDES (1441px - 1920px) === */
@media (min-width: 1441px) and (max-width: 1920px) {
    .header-content {
        max-width: 1400px;
    }
}

/* === TELAS ULTRA WIDE (1921px+) === */
@media (min-width: 1921px) {
    .header-content {
        max-width: 1600px;
    }
}

/* === GARANTIR QUE MENU TOGGLE FIQUE OCULTO NO DESKTOP === */
@media (min-width: 769px) {
    .menu-toggle-checkbox,
    .menu-toggle {
        display: none !important;
    }

    .nav-menu {
        display: flex !important;
    }
}

/* === BADGES: Particular / Convênio === */
.badge-mini {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 999px;
    vertical-align: middle;
}
.badge-particular {
    background: rgba(40, 167, 69, 0.15);
    color: #20c997;
    border: 1px solid rgba(40, 167, 69, 0.3);
}
.badge-convenio {
    background: rgba(23, 162, 184, 0.15);
    color: #17a2b8;
    border: 1px solid rgba(23, 162, 184, 0.3);
}

/* Badge Check-in */
.checkin-indicator {
    margin-top: 8px;
}

.badge-checkin {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.4);
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    animation: pulse-checkin 2s ease-in-out infinite;
}

.badge-checkin i {
    font-size: 12px;
}

@keyframes pulse-checkin {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(76, 175, 80, 0);
    }
}

/* === RESPONSIVIDADE TELAS GRANDES (>= 1600px) === */
@media (min-width: 1600px) {
    .header-content {
        padding: 1rem 2rem;
        gap    : 1rem;
    }

    .logo-section {
        max-width: 360px;
    }

    .logo-link {
        font-size: 1.7rem;
        letter-spacing: 0.2px;
    }

    .logo-link i {
        font-size: 1.8rem;
    }

    .user-welcome .welcome-text {
        font-size: 0.9rem;
        max-width: 260px;
    }

    .company-code {
        font-size: 0.8rem;
    }

    .modern-nav {
        gap: 1rem;
        justify-content: space-between;
        width: 100%;
    }

    .nav-menu {
        gap: 0.5rem;
        flex-wrap: nowrap; /* Não permite quebra de linha em telas grandes */
        max-width: none;   /* Sem limite artificial de largura */
        justify-content: flex-start; /* Mantém alinhamento consistente */
    }

    .nav-link {
        padding  : 0.65rem 0.95rem;
        font-size: 1.0rem;
        letter-spacing: 0.1px;
    }

    .nav-link i {
        font-size: 1.05rem;
        width    : 20px;
    }

    .submenu {
        font-size: 0.95rem;
    }

    .submenu-link {
        font-size: 0.95rem;
        padding  : 0.8rem 1rem;
    }

    .header-controls {
        gap: 0.75rem;
    }

    .theme-toggle,
    .logout-btn {
        width : 40px;
        height: 40px;
    }

    .btn-schedule-appointment {
        padding  : 0.65rem 1.1rem;
        font-size: 1.0rem;
    }
}

/* === TELAS MUITO GRANDES (>= 1920px) === */
@media (min-width: 1920px) {
    .header-content {
        padding: 1.25rem 2.5rem;
        gap    : 1.25rem;
    }

    .logo-link {
        font-size: 1.8rem;
    }

    .user-welcome .welcome-text {
        font-size: 1rem;
        max-width: 320px;
    }

    .nav-menu {
        gap        : 0.6rem;
        flex-wrap  : nowrap;
        justify-content: flex-start;
    }

    .nav-link {
        font-size: 1.05rem;
        padding  : 0.7rem 1rem;
    }

    .nav-link i {
        font-size: 1.1rem;
        width    : 22px;
    }

    .submenu,
    .submenu-link {
        font-size: 1rem;
    }

    .theme-toggle,
    .logout-btn {
        width : 42px;
        height: 42px;
    }

    .btn-schedule-appointment {
        font-size: 1.05rem;
        padding  : 0.7rem 1.15rem;
    }
}

/* === ULTRA-WIDE (>= 2560px) === */
@media (min-width: 2560px) {
    .header-content {
        padding: 1.5rem 3rem;
        gap    : 1.5rem;
    }

    .logo-link {
        font-size: 2rem;
        letter-spacing: 0.3px;
    }

    .user-welcome .welcome-text {
        font-size: 1.05rem;
        max-width: 380px;
    }

    .nav-menu {
        gap: 0.7rem;
    }

    .nav-link {
        font-size: 1.1rem;
        padding  : 0.75rem 1.1rem;
    }

    .nav-link i {
        font-size: 1.15rem;
        width    : 24px;
    }

    .submenu,
    .submenu-link {
        font-size: 1.05rem;
    }

    .theme-toggle,
    .logout-btn {
        width : 44px;
        height: 44px;
    }

    .btn-schedule-appointment {
        font-size: 1.1rem;
        padding  : 0.75rem 1.2rem;
    }
}
/* === MENU GESTOR - ITEM DESABILITADO === */
.submenu-link.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
}

.submenu-link.disabled:hover {
    background-color: transparent;
    transform: none;
}

.submenu-link.disabled:active {
    transform: none;
}

.menu-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b6b 0%, #e74c3c 100%);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    margin-left: 0.5rem;
    vertical-align: middle;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    100% {
        opacity: 0.8;
        transform: scale(1);
    }
}

/* === MENU GESTOR - ITEM ATIVO === */
.submenu-link[href*="gestor"] {
    background: linear-gradient(135deg, rgba(12, 105, 176, 0.1) 0%, rgba(0, 212, 170, 0.1) 100%);
    border-left: 3px solid var(--accent-blue);
}

.submenu-link[href*="gestor"]:hover {
    background: linear-gradient(135deg, rgba(12, 105, 176, 0.2) 0%, rgba(0, 212, 170, 0.2) 100%);
    transform: translateX(5px);
}

.submenu-link[href*="gestor"] i {
    color: var(--accent-blue);
}

/* === RESPONSIVIDADE PARA MENU GESTOR === */
@media (max-width: 768px) {
    .menu-badge {
        font-size: 0.6rem;
        padding: 0.15rem 0.4rem;
    }

    .submenu-link[href*="gestor"] {
        font-size: 0.95rem;
    }
}
/* ==========================================================================
   CONSOLIDATED STYLES FROM INTERNAL BLOCKS
   ========================================================================== */

/* Utility Classes */
.d-none { display: none !important; }
.text-center { text-align: center !important; }
.text-truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-0 { margin: 0 !important; }
.m-b-25 { margin-bottom: 25px !important; }
.m-t-2 { margin-top: 2px !important; }
.p-20 { padding: 20px !important; }
.flex-1 { flex: 1 !important; }
.gap-15 { gap: 15px !important; }
.opacity-0-9 { opacity: 0.9 !important; }

/* Log Viewer Styles */
.log-viewer {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    max-height: 600px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}
.log-line { padding: 4px 0; border-bottom: 1px solid #333; }
.log-line:hover { background: #2d2d2d; }
.log-success { color: #4ec9b0; }
.log-error { color: #f48771; }
.log-warning { color: #dcdcaa; }
.log-info { color: #9cdcfe; }
.filters-panel { margin-bottom: 20px; padding: 15px; background: #f8f9fa; border-radius: 8px; }

/* Modal Modern Styles */
.modal-modern {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
}
.modal-modern-content {
    background-color: #2a2a2a;
    margin: 10% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    border: 1px solid #444;
}
.modal-modern-header {
    padding: 20px;
    border-bottom: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-modern-header h3 { margin: 0; color: #fff; }
.modal-modern-header .close { color: #aaa; font-size: 28px; font-weight: bold; cursor: pointer; }
.modal-modern-header .close:hover { color: #fff; }
.modal-modern-body { padding: 20px; }
.modal-modern-body label { color: #fff; display: block; margin-bottom: 8px; }
.modal-modern-body select {
    background-color: #3a3a3a;
    color: #fff;
    border: 1px solid #555;
    padding: 8px;
    border-radius: 4px;
    width: 100%;
}

/* Template Grid Styles */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}
.template-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.template-card:hover { font-weight: bold; transform: translateY(-5px); box-shadow: 0 10px 40px rgba(0, 212, 170, 0.2); border-color: var(--accent-green); }
.template-card.destaque { border: 2px solid var(--accent-green); }

/* DataTables Overrides */
.dt-controls-force .dataTables_filter,
.dt-controls-force .dataTables_length {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin-bottom: 1rem !important;
}


/* Additional styles from sgprefere.php */
.integration-icons { display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: wrap; }
.integration-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; background: rgba(255, 255, 255, 0.05); color: var(--text-secondary); font-size: 16px; }
.integration-icon.active { background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); color: white; }
.nf-status { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.badge-nfe, .badge-nfse { padding: 4px 10px; border-radius: 6px; font-size: 0.75em; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.badge-nfe { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; }
.badge-nfse { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); color: white; }
.cert-warning { color: #ff9800; font-size: 0.75em; }
.attendance-days { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }

/* === REUSABLE UI COMPONENTS === */

/* Status & Badges */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-active {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.status-inactive {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.status-pending {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-tag {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-id {
    background: rgba(12, 105, 176, 0.15);
    color: var(--accent-blue);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-family: monospace;
}

.version-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.version-latest {
    background: linear-gradient(135deg, #00b894 0%, #00a085 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.3);
}

/* Modern Cards & Layouts */
.card-modern {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--glass-shadow);
    transition: all 0.3s ease;
}

.card-modern:hover {
    transform: translateY(-5px);
    border-color: var(--accent-green);
}

.card-header-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.grid-responsive {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Info Display */
.summary-grid-v2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.info-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.privacy-list {
    font-size: 0.95rem;
    list-style: disc;
    padding-left: 1.5rem;
}

.text-none { text-transform: none !important; }

/* Portal Utilities */
.justify-end { justify-content: flex-end; }
.space-between { justify-content: space-between; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 1rem; }
.mt-2 { margin-top: 2rem; }
.hidden { display: none !important; }
.icon-huge { font-size: 4rem; display: block; }
.text-success { color: var(--accent-green); }
.font-size-09 { font-size: 0.9rem; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }

/* Tool & Auth Utilities */
.tool-body { padding: 2rem; max-width: 1200px; margin: 0 auto; }
.btn-block { width: 100%; display: block; margin-bottom: 1rem; }
.mt-3 { margin-top: 3rem; }
.text-warning { color: var(--accent-orange); }
.text-center { text-align: center; }
.no-margin { margin: 0 !important; }
.opacity-09 { opacity: 0.9; }
.section-title { margin-top: 30px; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.5rem; }
.auth-page-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-primary);
}
.auth-icon-wrapper {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-blue));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}
.auth-title { font-size: 1.75rem; font-weight: 700; margin-bottom: 1rem; text-align: center; color: var(--text-primary); }
.auth-message { color: var(--text-secondary); text-align: center; margin-bottom: 2rem; line-height: 1.6; }
.countdown-timer { font-weight: 700; color: var(--accent-green); }
.auth-icon-warn {
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-red));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.alert-orange {
    background: rgba(255, 159, 28, 0.1);
    border: 1px solid rgba(255, 159, 28, 0.3);
    color: var(--accent-orange);
}
.btn-group-vertical { display: flex; flex-direction: column; gap: 1rem; }

/* Termo & Signature Utilities */
.termo-viewer {
    border: 1px solid var(--glass-border);
    padding: 20px;
    margin: 20px 0;
    max-height: 400px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}
.signature-box {
    border: 1px solid var(--glass-border);
    background: white;
    border-radius: 8px;
    cursor: crosshair;
}
.mv-2 { margin: 2rem 0; }
.mb-1 { margin-bottom: 1rem; }

.info-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-weight: 600;
    color: var(--text-primary);
}

.section-accent {
    border-left: 4px solid var(--accent-green);
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 0 12px 12px 0;
}

.content-section {
    margin-bottom: 1.5rem;
}

/* List & Items */
.list-item-modern {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.list-item-modern:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.avatar-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
}

/* Interactions */
.autocomplete-wrapper {
    position: relative;
    width: 100%;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--secondary-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: var(--glass-shadow);
}

.autocomplete-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.autocomplete-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.step-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.step-pill {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-bottom: 3px solid var(--glass-border);
    color: var(--text-secondary);
    font-weight: 600;
}

.step-pill.active {
    color: var(--accent-green);
    border-bottom-color: var(--accent-green);
}

.selectable-card {
    cursor: pointer;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.2s;
}

.selectable-card:hover {
    border-color: var(--accent-green);
    background: rgba(0, 212, 170, 0.05);
}

.selectable-card.selected {
    background: rgba(0, 212, 170, 0.1);
    border-color: var(--accent-green);
    box-shadow: 0 0 0 2px var(--accent-green);
}

/* === FORM SYSTEM (Dynamic Forms) === */
.form-responder-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 1rem;
}

.form-section-header {
    background: var(--gradient-primary);
    color: white;
    padding: 1.25rem 1.5rem;
    border-radius: 12px 12px 0 0;
    margin: 2rem 0 0 0;
}

.form-section-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-top: none;
    padding: 2rem;
    border-radius: 0 0 12px 12px;
}

.form-field-wrapper {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.form-field-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.form-field-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* === AUTH & LOGIN SYSTEM === */
.auth-page-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    padding: 2rem 1rem;
    background: var(--bg-dark);
}

.auth-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    box-shadow: var(--glass-shadow);
    width: 100%;
    max-width: 440px;
    position: relative;
    overflow: hidden;
    animation: authFadeInUp 0.6s ease-out;
}

@keyframes authFadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--accent-green) 0%, var(--primary-color) 100%);
}

.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-logo-container {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    position: relative;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-green) 0%, var(--primary-color) 100%);
    padding: 4px;
    box-shadow: 0 8px 25px rgba(0, 212, 170, 0.3);
}

.auth-logo-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--logo-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.auth-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent-green) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.5;
}

.auth-form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.auth-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.auth-step-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.auth-step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.auth-step-dot.active {
    background: var(--accent-green);
    width: 30px;
}

.auth-input-wrapper {
    position: relative;
}

.auth-input-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    z-index: 1;
}

/* Badge e Tags */
.badge-tag, .badge-id {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.badge-info {
    background: rgba(74, 144, 226, 0.1);
    border-color: rgba(74, 144, 226, 0.2);
    color: var(--primary-color);
}

.badge-success {
    background: rgba(39, 174, 96, 0.1);
    border-color: rgba(39, 174, 96, 0.2);
    color: var(--accent-green);
}

.badge-crm {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.2);
    color: #a3bffa;
}

.badge-muted {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.auth-input {
    width: 100%;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.auth-input-with-icon {
    padding-left: 3.5rem;
}

.auth-input:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
    background: rgba(255, 255, 255, 0.12);
}

.auth-links {
    text-align: center;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.auth-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-link:hover {
    color: var(--accent-green);
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.auth-version {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.auth-action-link {
    color: var(--accent-green);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.auth-action-link:hover {
    color: #00a8ff;
}

.auth-redirect-info {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1.5rem;
    border: 1px solid var(--glass-border);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-icon-wrapper {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--accent-green), var(--primary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

.auth-message {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.countdown-timer {
    font-weight: 700;
    color: var(--accent-green);
}

/* === RESPONSIVIDADE VERTICAL (Monitores de 15" / 768px de altura) === */
@media (max-height: 800px) {
    .auth-page-container {
        padding: 1rem;
    }

    .auth-card {
        padding: 1.5rem 2rem;
        border-radius: 20px;
    }

    .auth-header {
        margin-bottom: 1rem;
    }

    .auth-logo-container {
        width: 80px;
        height: 80px;
        margin-bottom: 1rem;
    }

    .auth-logo-inner i {
        font-size: 1.8rem !important;
    }

    .auth-title {
        font-size: 1.8rem !important;
    }

    .auth-subtitle {
        font-size: 0.95rem;
    }

    .auth-form-group {
        margin-bottom: 1rem;
    }

    .auth-form-group label {
        margin-bottom: 0.25rem;
        font-size: 0.85rem;
    }

    .auth-step-dots {
        margin-bottom: 1rem;
    }

    .auth-input {
        padding: 0.75rem 1.25rem;
    }

    .auth-footer {
        margin-top: 1rem;
        padding-top: 1rem;
    }

    .auth-icon-wrapper {
        font-size: 2.5rem !important;
        margin-bottom: 1rem;
    }

    .auth-message {
        margin-bottom: 1rem;
        padding: 0.75rem;
        font-size: 0.95rem;
    }
}

/* === ALERTS & NOTIFICATIONS === */
.alert {
    display: none;
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.4;
    text-align: center;
    border: 1px solid transparent;
    animation: authFadeInUp 0.3s ease;
}

.alert.show {
    display: block !important;
}

/* === LOGIN STEPS (Multi-step flow) === */
.login-step {
    display: none;
}

.login-step.active {
    display: block !important;
    animation: authFadeInUp 0.4s ease forwards;
}

.alert-error {
    background: rgba(255, 107, 107, 0.15);
    border-color: rgba(255, 107, 107, 0.3);
    color: #ff8e8e;
}

.alert-success {
    background: rgba(0, 212, 170, 0.15);
    border-color: rgba(0, 212, 170, 0.3);
    color: var(--accent-green);
}

/* === PRIVACY & STATIC CONTENT === */
.privacy-wrapper {
    padding: 1rem 0;
}

.privacy-card-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
}

.privacy-card-section:last-child {
    border-bottom: none;
}

.privacy-title-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--accent-green);
    margin-bottom: 1.5rem;
}

.privacy-grid-2col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 1.5rem 0;
}

.privacy-feature-box {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.compliance-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.sharing-scenario {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 12px;
}

.sharing-scenario-authorized {
    background: rgba(40, 167, 69, 0.1);
    border-left: 4px solid #28a745;
}

.sharing-scenario-prohibited {
    background: rgba(220, 53, 69, 0.1);
    border-left: 4px solid #dc3545;
}

.retention-item {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

.retention-period {
    background: var(--accent-green);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    min-width: 100px;
    text-align: center;
}

/* === EXPORT & PRINT === */

/* === PATIENT PORTAL LEFTOVERS === */
.horarios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 1rem;
}

.horario-btn {
    padding: 10px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    text-align: center;
}

.horario-btn:hover {
    background: var(--accent-green);
    color: white;
}

.horario-btn.selected {
    background: var(--accent-green);
    color: white;
    border-color: var(--accent-green);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}


/* === UTILITIES & GRADIENTS (Group 6) === */
.grid-2-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.full-width { width: 100%; }
.m-y-20 { margin: 2rem 0; }
.p-20 { padding: 2rem; }
.text-secondary { color: var(--text-secondary) !important; }

/* Gradients for Stat Icons */
.grad-purple { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important; }
.grad-green { background: linear-gradient(135deg, #00d4aa 0%, #0c69b0 100%) !important; }
.grad-pink { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important; }
.grad-orange { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%) !important; }

/* Print & Export Styles */
.print-layout { background: white; color: black; padding: 20px; }
.print-header { color: #333; border-bottom: 3px solid var(--accent-blue); padding-bottom: 10px; margin-bottom: 20px; }
.export-summary { background: #f8f9fa; padding: 15px; border-radius: 8px; margin: 20px 0; border: 1px solid #eee; }
.export-section-header { background: var(--accent-blue); color: white; padding: 10px 15px; border-radius: 6px; font-weight: 600; margin-top: 25px; }
.export-item { margin: 15px 0; padding: 10px; border-left: 3px solid var(--accent-blue); }
.export-label { color: #555; margin-bottom: 5px; font-weight: 600; font-size: 0.9rem; }
.export-value { color: #000; padding: 10px; background: #f9f9f9; border-radius: 6px; }

/* Group 8 Utilities */
.glass-divider {
    border: none;
    border-top: 1px solid var(--glass-border);
    margin: 2rem 0;
}

.file-hint {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.icon-large {
    font-size: 2rem;
    display: block;
}
/* Form & Chart Utilities */
.chart-container { width: 100%; position: relative; }
.chart-half { max-width: 400px; margin: 0 auto; padding: 1.5rem; }
.p-3 { padding: 3.75rem 1.875rem; }
.logo-responsive { max-width: 300px; width: 100%; height: auto; }
.success-wrapper {
    margin: 2.5rem auto;
    max-width: 600px;
    border-radius: 12px;
    text-align: center;
    padding: 2rem;
}
.font-size-2 { font-size: 2rem; }
.font-size-11 { font-size: 1.1rem; }
.font-size-08 { font-size: 0.85rem; }
.opacity-07 { opacity: 0.7; }
.opacity-05 { opacity: 0.5; }
.border-top { border-top: 1px solid var(--glass-border); }
.pt-2 { padding-top: 1.875rem; }
.w-auto { width: auto !important; }
.text-danger { color: #ff4444; }
.text-primary { color: var(--text-primary); }
.opacity-03 { opacity: 0.3; }
.font-size-2 { font-size: 2rem; }
.mb-2 { margin-bottom: 2rem; }
.btn-small { padding: 0.25rem 0.5rem; font-size: 0.75rem; border-radius: 4px; }
.w-80 { width: 80px !important; }
.img-preview { max-width: 200px; max-height: 200px; border-radius: 8px; border: 2px solid var(--glass-border); object-fit: cover; }
.flex-1 { flex: 1; }
.flex-basis-320 { flex: 1 1 320px; }
.flex-basis-400 { flex: 1 1 400px; }
.m-y-1 { margin-top: 1rem; margin-bottom: 1rem; }
.gap-05 { gap: 0.5rem; }
.align-center { align-items: center; }
.flex-column { flex-direction: column; }
.cursor-pointer { cursor: pointer; }
.font-weight-600 { font-weight: 600; }
.accent-box-blue {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    padding: 1rem;
}
.accent-box-purple {
    background: rgba(155, 89, 182, 0.1);
    border: 1px solid rgba(155, 89, 182, 0.3);
    border-radius: 8px;
    padding: 1rem;
}
.accent-box-red {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 8px;
    padding: 1rem;
}
.accent-box-green {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    border-radius: 8px;
    padding: 1rem;
}
.text-blue { color: #8b9eff; }
.text-purple { color: #b98dd6; }
.w-max-600 { max-width: 600px; }
.m-x-auto { margin-left: auto; margin-right: auto; }
.grid-1-col { grid-template-columns: 1fr !important; }
.d-none { display: none !important; }
.d-block { display: block !important; }
.mt-025 { margin-top: 0.25rem; }

/* Quick Access Menu */
.quick-access-menu {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}
.quick-access-menu h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.quick-access-buttons {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}
.quick-access-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 160px;
    justify-content: center;
    white-space: nowrap;
}
.quick-access-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 77, 146, 0.3);
}

/* Audit Info */
.audit-info {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.audit-info strong { color: var(--text-primary); }
.audit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 100%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
}
.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h2 { margin: 0; color: var(--text-primary); }
.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-body {
    padding: 25px;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Form Styles */
.allesmed-form {
    display: block;
    width: 100%;
}
.form-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}
.form-section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

/* Form Builder Styles */
.secao-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.secao-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.secao-inputs {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.secao-actions {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}
.campos-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.campo-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
}
.campo-row {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr auto;
    gap: 1rem;
    align-items: center;
}
.campo-col {
    min-width: 0;
}
.campo-actions {
    display: flex;
    justify-content: flex-end;
}
.campo-opcoes {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.input-lg {
    font-size: 1.125rem;
    font-weight: 600;
}
.checkbox-modern {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.875rem;
}
.checkbox-modern input[type="checkbox"] {
    cursor: pointer;
}
@media (max-width: 768px) {
    .secao-header { flex-direction: column; }
    .campo-row { grid-template-columns: 1fr; }
}

/* Advanced Form Builder Styles (Drag & Drop) */
.form-builder-container {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 1.5rem;
    margin-top: 1.5rem;
}
.builder-sidebar {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 100px;
}
.builder-sidebar h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.field-types {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.field-type-btn {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text-primary);
    cursor: grab;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}
.field-type-btn:hover {
    background: var(--glass-hover);
    border-color: var(--primary-color);
    transform: translateX(5px);
}
.field-type-btn i {
    width: 20px;
    color: var(--primary-color);
}
.builder-canvas {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    min-height: 600px;
}
.canvas-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
.form-sections {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.builder-properties {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}
.empty-canvas {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}
.empty-canvas i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}
.add-section-btn {
    width: 100%;
    background: rgba(13, 77, 146, 0.1);
    border: 2px dashed var(--primary-color);
    border-radius: 12px;
    padding: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-weight: 600;
    margin-top: 1rem;
}
.add-section-btn:hover {
    background: rgba(13, 77, 146, 0.2);
}
.form-field {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    cursor: move;
    transition: all 0.3s ease;
    position: relative;
}
.form-field:hover {
    border-color: var(--primary-color);
}
.form-field.selected {
    border-color: var(--accent-blue);
    box-shadow: 0 0 20px rgba(12, 105, 176, 0.3);
}
.property-input {
    width: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}
.property-input:focus {
    border-color: var(--primary-color);
    outline: none;
}
/* Terms and Links Form Styles */
.form-container { padding: 2rem; }
.form-grid-single { grid-template-columns: 1fr; gap: 1.5rem; display: grid; }
textarea.form-control-large { min-height: 220px; resize: vertical; padding: 12px; font-size: 15px; }

@media (max-width: 768px) {
    .form-container { padding: 1rem; }
    textarea.form-control-large { min-height: 180px; }
}

@media (max-width: 430px) {
    .form-container { padding: 0.15rem 0.15rem !important; }
    textarea.form-control-large { min-height: 180px; }
}

.p-2 { padding: 2rem; }

.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted, var(--text-secondary)); }
.font-weight-normal { font-weight: normal; }
.table-container {
    overflow-x: auto;
    width: 100%;
}

@media print {
    .no-print { display: none !important; }
    body { background: white !important; color: black !important; }
    .glass-card { background: white !important; border: 1px solid #ddd !important; box-shadow: none !important; }
}

.mr-05 { margin-right: 0.5rem; }
.gap-075 { gap: 0.75rem; }
.no-underline { text-decoration: none !important; }
.text-inherit { color: inherit !important; }
.badge-telemed {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(102, 126, 234, 0.15);
    color: #cbd5ff;
}
.text-warning-sm { font-size: 12px; color: #f59e0b; }
.opacity-03 { opacity: 0.3; }
.mt-1 { margin-top: 1rem; }
.portal-avatar { width: 60px; height: 60px; font-size: 1.5rem; }
.list-avatar { width: 50px; height: 50px; font-size: 1rem; }

/* === LEGACY UTILITY STYLES (Migrated from insert_style.css) === */

/* --- Inventory & Task Form Utilities --- */
.sidebar-toggle-checkbox { display: none; }
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
}
.menu-toggle-btn {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    background-color: var(--accent-green);
    color: #000;
    border: none;
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .menu-toggle-btn { display: block; }
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        width: 280px;
        transition: left 0.3s ease;
        z-index: 999;
        overflow-y: auto;
    }
    .sidebar-toggle-checkbox:checked ~ .container .sidebar { left: 0; }
    .sidebar-toggle-checkbox:checked ~ .sidebar-overlay { display: block; }
    .main-content { margin-left: 0; width: 100%; }
}

/* Autocomplete styles */
.autocomplete-wrapper { position: relative; }
.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 40;
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    background: rgba(25,25,35,0.98);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    max-height: 240px;
    overflow: auto;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.autocomplete-item {
    padding: 12px;
    cursor: pointer;
    color: var(--text-primary);
    transition: background 0.2s;
}
.autocomplete-item:hover {
    background: rgba(255,255,255,0.08);
    color: var(--accent-green);
}

/* === PROFILE PAGE STYLES === */
.perfil-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.profile-header {
    text-align: center;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
}

.profile-photo {
    width: 120px;
    height: 120px;
    aspect-ratio: 1 / 1;
    border-radius: 50% !important;
    border: 3px solid var(--accent-green);
    object-fit: cover;
    display: block;
    margin: 0 auto 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.profile-email {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.perfil-info {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.info-item i {
    width: 20px;
    color: var(--accent-green);
    text-align: center;
}

.info-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 80px;
}

.status-pill {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-active {
    background: rgba(0, 212, 170, 0.15);
    color: var(--accent-green);
}

.status-inactive {
    background: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
}

.glass-divider {
    border: 0;
    height: 1px;
    background: var(--glass-border);
    margin: 2rem 0;
}

.file-input-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.file-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.file-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.6;
    margin-top: 0.25rem;
}

.rastro-section .table-container {
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .perfil-container {
        padding: 1rem;
    }

    .grid-responsive {
        grid-template-columns: 1fr !important;
    }
}

/* Grupos de rádio */
.radio-group {
    display: flex;
    gap: 1.25rem;
    margin-top: 0.5rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.radio-option input[type="radio"] {
    margin: 0;
}

/* Botões de Cores */
.btn-success {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12, #f1c40f);
    color: #212529;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(243, 156, 18, 0.3);
}

/* Alertas Glassmorphism */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    font-weight: 500;
    backdrop-filter: blur(10px);
    font-size: 0.9em;
}

.alert-success {
    background: rgba(39, 174, 96, 0.15);
    border: 1px solid rgba(39, 174, 96, 0.3);
    color: #27ae60;
}

.alert-danger {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

.alert-info {
    background: rgba(52, 152, 219, 0.15);
    border: 1px solid rgba(52, 152, 219, 0.3);
    color: #3498db;
}

/* Utilitários de Formulário */
.form-help {
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.8;
    margin-top: 0.25rem;
}

.required::after {
    content: " *";
    color: #e74c3c;
}

/* Estilos específicos para inputs de data, CPF, telefone */
.input-date,
.input-cpf,
.input-phone {
    font-family: 'Inter', monospace;
}

/* === MODULE SPECIFIC STYLES (Migrated from eqinvprod.php & attarefa.php) === */

/* Inventory (eqinvprod.php) */
.eq-top-bar { background: linear-gradient(135deg,#343a40,#1f2a30); color: #fff; padding: 1rem; border-radius: .5rem; display:flex; justify-content:space-between; align-items:center; gap:.75rem; }
.eq-card { background: var(--secondary-bg); border-radius:.5rem; padding:1rem; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.eq-no-data { text-align:center; padding:2rem; color:var(--text-secondary); }

/* Tasks (attarefa.php) */
.row-overdue { background-color: rgba(220, 53, 69, 0.1) !important; }
.row-overdue:hover { background-color: rgba(220, 53, 69, 0.15) !important; }
.row-ontime { background-color: rgba(40, 167, 69, 0.1) !important; }
.row-ontime:hover { background-color: rgba(40, 167, 69, 0.15) !important; }

.progress-circle { position: relative; display: inline-block; width: 40px; height: 40px; }
.progress-circle svg { display: block; width: 100%; height: 100%; }
.progress-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 10px; font-weight: bold; color: var(--text-primary); pointer-events: none; }

.badge-danger { color: #fff !important; background-color: #dc3545 !important; font-weight: bold !important; border: 1px solid #b02a37 !important; }
.badge-secondary { color: #fff !important; background-color: #6c757d !important; font-weight: bold !important; border: 1px solid #545b62 !important; }

/* Especial visibility on dark tables */
.attarefa-table-colors tbody tr td:nth-child(-n+5) { color: var(--text-primary) !important; }

.stats-grid.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.stats-column { display: flex; flex-direction: column; gap: 1rem; }

@media (max-width: 768px) {
    .stats-grid.two-columns { grid-template-columns: 1fr; }
}

/* === MEDICAL MODULE STYLES (Migrated from medico/*.php) === */

/* Consultar Paciente */
.search-box-large { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 1.25rem; color: var(--text-secondary); font-size: 1.2rem; pointer-events: none; }
.search-input-large { width: 100%; padding: 1rem 1rem 1rem 3.5rem; background: rgba(255, 255, 255, 0.05); border: 2px solid var(--glass-border); border-radius: 12px; font-size: 1rem; color: var(--text-primary); transition: all 0.3s ease; }
.search-input-large:focus { outline: none; border-color: var(--accent-green); background: rgba(255, 255, 255, 0.08); }
.clear-search { position: absolute; right: 1rem; color: var(--text-secondary); cursor: pointer; padding: 0.5rem; transition: color 0.2s; }
.clear-search:hover { color: var(--text-primary); }

.pacientes-list { display: flex; flex-direction: column; gap: 0.75rem; }
.paciente-card { display: flex; align-items: center; gap: 1rem; padding: 1rem; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--glass-border); border-radius: 12px; cursor: pointer; transition: all 0.3s ease; }
.paciente-card:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--accent-green); transform: translateX(5px); }
.paciente-avatar { width: 60px; height: 60px; background: var(--gradient-primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.2rem; color: white; flex-shrink: 0; }
.paciente-info { flex: 1; }
.paciente-nome { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.5rem; }
.paciente-detalhes { display: flex; flex-wrap: wrap; gap: 1rem; font-size: 0.85rem; color: var(--text-secondary); }
.paciente-detalhes span { display: flex; align-items: center; gap: 0.4rem; }
.paciente-detalhes i { color: var(--accent-green); }
.paciente-action { color: var(--text-secondary); font-size: 1.2rem; }

.btn-pagina { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 0.5rem; background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); border-radius: 8px; color: var(--text-secondary); text-decoration: none; font-size: 0.875rem; transition: all 0.2s ease; }
.btn-pagina:hover { background: rgba(0, 212, 170, 0.15); border-color: var(--accent-green); color: var(--accent-green); }
.btn-pagina-ativo { background: var(--accent-green) !important; border-color: var(--accent-green) !important; color: #000 !important; font-weight: 700; }
.pag-ellipsis { color: var(--text-secondary); padding: 0 0.25rem; }

/* Detalhe Paciente */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; }
.info-item label { display: block; font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.5rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.info-item span { display: block; font-size: 1rem; color: var(--text-primary); font-weight: 500; }

.tabs-header { display: flex; border-bottom: 2px solid var(--glass-border); padding: 0 1.5rem; gap: 0.5rem; overflow-x: auto; }
.tab-btn { background: none; border: none; padding: 1rem 1.5rem; color: var(--text-secondary); font-weight: 600; cursor: pointer; border-bottom: 3px solid transparent; transition: all 0.3s ease; display: flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--accent-green); border-bottom-color: var(--accent-green); }
.tab-badge { background: rgba(0, 212, 170, 0.2); color: var(--accent-green); padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }
.tab-content { display: none; padding: 1.5rem; }
.tab-content.active { display: block; }
.tab-actions { margin-bottom: 1.5rem; display: flex; justify-content: flex-end; }

.timeline { display: flex; flex-direction: column; gap: 1.5rem; }
.timeline-item { display: flex; gap: 1rem; padding-left: 1rem; border-left: 3px solid var(--accent-green); }
.timeline-date { font-size: 0.85rem; color: var(--text-secondary); min-width: 120px; }
.timeline-content { flex: 1; background: rgba(255, 255, 255, 0.03); padding: 1rem; border-radius: 8px; }
.timeline-content h4 { margin-bottom: 0.5rem; color: var(--accent-green); }
.timeline-content p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }
.prontuario-section { margin-top: 0.75rem; padding: 0.75rem; background: rgba(0, 212, 170, 0.05); border-left: 3px solid var(--accent-green); border-radius: 4px; }
.prontuario-section strong { display: block; color: var(--accent-green); font-size: 0.85rem; margin-bottom: 0.5rem; }
.timeline-footer { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--glass-border); }
.timeline-doctor { font-size: 0.85rem; color: var(--text-secondary); }

.items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.item-card { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--glass-border); border-radius: 12px; padding: 1rem; transition: all 0.3s ease; }
.item-card:hover { background: rgba(255, 255, 255, 0.06); border-color: var(--accent-green); transform: translateY(-3px); }
.item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.item-tipo { font-weight: 600; font-size: 0.9rem; }
.item-date { font-size: 0.8rem; color: var(--text-secondary); }
.item-body { margin-bottom: 0.75rem; }
.item-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 0.75rem; border-top: 1px solid var(--glass-border); }
.empty-state-small { text-align: center; padding: 3rem; color: var(--text-secondary); }
.empty-state-small i { font-size: 3rem; opacity: 0.3; margin-bottom: 1rem; }

/* Agenda Médico */
.medico-topbar { display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 0.75rem 1.25rem; margin-bottom: 1.5rem; backdrop-filter: blur(10px); }
.medico-topbar .medico-info { display: flex; align-items: center; gap: 0.75rem; }
.medico-topbar .medico-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--gradient-accent); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; color: #fff; flex-shrink: 0; }
.medico-topbar .medico-name { font-weight: 600; font-size: 0.95rem; }
.medico-topbar .medico-crm { font-size: 0.78rem; opacity: 0.65; }
.medico-topbar .topbar-actions { display: flex; gap: 0.5rem; }

@media (max-width: 768px) {
    .paciente-card { flex-direction: column; text-align: center; }
    .paciente-detalhes { flex-direction: column; gap: 0.5rem; }
    .paciente-action { display: none; }
    .tabs-header { padding: 0 0.75rem; }
    .tab-btn { padding: 0.75rem 1rem; font-size: 0.85rem; }
    .timeline-item { flex-direction: column; }
    .items-grid { grid-template-columns: 1fr; }
}


/* === DOUTORDM2 THEME SELECTS === */
body.doutordm2-dark select,
body.doutordm2-dark select option,
body.doutordm2-dark select optgroup {
    background-color: #2c2f1a !important;
    color: var(--text-primary) !important;
}

body.doutordm2-dark select option:checked,
body.doutordm2-dark select option:hover,
body.doutordm2-dark select option:focus {
    background-color: var(--secondary-bg) !important;
    color: #ffffff !important;
}

/* === DOUTORDM2 LIGHT THEME === */
.doutordm2-light {
    --primary-bg    : #f8fafc;
    --secondary-bg  : #ffffff;
    --glass-bg      : rgba(255, 255, 255, 0.8);
    --glass-border  : rgba(255, 255, 255, 0.3);
    --glass-shadow  : 0 8px 32px rgba(0, 0, 0, 0.1);
    --text-primary  : #1a1a1a;
    --text-secondary: rgba(26, 26, 26, 0.7);
    --primary-color : #00A19A;
    --primary-dark  : #075C57;
    --bg-color      : var(--primary-bg);
    --bg-secondary  : var(--secondary-bg);
    --text-color    : var(--text-primary);
    --border-color  : #e2e8f0;
    --hover-color   : #f1f5f9;
    --error-color   : #ef4444;
    --logo-bg       : #0f0f0f;
}

body.doutordm2-light select,
body.doutordm2-light select option,
body.doutordm2-light select optgroup {
    background-color: #ffffff !important;
    color: #1a1a1a !important;
}

/* === UNIFIED TABLE STYLES (MATCHING SAMEDICO.PHP) === */
.table-controls {
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    gap: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
}

.left-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.search-container {
    max-width: 400px;
    width: 100%;
}

.dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0;
    width: 100%;
}

.dataTables_filter input {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 0.6rem 1.25rem;
    border-radius: 50px;
    color: var(--text-primary);
    width: 100%;
    transition: all 0.3s ease;
    font-family: inherit;
}

.dataTables_filter input:focus {
    outline: none;
    border-color: var(--accent-green);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 15px rgba(0, 212, 170, 0.1);
}

.clear-search-inline {
    margin-left: -2.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 5;
    transition: all 0.3s;
    height: 38px;
    display: flex;
    align-items: center;
}

.clear-search-inline:hover {
    color: #ff4d4d;
    transform: scale(1.1);
}

/* Footer and Pagination matching DT_bootstrap.js style */
.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid var(--glass-border);
}

.pagination-container .pagination ul {
    display: flex;
    list-style: none !important;
    padding: 0;
    margin: 0;
    gap: 0.3rem;
}

.pagination-container .pagination ul li {
    margin: 0 !important;
    padding: 0 !important;
}

.pagination-container .pagination ul li a {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    font-weight: 600;
    font-size: 0.9rem;
}

.pagination-container .pagination ul li.active a {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.2);
}

.pagination-container .pagination ul li.disabled a {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-container .pagination ul li:not(.active):not(.disabled) a:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--glass-border);
    transform: translateY(-2px);
}

.info-container {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .table-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .search-container {
        max-width: 100%;
    }
    .table-footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    .pagination-container .pagination ul {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* === REFINED PAGINATION MODERN === */
.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.pagination-modern {
    display: flex;
    justify-content: flex-end; /* Positioned to the right as requested */
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    order: 2; /* Ensure it stays in the middle/right depending on layout */
}

.page-link {
    background: transparent;
    border: 1px solid transparent;
    padding: 0.5rem 0.9rem;
    border-radius: 10px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 38px;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.page-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--glass-border);
    transform: translateY(-1px);
}

.page-link.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.3);
}

.page-link i {
    font-size: 0.75rem;
}

.page-dots {
    color: var(--text-secondary);
    padding: 0 0.4rem;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 2px;
}

@media (max-width: 992px) {
    .table-footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .pagination-modern {
        justify-content: center;
        order: 1;
    }

    .table-info {
        order: 2;
    }

    .table-actions {
        order: 3;
    }
}

/* === FINAL FOOTER LAYOUT REFINEMENT === */
.footer-actions-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto; /* Pushes to the right, matching DataTables pagination position */
}

.prev-next {
    padding: 0.5rem 0.7rem;
    min-width: 32px;
}

.table-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}


/* === CRITICAL FIX: RESTORE VISIBILITY OF PAGINATION === */
.dataTables_paginate, .dataTables_info, .dataTables_length, .dataTables_filter {
    display: block !important;
}

.pagination-container .pagination ul {
    display: flex !important;
    list-style: none !important;
    padding: 0;
    margin: 0;
    gap: 0.3rem;
}

.pagination-container .pagination ul li a {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    font-weight: 600;
}

.pagination-container .pagination ul li.active a {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

/* === FRANCHISE GOALS & SIDE-BY-SIDE === */
.side-by-side-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .side-by-side-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.meta-card {
    height: 100%;
}

.meta-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.meta-progress-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-ring__circle {
    transition: stroke-dashoffset 0.5s ease;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.meta-percentage {
    position: absolute;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.meta-details {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.meta-detail-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.meta-detail-item strong {
    color: var(--accent-green);
}

.meta-pending strong {
    color: var(--accent-orange);
}

.meta-completed {
    justify-content: center;
    border-bottom: none;
    color: var(--accent-green);
}

.quick-actions-card .quick-actions-grid {
    grid-template-columns: 1fr 1fr;
}


/* ==========================================================================
   ESTILOS ADICIONAIS DO NOVO DASHBOARD (INDEX)
   ========================================================================== */
:root {
            --bg-body: #07090e;
            --bg-header: rgba(13, 17, 28, 0.85);
            --bg-card: rgba(22, 28, 45, 0.45);
            --border-glow: rgba(255, 255, 255, 0.08);
            --glass-bg: rgba(22, 28, 45, 0.45);
            --glass-border: rgba(255, 255, 255, 0.08);
            --text-main: #f3f4f6;
            --text-muted: #9ca3af;
            --accent-green: #00f5c4;
            --accent-glow: rgba(0, 245, 196, 0.15);
            --shadow: rgba(0, 0, 0, 0.5);
            --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        body.light-theme {
            --bg-body: #f1f5f9;
            --bg-header: rgba(255, 255, 255, 0.9);
            --bg-card: rgba(255, 255, 255, 0.7);
            --border-glow: rgba(0, 0, 0, 0.07);
            --glass-bg: rgba(255, 255, 255, 0.75);
            --glass-border: rgba(0, 0, 0, 0.07);
            --text-main: #0f172a;
            --text-muted: #64748b;
            --accent-green: #0d9488;
            --accent-glow: rgba(13, 148, 136, 0.12);
            --shadow: rgba(148, 163, 184, 0.12);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Outfit', sans-serif;
        }
        body {
            background-color: var(--bg-body);
            color: var(--text-main);
            min-height: 100vh;
            transition: var(--transition);
            overflow-x: hidden;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
        }

        body.dashboard-body {
            height: 100vh;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        /* Modern Glass Header */
        .premium-header {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            flex-shrink: 0;
            background: var(--bg-header);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-bottom: 1px solid var(--border-glow);
            padding: 0.8rem 1.5rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            box-shadow: 0 4px 30px var(--shadow);
            gap: 1.5rem;
            z-index: 999;
        }

        .header-left {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .menu-hamburger {
            background: none;
            border: 1px solid var(--border-glow);
            color: var(--text-main);
            width: 44px;
            height: 44px;
            border-radius: 12px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.25rem;
            transition: var(--transition);
        }

        .menu-hamburger:hover {
            border-color: var(--accent-green);
            box-shadow: 0 0 10px var(--accent-glow);
        }

        .btn-logout-quick {
            text-decoration: none;
            color: var(--text-muted, #94a3b8) !important;
        }

        .btn-logout-quick:hover {
            color: #ef4444 !important;
            border-color: #ef4444 !important;
            background: rgba(239, 68, 68, 0.1) !important;
            box-shadow: 0 0 12px rgba(239, 68, 68, 0.25) !important;
        }

        .header-search {
            flex: 1;
            max-width: 550px;
            position: relative;
            z-index: 1000;
        }

        .header-search input {
            width: 100%;
            padding: 0.75rem 1rem 0.75rem 3rem;
            background: rgba(0, 0, 0, 0.15);
            border: 1px solid var(--border-glow);
            border-radius: 99px;
            color: var(--text-main);
            outline: none;
            font-size: 0.95rem;
            transition: var(--transition);
        }

        .header-search input:focus {
            border-color: var(--accent-green);
            box-shadow: 0 0 12px var(--accent-glow);
        }

        .header-search i {
            position: absolute;
            left: 1.2rem;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-muted);
        }

        .header-right {
            display: flex;
            align-items: center;
            gap: 1.2rem;
        }

        .user-greeting {
            text-align: right;
        }

        .user-greeting h4 {
            font-size: 0.9rem;
            font-weight: 600;
        }

        .user-greeting p {
            font-size: 0.75rem;
            color: var(--text-muted);
            margin-top: 1px;
        }

        .company-badge-new {
            background: var(--accent-glow);
            color: var(--accent-green);
            padding: 0.35rem 0.65rem;
            border-radius: 8px;
            font-size: 0.75rem;
            font-weight: 700;
            border: 1px solid rgba(0, 245, 196, 0.2);
        }

        /* Glass Cards */
        .glass-card-premium {
            background: var(--bg-card);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid var(--border-glow);
            border-radius: 20px;
            padding: 0.85rem;
            box-shadow: 0 8px 32px var(--shadow);
            transition: var(--transition);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .glass-card-premium:hover {
            border-color: var(--accent-green);
        }

        /* Dropdown Search */
        .search-suggest {
            position: absolute;
            top: 110%;
            left: 0;
            right: 0;
            background: var(--bg-header);
            border: 1px solid var(--border-glow);
            border-radius: 16px;
            max-height: 280px;
            overflow-y: auto;
            z-index: 99999 !important;
            display: none;
            box-shadow: 0 10px 30px var(--shadow);
        }

        .suggest-item {
            padding: 0.8rem 1.2rem;
            border-bottom: 1px solid var(--border-glow);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: space-between;
            transition: var(--transition);
        }

        .suggest-item:hover {
            background: var(--border-glow);
        }

        /* Workspace Grid */
        .main-workspace {
            flex: 1;
            max-width: 1600px;
            width: 100%;
            margin: 0 auto;
            padding: 0.6rem 0.6rem 55px 0.6rem !important;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            height: calc(100vh - 120px) !important;
        }


        /* 3-Column Central Dashboard View */
        .layout-dash-3col {
            flex: 1;
            display: grid;
            grid-template-columns: 1fr;
            gap: 0.75rem;
            height: 100%;
            overflow: hidden;
        }

        @media (min-width: 1200px) {
            .layout-dash-3col {
                grid-template-columns: 310px 1fr 340px;
            }
        }

        /* Mobile Tab Switcher */
        .mobile-tab-bar {
            display: none;
            grid-template-columns: repeat(3, 1fr);
            gap: 6px;
            background: rgba(0, 0, 0, 0.2);
            padding: 5px;
            border-radius: 14px;
            margin-bottom: 1rem;
            border: 1px solid var(--border-glow);
            flex-shrink: 0;
        }

        .mobile-tab-btn {
            background: none;
            border: none;
            padding: 10px;
            border-radius: 10px;
            color: var(--text-muted);
            font-weight: 600;
            font-size: 0.85rem;
            cursor: pointer;
            text-align: center;
            transition: var(--transition);
        }

        .mobile-tab-btn.active {
            background: var(--accent-green);
            color: #07090e;
        }

        @media (max-width: 1199px) {
            .mobile-tab-bar {
                display: grid;
            }
            .col-status, .col-agenda, .col-kpis {
                display: none !important;
            }
            .col-status.active-tab, .col-agenda.active-tab, .col-kpis.active-tab {
                display: flex !important;
                height: 100%;
            }
        }

        /* Live Status dot */
        .live-dot {
            width: 8px;
            height: 8px;
            background-color: var(--accent-green);
            border-radius: 50%;
            display: inline-block;
            box-shadow: 0 0 8px var(--accent-green);
            animation: pulse-dot 1.5s infinite;
        }

        @keyframes pulse-dot {
            0% { transform: scale(0.9); opacity: 0.6; }
            50% { transform: scale(1.2); opacity: 1; }
            100% { transform: scale(0.9); opacity: 0.6; }
        }

        /* Agenda Column & Cards responsive layout */
        .appointments-list {
            flex: 1;
            overflow-y: auto;
            padding-right: 4px;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        /* Responsive override for appointment items */
        .appointment-item {
            display: flex !important;
            flex-direction: row;
            gap: 15px;
            padding: 1rem !important;
            border-radius: 16px !important;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            background: var(--bg-card);
            border: 1px solid var(--border-glow);
            transition: var(--transition);
        }

        /* Cores de Status Parametrizadas do index.php */
        .status-agendada {
            border-left: 5px solid var(--status-agendado-color, #3498db) !important;
        }
        .status-confirmada {
            border-left: 5px solid var(--status-confirmado-color, #2980b9) !important;
        }
        .status-presente {
            border-left: 5px solid var(--status-presenca-color, #2ecc71) !important;
        }
        .status-faltou {
            border-left: 5px solid var(--status-ausencia-color, #f1c40f) !important;
        }
        .status-cancelada {
            border-left: 5px solid var(--status-cancelado-color, #e74c3c) !important;
        }
        .status-atendendo {
            border-left: 5px solid var(--status-atendimento-color, #9b59b6) !important;
        }
        .status-realizada {
            border-left: 5px solid var(--status-realizada-color, #27ae60) !important;
        }

        @media (max-width: 768px) {
            .appointment-item {
                flex-direction: column !important;
                align-items: stretch !important;
                gap: 10px !important;
            }
            .appointment-time {
                border-right: none !important;
                border-bottom: 1px solid var(--border-glow);
                padding-right: 0 !important;
                padding-bottom: 6px;
                display: flex;
                flex-direction: row !important;
                justify-content: space-between;
                width: 100%;
            }
            .appointment-actions {
                justify-content: flex-end;
                border-top: 1px solid var(--border-glow);
                padding-top: 8px;
                width: 100%;
            }
        }

        /* Theme Light adjustments for custom components */
        body.light-theme .appointment-item {
            background: #ffffff !important;
            border: 1px solid rgba(0, 0, 0, 0.08);
        }

        /* Patient Detail View */
        .layout-patient {
            display: none;
            grid-template-columns: 1fr;
            gap: 2rem;
            flex: 1;
            overflow: hidden;
            height: 100%;
        }

        @media (min-width: 900px) {
            .layout-patient {
                grid-template-columns: 330px 1fr;
            }
        }

        .profile-card {
            text-align: center;
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
            height: 100%;
        }

        .avatar-lg {
            width: 85px;
            height: 85px;
            border-radius: 50%;
            background: var(--accent-glow);
            color: var(--accent-green);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2rem;
            font-weight: 700;
            margin: 0 auto;
        }

        .back-btn {
            background: none;
            border: 1px solid var(--border-glass);
            color: var(--text-main);
            padding: 0.5rem 1rem;
            border-radius: 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.85rem;
            transition: var(--transition);
        }

        .back-btn:hover {
            background: var(--border-glow);
            color: var(--accent-green);
        }

        .btn-modern-new {
            background: var(--accent-green);
            color: #07090e;
            border: none;
            padding: 0.75rem 1.25rem;
            border-radius: 12px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            transition: var(--transition);
            flex-shrink: 0;
        }

        .btn-modern-new:hover {
            box-shadow: 0 0 15px var(--accent-glow);
            transform: translateY(-2px);
        }

        /* Smaller KPI stats for right column */
        .kpi-card {
            display: flex;
            align-items: center;
            gap: 0.8rem;
            padding: 0.8rem 1rem !important;
        }

        .kpi-icon {
            width: 38px;
            height: 38px;
            border-radius: 10px;
            background: var(--accent-glow);
            color: var(--accent-green);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.95rem;
            border: 1px solid rgba(0, 245, 196, 0.15);
        }

        .kpi-num {
            font-size: 1.25rem;
            font-weight: 700;
        }

        .kpi-label {
            font-size: 0.75rem;
            color: var(--text-muted);
            margin-top: 1px;
        }

        /* Drawer Navigation Menu */
        .drawer-overlay-new {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(8px);
            z-index: 290;
            opacity: 0;
            pointer-events: none;
            transition: var(--transition);
        }

        .drawer-overlay-new.active {
            opacity: 1;
            pointer-events: all;
        }

        .drawer-panel-new {
            position: fixed;
            top: 0;
            left: -320px;
            width: 320px;
            height: 100vh;
            background: var(--bg-header);
            border-right: 1px solid var(--border-glow);
            z-index: 300;
            padding: 2rem;
            display: flex;
            flex-direction: column;
            gap: 2rem;
            transition: var(--transition);
            box-shadow: 10px 0 40px var(--shadow);
        }

        .drawer-panel-new.active {
            left: 0;
        }

        .drawer-list {
            list-style: none;
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
            overflow-y: auto;
        }

        .drawer-list a {
            color: var(--text-main);
            text-decoration: none;
            padding: 0.8rem 1rem;
            border-radius: 12px;
            display: flex;
            align-items: center;
            gap: 0.75rem;
            font-weight: 500;
            transition: var(--transition);
            border: 1px solid transparent;
        }

        .drawer-list a:hover {
            background: var(--accent-glow);
            color: var(--accent-green);
            border-color: rgba(0, 245, 196, 0.15);
        }

        .btn-close-drawer {
            background: none;
            border: none;
            color: var(--text-muted);
            font-size: 1.3rem;
            cursor: pointer;
        }

        .btn-close-drawer:hover {
            color: var(--text-main);
        }

        /* Overlay modal */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(10px);
            z-index: 400;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            pointer-events: none;
            transition: var(--transition);
            padding: 1.5rem;
        }

        .modal-overlay.active {
            opacity: 1;
            pointer-events: all;
        }

        .modal-window {
            background: var(--bg-header);
            border: 1px solid var(--border-glow);
            border-radius: 24px;
            width: 100%;
            max-width: 500px;
            padding: 2rem;
            box-shadow: 0 10px 40px var(--shadow);
        }

        /* Modernized footer styling to match transparent glass look */
        .modern-footer {
            flex-shrink: 0 !important;
            background: var(--bg-header) !important;
            border-top: 1px solid var(--border-glow) !important;
            padding: 0.35rem 1.5rem !important;
            margin: 0 !important;
            height: auto !important;
            min-height: auto !important;
            z-index: 10 !important;
        }
        .modern-footer .footer-content {
            display: flex !important;
            justify-content: space-between !important;
            align-items: center !important;
            font-size: 0.75rem !important;
            color: var(--text-muted) !important;
            flex-wrap: nowrap !important;
            gap: 10px !important;
            padding: 0 !important;
            margin: 0 !important;
            line-height: 1.2 !important;
        }
        .modern-footer .footer-content p, 
        .modern-footer .footer-content div,
        .modern-footer .footer-links {
            margin: 0 !important;
            padding: 0 !important;
            display: flex !important;
            align-items: center !important;
            gap: 8px !important;
        }
        .modern-footer a {
            color: var(--text-muted) !important;
            text-decoration: none !important;
            margin-left: 10px !important;
            transition: var(--transition) !important;
            font-size: 0.75rem !important;
        }
        .modern-footer a:hover {
            color: var(--accent-green) !important;
        }

        /* Custom scrollbar */
        ::-webkit-scrollbar {
            width: 5px;
        }
        ::-webkit-scrollbar-track {
            background: transparent;
        }
        ::-webkit-scrollbar-thumb {
            background: var(--border-glow);
            border-radius: 10px;
        }
        ::-webkit-scrollbar-thumb:hover {
            background: var(--accent-green);
        }

        /* Collapsible accordion cards style */
        .collapsible-header {
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;
            user-select: none;
        }
        .collapsible-content {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.35s ease-out, padding 0.35s ease-out;
            padding-top: 0;
        }
        .collapsible-content.expanded {
            max-height: 450px;
            padding-top: 0.8rem;
            overflow-y: auto;
        }
        .chevron-icon {
            transition: transform 0.3s;
            color: var(--text-muted);
            font-size: 0.85rem;
        }
        .chevron-icon.rotated {
            transform: rotate(180deg);
            color: var(--accent-green);
        }


/* ==========================================================================
   ESTILOS CONSOLIDADOS DE STYLES_MODERNO.CSS
   ========================================================================== */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #7c3aed;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --light: #f8fafc;
    --dark: #1e293b;
    --gray: #64748b;
    --gray-light: #e2e8f0;
    --border-radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background : var(--bg-body, var(--primary-bg));
    color      : var(--text-main, var(--text-primary));
    min-height : 100vh;
    transition : background-color 0.3s ease, color 0.3s ease;
    position   : relative;
    padding-top: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


html, body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body, var(--primary-bg));
    color: var(--text-main, var(--text-primary));
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    display: flex;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: white;
    box-shadow: var(--shadow);
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    z-index: 10;
    overflow-y: auto;
    max-height: 100vh;
}

.logo {
    display: flex;
    align-items: center;
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--gray-light);
    margin-bottom: 1.5rem;
}

.logo h1 {
    color: var(--primary);
    font-size: 1.8rem;
    font-weight: 700;
    margin-left: 10px;
}

.logo-icon {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-section h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--gray);
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 0 1.5rem;
    margin-bottom: 0.75rem;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.5rem;
    color: var(--dark);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 4px solid transparent;
    cursor: pointer;
}

.nav-item:hover {
    background-color: #f8fafc;
    color: var(--primary);
    border-left: 4px solid var(--primary);
}

.nav-item.active {
    background-color: #eff6ff;
    color: var(--primary);
    border-left: 4px solid var(--primary);
    font-weight: 500;
}

.nav-item i {
    width: 24px;
    margin-right: 12px;
    font-size: 1.1rem;
}

/* Nav Header Styles */
.nav-header {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.5rem;
    color: var(--dark);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 4px solid transparent;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.nav-header:hover {
    background-color: #f8fafc;
    color: var(--primary);
    border-left: 4px solid var(--primary);
}

.nav-header.active {
    background-color: #eff6ff;
    color: var(--primary);
    border-left: 4px solid var(--primary);
    font-weight: 500;
}

.nav-header i {
    width: 24px;
    margin-right: 12px;
    font-size: 1.1rem;
    transition: transform 0.2s;
}

/* Submenu Styles */
.submenu {
    list-style: none;
    padding-left: 0;
    display: none;
    background-color: #f8fafc;
    border-left: 4px solid var(--gray-light);
}

.submenu.active {
    display: block;
}

.nav-submenu {
    display: none;
    list-style: none;
    padding-left: 1.5rem;
}

.nav-submenu.active {
    display: block;
}

.nav-submenu .nav-item {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
}

.company-info {
    margin-top: auto;
    padding: 1.5rem;
    border-top: 1px solid var(--gray-light);
    background-color: #f8fafc;
}

.company-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.company-id {
    font-size: 0.85rem;
    color: var(--gray);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 100vh;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.user-greeting h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark);
}

.user-greeting p {
    color: var(--gray);
    margin-top: 0.25rem;
}

.user-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-outline {
    background-color: white;
    color: var(--primary);
    border: 1px solid var(--gray-light);
}

.btn-outline:hover {
    background-color: #f8fafc;
}

/* Dashboard Cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-title {
    font-weight: 600;
    color: var(--dark);
    font-size: 1rem;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.sales-icon {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
}

.tasks-icon {
    background: linear-gradient(135deg, #10b981, #34d399);
}

.revenue-icon {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.items-icon {
    background: linear-gradient(135deg, #8b5cf6, #d946ef);
}

.card-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.card-change {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.positive {
    color: var(--success);
}

.negative {
    color: var(--danger);
}

/* Tasks Section */
.tasks-section {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.task-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.task-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.task-stat {
    text-align: center;
}

.task-stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    display: block;
}

.task-stat-label {
    font-size: 0.9rem;
    color: var(--gray);
}

.task-list {
    list-style: none;
}

.task-item {
    display: flex;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--gray-light);
}

.task-item:last-child {
    border-bottom: none;
}

.task-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid var(--gray-light);
    margin-right: 1rem;
    cursor: pointer;
}

.task-content {
    flex: 1;
}

.task-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.task-desc {
    font-size: 0.85rem;
    color: var(--gray);
}

/* Sales Chart */
.sales-chart {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.chart-title {
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--dark);
}

.chart-container {
    height: 300px;
    position: relative;
}

.chart-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background-color: #f8fafc;
    border-radius: 10px;
    border: 2px dashed #e2e8f0;
    color: var(--gray);
}

/* Recent Sales */
.recent-sales {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.table-container {
    overflow-x: auto;
    margin-top: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem;
    font-weight: 600;
    color: var(--dark);
    border-bottom: 2px solid var(--gray-light);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-light);
}

.status {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-completed {
    background-color: #d1fae5;
    color: #065f46;
}

.no-data {
    text-align: center;
    padding: 3rem;
    color: var(--gray);
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.action-btn {
    background-color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    background-color: #eff6ff;
}

.action-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin-bottom: 1rem;
}

.action-customer {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
}

.action-task {
    background: linear-gradient(135deg, #10b981, #34d399);
}

.action-account {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.action-sale {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
}

/* Footer */
.footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--gray);
    font-size: 0.9rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.help-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.help-link:hover {
    text-decoration: underline;
}

/* Footer responsive */
@media (max-width: 768px) {
    .footer {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
}

/* Responsive */
@media (max-width: 1200px) {
    .tasks-section {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   TABLET LANDSCAPE (e telas entre 992-1024px)
   =================================== */
@media (max-width: 1024px) and (min-width: 993px) {
    .sidebar {
        width: 200px;
        padding: 1rem 0;
    }

    .nav-item span,
    .nav-section h3,
    .company-info {
        font-size: 0.9rem;
    }

    .logo h1 {
        font-size: 1.5rem;
        margin-left: 8px;
    }

    .logo-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .nav-item {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .nav-item i {
        font-size: 1.1rem;
        margin-right: 0.5rem;
    }

    /* Garantir que submenus são visíveis */
    .submenu {
        max-height: 400px;
        overflow-y: auto;
    }

    .main-content {
        padding: 1rem;
    }

    /* Reduzir gap em formulários para tablet */
    form[style*="grid"] {
        gap: 1rem !important;
    }
}

/* ===================================
   TABLET PORTRAIT (Lenovo TAB IDEA ~800px vertical)
   =================================== */
@media (max-width: 992px) and (min-width: 769px) {
    .sidebar {
        width: 220px;
        padding: 1rem 0;
    }

    .logo h1 {
        font-size: 1.6rem;
        margin-left: 10px;
    }

    .logo-icon {
        width: 38px;
        height: 38px;
    }

    .nav-item {
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
    }

    .nav-item i {
        font-size: 1.2rem;
        margin-right: 0.75rem;
    }

    .nav-section {
        margin-bottom: 1.5rem;
    }

    /* Garantir que submenus funcionam bem em tablet */
    .submenu {
        max-height: 350px;
        overflow-y: auto;
    }

    .main-content {
        padding: 1rem;
    }

    /* Botões maior para touch em tablet */
    .btn {
        min-height: 40px;
        padding: 0.7rem 1rem;
    }

    .top-bar {
        flex-direction: column;
        gap: 1rem;
    }

    .user-greeting h2 {
        font-size: 1.6rem;
    }

    /* Reduzir gap em formulários */
    form[style*="grid"] {
        gap: 1rem !important;
    }

    /* Cards em tablet */
    .card {
        padding: 1.25rem;
    }

    .card-title {
        font-size: 1rem;
        margin-bottom: 1.25rem;
    }

    /* Tabelas em tablet */
    table {
        font-size: 0.875rem;
    }

    th, td {
        padding: 0.6rem;
    }
}

@media (max-width: 992px) {
    .sidebar {
        width: 80px;
    }

    .logo h1,
    .nav-section h3,
    .nav-item span,
    .company-info {
        display: none;
    }

    .logo {
        justify-content: center;
        padding: 0 0 1.5rem;
    }

    .nav-item {
        justify-content: center;
        padding: 1rem;
    }

    .nav-item i {
        margin-right: 0;
        font-size: 1.3rem;
    }

    .nav-submenu {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        max-height: auto;
        padding: 1rem 0;
    }

    .logo h1 {
        display: block !important;
    }

    .main-content {
        max-height: auto;
        padding: 1rem;
    }

    .dashboard-cards {
        grid-template-columns: 1fr;
    }

    .top-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .user-actions {
        width: 100%;
        justify-content: space-between;
    }

    .btn {
        flex: 1;
        /* Touch-friendly size */
        min-height: 44px;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    /* Touch-friendly nav items */
    .nav-header,
    .nav-item {
        min-height: 44px;
        padding: 0.8rem 1rem;
    }

    .nav-item i {
        margin-right: 0.75rem;
        font-size: 1.1rem;
    }

    /* Menu improvements for mobile/tablet */
    .submenu {
        max-height: 300px;
        overflow-y: auto;
    }

    /* Form improvements for mobile */
    form[style*="grid"] {
        gap: 1rem !important;
    }

    /* Consistent form styling */
    .form-control {
        min-height: 40px;
        padding: 0.75rem;
    }

    textarea.form-control {
        min-height: 100px;
    }

    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    .tasks-section {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 0.85rem;
    }

    th, td {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .quick-actions {
        grid-template-columns: 1fr;
    }

    .user-greeting h2 {
        font-size: 1.4rem;
    }

    .card-value {
        font-size: 1.5rem;
    }

    .task-stat-value {
        font-size: 1.8rem;
    }
}

/* Estilo profissional para botões de ação */
.btn-edit {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--primary-color, #007bff);
    background-color: rgba(0, 123, 255, 0.1);
    border: 1px solid var(--primary-color, #007bff);
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-edit:hover {
    color: white;
    background-color: var(--primary-color, #007bff);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.btn-edit:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.btn-edit i {
    font-size: 0.9rem;
}

.btn-edit span {
    font-weight: 500;
}

/* Classe para botões de perigo/exclusão */
.btn-danger {
    color: #dc3545 !important;
    background-color: rgba(220, 53, 69, 0.1) !important;
    border-color: #dc3545 !important;
}

.btn-danger:hover {
    color: white !important;
    background-color: #dc3545 !important;
}

/* EAN image layered crossfade */
.ean-image { position: relative; width: 150px; height: 150px; overflow: hidden; border-radius: 0.375rem; background:#f3f4f6; }
.ean-img-layer { position: absolute; inset: 0; background-size: cover; background-position: center; transition: opacity .35s ease-in-out; opacity: 1; }
.ean-img-layer.next { opacity: 0; }
.ean-img-layer.hidden { opacity: 0 !important; }

/* Notifications panel styles */
.notifs-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 2000; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 200ms ease; }
.notifs-backdrop.show { opacity: 1; visibility: visible; pointer-events: auto; }

.notifs-panel { position: fixed; top: 64px; right: 16px; width: 380px; max-width: 95%; max-height: 70vh; overflow: auto; background: #fff; border-radius: 8px; box-shadow: var(--shadow-lg); z-index: 2100; transform: translateY(-8px); opacity: 0; pointer-events: none; transition: transform 220ms ease, opacity 220ms ease; }
.notifs-panel.open { transform: translateY(0); opacity: 1; pointer-events: auto; }

.notifs-panel .notif-item { display: flex; gap: 12px; padding: 12px 16px; align-items: center; text-decoration: none; color: var(--dark); border-bottom: 1px solid var(--gray-light); }
.notifs-panel .notif-item:last-child { border-bottom: none; }
.notif-icon { width: 40px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: white; font-size: 0.95rem; flex-shrink: 0; }
.notif-icon.tasks { background: linear-gradient(135deg, var(--success), #34d399); }
.notif-icon.company { background: linear-gradient(135deg, #6b7280, #9ca3af); }
.notif-icon.receber { background: linear-gradient(135deg, #10b981, #34d399); }
.notif-icon.pagar { background: linear-gradient(135deg, #ef4444, #fb923c); }

.notif-content { flex: 1; display:flex; align-items:center; gap:8px; }
.notif-priority { display:inline-flex; align-items:center; justify-content:center; width:20px; height:20px; border-radius:50%; font-size:0.75rem; margin-right:6px; }
.notif-priority.warn { background: var(--warning); color: #fff; }
.notif-priority.danger { background: var(--danger); color: #fff; }
.notif-title { font-weight: 600; margin-bottom: 2px; display:flex; align-items:center; gap:8px; }
.notif-meta { font-size: 0.85rem; color: var(--gray); }
.notif-days { font-weight: 700; color: var(--danger); font-size: 0.85rem; min-width: 44px; text-align: right; }

.notif-item.overdue { background: #fff7f0; border-left: 4px solid var(--warning); }
.notif-item.overdue-30 { background: #fff2f2; border-left: 4px solid var(--danger); }

/* Legend */
.notif-legend { display:flex; gap:12px; padding:0.5rem 1rem; align-items:center; }
.notif-legend .legend-item { display:flex; align-items:center; gap:8px; font-size:0.9rem; color:#333; }
.notif-legend .legend-dot { width:14px; height:14px; border-radius:4px; display:inline-block; }
.notif-legend .legend-dot.warn { background: var(--warning); }
.notif-legend .legend-dot.danger { background: var(--danger); }

/* Header badges */
.notif-header { display:flex; align-items:center; justify-content:space-between; gap:8px; padding: 0.5rem 1rem; }
.notif-section-title { font-size:0.92rem; color:#333; margin:0; }
.notif-badge { background: var(--danger); color:white; border-radius:12px; padding:2px 8px; font-size:0.8rem; font-weight:600; }

@media (max-width: 420px) {
  .notifs-panel { top: 50%; left: 50%; right: auto; transform: translate(-50%, -50%); width: 94%; max-height: 80vh; border-radius: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .notifs-panel, .notifs-backdrop { transition: none; }
}

/* User Photo */
.user-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    object-fit: cover;
}


/* ==========================================================================
   ESTILOS CONSOLIDADOS DE PACIENTE.CSS
   ========================================================================== */
/* Estilos exclusivos do paciente - login */

:root {
    --paciente-bg: #071420;
    --paciente-text: #1b2730;
    --paciente-muted: rgba(27, 39, 48, 0.72);
    --paciente-surface: rgba(255, 255, 255, 0.92);
    --paciente-surface-dark: rgba(255, 255, 255, 0.1);
    --paciente-border: rgba(255, 255, 255, 0.18);
    --paciente-primary: #0c69b0;
    --paciente-accent: #00d4aa;
    --paciente-shadow: 0 35px 90px rgba(0, 0, 0, 0.24);
    --paciente-radius: 32px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: 'Inter', sans-serif;
}

body.login-screen {
    background: #071420;
}

body {
    line-height: 1.5;
    overflow-x: hidden;
}

body.login-screen {
    min-height: 100vh;
    background-image: linear-gradient(180deg, rgba(7, 18, 33, 0.78), rgba(7, 18, 33, 0.92)), url("telas/wallpaper-FUNDO ESCURO.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

body.light-theme.login-screen {
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.95)), url("telas/wallpaper-FUNDO CLARO.png");
}

body.login-screen .auth-page-container,
body.login-screen .main-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

body.login-screen .landing-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

body.login-screen .landing-card {
    width: min(100%, 420px);
    padding: 2rem 1.8rem;
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(20px);
    color: #0f2f33;
}

body.dark-theme.login-screen .landing-card {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: #eef5fb;
}

body.login-screen .landing-logo {
    width: 120px;
    height: auto;
    display: block;
    margin: 0 auto 1.4rem;
}

body.login-screen .landing-title {
    font-size: 2.4rem;
    text-align: center;
    margin: 0;
    font-weight: 800;
    letter-spacing: 0.04em;
}

body.login-screen .landing-divider {
    width: 56px;
    height: 4px;
    margin: 1rem auto;
    border-radius: 999px;
    background: linear-gradient(90deg, #0c69b0, #00d4aa);
}

body.login-screen .landing-subtitle {
    text-align: center;
    margin: 0 0 1.8rem;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-weight: 700;
    color: rgba(15, 47, 57, 0.84);
}

body.dark-theme.login-screen .landing-subtitle {
    color: rgba(255, 255, 255, 0.82);
}

body.login-screen .landing-actions {
    display: grid;
    gap: 1rem;
}

body.login-screen .landing-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1.05rem 1.2rem;
    border-radius: 24px;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
}

body.login-screen .landing-btn:hover {
    transform: translateY(-1px);
}

body.login-screen .landing-btn-primary,
body.login-screen .landing-btn-secondary {
    background: rgba(255, 255, 255, 0.95);
    color: #0d5c52;
    border: 1px solid rgba(13, 92, 82, 0.16);
    box-shadow: inset 0 -2px 8px rgba(0, 0, 0, 0.05);
}

body.dark-theme.login-screen .landing-btn-primary,
body.dark-theme.login-screen .landing-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.16);
}

body.login-screen .landing-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-size: 1.1rem;
    min-width: 24px;
}

body.login-screen .landing-btn-icon-primary {
    background: transparent;
    color: #0c69b0;
}

body.login-screen .landing-btn-icon-secondary {
    background: transparent;
    color: #0d5c52;
    width: auto;
    height: auto;
    border-radius: 0;
}

body.dark-theme.login-screen .landing-btn-icon-secondary {
    color: #fff;
    background: transparent;
}

body.login-screen .landing-geo-status {
    color: rgba(15, 47, 57, 0.78);
    font-size: 0.95rem;
    text-align: center;
}

body.dark-theme.login-screen .landing-geo-status {
    color: rgba(255, 255, 255, 0.84);
}

@media (max-width: 420px) {
    body.login-screen .landing-card {
        padding: 1.5rem;
    }

    body.login-screen .landing-title {
        font-size: 2rem;
    }

    body.login-screen .landing-subtitle {
        font-size: 0.8rem;
    }
}

body.login-screen .auth-card {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    padding: 2.5rem;
    padding-bottom: 3rem;
    border-radius: var(--paciente-radius);
    background: var(--paciente-surface);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: var(--paciente-shadow);
    backdrop-filter: blur(24px);
    min-height: auto;
    height: auto;
    overflow: visible;
}

body.dark-theme.login-screen .auth-card {
    background: rgba(7, 18, 33, 0.86);
    border-color: rgba(255, 255, 255, 0.14);
    color: #f4f7fb;
}

body.login-screen .auth-card-inner {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.25rem;
}

body.login-screen .auth-logo-container {
    width: 104px;
    height: 104px;
    margin: 0 auto 1.5rem;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 16px 35px rgba(0, 0, 0, 0.12);
}

body.dark-theme.login-screen .auth-logo-container {
    background: rgba(255, 255, 255, 0.12);
}

body.login-screen .auth-logo-img,
body.login-screen .auth-logo-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

body.login-screen .auth-logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    color: var(--paciente-accent);
}

body.dark-theme.login-screen .auth-logo-icon {
    color: #fff;
}

body.login-screen .auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

body.login-screen .auth-title {
    margin: 0.75rem 0 0.5rem;
    font-size: 2.4rem;
    letter-spacing: 0.06em;
    font-weight: 800;
}

body.login-screen .auth-title span {
    color: var(--paciente-accent);
}

body.login-screen .auth-subtitle {
    margin: 0 auto 2rem;
    max-width: 88%;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(34, 54, 60, 0.8);
}

body.dark-theme.login-screen .auth-subtitle {
    color: rgba(255, 255, 255, 0.8);
}

body.login-screen .auth-form-group {
    margin-bottom: 1.35rem;
}

body.login-screen .auth-label {
    display: block;
    margin-bottom: 0.55rem;
    color: rgba(34, 54, 60, 0.75);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body.dark-theme.login-screen .auth-label {
    color: rgba(255, 255, 255, 0.78);
}

body.login-screen .auth-input-wrapper {
    position: relative;
}

body.login-screen .auth-input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(34, 54, 60, 0.45);
}

body.dark-theme.login-screen .auth-input-icon {
    color: rgba(255, 255, 255, 0.55);
}

body.login-screen .auth-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3.2rem;
    border-radius: 18px;
    border: 1px solid rgba(34, 54, 60, 0.12);
    background: rgba(255, 255, 255, 0.97);
    color: #111;
}

body.dark-theme.login-screen .auth-input {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #fff;
}

body.login-screen .auth-input:focus {
    outline: none;
    border-color: rgba(0, 212, 170, 0.85);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.12);
}

body.login-screen .btn-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1.05rem 1.2rem;
    border-radius: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #0c69b0 0%, #00d4aa 100%);
    color: #fff;
    border: none;
    box-shadow: 0 18px 34px rgba(12, 105, 176, 0.22);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

body.login-screen .btn-modern:hover {
    transform: translateY(-1px);
}

body.login-screen .btn-modern.btn-secondary {
    background: rgba(255, 255, 255, 0.96);
    color: #0b4a49;
    border: 1px solid rgba(13, 92, 82, 0.18);
    box-shadow: inset 0 -2px 10px rgba(0, 0, 0, 0.04);
}

body.dark-theme.login-screen .btn-modern.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: none;
}

body.login-screen .btn-modern i,
body.login-screen .btn-modern.btn-secondary i {
    margin-right: 0.75rem;
}

body.login-screen .auth-links {
    margin-top: 1.25rem;
    text-align: center;
}

body.login-screen .auth-link {
    color: inherit;
    opacity: 0.8;
}

body.login-screen .auth-link:hover {
    opacity: 1;
}

body.login-screen .auth-footer,
body.login-screen .app-footer {
    margin-top: 1.5rem;
    color: rgba(34, 54, 60, 0.65);
}

body.dark-theme.login-screen .auth-footer,
body.dark-theme.login-screen .app-footer {
    color: rgba(255, 255, 255, 0.7);
}

body.login-screen .field-error {
    color: #d64545;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: none;
}

body.login-screen .biometric-area {
    margin-top: 1.5rem;
}

body.login-screen .biometric-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.95rem 1.1rem;
    border-radius: 20px;
    border: 1px solid rgba(32, 32, 32, 0.10);
    background: rgba(255, 255, 255, 0.95);
    color: #0b4a49;
}

body.dark-theme.login-screen .biometric-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
    color: #fff;
}

body.login-screen .separator-line {
    height: 1px;
    background: rgba(34, 54, 60, 0.1);
    margin: 1.25rem 0;
}

body.dark-theme.login-screen .separator-line {
    background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 520px) {
    body.login-screen .auth-card {
        padding: 1.5rem;
        max-width: 100%;
    }

    body.login-screen .auth-title {
        font-size: 2rem;
    }

    body.login-screen .auth-subtitle {
        font-size: 0.85rem;
    }
}

@media (max-height: 760px) {
    body.login-screen .auth-page-container {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    body.login-screen .auth-card {
        max-height: calc(100vh - 1.5rem);
        padding: 1.75rem;
    }
}


/* ==========================================================================
   ESTILOS PREMIUM DE LOGIN (DUAL-PANEL LAYOUT)
   ========================================================================== */

.premium-login-container {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #07090e;
    color: #f3f4f6;
    overflow: hidden;
    z-index: 9999;
}

body.light-theme .premium-login-container {
    background-color: #f1f5f9;
    color: #0f172a;
}

.premium-login-brand-panel {
    flex: 1.2;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0d9488 100%);
    color: white;
    padding: 4rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.premium-login-brand-panel::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: rgba(0, 245, 196, 0.05);
    border-radius: 50%;
    filter: blur(80px);
}

.premium-login-brand-header {
    position: relative;
    z-index: 2;
}

.premium-login-logo {
    display: flex;
    align-items: center;
    margin-bottom: 3rem;
}

.premium-login-logo-inner {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    backdrop-filter: blur(10px);
}

.premium-login-logo-img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

.premium-login-logo-text {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    background: linear-gradient(90deg, #ffffff, #00f5c4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.premium-login-tagline {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1.5rem;
    color: #ffffff;
    max-width: 550px;
}

.premium-login-description {
    font-size: 1.1rem;
    color: #9ca3af;
    max-width: 500px;
    line-height: 1.6;
}

.premium-login-brand-footer {
    position: relative;
    z-index: 2;
    font-size: 0.85rem;
    color: #6b7280;
}

.premium-login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background-color: #0d1117;
    position: relative;
}

body.light-theme .premium-login-form-panel {
    background-color: #ffffff;
}

.premium-login-form-container {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
}

.premium-login-form-header {
    margin-bottom: 2.5rem;
}

.premium-login-form-header h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.premium-login-form-header p {
    color: #9ca3af;
    font-size: 1.05rem;
}

body.light-theme .premium-login-form-header p {
    color: #64748b;
}

.premium-login-form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.premium-login-form-label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
}

body.light-theme .premium-login-form-label {
    color: #475569;
}

.premium-login-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.premium-login-input-icon {
    position: absolute;
    left: 1.25rem;
    color: #4b5563;
    font-size: 1.1rem;
    pointer-events: none;
    transition: all 0.3s;
}

.premium-login-input {
    width: 100%;
    padding: 1.1rem 1.25rem 1.1rem 3.2rem;
    border-radius: 14px;
    border: 1px solid #1f2937;
    background-color: #161b22;
    color: #f3f4f6;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}

body.light-theme .premium-login-input {
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
    color: #0f172a;
}

.premium-login-input:focus {
    border-color: #00f5c4;
    box-shadow: 0 0 0 3px rgba(0, 245, 196, 0.1);
    background-color: #0d1117;
}

body.light-theme .premium-login-input:focus {
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
    background-color: #ffffff;
}

.premium-login-input:focus + .premium-login-input-icon {
    color: #00f5c4;
}

body.light-theme .premium-login-input:focus + .premium-login-input-icon {
    color: #0d9488;
}

.premium-login-btn {
    width: 100%;
    padding: 1.1rem;
    border-radius: 14px;
    border: none;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 1rem;
}

.premium-login-btn-primary {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: white;
}

.premium-login-btn-primary:hover {
    box-shadow: 0 10px 25px rgba(13, 148, 136, 0.25);
    transform: translateY(-1px);
}

/* Popover Menu Gerenciar Cards */
.manage-cards-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background: #1e293b;
    border: 1px solid var(--border-glow, rgba(255, 255, 255, 0.2));
    border-radius: 10px;
    padding: 10px 14px;
    z-index: 150;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    width: 210px;
    display: none;
}

.manage-cards-menu.active {
    display: block;
}

.manage-cards-menu-title {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 4px;
    color: var(--accent-green, #00f5c4);
}

.manage-cards-menu label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #f8fafc;
    margin-bottom: 6px;
    cursor: pointer;
}

/* Tema Claro para o Popover */
body.light-theme .manage-cards-menu {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

body.light-theme .manage-cards-menu-title {
    border-bottom: 1px solid #e2e8f0;
    color: #0d9488;
}

body.light-theme .manage-cards-menu label {
    color: #1e293b;
}

.premium-login-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    flex-wrap: nowrap;
    gap: 0.5rem;
}

.premium-login-link {
    font-size: 0.82rem;
    color: #9ca3af;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

body.light-theme .premium-login-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    flex-wrap: nowrap;
    gap: 0.5rem;
}

.premium-login-link {
    color: #64748b;
}

.premium-login-link:hover {
    color: #00f5c4;
}

body.light-theme .premium-login-link:hover {
    color: #0d9488;
}

.premium-login-support {
    background: #161b22;
    border: 1px solid #1f2937;
    padding: 1.25rem;
    border-radius: 16px;
    margin-top: 2rem;
    text-align: center;
}

body.light-theme .premium-login-support {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.premium-login-support-title {
    font-weight: 700;
    color: #f3f4f6;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

body.light-theme .premium-login-support-title {
    color: #0f172a;
}

.premium-login-support-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.premium-login-support-link {
    font-size: 0.9rem;
    color: #00f5c4;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

body.light-theme .premium-login-support-link {
    color: #0d9488;
}

.premium-login-footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #1f2937;
    text-align: center;
    font-size: 0.85rem;
    color: #6b7280;
}

body.light-theme .premium-login-footer {
    border-top: 1px solid #e2e8f0;
    color: #64748b;
}

.premium-login-footer a {
    color: #00f5c4;
    text-decoration: none;
    font-weight: 600;
}

body.light-theme .premium-login-footer a {
    color: #0d9488;
}

.premium-login-password-toggle {
    position: absolute;
    right: 1.25rem;
    background: none;
    border: none;
    color: #4b5563;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
    z-index: 5;
}

.premium-login-password-toggle:hover {
    color: #00f5c4;
}

body.light-theme .premium-login-password-toggle:hover {
    color: #0d9488;
}

@media (max-width: 992px) {
    .premium-login-container {
        flex-direction: column;
    }
    
    .premium-login-brand-panel {
        flex: none;
        padding: 3rem 2rem;
        min-height: 280px;
    }
    
    .premium-login-brand-panel::before {
        display: none;
    }
    
    .premium-login-logo {
        margin-bottom: 1.5rem;
    }
    
    .premium-login-logo-inner {
        width: 48px;
        height: 48px;
        border-radius: 12px;
    }
    
    .premium-login-logo-text {
        font-size: 2rem;
    }
    
    .premium-login-tagline {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }
    
    .premium-login-description {
        font-size: 0.95rem;
    }
    
    .premium-login-form-panel {
        flex: 1;
        padding: 2rem 1.5rem;
    }
    
    .premium-login-form-container {
        max-width: 100%;
    }
}

/* Highlight input error borders */
.premium-login-form-group.error .premium-login-input {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}


/* ==========================================================================
   MELHORIAS DE RESPONSIVIDADE MOBILE & CORREÇÕES DE TEMAS (CLARO/ESCURO)
   ========================================================================== */

/* Garantir altura dinâmica correta para navegadores móveis */
body {
    min-height: 100vh;
    min-height: 100dvh;
}

/* --- OVERRIDES DO TEMA ESCURO (DARK THEME) --- */
body.dark-theme h1,
body.dark-theme h2,
body.dark-theme h3,
body.dark-theme h4,
body.dark-theme h5,
body.dark-theme h6,
body.dark-theme .patient-name,
body.dark-theme .user-greeting h4,
body.dark-theme .header-left div {
    color: #f3f4f6 !important;
}

body.dark-theme p,
body.dark-theme span:not(.status-badge):not(.badge-particular):not(.badge-mini):not(.live-dot),
body.dark-theme strong,
body.dark-theme td,
body.dark-theme th,
body.dark-theme .appointment-meta,
body.dark-theme .doctor,
body.dark-theme .type,
body.dark-theme .kpi-label,
body.dark-theme .user-greeting p,
body.dark-theme .drawer-list a,
body.dark-theme .time,
body.dark-theme .date {
    color: #9ca3af !important;
}

body.dark-theme .appointment-item {
    background: rgba(22, 28, 45, 0.35) !important;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

body.dark-theme .glass-card-premium {
    background: rgba(22, 28, 45, 0.45) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5) !important;
}

/* --- OVERRIDES DO TEMA CLARO (LIGHT THEME) --- */
body.light-theme {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

body.light-theme h1,
body.light-theme h2,
body.light-theme h3,
body.light-theme h4,
body.light-theme h5,
body.light-theme h6,
body.light-theme .patient-name,
body.light-theme .user-greeting h4,
body.light-theme .header-left div {
    color: #0f172a !important;
}

body.light-theme p,
body.light-theme span:not(.status-badge):not(.badge-particular):not(.badge-mini):not(.live-dot),
body.light-theme strong,
body.light-theme td,
body.light-theme th,
body.light-theme .appointment-meta,
body.light-theme .doctor,
body.light-theme .type,
body.light-theme .kpi-label,
body.light-theme .user-greeting p,
body.light-theme .drawer-list a,
body.light-theme .time,
body.light-theme .date {
    color: #475569 !important;
}

body.light-theme .appointment-item {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
}

body.light-theme .glass-card-premium {
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05) !important;
}

body.light-theme .premium-header {
    background: rgba(255, 255, 255, 0.9) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
}

body.light-theme .company-badge-new {
    background: rgba(13, 148, 136, 0.1) !important;
    color: #0d9488 !important;
    border: 1px solid rgba(13, 148, 136, 0.2) !important;
}

/* --- AJUSTES DE RESPONSIVIDADE PARA SMARTPHONES (MAX-WIDTH: 768PX) --- */
@media (max-width: 768px) {
    .premium-header {
        padding: 0.5rem 0.75rem !important;
        gap: 0.5rem !important;
    }
    .premium-header .header-left div {
        display: none !important;
    }
    .premium-header .user-greeting {
        display: none !important;
    }
    .premium-header .company-badge-new {
        font-size: 0.7rem !important;
        padding: 0.25rem 0.5rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }
    .premium-header .header-search {
        max-width: 100% !important;
        flex: 1 !important;
    }
    .premium-header .header-search input {
        font-size: 0.85rem !important;
        padding: 0.5rem 0.75rem 0.5rem 2.2rem !important;
    }
    .premium-header .header-search i {
        left: 0.8rem !important;
    }
    .premium-header .menu-hamburger {
        width: 36px !important;
        height: 36px !important;
        border-radius: 8px !important;
        font-size: 1rem !important;
        flex-shrink: 0 !important;
    }
}

/* ==========================================================================
   ESTILOS DE RECOLHIMENTO/EXPANSÃO DE COLUNAS LATERAIS (INDEX)
   ========================================================================== */

/* Abas de Expansão Lateral */
.sidebar-expand-tab {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 70px;
    background: var(--bg-header);
    border: 1px solid var(--border-glow);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sidebar-expand-tab:hover {
    background: var(--accent-glow);
    color: var(--accent-green);
    border-color: var(--accent-green);
}

.sidebar-expand-tab.left {
    left: 0;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    border-left: none;
}

.sidebar-expand-tab.right {
    right: 0;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    border-right: none;
}

/* Botão de recolher no cabeçalho */
.btn-collapse-sidebar {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 4px 8px;
    border-radius: 6px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-collapse-sidebar:hover {
    color: var(--accent-green);
    background: var(--border-glow);
}

/* Flexbox transition layout para desktop */
@media (min-width: 1200px) {
    .layout-dash-3col {
        display: flex !important;
        gap: 0.75rem;
    }
    
    .col-status {
        width: 310px;
        flex-shrink: 0;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        flex-direction: column;
    }
    
    .col-agenda {
        flex: 1;
        min-width: 0;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .col-kpis {
        width: 340px;
        flex-shrink: 0;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        flex-direction: column;
    }

    /* Classes de Recolhimento */
    .col-status.collapsed,
    .col-kpis.collapsed {
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
        opacity: 0 !important;
        border: none !important;
        pointer-events: none !important;
    }
}

/* ==========================================================================
   ESTILOS DE MENUS HIERÁRQUICOS / SUBMENUS NO DRAWER LATERAL
   ========================================================================== */

.drawer-has-submenu {
    display: flex;
    flex-direction: column;
}

.drawer-submenu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.2rem;
    color: var(--text-main);
    cursor: pointer;
    border-radius: 12px;
    font-weight: 500;
    transition: var(--transition);
}

.drawer-submenu-header:hover {
    background: var(--border-glow);
    color: var(--accent-green);
}

.drawer-submenu-header span {
    display: flex;
    align-items: center;
    gap: 12px;
}

.drawer-submenu-header .dropdown-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    color: var(--text-muted);
}

.drawer-has-submenu.active .drawer-submenu-header .dropdown-icon {
    transform: rotate(180deg);
    color: var(--accent-green);
}

.drawer-submenu {
    display: none;
    flex-direction: column;
    padding-left: 2.2rem;
    gap: 4px;
    margin-top: 4px;
    margin-bottom: 8px;
}

.drawer-has-submenu.active .drawer-submenu {
    display: flex;
}

.drawer-submenu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.5rem 0.8rem !important;
    font-size: 0.85rem !important;
    color: var(--text-muted) !important;
    border-radius: 8px;
    transition: var(--transition);
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

.drawer-submenu a:hover {
    color: var(--accent-green) !important;
    background: rgba(255, 255, 255, 0.02) !important;
}

/* ==========================================================================
   CLASSES AUXILIARES DE TABELA & MODAIS DE ALERTA (SEM INLINE STYLE)
   ========================================================================== */

.flex-column-gap-sm {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

.badge-status-nf {
    background: linear-gradient(135deg, #ff9800, #ff5722) !important;
    color: white !important;
}

.badge-status-none {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-muted) !important;
}

body.light-theme .badge-status-none {
    background: rgba(0, 0, 0, 0.05) !important;
}

.empty-state-container {
    padding: 2.5rem !important;
    text-align: center !important;
}

.empty-state-icon {
    font-size: 3rem !important;
    color: var(--text-muted) !important;
    margin-bottom: 1rem !important;
}

/* Modais de Alerta Customizados com Glassmorphism */
.custom-alert-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-alert-box {
    background: var(--bg-header) !important;
    border: 1px solid var(--border-glow) !important;
    border-radius: 16px !important;
    padding: 2rem 2.5rem !important;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4) !important;
}

.custom-alert-icon {
    font-size: 2.8rem;
    margin-bottom: 0.8rem;
}

.custom-alert-text {
    font-size: 0.95rem;
    color: var(--text-main);
    margin: 0 0 1.5rem;
    line-height: 1.6;
}

.custom-alert-btn {
    color: #fff !important;
    border: none !important;
    padding: 0.6rem 2rem !important;
    border-radius: 8px !important;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition);
}

.custom-alert-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ==========================================================================
   SOBRESCRIÇÃO DE FOOTER FIXO, PADDING DO MAIN E CABEÇALHOS ORDENÁVEIS
   ========================================================================== */

.modern-footer {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 1000 !important;
    margin-top: 0 !important;
}

.main-container,
.main-workspace {
    padding-bottom: 55px !important;
}

/* Footer ultra compacto para telas mobile */
@media (max-width: 768px) {
    .modern-footer {
        padding: 0.2rem 0.6rem !important;
        font-size: 0.68rem !important;
        min-height: 28px !important;
        height: 28px !important;
        background: rgba(15, 23, 42, 0.95) !important;
        backdrop-filter: blur(12px) !important;
        -webkit-backdrop-filter: blur(12px) !important;
        border-top: 1px solid var(--border-glow) !important;
    }
    .modern-footer .footer-content {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        font-size: 0.68rem !important;
        gap: 6px !important;
        white-space: nowrap !important;
        overflow-x: auto !important;
        scrollbar-width: none !important;
    }
    .modern-footer .footer-content::-webkit-scrollbar {
        display: none !important;
    }
    .modern-footer .footer-links {
        display: flex !important;
        gap: 6px !important;
    }
    .modern-footer a {
        font-size: 0.68rem !important;
        margin-left: 2px !important;
    }
    .modern-footer .version-badge {
        display: none !important;
    }
    .main-container,
    .main-workspace {
        padding-bottom: 35px !important;
    }
}



/* Indicador visual de que as colunas da tabela são clicáveis/ordenáveis */
.modern-datatable thead th,
table.dataTable thead th {
    cursor: pointer !important;
    position: relative;
    user-select: none;
    transition: var(--transition);
}

.modern-datatable thead th:hover,
table.dataTable thead th:hover {
    color: var(--accent-green) !important;
    background: rgba(255, 255, 255, 0.03) !important;
}

body.light-theme .modern-datatable thead th:hover,
body.light-theme table.dataTable thead th:hover {
    background: rgba(0, 0, 0, 0.03) !important;
}

/* ==============================================================================
   MENU INTERNOS E LAUNCHPAD (HUB DE MÓDULOS)
   ============================================================================== */

/* Filtro Rápido (UX Search) */
.menu-filter-container {
    margin-bottom: 2rem;
    position: relative;
}
.menu-filter-input {
    width: 100%;
    padding: 1.2rem 1.5rem 1.2rem 3.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 1.1rem;
    transition: all 0.3s ease;
}
.menu-filter-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(var(--primary-color-rgb), 0.1);
}
.menu-filter-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.2rem;
    pointer-events: none;
}

/* Breadcrumb / Navegação Contextual */
.breadcrumb {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}
.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}
.breadcrumb a:hover {
    color: var(--primary-color);
}
.breadcrumb .separator {
    opacity: 0.5;
    font-size: 0.8rem;
}
.breadcrumb .current {
    color: var(--text-primary);
    font-weight: 500;
}

/* Mensagem de Não Encontrado */
.no-results-msg {
    display: none;
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* 
   Grid Principal de Módulos
*/
.modules-grid {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.module-group {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.module-group-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.module-group-title i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* MODERNIZAÇÃO GRID (APP GRID / LAUNCHPAD) */
.module-buttons-grid {
    display: grid;
    /* Grid fluido adaptável à largura da tela */
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
}

.module-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 1.2rem;
    gap: 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.module-button:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.module-button.placeholder {
    opacity: 0.7;
    cursor: not-allowed;
}
.module-button.placeholder:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

/* Ícones Modernos (Phosphor / Glassmorphism Soft Colors) */
.module-icon-modern {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    font-size: 2rem;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.module-icon-blue { background: rgba(52, 152, 219, 0.15); color: #3498db; }
.module-icon-purple { background: rgba(155, 89, 182, 0.15); color: #9b59b6; }
.module-icon-green { background: rgba(46, 204, 113, 0.15); color: #2ecc71; }
.module-icon-orange { background: rgba(230, 126, 34, 0.15); color: #e67e22; }
.module-icon-red { background: rgba(231, 76, 60, 0.15); color: #e74c3c; }

.module-button:hover .module-icon-modern {
    transform: scale(1.1) rotate(5deg);
}

/* Conteúdo do Card */
.module-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.module-title {
    font-weight: 600;
    font-size: 1.15rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.module-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.85;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.module-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    background: rgba(230, 126, 34, 0.2);
    color: #e67e22;
    border: 1px solid rgba(230, 126, 34, 0.3);
}

/* Ações Rápidas (legado mantido por compatibilidade) */
.quick-actions {
    margin-top: 2rem;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem 0;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.action-btn i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.action-btn span {
    font-weight: 500;
    font-size: 0.9rem;
    text-align: center;
}

/* Responsividade */
@media (max-width: 480px) {
    .module-group-title {
        font-size: 1.1rem;
    }
    .module-title {
        font-size: 1rem;
    }
    .module-description {
        font-size: 0.8rem;
    }
    .module-buttons-grid {
        grid-template-columns: 1fr; /* 1 card por linha no mobile extremo */
    }
}

/* === MAIÚSCULAS GLOBAIS === */
input[type="text"]:not(#senha):not([name*="senha"]):not([type="password"]):not(.no-uppercase), 
input[type="search"], 
input[type="tel"], 
input[type="url"], 
textarea {
    text-transform: uppercase;
}

input[type="email"], 
input[type="password"],
#senha,
[name*="senha"],
.no-uppercase {
    text-transform: none !important;
}

/* === FORM LAYOUT (90 GRAUS) === */
.form-section-side {
    display: flex;
    gap: 2rem;
    align-items: stretch;
}

.form-section-side .form-section-title {
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    text-align: center;
    margin: 0;
    padding: 0;
    border-bottom: none;
    border-left: 2px solid var(--accent-green);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    white-space: nowrap;
    font-size: 0.85rem; /* Fonte um pouco menor */
    font-weight: 500;
}

.form-section-side .form-section-title i {
    margin-right: 0;
    margin-bottom: 10px;
    transform: rotate(90deg);
}

.form-section-side .form-grid,
.form-section-side .form-grid-12 {
    flex: 1;
    min-width: 0;
}

.form-grid-12 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem 1.5rem;
}

.form-grid.compact {
    gap: 0.5rem 1.5rem; /* Força um espaçamento menor verticalmente */
}

.form-grid.compact .form-group {
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .form-section-side {
        flex-direction: column;
        gap: 1rem;
    }
    .form-section-side .form-section-title {
        writing-mode: horizontal-tb;
        transform: none;
        border-left: none;
        border-bottom: 1px solid var(--glass-border);
        min-width: auto;
        padding-bottom: 0.5rem;
        margin-bottom: 0.5rem;
        justify-content: flex-start;
    }
    .form-section-side .form-section-title i {
        margin-bottom: 0;
        margin-right: 10px;
        transform: none;
    }
}

/* === 12-COLUMN FORM GRID AND UTILITIES === */
@media (min-width: 769px) {
    .form-grid-12 {
        display: grid !important;
        grid-template-columns: repeat(12, 1fr) !important;
        gap: 0.75rem 1.5rem;
    }
    
    .col-span-1 { grid-column: span 1 !important; }
    .col-span-2 { grid-column: span 2 !important; }
    .col-span-3 { grid-column: span 3 !important; }
    .col-span-4 { grid-column: span 4 !important; }
    .col-span-5 { grid-column: span 5 !important; }
    .col-span-6 { grid-column: span 6 !important; }
    .col-span-7 { grid-column: span 7 !important; }
    .col-span-8 { grid-column: span 8 !important; }
    .col-span-9 { grid-column: span 9 !important; }
    .col-span-10 { grid-column: span 10 !important; }
    .col-span-11 { grid-column: span 11 !important; }
    .col-span-12 { grid-column: span 12 !important; }
    .col-span-full { grid-column: span 1 / -1 !important; }
}

/* === INPUTS WITH ICONS (v3) === */
.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-icon-wrapper .icon {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 2;
}

.input-icon-wrapper .form-control {
    width: 100% !important;
    padding-left: 2.75rem !important;
}

.input-icon-wrapper:focus-within .icon {
    color: var(--accent-green) !important;
}

/* ==========================================================================
   MÓDULO PACIENTE - UNIFICADO & GLASSMORPHISM (v3)
   ========================================================================== */

/* Navbar Unificada do Paciente (Equalizada com Módulo Médico) */
.paciente-header-navbar {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 0.75rem 1.5rem;
    margin-bottom: 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    box-shadow: var(--glass-shadow);
    width: 100%;
    box-sizing: border-box;
}

.paciente-profile-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.paciente-avatar-box {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #00d4aa, #0c69b0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.15rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.25);
    border: 2px solid var(--border-glow);
}

.paciente-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.paciente-identity {
    display: flex;
    flex-direction: column;
}

.paciente-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-main);
    line-height: 1.25;
}

.paciente-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.paciente-main-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.3rem 0.4rem;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    max-width: 100%;
}

.paciente-main-nav::-webkit-scrollbar {
    display: none;
}

.paciente-nav-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap !important;
    flex-shrink: 0;
    transition: var(--transition);
}

.paciente-nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.paciente-nav-link.active {
    background: var(--accent-green);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
    border: 1px solid var(--border-glow);
}

.paciente-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Cards e Módulos do Paciente */
.paciente-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-top: 1.25rem;
}

.water-card-container {
    text-align: center;
    padding: 2rem 1.5rem;
}

.water-card-container .water-icon {
    font-size: 3rem;
    color: #3b82f6;
    margin-bottom: 1rem;
}

.water-progress-bar {
    width: 100%;
    height: 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
    margin: 1.25rem 0;
    border: 1px solid var(--glass-border);
}

.water-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #00d4aa);
    border-radius: 999px;
    transition: width 0.4s ease;
}

.recipe-card-modern {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    transition: var(--transition);
}

.recipe-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: var(--glass-shadow);
    border-color: var(--accent-green);
}

.workout-item-modern {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    margin-bottom: 0.75rem;
    transition: var(--transition);
}

.workout-item-modern:hover {
    border-color: var(--accent-green);
    background: rgba(255, 255, 255, 0.04);
}

/* Tela de Login do Paciente */
.paciente-login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: var(--bg-body);
}

.paciente-login-card {
    width: 100%;
    max-width: 960px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: 24px;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.paciente-login-brand-panel {
    background: linear-gradient(135deg, #071420 0%, #0c69b0 50%, #00d4aa 100%);
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #ffffff;
}

@media (max-width: 868px) {
    .paciente-header-navbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .paciente-main-nav {
        width: 100%;
        justify-content: space-around;
    }
    .paciente-login-card {
        grid-template-columns: 1fr;
    }
    .paciente-login-brand-panel {
        display: none;
    }
}

/* ==========================================================================
   LAYOUT PORTAL DO PACIENTE MODERNO (v3) - SEM ESTILOS INLINE
   ========================================================================== */

/* Hero Section */
.patient-hero-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.75rem 2rem;
    margin-bottom: 1.75rem;
    box-shadow: var(--glass-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.patient-hero-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 0.4rem 0;
    line-height: 1.2;
}

.patient-hero-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0;
}

.patient-hero-btn {
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 212, 170, 0.3);
}

/* Grade de 4 Ações Principais */
.patient-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.patient-action-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    user-select: none;
}

.patient-action-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--glass-shadow);
    border-color: var(--accent-green);
    background: rgba(255, 255, 255, 0.05);
}

.patient-action-card.active {
    border-color: var(--accent-green);
    background: var(--accent-glow);
    box-shadow: 0 0 20px rgba(0, 245, 196, 0.15);
}

.patient-action-icon-box {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.action-icon-blue {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.action-icon-green {
    background: var(--accent-glow);
    color: var(--accent-green);
    border: 1px solid var(--border-glow);
}

.action-icon-purple {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.action-icon-orange {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.patient-action-card:hover .patient-action-icon-box {
    transform: scale(1.1);
}

.patient-action-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.35rem;
}

.patient-action-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.35;
    margin: 0;
}

/* Painéis Dinâmicos de Conteúdo */
.patient-panel {
    display: none;
}

.patient-panel.active {
    display: block;
    animation: pacienteFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pacienteFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.patient-panel-header {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.patient-panel-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.patient-panel-icon {
    font-size: 1.5rem;
}

.patient-panel-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

/* Cards de Agendamento do Paciente */
.paciente-appointment-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    transition: var(--transition);
}

.paciente-appointment-card:hover {
    border-color: var(--accent-green);
    background: rgba(255, 255, 255, 0.04);
}

.paciente-appointment-date {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.paciente-appointment-doctor {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.paciente-appointment-plan {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* Cards de Documentos (Receitas & Exames) */
.paciente-doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.paciente-doc-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.35rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
}

.paciente-doc-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--glass-shadow);
    border-color: var(--accent-green);
}

.paciente-doc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
}

.paciente-doc-badge {
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.paciente-doc-date {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.paciente-doc-doctor {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

.paciente-doc-specialty {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.paciente-doc-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.45;
    margin-bottom: 1.25rem;
}

.paciente-doc-actions {
    display: flex;
    gap: 0.5rem;
}

.paciente-doc-btn {
    flex: 1;
    justify-content: center;
    font-size: 0.88rem;
    padding: 0.6rem 1rem;
}

/* Rodapé Secundário de Dados Pessoais */
.patient-profile-footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-glow);
}

.patient-profile-footer .value,
.form-grid-12 .value,
.value {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
}

/* Responsividade */
@media (max-width: 900px) {
    .paciente-header-navbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }

    .paciente-profile-brand {
        justify-content: space-between;
        width: 100%;
    }

    .paciente-main-nav {
        width: 100%;
        box-sizing: border-box;
        justify-content: flex-start;
        padding: 0.35rem 0.5rem;
        border-radius: 999px;
        overflow-x: auto;
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch;
    }

    .paciente-nav-link {
        padding: 0.4rem 0.7rem;
        font-size: 0.82rem;
        flex-shrink: 0;
    }
}

@media (max-width: 1024px) {
    .patient-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .patient-hero-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.25rem;
    }
    .patient-hero-btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    .patient-actions-grid {
        grid-template-columns: 1fr;
    }
    .paciente-appointment-card {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Utilitários Visuais Globais (Sem inline styles) */
.icon-blue { color: #3b82f6 !important; }
.icon-green { color: var(--accent-green) !important; }
.icon-purple { color: #8b5cf6 !important; }
.icon-orange { color: #f59e0b !important; }
.icon-muted { color: var(--text-muted) !important; }

.card-big-icon {
    font-size: 2.5rem !important;
}

.card-title-lg {
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
    margin-bottom: 0.25rem !important;
}

.card-title-md {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
}

.clickable-card {
    cursor: pointer !important;
    transition: var(--transition) !important;
}

.clickable-card:hover {
    transform: translateY(-3px) !important;
    border-color: var(--accent-green) !important;
    background: rgba(255, 255, 255, 0.04) !important;
}

.flex-align-center {
    display: flex !important;
    align-items: center !important;
}

.gap-2 {
    gap: 0.75rem !important;
}

.text-sm {
    font-size: 0.85rem !important;
}

.p-4 {
    padding: 1.5rem !important;
}

.mb-2 {
    margin-bottom: 0.75rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

/* Regras para remoção total de inline styles no Módulo Paciente */
.btn-logout-paciente {
    padding: 0.5rem 0.85rem !important;
}

.display-none {
    display: none !important;
}

.btn-full-width {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
}

.card-header-clean {
    margin-bottom: 1.5rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
}

.page-title-clean {
    font-size: 1.5rem !important;
    margin: 0 !important;
    font-weight: 700 !important;
}

.empty-state-lg {
    padding: 3rem !important;
    text-align: center !important;
}

.empty-state-icon-lg {
    font-size: 3rem !important;
    color: var(--text-muted) !important;
    margin-bottom: 1rem !important;
}

.video-responsive-wrap {
    position: relative !important;
    padding-bottom: 56.25% !important;
    height: 0 !important;
    overflow: hidden !important;
    border-radius: 12px 12px 0 0 !important;
}

.video-responsive-iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
}

.card-body-padded {
    padding: 1.25rem !important;
}

.recipe-image-wrap {
    height: 180px !important;
    overflow: hidden !important;
}

.recipe-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.store-card-image-box {
    height: 120px !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 1rem !important;
}

.store-card-footer {
    padding: 1.25rem !important;
    border-top: 1px solid var(--glass-border) !important;
    background: rgba(0, 0, 0, 0.1) !important;
}

.store-card-price {
    font-size: 1.4rem !important;
    font-weight: 800 !important;
    color: var(--accent-green) !important;
    margin-bottom: 0.75rem !important;
}

.glicose-grid-container {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)) !important;
    gap: 1.5rem !important;
}

.glicose-history-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
}

.glicose-history-item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.85rem 1rem !important;
    background: var(--bg-card) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 12px !important;
}

.glicose-value {
    font-size: 1.4rem !important;
    font-weight: 800 !important;
    color: var(--text-main) !important;
}

.glicose-unit {
    color: var(--accent-green) !important;
    font-weight: 700 !important;
    margin-left: 4px !important;
}

.status-agendado {
    background: rgba(12, 105, 176, 0.15) !important;
    color: #0c69b0 !important;
    border: 1px solid #0c69b0 !important;
}

.status-confirmado {
    background: rgba(139, 92, 246, 0.15) !important;
    color: #8b5cf6 !important;
    border: 1px solid #8b5cf6 !important;
}

.status-realizado {
    background: rgba(0, 212, 170, 0.15) !important;
    color: #00d4aa !important;
    border: 1px solid #00d4aa !important;
}

.status-cancelado {
    background: rgba(255, 107, 107, 0.15) !important;
    color: #ff6b6b !important;
    border: 1px solid #ff6b6b !important;
}

.water-card-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.paciente-app-logo {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding-right: 0.85rem !important;
    border-right: 1px solid var(--glass-border) !important;
    margin-right: 0.35rem !important;
}

.paciente-app-title {
    font-weight: 800 !important;
    font-size: 1.1rem !important;
    color: var(--text-main) !important;
    letter-spacing: -0.02em !important;
}

/* Seleção de Médicos e Cards no Agendamento do Paciente */
.medico-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    gap: 1.25rem !important;
    margin-top: 1.25rem !important;
}

.medico-card {
    background: var(--bg-card) !important;
    border: 2px solid var(--glass-border) !important;
    border-radius: 16px !important;
    padding: 1.5rem 1rem !important;
    text-align: center !important;
    cursor: pointer !important;
    transition: var(--transition) !important;
    user-select: none !important;
}

.medico-card:hover {
    transform: translateY(-3px) !important;
    border-color: var(--accent-green) !important;
    box-shadow: var(--glass-shadow) !important;
}

.medico-card.selected {
    border-color: var(--accent-green) !important;
    background: rgba(0, 212, 170, 0.12) !important;
    box-shadow: 0 0 16px rgba(0, 212, 170, 0.35) !important;
}

.medico-avatar {
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #00d4aa, #0c69b0) !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    font-size: 1.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto 0.75rem auto !important;
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.25) !important;
}

.form-compact-center {
    max-width: 320px !important;
    margin: 1rem auto 0 !important;
}

.water-percentage {
    font-size: 2.2rem !important;
    font-weight: 800 !important;
    color: var(--text-main) !important;
    margin: 0.5rem 0 !important;
}

.water-consumption-text {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: var(--accent-green) !important;
    margin-bottom: 1rem !important;
}

.alert-capsule {
    display: inline-block !important;
    padding: 0.5rem 1.25rem !important;
    border-radius: 999px !important;
    margin-bottom: 1rem !important;
}

.water-btn-group {
    display: flex !important;
    gap: 0.75rem !important;
    justify-content: center !important;
    margin-top: 1.5rem !important;
    flex-wrap: wrap !important;
}

.water-quick-btn {
    flex: 1 !important;
    min-width: 120px !important;
    padding: 1rem !important;
}

.medico-app-logo {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding-right: 0.85rem !important;
    border-right: 1px solid var(--glass-border) !important;
    margin-right: 0.35rem !important;
}

.medico-app-title {
    font-weight: 800 !important;
    font-size: 1.1rem !important;
    color: var(--text-main) !important;
    letter-spacing: -0.02em !important;
}

/* === MÓDULO DE VENDAS & LOGIN (CRM) === */
.portal-badge {
    display: inline-block;
    background: var(--accent-green);
    color: #000;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.crm-logo-container {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crm-logo-img {
    width: 85%;
    height: 85%;
    object-fit: contain;
}

.auth-subtitle-restricted {
    color: var(--accent-green);
    font-weight: 600;
}

.auth-error-alert {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.3);
    color: #ef4444;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-align: center;
}

.btn-login-submit {
    width: 100%;
    margin: 1rem 0 1.5rem;
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.material-symbols-filled {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.crm-glass-panel, .crm-glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
}

.gradient-brand {
    background: linear-gradient(135deg, #006067 0%, #007b83 100%);
}

.drag-target-highlight .kanban-column {
    background-color: rgba(0, 96, 103, 0.09) !important;
    border-color: #006067 !important;
    border-style: solid !important;
    box-shadow: 0 0 15px rgba(0, 96, 103, 0.2);
}

.drag-target-highlight h3 {
    color: #006067 !important;
    transform: scale(1.03);
    transition: all 0.2s ease;
}

.crm-stage-column {
    border-right: 1px solid rgba(189, 201, 202, 0.35);
    padding-right: 16px;
    margin-right: 8px;
}

.crm-sticky-header {
    top: 10px;
}

.crm-kanban-column-scroll {
    max-height: 68vh;
    min-height: 400px;
    overflow-y: auto;
}

.crm-interaction-content-max {
    max-height: 4.5rem;
}

.form-optional-tag {
    font-size: 0.8em;
    opacity: 0.7;
}

/* === CRM & VENDA MODULE THEME & CONTRAST OVERRIDES === */

/* Light Theme Guarantees (High Contrast & Legibility) */
html.light body, body.light-theme {
    background-color: #f8f9fa;
    color: #191c1d;
}
html.light .bg-surface, body.light-theme .bg-surface {
    background-color: #f8f9fa !important;
}
html.light .bg-surface-container-lowest, body.light-theme .bg-surface-container-lowest {
    background-color: #ffffff !important;
}
html.light .bg-surface-container-low, body.light-theme .bg-surface-container-low {
    background-color: #f3f4f5 !important;
}
html.light .bg-surface-container-high, body.light-theme .bg-surface-container-high {
    background-color: #e7e8e9 !important;
}
html.light .bg-surface-container-highest, body.light-theme .bg-surface-container-highest {
    background-color: #e1e3e4 !important;
}
html.light .text-on-surface, body.light-theme .text-on-surface {
    color: #191c1d !important;
}
html.light .text-on-surface-variant, body.light-theme .text-on-surface-variant {
    color: #3e494a !important;
}
html.light .text-outline, body.light-theme .text-outline {
    color: #6e797a !important;
}

/* Dark Theme Support Rules */
html.dark, html.dark body, body.dark-theme {
    color-scheme: dark;
    background-color: #0f172a !important;
    color: #f8fafc !important;
}
html.dark .bg-surface, body.dark-theme .bg-surface {
    background-color: #0f172a !important;
}
html.dark .bg-surface-container-lowest, body.dark-theme .bg-surface-container-lowest {
    background-color: #1e293b !important;
}
html.dark .bg-surface-container-low, body.dark-theme .bg-surface-container-low {
    background-color: #334155 !important;
}
html.dark .bg-surface-container-high, body.dark-theme .bg-surface-container-high {
    background-color: #475569 !important;
}
html.dark .bg-surface-container-highest, body.dark-theme .bg-surface-container-highest {
    background-color: #334155 !important;
}
html.dark .text-on-surface, body.dark-theme .text-on-surface {
    color: #f8fafc !important;
}
html.dark .text-on-surface-variant, body.dark-theme .text-on-surface-variant {
    color: #94a3b8 !important;
}
html.dark .text-outline, body.dark-theme .text-outline {
    color: #cbd5e1 !important;
}
html.dark .border-outline-variant, body.dark-theme .border-outline-variant {
    border-color: rgba(255, 255, 255, 0.12) !important;
}
html.dark select, html.dark input, html.dark textarea,
body.dark-theme select, body.dark-theme input, body.dark-theme textarea {
    background-color: #334155 !important;
    color: #f8fafc !important;
}
html.dark select option, body.dark-theme select option {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

/* === REFINAMENTOS DE CALENDÁRIO E AGENDA COMPLETA (TEMA CLARO) === */
body.light-theme,
html.light-theme {
    background-color: var(--bg-body, #f1f5f9) !important;
}

body.light-theme .bg-shape {
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.14), rgba(59, 130, 246, 0.12));
    opacity: 0.55;
}

body.light-theme .calendar-header {
    background: linear-gradient(135deg, #0d9488, #0369a1) !important;
    color: #ffffff !important;
}

body.light-theme .calendar-day,
body.light-theme .weekday,
body.light-theme .time-slot,
body.light-theme .week-day,
body.light-theme .week-hour,
body.light-theme .timeline-col,
body.light-theme .time-marker,
body.light-theme .prof-header-col {
    border-color: rgba(0, 0, 0, 0.07) !important;
}

body.light-theme .calendar-day,
body.light-theme .week-hour {
    background: rgba(255, 255, 255, 0.7) !important;
}

body.light-theme .calendar-day:hover,
body.light-theme .week-hour:hover {
    background: rgba(255, 255, 255, 0.95) !important;
}

body.light-theme .calendar-day.other-month {
    background: rgba(241, 245, 249, 0.5) !important;
    color: #94a3b8 !important;
}

body.light-theme .calendar-day.today {
    background: rgba(13, 148, 136, 0.08) !important;
    border: 2px solid var(--accent-green, #0d9488) !important;
}

body.light-theme .weekday,
body.light-theme .time-slot,
body.light-theme .week-day,
body.light-theme .prof-header-col {
    background: rgba(241, 245, 249, 0.9) !important;
    color: var(--text-main, #0f172a) !important;
}

body.light-theme .grade-container {
    background: rgba(255, 255, 255, 0.85) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

body.light-theme .grade-header-row {
    background: rgba(241, 245, 249, 0.95) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

body.light-theme .timeline-corner,
body.light-theme .timeline-col {
    border-right-color: rgba(0, 0, 0, 0.08) !important;
    background: rgba(248, 250, 252, 0.6) !important;
}

body.light-theme .event-modal-content {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    color: #0f172a !important;
}

/* Drawer Lateral de Agendamento Rápido */
.agenda-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1050;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.agenda-drawer-overlay.active {
    display: block;
    opacity: 1;
}

/* Transição para Push Drawer (empurra o conteúdo principal sem sobrepor) */
.main-container {
    transition: margin-right 0.35s cubic-bezier(0.16, 1, 0.3, 1), max-width 0.35s cubic-bezier(0.16, 1, 0.3, 1), width 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@media (min-width: 992px) {
    body.drawer-push-active .main-container,
    body.drawer-push-active .main-workspace {
        margin-right: 500px !important;
        max-width: calc(100% - 500px) !important;
        width: calc(100% - 500px) !important;
    }

    body.drawer-push-active #agendaDrawerOverlay {
        display: none !important;
        pointer-events: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }

    body.drawer-push-active .agenda-drawer {
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.25);
    }
}


.agenda-drawer {
    position: fixed;
    top: 0;
    right: -520px;
    width: 500px;
    max-width: 95vw;
    height: 100vh;
    background: var(--bg-card, #161c2d);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--border-glow, rgba(255, 255, 255, 0.1));
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
    z-index: 1060;
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    color: var(--text-main, #ffffff);
}

body.light-theme .agenda-drawer {
    background: rgba(255, 255, 255, 0.97);
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.08);
}

.agenda-drawer.active {
    right: 0;
}

.agenda-drawer-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-glow, rgba(255, 255, 255, 0.08));
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.agenda-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.agenda-drawer-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-glow, rgba(255, 255, 255, 0.08));
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Doctor Filter Chips */
.doctor-chips-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 12px;
    scrollbar-width: none;
}
.doctor-chips-bar::-webkit-scrollbar {
    display: none;
}
.btn-doctor-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glow, rgba(255, 255, 255, 0.15));
    color: var(--text-muted, #94a3b8);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}
.btn-doctor-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main, #fff);
    border-color: var(--accent-green, #00f5c4);
}
.btn-doctor-chip.active {
    background: var(--accent-green, #00f5c4);
    color: #000000 !important;
    border-color: var(--accent-green, #00f5c4);
    font-weight: 700;
}
body.light-theme .btn-doctor-chip {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #475569;
}
body.light-theme .btn-doctor-chip:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: var(--accent-green, #0d9488);
}
body.light-theme .btn-doctor-chip.active {
    background: var(--accent-green, #0d9488);
    color: #ffffff !important;
    border-color: var(--accent-green, #0d9488);
}

/* ==========================================================================
   BI DRAWER & FILTROS UNIFICADOS DA AGENDA
   ========================================================================== */
.doctor-filter-wrapper,
.type-filter-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Agenda KPI Summary Bar */
.agenda-kpi-summary-bar {
    border-top: 1px solid var(--border-glow, rgba(255, 255, 255, 0.08));
    padding-top: 1.1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
}

.agenda-kpi-pill {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border-glow, rgba(255, 255, 255, 0.07));
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    transition: all 0.25s ease;
}

body.light-theme .agenda-kpi-pill {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.07);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.agenda-kpi-pill:hover {
    transform: translateY(-2px);
    border-color: var(--border-glow, rgba(0, 245, 196, 0.3));
}

.agenda-kpi-pill.kpi-highlight-avaliativa {
    border-color: rgba(168, 85, 247, 0.35);
    background: rgba(168, 85, 247, 0.04);
}

body.light-theme .agenda-kpi-pill.kpi-highlight-avaliativa {
    background: #faf5ff;
    border-color: rgba(168, 85, 247, 0.3);
}

.kpi-pill-tag {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    padding: 2px 6px;
    border-radius: 4px;
}

body.light-theme .kpi-pill-tag {
    background: #ede9fe;
    color: #7e22ce;
}

.kpi-icon-pill {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.kpi-icon-pill.icon-total {
    background: var(--accent-glow, rgba(0, 245, 196, 0.15));
    color: var(--accent-green, #00f5c4);
}

body.light-theme .kpi-icon-pill.icon-total {
    background: rgba(13, 148, 136, 0.12);
    color: #0d9488;
}

.kpi-icon-pill.icon-clinica {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.kpi-icon-pill.icon-avaliativa {
    background: rgba(168, 85, 247, 0.18);
    color: #a855f7;
}

.kpi-icon-pill.icon-medicos {
    background: rgba(14, 165, 233, 0.15);
    color: #0ea5e9;
}

.kpi-pill-data {
    display: flex;
    flex-direction: column;
}

.kpi-pill-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main, #f8fafc);
    line-height: 1.1;
}

.kpi-pill-label {
    font-size: 0.74rem;
    color: var(--text-muted, #94a3b8);
    font-weight: 500;
}

/* Modern Calendar Nav & Controls */
.calendar-nav-datepicker {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-glow, rgba(255, 255, 255, 0.15));
    color: var(--text-main, #ffffff);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.82rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    outline: none;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 145px;
}

body.light-theme .calendar-nav-datepicker {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.15);
    color: #0f172a;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

body.light-theme .calendar-nav-btn {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    color: #1e293b !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

body.light-theme .calendar-nav-btn:hover {
    background: #f1f5f9 !important;
    color: var(--accent-green, #0d9488) !important;
}

body.light-theme .current-month {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    color: #0f172a !important;
    font-weight: 600;
}

/* Segmented Control para View Toggle */
.view-toggle {
    display: inline-flex !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--border-glow, rgba(255, 255, 255, 0.1)) !important;
    border-radius: 10px !important;
    padding: 3px !important;
    gap: 3px !important;
    backdrop-filter: blur(8px);
}

body.light-theme .view-toggle {
    background: #f1f5f9 !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

.view-btn {
    padding: 6px 14px !important;
    border-radius: 7px !important;
    border: none !important;
    background: transparent !important;
    color: var(--text-muted, #94a3b8) !important;
    font-size: 0.82rem !important;
    font-weight: 500 !important;
    cursor: pointer;
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease !important;
}

.view-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-main, #ffffff) !important;
    transform: none !important;
}

body.light-theme .view-btn:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    color: #0f172a !important;
    transform: none !important;
}

.view-btn.active {
    background: var(--accent-green, #00f5c4) !important;
    color: #000000 !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

body.light-theme .view-btn.active {
    background: var(--accent-green, #0d9488) !important;
    color: #ffffff !important;
}

/* Destaque Visual de Consultas Avaliativas */
.event-item.event-avaliativa,
.week-event.event-avaliativa,
.calendar-event-block.event-avaliativa {
    border-left: 3.5px solid #a855f7 !important;
}

.event-item.event-avaliativa {
    background: rgba(168, 85, 247, 0.12) !important;
    color: #f3e8ff !important;
}

body.light-theme .event-item.event-avaliativa {
    background: #faf5ff !important;
    color: #6b21a8 !important;
}

.calendar-event-block.event-avaliativa {
    background: rgba(168, 85, 247, 0.15) !important;
    border-left: 4px solid #a855f7 !important;
}

body.light-theme .calendar-event-block.event-avaliativa {
    background: #faf5ff !important;
    border-left: 4px solid #7e22ce !important;
}

.badge-avaliativa-grade {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(168, 85, 247, 0.25);
    color: #d8b4fe;
    font-size: 0.68rem;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
}

body.light-theme .badge-avaliativa-grade {
    background: #ede9fe;
    color: #6b21a8;
}


.bi-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.bi-kpi-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glow, rgba(255, 255, 255, 0.08));
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

body.light-theme .bi-kpi-card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.bi-kpi-title {
    font-size: 0.76rem;
    color: var(--text-muted, #94a3b8);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bi-kpi-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main, #f8fafc);
    line-height: 1.1;
}

.bi-kpi-sub {
    font-size: 0.72rem;
    color: var(--text-muted, #94a3b8);
}

.bi-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main, #f8fafc);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 8px 0;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-glow, rgba(255, 255, 255, 0.08));
}

.bi-stat-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.bi-stat-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-main, #f8fafc);
}

.bi-progress-bar {
    width: 100%;
    height: 7px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

body.light-theme .bi-progress-bar {
    background: rgba(0, 0, 0, 0.06);
}

.bi-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.bi-ranking-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glow, rgba(255, 255, 255, 0.06));
    font-size: 0.82rem;
    color: var(--text-main, #f8fafc);
    margin-bottom: 6px;
}

body.light-theme .bi-ranking-item {
    background: #f8fafc;
    border-color: rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   LAUNCHPAD FLUTUANTE INTELIGENTE (ESTILO OLIVIUS / WIN 11 FLUENT DESIGN)
   ========================================================================== */

/* Overlay de Fundo Translúcido com Desfoque */
.launchpad-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 29, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s;
}

.launchpad-overlay.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

/* Modal Central Flutuante */
.launchpad-modal {
    width: 100%;
    max-width: 1060px;
    max-height: 88vh;
    background: var(--bg-card, #161c2d);
    border: 1px solid var(--border-glow, rgba(255, 255, 255, 0.12));
    border-radius: 24px;
    box-shadow: 0 35px 80px -20px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95) translateY(12px);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.launchpad-overlay.active .launchpad-modal {
    transform: scale(1) translateY(0);
}

body.light-theme .launchpad-modal {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

/* Cabeçalho Fixo do Launchpad */
.launchpad-header {
    padding: 22px 28px 16px 28px;
    border-bottom: 1px solid var(--border-glow, rgba(255, 255, 255, 0.08));
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: rgba(255, 255, 255, 0.015);
    flex-shrink: 0;
}

body.light-theme .launchpad-header {
    background: rgba(248, 250, 252, 0.9);
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

.launchpad-brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.launchpad-brand-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.launchpad-brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--accent-glow, rgba(0, 245, 196, 0.12));
    color: var(--accent-green, #00f5c4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    box-shadow: 0 4px 14px var(--accent-glow, rgba(0, 245, 196, 0.2));
}

.launchpad-brand-title {
    margin: 0;
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--text-main, #f8fafc);
    letter-spacing: -0.02em;
}

.launchpad-brand-sub {
    font-size: 0.8rem;
    color: var(--text-muted, #94a3b8);
}

.launchpad-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glow, rgba(255, 255, 255, 0.1));
    color: var(--text-muted, #94a3b8);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.launchpad-close-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
    transform: rotate(90deg);
}

body.light-theme .launchpad-close-btn {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #64748b;
}

/* Barra Omnisearch de Busca em Tempo Real */
.launchpad-search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.22);
    border: 1.5px solid var(--border-glow, rgba(255, 255, 255, 0.14));
    border-radius: 14px;
    padding: 0 16px;
    transition: all 0.25s ease;
}

.launchpad-search-box:focus-within {
    border-color: var(--accent-green, #00f5c4);
    background: rgba(0, 0, 0, 0.35);
    box-shadow: 0 0 0 3px var(--accent-glow, rgba(0, 245, 196, 0.2));
}

body.light-theme .launchpad-search-box {
    background: #ffffff;
    border-color: #cbd5e1;
}

body.light-theme .launchpad-search-box:focus-within {
    border-color: var(--accent-green, #00f5c4);
    box-shadow: 0 0 0 3px rgba(0, 245, 196, 0.2);
}

.launchpad-search-icon {
    color: var(--accent-green, #00f5c4);
    font-size: 1.1rem;
    margin-right: 12px;
}

.launchpad-search-input {
    flex: 1;
    height: 48px;
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.95rem;
    color: var(--text-main, #f8fafc);
    font-family: inherit;
}

.launchpad-search-input::placeholder {
    color: var(--text-muted, #94a3b8);
}

.launchpad-search-kbd {
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted, #94a3b8);
    border: 1px solid var(--border-glow, rgba(255, 255, 255, 0.1));
    font-weight: 600;
}

body.light-theme .launchpad-search-kbd {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

/* Barra de Ações Rápidas Fixadas */
.launchpad-quick-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
}

.launchpad-quick-actions::-webkit-scrollbar {
    display: none;
}

.launchpad-quick-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glow, rgba(255, 255, 255, 0.1));
    color: var(--text-main, #f8fafc);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
    cursor: pointer;
}

.launchpad-quick-pill i {
    color: var(--accent-green, #00f5c4);
    font-size: 0.85rem;
}

.launchpad-quick-pill:hover {
    background: var(--accent-green, #00f5c4);
    color: #0f172a;
    border-color: var(--accent-green, #00f5c4);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow, rgba(0, 245, 196, 0.25));
}

.launchpad-quick-pill:hover i {
    color: #0f172a;
}

body.light-theme .launchpad-quick-pill {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #334155;
}

/* Corpo com Rolagem e Domínios */
.launchpad-body-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 22px 28px;
    display: flex;
    flex-direction: column;
    gap: 26px;
    scroll-behavior: smooth;
}

.launchpad-body-scroll::-webkit-scrollbar {
    width: 6px;
}

.launchpad-body-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 10px;
}

body.light-theme .launchpad-body-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
}

/* Seções de Domínio */
.launchpad-domain-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.launchpad-domain-heading {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent-green, #00f5c4);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--border-glow, rgba(255, 255, 255, 0.08));
}

body.light-theme .launchpad-domain-heading {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

.launchpad-domain-heading-icon {
    font-size: 0.95rem;
}

/* Grade de Módulos */
.launchpad-modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
    gap: 10px;
}

/* Cartão de Módulo Autoexplicativo */
.launchpad-module-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border-glow, rgba(255, 255, 255, 0.08));
    text-decoration: none;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.launchpad-module-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent-green, #00f5c4);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.35);
}

body.light-theme .launchpad-module-card {
    background: #f8fafc;
    border-color: #e2e8f0;
}

body.light-theme .launchpad-module-card:hover {
    background: #ffffff;
    border-color: var(--accent-green, #00f5c4);
    box-shadow: 0 10px 22px -6px rgba(0, 0, 0, 0.08);
}

.launchpad-module-icon-box {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glow, rgba(255, 255, 255, 0.08));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: var(--accent-green, #00f5c4);
    transition: all 0.22s ease;
}

.launchpad-module-card:hover .launchpad-module-icon-box {
    transform: scale(1.08);
    background: var(--accent-green, #00f5c4);
    color: #0f172a;
    border-color: var(--accent-green, #00f5c4);
}

body.light-theme .launchpad-module-icon-box {
    background: #ffffff;
    border-color: #e2e8f0;
}

.launchpad-module-texts {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.launchpad-module-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-main, #f8fafc);
    line-height: 1.25;
}

.launchpad-module-desc {
    font-size: 0.74rem;
    color: var(--text-muted, #94a3b8);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.launchpad-module-card:hover .launchpad-module-desc {
    color: var(--text-main, #cbd5e1);
}

/* Ocultação por Busca */
.launchpad-module-card.search-hidden {
    display: none !important;
}

.launchpad-domain-section.search-empty-domain {
    display: none !important;
}

/* Mensagem de Nenhum Resultado */
.launchpad-no-results {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    text-align: center;
    color: var(--text-muted, #94a3b8);
}

.launchpad-no-results.active {
    display: flex;
}

.launchpad-no-results i {
    font-size: 2.4rem;
    color: var(--accent-green, #00f5c4);
    margin-bottom: 12px;
    opacity: 0.8;
}

.launchpad-no-results h4 {
    margin: 0 0 6px 0;
    font-size: 1.1rem;
    color: var(--text-main, #f8fafc);
}

.launchpad-no-results p {
    margin: 0;
    font-size: 0.84rem;
    color: var(--text-muted, #94a3b8);
}

/* Rodapé do Launchpad */
.launchpad-footer {
    padding: 12px 28px;
    border-top: 1px solid var(--border-glow, rgba(255, 255, 255, 0.08));
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted, #94a3b8);
    background: rgba(255, 255, 255, 0.015);
    flex-shrink: 0;
}

body.light-theme .launchpad-footer {
    background: #f8fafc;
    border-top-color: rgba(0, 0, 0, 0.06);
}

.launchpad-footer-shortcuts {
    display: flex;
    align-items: center;
    gap: 14px;
}

.launchpad-footer-shortcuts span kbd {
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-glow, rgba(255, 255, 255, 0.1));
    font-size: 0.7rem;
    color: var(--text-main, #f8fafc);
}

body.light-theme .launchpad-footer-shortcuts span kbd {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

/* Responsividade Mobile */
@media (max-width: 768px) {
    .launchpad-overlay {
        padding: 12px;
    }
    .launchpad-modal {
        max-height: 94vh;
        border-radius: 18px;
    }
    .launchpad-header {
        padding: 16px 18px 12px 18px;
    }
    .launchpad-body-scroll {
        padding: 16px 18px;
    }
    .launchpad-modules-grid {
        grid-template-columns: 1fr;
    }
    .launchpad-footer-shortcuts {
        display: none;
    }
}



