/* ================================================================
   DARK THEME — HealthyFlow
   Carregado APÓS HealthyFlowWeb.styles.css para sobrescrever
   estilos com escopo (scoped CSS) por ordem de cascata.
   ================================================================ */

/* ── Transição suave ao trocar tema ─────────────────────────── */
.theme-dark,
.theme-dark *:not(i):not(.fa):not([class*="fa-"]):not([class*="ph-"]):not([class*="bi-"]):not([class*="material"]) {
    transition:
        background-color 0.25s ease,
        background 0.25s ease,
        color 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease !important;
}

/* ── Variáveis em .theme-dark E todos os descendentes ───────────
   CRÍTICO: app.css usa o seletor * para definir as vars, o que
   coloca uma cópia em cada elemento e bloqueia a herança normal.
   Usar .theme-dark, .theme-dark * garante que ganhamos do * (0-0-0)
   com especificidade 0-1-0.
   ─────────────────────────────────────────────────────────────── */
.theme-dark,
.theme-dark * {
    --body-text: #cbd5e1;
    --title-text: #f1f5f9;
    --text-muted: #94a3b8;
    --text-placeholder: #475569;
    --text-inverted: #142034;
    --bg-divider: #334155;
    --surface: #1e293b;
    --border: #334155;
    --border-color: #334155;
    --bg-input: #1e293b;
    --bg-overlay: rgba(0, 0, 0, 0.82);
    --primary-soft: rgba(46, 134, 171, 0.2);
    --success-soft: rgba(25, 135, 84, 0.2);
    --danger-soft: rgba(239, 68, 68, 0.2);
    --warning-soft: rgba(245, 158, 11, 0.15);
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --box-shadow-focus: 0 0 0 2px rgba(46, 134, 171, 0.35);
    --light-color: #1e293b;
    --dark-color: #f1f5f9;
}

/* ================================================================
   PÁGINA / BODY
   ================================================================ */
.theme-dark {
    background: #142034;
    color: #cbd5e1;
}

.theme-dark body {
    background: #142034;
    color: #cbd5e1;
}

/* ================================================================
   HEADER (app.css)
   ================================================================ */
.theme-dark .header {
    background: #1e293b;
    border-bottom: 1px solid #334155;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.theme-dark .header-subtitle { color: #94a3b8; }
.theme-dark .header-left h1  { color: #2E86AB; }

.theme-dark .stat-item       { background: #142034; }
.theme-dark .stat-item:hover { background: #1e293b; }
.theme-dark .stat-text       { color: #cbd5e1; }

/* ================================================================
   SIDEBAR (Menu.razor.css — scoped, sobrescrito por cascata)
   ================================================================ */
.theme-dark .sidebar {
    background: #142034;
    border-right: 1px solid #1e293b;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
}

.theme-dark .sidebar-header {
    border-bottom: 1px solid #1e293b;
}

.theme-dark .logo-full        { color: #cbd5e1; }
.theme-dark .logo-short       { color: #2e86ab; }
.theme-dark .logo-accent      { color: #2e86ab; }

.theme-dark .sidebar-toggle { color: #475569; }
.theme-dark .sidebar-toggle:hover {
    color: #f1f5f9;
    background: #1e293b;
}

.theme-dark .menu-group-label { color: #334155; }

.theme-dark .menu-item {
    color: #64748b;
}
.theme-dark .menu-item:hover {
    color: #f1f5f9;
    background: #1e293b;
    text-decoration: none;
}
.theme-dark .menu-item.active {
    color: #2e86ab;
    background: rgba(46, 134, 171, 0.15);
    border-left-color: #2e86ab;
    text-decoration: none;
}

.theme-dark .sidebar-footer { border-top: 1px solid #1e293b; }

.theme-dark .user-name   { color: #f1f5f9; }
.theme-dark .user-role   { color: #475569; }
.theme-dark .user-avatar {
    background: rgba(46, 134, 171, 0.18);
    border-color: rgba(46, 134, 171, 0.3);
    color: #2e86ab;
}

.theme-dark .theme-toggle        { color: #64748b; }
.theme-dark .theme-toggle:hover  { color: #2e86ab; background: rgba(46, 134, 171, 0.1); }

.theme-dark .logout-item       { color: #64748b; }
.theme-dark .logout-item:hover { color: #dc2626; background: rgba(220, 38, 38, 0.1); }

/* ================================================================
   MOBILE BUTTON (MainLayout.razor.css)
   ================================================================ */
.theme-dark .mobile-menu-btn {
    background: #1e293b;
    color: #f1f5f9;
    border-color: #334155;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.theme-dark .mobile-menu-btn:active { background: #334155; }

/* ================================================================
   FILTROS (filters.css)
   ================================================================ */
.theme-dark .filters-section {
    background: #1e293b;
    border-color: #334155;
}

.theme-dark .filter-group input,
.theme-dark .search-input input,
.theme-dark .filter-group select {
    background: #142034;
    background-color: #142034;
    color: #cbd5e1;
    border-color: #334155;
}

.theme-dark .filter-group input:focus,
.theme-dark .search-input input:focus,
.theme-dark .filter-group select:focus {
    background: #1e293b;
    background-color: #1e293b;
    border-color: #2E86AB;
    box-shadow: 0 0 0 3px rgba(46, 134, 171, 0.15);
}

.theme-dark .search-input input::placeholder { color: #475569; }

.theme-dark .specialty-btn {
    background: #142034;
    border-color: #334155;
    color: #94a3b8;
}
.theme-dark .specialty-btn:hover {
    border-color: #2E86AB;
    color: #2E86AB;
    background: rgba(46, 134, 171, 0.08);
}
.theme-dark .specialty-btn.active {
    background: #2E86AB;
    border-color: #2E86AB;
    color: white;
}

/* ================================================================
   TABELA (table.css)
   ================================================================ */
.theme-dark .custom-table-section {
    background: #1e293b;
    border-color: #334155;
}
.theme-dark .custom-table-header {
    border-bottom-color: #334155;
}
.theme-dark .custom-table th {
    background: #142034;
    color: #94a3b8;
    border-bottom-color: #334155;
}
.theme-dark .custom-table td {
    color: #cbd5e1;
    border-bottom-color: #1e293b;
}
.theme-dark .custom-table tr:last-child td { border-bottom: none; }
.theme-dark .custom-table tr:hover td     { background: rgba(255, 255, 255, 0.02); }

.theme-dark .view-toggle           { background: #142034; }

/* ================================================================
   MODAL (modal.css)
   ================================================================ */
.theme-dark .modal-container {
    background: #1e293b;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}
.theme-dark .modal-header {
    background: #1e293b;
    border-bottom-color: #334155;
    color: #f1f5f9;
}
/* Especificidade 0-2-0: cobre modal-title fora do header */
.theme-dark .modal-title { color: #f1f5f9; }
/* Especificidade 0-3-0: empata com .modal-header .modal-title[b-xxx] do scoped CSS
   e ganha por ordem de cascata (dark-theme.css carregado depois) */
.theme-dark .modal-header h2,
.theme-dark .modal-header .modal-title { color: #f1f5f9; }

.theme-dark .modal-footer {
    background: #142034;
    border-top-color: #334155;
}

.theme-dark .input-group-default label { color: #cbd5e1; }

.theme-dark .section-title-modal::after,
.theme-dark .section-title::after { background: #334155; }

.theme-dark .modal-close {
    background: transparent;
    border-color: #334155;
    color: #64748b;
}
.theme-dark .modal-close:hover {
    background: #334155;
    color: #f1f5f9;
}

.theme-dark .modal-body::-webkit-scrollbar-thumb         { background: #334155; }
.theme-dark .modal-body::-webkit-scrollbar-thumb:hover   { background: #475569; }

/* ================================================================
   CONTROLES DE FORMULÁRIO (form-controls.css + text-fields.css)
   ================================================================ */
.theme-dark input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
.theme-dark select,
.theme-dark textarea {
    background-color: #142034;
    border-color: #334155;
    color: #cbd5e1;
}

.theme-dark input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
.theme-dark select:focus,
.theme-dark textarea:focus {
    background-color: #1e293b;
    border-color: #2E86AB;
    box-shadow: 0 0 0 3px rgba(46, 134, 171, 0.15);
}

.theme-dark input:not([type="checkbox"]):not([type="radio"])::placeholder,
.theme-dark textarea::placeholder { color: #475569; }

.theme-dark input:disabled,
.theme-dark select:disabled,
.theme-dark textarea:disabled {
    background: #1e293b;
    color: #475569;
    border-color: #334155;
}

.theme-dark .form-input {
    background: #142034;
    border-color: #334155;
    color: #cbd5e1;
}
.theme-dark .form-input:focus {
    background: #1e293b;
    border-color: #2E86AB;
}

.theme-dark .input-group-default label,
.theme-dark .form-group label,
.theme-dark .form-label { color: #cbd5e1; }

.theme-dark textarea[readonly] {
    background-color: #142034;
    border-color: #334155;
    color: #94a3b8;
}
.theme-dark textarea { background-color: #142034; }

/* form-controls (::deep) */
.theme-dark .form-control {
    background: #142034;
    border-color: #334155;
    color: #cbd5e1;
}
.theme-dark .form-control:focus {
    background: #1e293b;
    border-color: #2E86AB;
    box-shadow: 0 0 0 3px rgba(46, 134, 171, 0.15);
}

/* ================================================================
   BOTÕES (buttons.css)
   ================================================================ */
.theme-dark .btn-cancel {
    background: #1e293b;
    color: #94a3b8;
    border-color: #334155;
}
.theme-dark .btn-cancel:hover {
    background: #334155;
    color: #f1f5f9;
}

.theme-dark .btn-secondary {
    background: #1e293b;
    color: #94a3b8;
    border-color: #334155;
}
.theme-dark .btn-secondary:hover {
    background: #334155;
    color: #f1f5f9;
}

.theme-dark .btn-outline {
    background: transparent;
    color: #2E86AB;
    border-color: #2E86AB;
}
.theme-dark .btn-outline:hover {
    background: #2E86AB;
    color: white;
}

.theme-dark .add-button {
    background: #1e293b;
    color: #2E86AB;
    border-color: #2E86AB;
}

/* ── Action Buttons ─────────────────────────────────────────── */
.theme-dark .action-btn.view            { background: rgba(46, 134, 171, 0.15); color: #7dd3fc; }
.theme-dark .action-btn.edit            { background: rgba(245, 124, 0, 0.15);  color: #fdba74; }
.theme-dark .action-btn.delete          { background: rgba(211, 47, 47, 0.15);  color: #fca5a5; }
.theme-dark .action-btn.activate        { background: rgba(46, 125, 50, 0.15);  color: #86efac; }
.theme-dark .action-btn.restock         { background: rgba(40, 167, 69, 0.15);  color: #86efac; }
.theme-dark .action-btn.schedule        { background: rgba(40, 167, 69, 0.15);  color: #86efac; }
.theme-dark .action-btn.clinical-record { background: rgba(139, 92, 246, 0.2);  color: #c4b5fd; }

.theme-dark .action-btn-calendar.edit    { background: rgba(25, 118, 210, 0.18); border-color: #1e3a5f; color: #93c5fd; }
.theme-dark .action-btn-calendar.cancel  { background: rgba(211, 47, 47, 0.18);  border-color: #5f1e1e; color: #fca5a5; }
.theme-dark .action-btn-calendar.start   { background: rgba(56, 142, 60, 0.18);  border-color: #1e3a1e; color: #86efac; }
.theme-dark .action-btn-calendar.profile { background: rgba(139, 92, 246, 0.18); border-color: #3a1e5f; color: #c4b5fd; }

/* ================================================================
   SPINNER / LOADING (spinner-layout.css)
   ================================================================ */
.theme-dark .loading-overlay {
    background: rgba(15, 23, 42, 0.97);
}
.theme-dark .loading-state {
    background: #1e293b;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}
.theme-dark .loading-state h3 { color: #2E86AB; }
.theme-dark .loading-container {
    background: #1e293b;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.theme-dark .progress-container { background: #334155; }
.theme-dark .spinner-ring       { border-color: #334155; }

/* ================================================================
   LOGIN (login.css)
   ================================================================ */
.theme-dark .login-page { background: #142034; }
.theme-dark .login-card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
}
.theme-dark .login-title    { color: #f1f5f9 !important; }
.theme-dark .login-subtitle { color: #64748b; }
.theme-dark .login-field label { color: #cbd5e1; }
.theme-dark .login-input-wrap input {
    background: #142034 !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}
.theme-dark .login-input-wrap input:focus {
    background: #1e293b !important;
    border-color: #2E86AB !important;
    box-shadow: 0 0 0 3px rgba(46, 134, 171, 0.18) !important;
}
.theme-dark .login-input-wrap input::placeholder { color: #475569 !important; }
.theme-dark .login-input-icon { color: #475569; }
.theme-dark .login-eye        { color: #475569; }
.theme-dark .login-eye:hover  { color: #2E86AB; }
.theme-dark .login-links      { color: #475569; }
.theme-dark .login-links a    { color: #64748b; }
.theme-dark .login-links a:hover { color: #2E86AB; }

/* ================================================================
   BADGES DE STATUS (app.css + replicados em scoped)
   ================================================================ */
.theme-dark .status-active,
.theme-dark .status-new {
    background: rgba(21, 87, 36, 0.25);
    color: #86efac;
    border-color: rgba(21, 87, 36, 0.4);
}
.theme-dark .status-onleave,
.theme-dark .status-incare {
    background: rgba(12, 84, 96, 0.25);
    color: #67e8f9;
    border-color: rgba(12, 84, 96, 0.4);
}
.theme-dark .status-vacation,
.theme-dark .status-pending {
    background: rgba(133, 100, 4, 0.25);
    color: #fde68a;
    border-color: rgba(133, 100, 4, 0.4);
}
.theme-dark .status-training,
.theme-dark .status-hospitalized {
    background: rgba(114, 28, 36, 0.25);
    color: #fca5a5;
    border-color: rgba(114, 28, 36, 0.4);
}
.theme-dark .status-suspended,
.theme-dark .status-discharged {
    background: rgba(56, 61, 65, 0.25);
    color: #9ca3af;
    border-color: #475569;
}
.theme-dark .status-inactive {
    background: rgba(30, 41, 59, 0.6);
    color: #64748b;
    border-color: #334155;
}

/* ================================================================
   PAGINAÇÃO (Pagination.razor.css — ::deep => sem escopo)
   ================================================================ */
.theme-dark .pagination { border-top-color: #334155; }
.theme-dark .pagination-btn:hover:not(:disabled) {
    background: #1e293b;
    color: #f1f5f9;
}
.theme-dark .pagination-btn.active {
    background: #2E86AB;
    color: white;
}

/* ================================================================
   SUGESTÕES / DROPDOWN DE BUSCA (global — usado em vários lugares)
   ================================================================ */
.theme-dark .suggestions,
.theme-dark .patient-suggestions {
    background: #1e293b;
    border-color: #334155;
}
.theme-dark .suggestion,
.theme-dark .patient-suggestion {
    border-bottom-color: #334155;
    color: #cbd5e1;
}
.theme-dark .suggestion:hover,
.theme-dark .patient-suggestion:hover,
.theme-dark .patient-suggestion.highlight {
    background: #142034;
}
.theme-dark .sug-info strong { color: #f1f5f9; }
.theme-dark .sug-info small  { color: #94a3b8; }

/* ================================================================
   HOMEPAGE (HomePage.razor.css)
   ================================================================ */
.theme-dark .welcome-section {
    background: #1e293b;
    border-color: #334155;
    border-left-color: #2e86ab;
}
.theme-dark .welcome-title   { color: #f1f5f9; }
.theme-dark .welcome-subtitle { color: #94a3b8; }

.theme-dark .quick-stat {
    background: #142034;
    border-color: #334155;
}
.theme-dark .quick-stat-label  { color: #94a3b8; }

.theme-dark .alert-card {
    background: #1e293b;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.theme-dark .alert-header  { border-bottom-color: #334155; }
.theme-dark .alert-title   { color: #cbd5e1; }

.theme-dark .alert-icon.agenda  { background: rgba(46, 134, 171, 0.15); }
.theme-dark .alert-icon.estoque { background: rgba(255, 143, 0, 0.15); }

.theme-dark .alert-item           { border-bottom-color: #1e293b; }
.theme-dark .alert-item-title     { color: #cbd5e1; }
.theme-dark .alert-item-subtitle  { color: #94a3b8; }
.theme-dark .alert-item-time      { color: #94a3b8; }

.theme-dark .alert-item-icon.urgent  { background: rgba(211, 47, 47, 0.15); }
.theme-dark .alert-item-icon.warning { background: rgba(245, 124, 0, 0.15); }
.theme-dark .alert-item-icon.info    { background: rgba(25, 118, 210, 0.15); }

.theme-dark .chart-card,
.theme-dark .stat-card,
.theme-dark .recent-activity {
    background: #1e293b;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.theme-dark .activity-header { border-bottom-color: #334155; }
.theme-dark .activity-item   { border-bottom-color: #334155; }
.theme-dark .activity-text   { color: #cbd5e1; }
.theme-dark .activity-user   { color: #f1f5f9; }
.theme-dark .activity-time   { color: #94a3b8; }

/* ================================================================
   AGENDA DIÁRIA — CalendarPage.razor.css
   ================================================================ */
.theme-dark .main-schedule {
    background: #1e293b;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.theme-dark .schedule-header {
    background: #1e293b;
    border-bottom-color: #334155;
    color: #f1f5f9;
}
.theme-dark .time-slot {
    background: #142034;
    color: #94a3b8;
    border-bottom-color: #1e293b;
    border-left-color: #1e293b;
}
.theme-dark .time-slot.blocked { background: #0a111e; color: #475569; }
.theme-dark .appointment-slot { border-bottom-color: #1e293b; }

/* Appointment card — texto legível sobre fundo escuro */
.theme-dark .appointment-card {
    background: #283548;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    color: #cbd5e1;
}
.theme-dark .appointment-patient { color: #f1f5f9; font-weight: 600; }
.theme-dark .appointment-summary,
.theme-dark .appointment-type    { color: #94a3b8; }

.theme-dark .appointment-card.Consultation { background: rgba(46, 134, 171, 0.2);  border-left-color: #2e86ab; }
.theme-dark .appointment-card.Procedimento { background: rgba(202, 138, 4, 0.2);   border-left-color: #ca8a04; }
.theme-dark .appointment-card.FollowUp     { background: rgba(56, 189, 248, 0.15); border-left-color: #38bdf8; }
.theme-dark .appointment-card.Exam         { background: rgba(124, 58, 237, 0.2);  border-left-color: #7c3aed; }
.theme-dark .appointment-card.Emergency    { background: rgba(220, 38, 38, 0.2)  !important; border-left-color: #dc2626 !important; }
.theme-dark .appointment-card.Cancelled    { background: rgba(148, 163, 184, 0.1) !important; border-left-color: #94a3b8 !important; }
.theme-dark .appointment-card.Completed    { background: rgba(22, 163, 74, 0.2);  border-left-color: #16a34a; }
.theme-dark .appointment-card.NoShow       { background: rgba(148, 163, 184, 0.1); border-left-color: #94a3b8; }
.theme-dark .appointment-card.bloqueado    { background: rgba(147, 51, 234, 0.2)  !important; border-left-color: #9333ea !important; }

.theme-dark .blocked-row-inner { background: rgba(144, 164, 174, 0.04); color: #64748b; }
.theme-dark .blocked-row:hover .blocked-row-inner { background: rgba(144, 164, 174, 0.1); }
.theme-dark .blocked-row-remove { border-color: #475569; color: #64748b; }

/* ── Nav / view buttons ── */
.theme-dark .view-btn {
    border-color: #334155;
    background: #1e293b;
    color: #94a3b8;
}
.theme-dark .view-btn.active {
    background: rgba(46, 134, 171, 0.15);
    border-color: #2e86ab;
    color: #2e86ab;
}
.theme-dark .view-btn:hover { background: #334155; color: #f1f5f9; }

.theme-dark .nav-btn,
.theme-dark .today-btn {
    border-color: #334155;
    background: #1e293b;
    color: #cbd5e1;
}
.theme-dark .nav-btn:hover,
.theme-dark .today-btn:hover { background: #334155; color: #f1f5f9; }

/* ── Sidebar direita da Agenda ── */
.theme-dark .info-card {
    background: #1e293b;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.theme-dark .info-card-title     { border-bottom-color: #334155; }
.theme-dark .info-card-title h3  { color: #94a3b8; }
.theme-dark .info-card h3        { color: #2E86AB; }

.theme-dark .next-appointment-item { border-bottom-color: #334155; }
.theme-dark .next-patient          { color: #cbd5e1; }
.theme-dark .next-type             { color: #94a3b8; }

.theme-dark .quick-action-btn.block,
.theme-dark .quick-action-btn.patients,
.theme-dark .quick-action-btn.remaining,
.theme-dark .quick-action-btn.unblock {
    background: #142034;
    color: #cbd5e1;
    border-color: #334155;
}
.theme-dark .quick-action-btn:hover { background: #1e293b; border-color: #475569; }

.theme-dark .empty-slot { border-color: #334155; color: #64748b; }

/* ── Legenda ── */
.theme-dark .legend-item.type-consultation { background: rgba(46, 134, 171, 0.15); color: #7dd3fc; }
.theme-dark .legend-item.type-followup     { background: rgba(56, 189, 248, 0.12); color: #bae6fd; }
.theme-dark .legend-item.type-exam         { background: rgba(124, 58, 237, 0.15); color: #c4b5fd; }
.theme-dark .legend-item.type-emergency    { background: rgba(220, 38, 38, 0.15);  color: #fca5a5; }
.theme-dark .legend-item.type-completed    { background: rgba(22, 163, 74, 0.15);  color: #86efac; }
.theme-dark .legend-item.type-cancelled    { background: rgba(148, 163, 184, 0.1); color: #94a3b8; }

/* ================================================================
   AGENDA MENSAL — CalendarMonthlyPage.razor.css
   ================================================================ */
.theme-dark .calendar-container {
    background: #1e293b;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* header da view mensal (seletores scoped) */
.theme-dark .month-day-header {
    background: #142034;
    color: #94a3b8;
    border-right-color: #334155;
    border-bottom-color: #334155;
}

.theme-dark .month-day {
    background: #1e293b;
    border-right-color: #334155;
    border-bottom-color: #334155;
}
.theme-dark .month-day:hover          { background: #243044; }
.theme-dark .month-day.other-month    { background: #161f2e; }
.theme-dark .month-day.today          { background: rgba(46, 134, 171, 0.12); }
.theme-dark .month-day.selected       {
    background: rgba(46, 134, 171, 0.15);
    outline-color: #2E86AB;
}

.theme-dark .month-day-number         { color: #94a3b8; }
.theme-dark .month-day.other-month .month-day-number { color: #334155; }

/* Chips de agendamento no mês */
.theme-dark .month-appt-chip          { background: rgba(46, 134, 171, 0.15); border-left-color: #2e86ab; color: #7dd3fc; }
.theme-dark .month-appt-chip.Consultation  { background: rgba(46, 134, 171, 0.15); border-left-color: #2e86ab; color: #7dd3fc; }
.theme-dark .month-appt-chip.FollowUp      { background: rgba(56, 189, 248, 0.12); border-left-color: #38bdf8; color: #bae6fd; }
.theme-dark .month-appt-chip.Exam          { background: rgba(124, 58, 237, 0.15); border-left-color: #7c3aed; color: #c4b5fd; }
.theme-dark .month-appt-chip.Emergency     { background: rgba(220, 38, 38, 0.15);  border-left-color: #dc2626; color: #fca5a5; }
.theme-dark .month-appt-chip.Completed     { background: rgba(22, 163, 74, 0.15);  border-left-color: #16a34a; color: #86efac; }
.theme-dark .month-appt-chip.NoShow        { background: rgba(148, 163, 184, 0.1); border-left-color: #94a3b8; color: #94a3b8; }
.theme-dark .month-appt-more               { color: #64748b; }

/* ================================================================
   AGENDA SEMANAL — CalendarWeeklyPage.razor.css
   ================================================================ */
.theme-dark .weekly-grid {
    border-top-color: #334155;
    border-left-color: #334155;
}
.theme-dark .week-corner {
    background: #142034;
    border-right-color: #334155;
    border-bottom-color: #334155;
}
.theme-dark .week-day-header {
    background: #142034;
    color: #94a3b8;
    border-right-color: #334155;
    border-bottom-color: #334155;
}
.theme-dark .week-day-header.today { background: rgba(46, 134, 171, 0.12); color: #7dd3fc; }
.theme-dark .week-day-number       { color: #94a3b8; }

.theme-dark .week-time-slot {
    background: #142034;
    color: #64748b;
    border-right-color: #334155;
    border-bottom-color: #334155;
}
.theme-dark .week-cell {
    border-right-color: #334155;
    border-bottom-color: #334155;
}
.theme-dark .week-cell:hover    { background: rgba(46, 134, 171, 0.06); }
.theme-dark .week-cell.today-col { background: rgba(46, 134, 171, 0.04); }
.theme-dark .week-cell.past     { background: rgba(15, 23, 42, 0.5); }

/* Mini cards semanais — texto legível */
.theme-dark .week-appt            { background: rgba(46, 134, 171, 0.15); border-left-color: #2e86ab; }
.theme-dark .week-appt-name       { color: #f1f5f9; }
.theme-dark .week-appt-meta       { color: #94a3b8; }

.theme-dark .week-appt.Consultation  { background: rgba(46, 134, 171, 0.18); border-left-color: #2e86ab; }
.theme-dark .week-appt.FollowUp      { background: rgba(56, 189, 248, 0.15); border-left-color: #38bdf8; }
.theme-dark .week-appt.Exam          { background: rgba(124, 58, 237, 0.18); border-left-color: #7c3aed; }
.theme-dark .week-appt.Emergency     { background: rgba(220, 38, 38, 0.18);  border-left-color: #dc2626; }
.theme-dark .week-appt.Cancelled     { background: rgba(148, 163, 184, 0.1); border-left-color: #94a3b8; opacity: 0.7; }
.theme-dark .week-appt.Completed     { background: rgba(22, 163, 74, 0.18);  border-left-color: #16a34a; }
.theme-dark .week-appt.NoShow        { background: rgba(148, 163, 184, 0.1); border-left-color: #94a3b8; }

/* ================================================================
   RECEPÇÃO — ReceptionPage.razor.css
   ================================================================ */
.theme-dark .professional-search-wrapper {
    background: #1e293b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.theme-dark .reception-container {
    background: #1e293b;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.theme-dark .table-header-row {
    background: #142034;
    color: #94a3b8;
    border-bottom-color: #334155;
}
.theme-dark .appt-row              { border-bottom-color: #334155; }
.theme-dark .appt-row:hover        { background: rgba(255, 255, 255, 0.02); }
.theme-dark .appt-row.Called       { background: rgba(46, 134, 171, 0.08); }
.theme-dark .appt-row.Completed    { background: rgba(22, 163, 74, 0.06); }

.theme-dark .time-badge    { color: #2E86AB; }
.theme-dark .time-end      { color: #64748b; }
.theme-dark .patient-name  { color: #f1f5f9; }

/* Chips de status da recepção */
.theme-dark .stat-chip.total   { background: rgba(21, 101, 192, 0.18); color: #93c5fd; }
.theme-dark .stat-chip.waiting { background: rgba(230, 81, 0, 0.15);   color: #fdba74; }
.theme-dark .stat-chip.done    { background: rgba(46, 125, 50, 0.18);  color: #86efac; }

/* Type badges */
.theme-dark .type-badge.Consultation { background: rgba(21, 101, 192, 0.18); color: #93c5fd; }
.theme-dark .type-badge.FollowUp     { background: rgba(46, 125, 50, 0.18);  color: #86efac; }
.theme-dark .type-badge.Exam         { background: rgba(106, 27, 154, 0.18); color: #c4b5fd; }
.theme-dark .type-badge.Emergency    { background: rgba(198, 40, 40, 0.18);  color: #fca5a5; }

/* Status badges da recepção */
.theme-dark .status-badge.Initial    { background: #1e293b; color: #64748b; }
.theme-dark .status-badge.Scheduled  { background: rgba(21, 101, 192, 0.18); color: #93c5fd; }
.theme-dark .status-badge.Pending    { background: rgba(230, 81, 0, 0.15);   color: #fdba74; }
.theme-dark .status-badge.Called     { background: rgba(29, 78, 216, 0.2);   color: #a5b4fc; }
.theme-dark .status-badge.Completed  { background: rgba(46, 125, 50, 0.18);  color: #86efac; }
.theme-dark .status-badge.Cancelled  { background: rgba(198, 40, 40, 0.15);  color: #fca5a5; }
.theme-dark .status-badge.NoShow     { background: rgba(84, 110, 122, 0.18); color: #94a3b8; }

/* Billing badges */
.theme-dark .billing-badge.Draft   { background: #1e293b; color: #64748b; }
.theme-dark .billing-badge.Issued  { background: rgba(133, 100, 4, 0.2);  color: #fde68a; }
.theme-dark .billing-badge.Partial { background: rgba(199, 80, 0, 0.2);   color: #fdba74; }
.theme-dark .billing-badge.Paid    { background: rgba(20, 108, 67, 0.2);  color: #86efac; }
.theme-dark .billing-badge.Overdue { background: rgba(132, 32, 41, 0.2);  color: #fca5a5; }

/* Action buttons na recepção */
.theme-dark .action-btn1.arrive  { background: rgba(46, 125, 50, 0.18); color: #86efac; }
.theme-dark .action-btn1.arrive:hover { background: rgba(46, 125, 50, 0.28); }
.theme-dark .action-btn1.call    { background: rgba(230, 81, 0, 0.15);  color: #fdba74; }
.theme-dark .action-btn1.call:hover { background: rgba(230, 81, 0, 0.25); }
.theme-dark .action-btn1.call.called { background: #1e293b; color: #64748b; }
.theme-dark .action-btn1.billing { background: rgba(21, 101, 192, 0.18); color: #93c5fd; }
.theme-dark .action-btn1.billing:hover { background: rgba(21, 101, 192, 0.28); }

/* ================================================================
   PACIENTES — PatientsPage.razor.css
   ================================================================ */
.theme-dark .patients-grid .stat-card {
    background: #1e293b;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.theme-dark .step-item.active{
    background: #142034;
    color: #94a3b8;
}

.theme-dark .step-icon{
    background: #334155;
    color: #94a3b8;
}

.theme-dark .step-item.completed .step-icon{
    background: rgba(21, 87, 36, 0.25);
    color: #86efac;
}

.theme-dark .step-item.active .step-label{
    color: #f1f5f9;
}

.theme-dark .form-container{
    background: #1e293b;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.theme-dark .section-header h2{
    border-bottom-color: #334155;
    color: #f1f5f9;
}

.theme-dark .cns-block{
    background: #142034;
    color: #94a3b8;
    border-color: #334155;  
}

/* PatientCard.razor.css */
.theme-dark .patient-card {
    background: #1e293b;
    border-color: #334155;
}
.theme-dark .patient-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border-color: #2E86AB;
}
.theme-dark .pc-name      { color: #f1f5f9; }
.theme-dark .pc-id        { color: #475569; }
.theme-dark .pc-info-item { color: #94a3b8; }

/* ================================================================
   ESTOQUE — StockPage.razor.css
   ================================================================ */
.theme-dark .inventory-dashboard .stat-card {
    background: #1e293b;
    border-color: #334155;
}
.theme-dark .stat-info label { color: #94a3b8; }
.theme-dark .stat-info h3    { color: #f1f5f9; }
.theme-dark .total-badge     { background: #142034; color: #94a3b8; }

.theme-dark .stat-icon.warning { background: rgba(133, 100, 4, 0.2);  color: #fde68a; }
.theme-dark .stat-icon.caution { background: rgba(194, 68, 11, 0.2);  color: #fdba74; }
.theme-dark .stat-icon.danger  { background: rgba(114, 28, 36, 0.2);  color: #fca5a5; }
.theme-dark .stat-icon.muted   { background: rgba(108, 117, 125, 0.2); color: #94a3b8; }
.theme-dark .stat-icon.success { background: rgba(21, 87, 36, 0.2);   color: #86efac; }

/* Tabs do estoque */
.theme-dark .table-tab-btn            { color: #64748b; }
.theme-dark .table-tab-btn:hover:not(.active) { background: #1e293b; color: #94a3b8; }
.theme-dark .table-tab-btn.active     { background: rgba(46, 134, 171, 0.15); border-color: rgba(46, 134, 171, 0.3); color: #2E86AB; }

/* Texto na tabela de estoque */
.theme-dark .prod-name  { color: #f1f5f9; }
.theme-dark .prod-sku   { background: #142034; color: #94a3b8; }
.theme-dark .prod-cat   { color: #64748b; }
.theme-dark .prod-lot   { background: rgba(180, 83, 9, 0.2); color: #fde68a; }
.theme-dark .prod-loc   { color: #7dd3fc; }

.theme-dark .qty-num    { color: #f1f5f9; }
.theme-dark .qty-num.critical { color: #fca5a5; }
.theme-dark .qty-bar    { background: #334155; }
.theme-dark .qty-min-label { color: #475569; }

.theme-dark .exp-ok      { color: #cbd5e1; }
.theme-dark .exp-warning { color: #fde68a; }
.theme-dark .exp-danger  { color: #fca5a5; }

.theme-dark .status-pill.success { background: rgba(21, 87, 36, 0.25); color: #86efac; }
.theme-dark .status-pill.warning { background: rgba(133, 100, 4, 0.25); color: #fde68a; }
.theme-dark .status-pill.danger  { background: rgba(114, 28, 36, 0.25); color: #fca5a5; }

/* StockModal — toggle Entrada/Saída */
.theme-dark .movement-toggle { background: #142034; }
.theme-dark .toggle-btn.active.entry {
    background: #1e293b;
    color: #86efac;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.theme-dark .toggle-btn.active.exit {
    background: #1e293b;
    color: #fca5a5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Seções dentro do StockModal */
.theme-dark .form-section {
    background: #1e293b;
    border-color: #334155;
}
.theme-dark .form-section-title { color: #cbd5e1; }

/* Stock selector buttons */
.theme-dark .stock-btn {
    background: #142034;    
    border-color: #334155;
    color: #94a3b8;
}
.theme-dark .stock-btn.active {
    border-color: #2E86AB;
    background: rgba(46, 134, 171, 0.12);
    color: #2E86AB;
}

/* Alert boxes no modal */
.theme-dark .alert-box.info    { background: rgba(30, 64, 175, 0.12); border-color: rgba(30, 64, 175, 0.3); }
.theme-dark .alert-box.info i,
.theme-dark .alert-box.info p  { color: #93c5fd; }
.theme-dark .alert-box.warning { background: rgba(146, 64, 14, 0.12); border-color: rgba(146, 64, 14, 0.3); }
.theme-dark .alert-box.warning i,
.theme-dark .alert-box.warning p { color: #fde68a; }

/* Lote info */
.theme-dark .lot-single     { background: rgba(22, 163, 74, 0.1); border-color: rgba(22, 163, 74, 0.3); }
.theme-dark .lot-single > i { color: #86efac; }
.theme-dark .lot-single-name { color: #86efac; }
.theme-dark .lot-single-meta { color: #6ee7b7; }
.theme-dark .lots-empty      { background: rgba(180, 83, 9, 0.12); color: #fde68a; }
.theme-dark .lot-auto-tag    { background: rgba(22, 163, 74, 0.15); color: #86efac; }

/* ================================================================
   FINANCEIRO — FinancePage.razor.css
   ================================================================ */
.theme-dark .kpi-card {
    background: #1e293b;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.theme-dark .kpi-card:hover { box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4); }

.theme-dark .kpi-icon.total-icon    { background: rgba(9, 132, 227, 0.15); }
.theme-dark .kpi-icon.pago-icon     { background: rgba(0, 184, 148, 0.15); }
.theme-dark .kpi-icon.pendente-icon { background: rgba(253, 203, 110, 0.12); }
.theme-dark .kpi-icon.atrasado-icon { background: rgba(214, 48, 49, 0.15); }

/* Valor do KPI — era ilegível */
.theme-dark .kpi-value         { color: #f1f5f9; }
.theme-dark .kpi-value.pago    { color: #6ee7b7; }
.theme-dark .kpi-value.pendente { color: #fdba74; }
.theme-dark .kpi-value.atrasado { color: #fca5a5; }
.theme-dark .kpi-label         { color: #94a3b8; }
.theme-dark .kpi-sub           { color: #64748b; }

/* Period selector */
.theme-dark .period-selector {
    background: #142034;
    border-color: #334155;
}
.theme-dark .period-btn { color: #64748b; background: transparent; }
.theme-dark .period-btn.active {
    background: #1e293b;
    color: #2E86AB;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.theme-dark .period-btn:hover:not(.active) {
    background: rgba(46, 134, 171, 0.08);
    color: #2E86AB;
}

.theme-dark .custom-range-bar {
    background: #1e293b;
    border-color: #2E86AB;
}

/* Lookup / patient search */
.theme-dark .lookup-card,
.theme-dark .patient-card,
.theme-dark .billing-panel {
    background: #1e293b;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.theme-dark .patient-card  { border-left-color: #2E86AB; }
.theme-dark .pc-stats      { border-color: #334155; }
.theme-dark .pcs           { border-right-color: #334155; }
.theme-dark .pcs-val       { color: #f1f5f9; }
.theme-dark .pcs-lbl       { color: #94a3b8; }
.theme-dark .pcs.pago .pcs-val     { color: #6ee7b7; }
.theme-dark .pcs.pendente .pcs-val { color: #fdba74; }
.theme-dark .pcs.atrasado .pcs-val { color: #fca5a5; }

/* Tabs do painel de cobrança */
.theme-dark .panel-tabs {
    background: #142034;
    border-bottom-color: #334155;
}
.theme-dark .panel-tab        { color: #94a3b8; }
.theme-dark .panel-tab.active {
    color: #2E86AB;
    background: #1e293b;
    border-bottom-color: #2E86AB;
}
.theme-dark .panel-tab:hover:not(.active) { background: rgba(46, 134, 171, 0.08); }
.theme-dark .tab-badge         { background: #334155; color: #94a3b8; }
.theme-dark .panel-tab.active .tab-badge { background: rgba(46, 134, 171, 0.2); }

.theme-dark .billing-row              { border-bottom-color: #334155; }
.theme-dark .billing-row:hover        { background: rgba(255, 255, 255, 0.02); }
.theme-dark .billing-row:last-child   { border-bottom: none; }
.theme-dark .br-date    { color: #94a3b8; }
.theme-dark .br-date.overdue { color: #fca5a5; }
.theme-dark .br-invoice { color: #94a3b8; }
.theme-dark .br-amount  { color: #f1f5f9; }

.theme-dark .status-pill.pago      { background: rgba(6, 95, 70, 0.25);   color: #86efac; }
.theme-dark .status-pill.pendente  { background: rgba(146, 64, 14, 0.25); color: #fde68a; }
.theme-dark .status-pill.atrasado  { background: rgba(153, 27, 27, 0.25); color: #fca5a5; }
.theme-dark .status-pill.parcelado { background: rgba(59, 92, 168, 0.25); color: #a5b4fc; }
.theme-dark .status-pill.cancelado { background: rgba(30, 41, 59, 0.6);   color: #64748b; }

.theme-dark .row-btn {
    background: #142034;
    border-color: #334155;
    color: #94a3b8;
}
.theme-dark .row-btn:hover {
    border-color: #2E86AB;
    color: #2E86AB;
    background: rgba(46, 134, 171, 0.08);
}
.theme-dark .row-btn.pay { border-color: #00b894; color: #6ee7b7; }

.theme-dark .clear-btn {
    border-color: #334155;
    color: #94a3b8;
}
.theme-dark .clear-btn:hover { border-color: #fca5a5; color: #fca5a5; }

/* ================================================================
   MODAL DE COBRANÇA — BillingModal.razor.css
   ================================================================ */
.theme-dark .billing-modal {
    background: #1e293b;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}
.theme-dark .billing-patient { color: #94a3b8; }

.theme-dark .billing-summary {
    background: #142034;
    border-color: #334155;
}
.theme-dark .summary-item   { border-right-color: #334155; }
.theme-dark .summary-label  { color: #94a3b8; }
.theme-dark .summary-value  { color: #f1f5f9; }
.theme-dark .summary-value.total    { color: #7dd3fc; }
.theme-dark .summary-value.pago     { color: #86efac; }
.theme-dark .summary-value.restante { color: #fdba74; }

/* Tabela interna do modal de cobrança */
.theme-dark .billing-table th {
    background: #142034;
    color: #94a3b8;
    border-bottom-color: #334155;
}
.theme-dark .billing-table td {
    color: #cbd5e1;
    border-bottom-color: #334155;
}
.theme-dark .billing-table tr:last-child td { border-bottom: none; }

.theme-dark .section-title {
    color: #cbd5e1;
    border-bottom-color: #334155;
}
.theme-dark .notes-cell  { color: #94a3b8; }
.theme-dark .method-badge { background: #334155; color: #cbd5e1; }

.theme-dark .add-item-form {
    background: #142034;
    border-color: #334155;
}
.theme-dark .add-item-form h5     { color: #94a3b8; }
.theme-dark .no-services-warning  { background: rgba(123, 88, 0, 0.15); border-color: rgba(254, 240, 130, 0.25); color: #fde68a; }

/* Parcelamento */
.theme-dark .installment-row {
    background: #142034;
    border-color: #334155;
}
.theme-dark .installment-row.inst-paid    { background: rgba(22, 163, 74, 0.08); border-color: rgba(22, 163, 74, 0.3); }
.theme-dark .installment-row.inst-overdue { background: rgba(220, 38, 38, 0.08); border-color: rgba(220, 38, 38, 0.3); }
.theme-dark .inst-number                  { background: #334155; color: #94a3b8; }
.theme-dark .inst-paid .inst-number       { background: rgba(22, 163, 74, 0.2); color: #86efac; }
.theme-dark .inst-overdue .inst-number    { background: rgba(220, 38, 38, 0.2); color: #fca5a5; }
.theme-dark .inst-due   { color: #cbd5e1; }
.theme-dark .inst-amount { color: #7dd3fc; }
.theme-dark .inst-paid-at { color: #86efac; }

.theme-dark .installment-creator   { background: rgba(59, 92, 168, 0.12); border-color: rgba(59, 92, 168, 0.3); }
.theme-dark .installment-creator h5 { color: #a5b4fc; }
.theme-dark .install-field label   { color: #94a3b8; }
.theme-dark .preview-text          { background: rgba(59, 92, 168, 0.2); color: #a5b4fc; }
.theme-dark .install-hint          { color: #64748b; }

/* Status badges de cobrança */
.theme-dark .billing-status-badge.Draft       { background: #1e293b; color: #64748b; }
.theme-dark .billing-status-badge.Issued      { background: rgba(133, 100, 4, 0.2); color: #fde68a; }
.theme-dark .billing-status-badge.Partial     { background: rgba(199, 80, 0, 0.2);  color: #fdba74; }
.theme-dark .billing-status-badge.Paid        { background: rgba(20, 108, 67, 0.2); color: #86efac; }
.theme-dark .billing-status-badge.Overdue     { background: rgba(132, 32, 41, 0.2); color: #fca5a5; }
.theme-dark .billing-status-badge.Installment { background: rgba(59, 92, 168, 0.2); color: #a5b4fc; }
.theme-dark .billing-status-badge.Cancelled   { background: #1e293b; color: #64748b; }

/* ================================================================
   MODAIS FINANCEIROS — ReceivePaymentModal / EditPaymentModal
   ================================================================ */
.theme-dark .modal-content {
    background: #1e293b;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.theme-dark .modal-header.success {
    background: rgba(22, 163, 74, 0.12);
    border-bottom-color: rgba(134, 239, 172, 0.3);
}
.theme-dark .modal-header.warning {
    background: rgba(245, 158, 11, 0.12);
    border-bottom-color: rgba(253, 230, 138, 0.3);
}
.theme-dark .modal-header.info {
    background: rgba(14, 165, 233, 0.12);
    border-bottom-color: rgba(186, 230, 253, 0.3);
}

.theme-dark .payment-info {
    background: rgba(46, 134, 171, 0.08);
    border-radius: 12px;
}
.theme-dark .payment-description { color: #94a3b8; }

.theme-dark .payment-method {
    border-color: #334155;
    background: transparent;
}
.theme-dark .payment-method:hover  { background: rgba(46, 134, 171, 0.08); border-color: #2E86AB; }
.theme-dark .payment-method.selected { background: rgba(46, 134, 171, 0.15); border-color: #2E86AB; }
.theme-dark .payment-method span   { color: #94a3b8; }

.theme-dark .installment-option {
    border-color: #334155;
    background: transparent;
}
.theme-dark .installment-option:hover   { background: rgba(46, 134, 171, 0.08); border-color: #2E86AB; }
.theme-dark .installment-option.selected { background: rgba(46, 134, 171, 0.15); border-color: #2E86AB; }
.theme-dark .installment-option .value  { color: #94a3b8; }

/* ================================================================
   FINANCEIRO GERAL — FinanceGeneralPage.razor.css
   ================================================================ */
.theme-dark .overview-card {
    background: #1e293b;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.theme-dark .card-title          { color: #94a3b8; }

.theme-dark .chart-container,
.theme-dark .transactions-container {
    background: #1e293b;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.theme-dark .transaction-item     { border-bottom-color: #334155; }
.theme-dark .transaction-description { color: #cbd5e1; }
.theme-dark .transaction-category    { color: #94a3b8; }

.theme-dark .report-card {
    background: #1e293b;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.theme-dark .report-title       { color: #cbd5e1; }
.theme-dark .report-description { color: #94a3b8; }

/* Filtros de período no financeiro geral */
.theme-dark .chart-filter {
    background: #142034;
    border-color: #334155;
    color: #cbd5e1;
}

/* ================================================================
   CONFIGURAÇÕES (Settings)
   ================================================================ */
.theme-dark .settings-nav {
    background: #1e293b;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.theme-dark .nav-title  { color: #64748b; }
.theme-dark .nav-item   { color: #94a3b8; }
.theme-dark .nav-item:hover {
    background: #142034;
    color: #2E86AB;
    border-left-color: #2E86AB;
}
.theme-dark .nav-item.active {
    background: rgba(46, 134, 171, 0.12);
    color: #2E86AB;
    border-left-color: #2E86AB;
}
.theme-dark .settings-content {
    background: #1e293b;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.theme-dark .section-header    { border-bottom-color: #334155; }
.theme-dark .section-description { color: #94a3b8; }
.theme-dark .slider            { background-color: #334155; }

/* ================================================================
   PRONTUÁRIO / CLÍNICO (ClinicalRecordsPage.razor.css)
   ================================================================ */
.theme-dark .patient-info {
    border-color: rgba(46, 134, 171, 0.2);
}
.theme-dark .vital-signs { background: #142034; }
.theme-dark .patient-details h3 { color: #2E86AB; }
.theme-dark .patient-details p  { color: #94a3b8; }

.theme-dark .allergy-type{
    background: rgba(211, 47, 47, 0.12);
    color: #fca5a5;
    border-color: rgba(211, 47, 47, 0.3);
}

.theme-dark .allergen-suggestion{
    background: rgba(211, 47, 47, 0.08);
    color: #fca5a5;
}

.theme-dark .allergen-suggestion:hover{
    background: rgba(211, 47, 47, 0.15);
    color: #fca5a5;
}

.theme-dark .severity-level{
    background: rgba(211, 47, 47, 0.05);    
    color: #fca5a5;
}
.theme-dark .severity-level .selected{
    background: rgba(211, 47, 47, 0.15);
    color: #fca5a5;
}

.theme-dark .prontuario-main {
    background: #1e293b;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.theme-dark .prontuario-tabs    { background: #142034; border-bottom-color: #334155; }
.theme-dark .tab-btn            { color: #94a3b8; background: none; }
.theme-dark .tab-btn.active     { background: #1e293b; color: #2E86AB; border-bottom-color: #2E86AB; }

.theme-dark .vital-sign         { background: #142034; }

.theme-dark .allergy-item       { background: rgba(211, 47, 47, 0.12); color: #fca5a5; }
.theme-dark .medication-item    { background: rgba(46, 125, 50, 0.12); color: #86efac; }
.theme-dark .medication-item.Discontinued { background: rgba(30, 41, 59, 0.4); color: #64748b; }

.theme-dark .history-item       { border-bottom-color: #334155; }
.theme-dark .history-date       { color: #94a3b8; }
.theme-dark .history-type       { color: #cbd5e1; }
.theme-dark .patient-info-bar   { border-bottom-color: #334155; }

.theme-dark .session-timer {
    background: #1e293b;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
}
.theme-dark .timer-label { color: #94a3b8; }

/* QA Card */
.theme-dark .qa-card            { background: #1e293b; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); }
.theme-dark .qa-header          { border-bottom-color: #334155; color: #94a3b8; }
.theme-dark .qa-section-label   { color: #475569; }
.theme-dark .qa-divider         { background: linear-gradient(to right, transparent, #334155 20%, #334155 80%, transparent); }
.theme-dark .qa-btn--doc        { background: rgba(26, 95, 122, 0.2); color: #7dd3fc; border-color: rgba(46, 134, 171, 0.3); }
.theme-dark .qa-btn--doc:hover  { background: rgba(26, 95, 122, 0.3); border-color: #2E86AB; }
.theme-dark .qa-btn--stock      { background: rgba(146, 64, 14, 0.15); color: #fde68a; border-color: rgba(245, 158, 11, 0.3); }
.theme-dark .qa-btn--schedule   { background: rgba(22, 101, 52, 0.15); color: #86efac; border-color: rgba(74, 222, 128, 0.3); }

/* ================================================================
   TOAST (CustomToast.razor.css + ToastNotification.razor.css)
   ================================================================ */
.theme-dark .custom-toast {
    background: #1e293b;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.theme-dark .toast-title          { color: #f1f5f9; }
.theme-dark .toast-message        { color: #94a3b8; }
.theme-dark .toast-time           { color: #475569; }
.theme-dark .toast-close          { color: #64748b; }
.theme-dark .toast-close:hover    { background: #334155; color: #94a3b8; }
.theme-dark .toast-icon-container { background-color: rgba(74, 144, 226, 0.08); }

/* ToastNotification.razor.css */
.theme-dark .toast {
    background: #1e293b;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.theme-dark .toast-action {
    border-color: #334155;
    color: #7dd3fc;
}
.theme-dark .toast-action:hover {
    background: #2E86AB;
    color: white;
    border-color: #2E86AB;
}

/* ================================================================
   SEARCH BOX (ProfessionalSearchBox.razor.css)
   ================================================================ */
.theme-dark .search-professional input {
    background: #142034;
    border-color: #334155;
    color: #cbd5e1;
}

/* ================================================================
   PRODUTO MODAL — ProductModal.razor.css
   "Item Faturável" checkbox
   ================================================================ */
/* .theme-dark .checkbox-group {
    background: #142034;
    border-color: #334155;
}
.theme-dark .checkbox-group:hover {
    background: rgba(124, 58, 237, 0.1);
    border-color: #7c3aed;
} */

/* ================================================================
   COLABORADOR MODAL — ProfessionalModal.razor.css
   ================================================================ */
.theme-dark .progress-bar-container { background: #334155; }
.theme-dark .progress-label         { color: #94a3b8; }

.theme-dark .photo-preview {
    background: #142034;
    border-color: #334155;
}
.theme-dark .photo-placeholder { color: #475569; }

.theme-dark .checkbox-item {
    border-color: #334155;
    background: transparent;
}
.theme-dark .checkbox-item:hover {
    border-color: #2E86AB;
    background: rgba(46, 134, 171, 0.08);
}
.theme-dark .checkbox-item.checked {
    border-color: #2E86AB;
    background: rgba(46, 134, 171, 0.12);
}
.theme-dark .schedule-day          { color: #94a3b8; }
.theme-dark .schedule-input {
    background: #142034;
    border-color: #334155;
    color: #cbd5e1;
}

/* section-title-modal border no ProfessionalModal */
.theme-dark .section-title-modal {
    border-bottom-color: #334155;
}

/* SectionSecurity — selected professional card */
.theme-dark .selected-professional-card {
    background: linear-gradient(135deg, rgba(46, 134, 171, 0.12), rgba(40, 167, 69, 0.08));
    border-color: rgba(46, 134, 171, 0.3);
}
.theme-dark .selected-name  { color: #f1f5f9; }
.theme-dark .selected-role  { color: #7dd3fc; }
.theme-dark .selected-email { color: #94a3b8; }

.theme-dark .password-section {
    background: #1e293b;
    border-color: rgba(46, 134, 171, 0.25);
}

.theme-dark .search-state {
    background: #142034;
    border-color: #334155;
}
.theme-dark .search-state-title { color: #cbd5e1; }
.theme-dark .search-state-desc  { color: #94a3b8; }
.theme-dark .search-state-icon  {
    background: rgba(46, 134, 171, 0.1);
}

.theme-dark .checkbox-row {
    background: #142034;
    border-color: #334155;
}
.theme-dark .checkbox-title { color: #cbd5e1; }
.theme-dark .checkbox-desc  { color: #64748b; }

.theme-dark .section-badge {
    background: rgba(133, 100, 4, 0.2);
    color: #fde68a;
    border-color: rgba(133, 100, 4, 0.3);
}

.theme-dark .setting-item     { border-bottom-color: #334155; }
.theme-dark .setting-name     { color: #cbd5e1; }
.theme-dark .setting-desc     { color: #94a3b8; }

/* ================================================================
   SECTION USER MANAGER — SectionUserManager.razor.css
   Cards de usuário sem dark mode
   ================================================================ */
.theme-dark .user-card {
    background: #1a2439;
    border: 1px solid #334155;
    border-radius: 12px;
}
.theme-dark .user-info .user-name  { color: #f1f5f9; }
.theme-dark .user-info .user-role  { color: #94a3b8; }
.theme-dark .user-actions          { gap: 10px; }

/* ================================================================
   SECTION VISIT TEMPLATES — SectionVisitTemplates.razor.css
   Cards de template sem dark mode
   ================================================================ */
.theme-dark .tpl-stat {
    background: #142034;
    border-color: #334155;
    color: #94a3b8;
}
.theme-dark .tpl-stat--active {
    background: rgba(21, 87, 36, 0.2);
    border-color: rgba(21, 87, 36, 0.35);
    color: #86efac;
}

.theme-dark .tpl-empty-icon  { background: rgba(46, 134, 171, 0.12); }
.theme-dark .tpl-empty-title { color: #cbd5e1; }
.theme-dark .tpl-empty-sub   { color: #64748b; }

.theme-dark .tpl-group-header  { border-bottom-color: #334155; }
.theme-dark .tpl-group-label   { color: #94a3b8; }
.theme-dark .tpl-group-icon    { background: rgba(46, 134, 171, 0.12); }
.theme-dark .tpl-group-count   { background: #334155; color: #94a3b8; }

.theme-dark .tpl-card {
    background: #1e293b;
    border-color: #334155;
}
.theme-dark .tpl-card:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    border-color: #475569;
}
.theme-dark .tpl-card--active   { border-left-color: #86efac; }
.theme-dark .tpl-card--inactive { border-left-color: #334155; }

.theme-dark .tpl-card-name { color: #f1f5f9; }

.theme-dark .tpl-field-chip {
    background: rgba(51, 103, 214, 0.15);
    color: #93c5fd;
}
.theme-dark .tpl-field-chip--med {
    background: rgba(230, 81, 0, 0.15);
    color: #fdba74;
}
.theme-dark .tpl-field-chip--off {
    background: #1e293b;
    color: #64748b;
}

.theme-dark .tpl-dot--on  { color: #86efac; }
.theme-dark .tpl-dot--off { color: #334155; }

.theme-dark .tpl-action-btn--edit:hover {
    background: #334155;
    border-color: #475569;
}
.theme-dark .tpl-action-btn--delete:hover {
    background: rgba(220, 38, 38, 0.15);
    border-color: rgba(220, 38, 38, 0.3);
}

/* ================================================================
   VISIT TEMPLATE MODAL — VisitTemplateModal.razor.css
   Prescrição Padrão sem dark mode
   ================================================================ */
.theme-dark .tpl-med-form {
    background: #1a2439;
    border-color: #334155;
}
.theme-dark .tpl-med-row {
    background: #1e293b;
    border-color: #334155;
}
.theme-dark .tpl-med-row:hover { box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3); }

.theme-dark .tpl-med-name        { color: #f1f5f9; }
.theme-dark .tpl-med-chip        { background: #142034; color: #94a3b8; }
.theme-dark .tpl-med-empty       { color: #64748b; }

.theme-dark .tpl-slider          { background: #334155; }
.theme-dark .tpl-switch-label    { color: #64748b; }
.theme-dark .tpl-switch-label--on { color: #86efac; }
.theme-dark .tpl-hint            { color: #475569; }

.theme-dark .tpl-add-med-btn:disabled { background: #334155; }

/* ================================================================
   PRESCRIÇÃO MODAL — PrescriptionModal.razor.css
   ================================================================ */
.theme-dark .rx-chips-label { color: #94a3b8; }

.theme-dark .rx-chip {
    background: rgba(46, 134, 171, 0.15);
    color: #7dd3fc;
    border-color: rgba(46, 134, 171, 0.3);
}
.theme-dark .rx-chip:hover,
.theme-dark .rx-chip--on {
    background: #2E86AB;
    color: white;
    border-color: #2E86AB;
}

.theme-dark .rx-item-list { border-color: #334155; }
.theme-dark .rx-item {
    background: #1e293b;
    border-bottom-color: #334155;
}
.theme-dark .rx-item:hover  { background: #243044; }
.theme-dark .rx-item-name   { color: #f1f5f9; }
.theme-dark .rx-item-conc   { color: #94a3b8; }
.theme-dark .rx-item-posology { color: #94a3b8; }

.theme-dark .rx-item-remove {
    background: rgba(198, 40, 40, 0.15);
    color: #fca5a5;
}
.theme-dark .rx-item-remove:hover { background: rgba(198, 40, 40, 0.25); }

.theme-dark .rx-empty {
    background: rgba(21, 101, 192, 0.1);
    border-color: rgba(144, 202, 249, 0.3);
    color: #93c5fd;
}
.theme-dark .rx-empty-sub  { color: #60a5fa; }

.theme-dark .rx-count { background: #2E86AB; color: white; }

.theme-dark .rx-btn-add {
    background: #2E86AB;
    border-color: rgba(46, 134, 171, 0.4);
    box-shadow: 0 4px 12px rgba(46, 134, 171, 0.2);
}
.theme-dark .rx-btn-add:hover:not(:disabled) {
    background: #247697;
    box-shadow: 0 6px 16px rgba(46, 134, 171, 0.3);
}
.theme-dark .rx-btn-add:disabled { background: #334155; }

.theme-dark .btn-outline-primary {
    background: transparent;
    color: #7dd3fc;
    border-color: rgba(46, 134, 171, 0.5);
}
.theme-dark .btn-outline-primary:hover {
    background: rgba(46, 134, 171, 0.12);
}

/* ================================================================
   PRESCRIÇÕES / ATESTADOS — PrescriptionsContentTab.razor.css
   ================================================================ */

/* ── Seção ── */
.theme-dark .cert-section-header { border-top-color: #334155; }

/* ── Estado vazio ── */
.theme-dark .pres-empty {
    background: #0f172a;
    border-color: #334155;
}
.theme-dark .pres-empty-icon  { color: #475569; }
.theme-dark .pres-empty-title { color: #94a3b8; }
.theme-dark .pres-empty-sub   { color: #64748b; }

/* ── Card base (prescrição e atestado) ── */
.theme-dark .pres-card {
    background: #1e293b;
    border-color: #334155;
}
.theme-dark .pres-card:hover    { box-shadow: 0 4px 18px rgba(0,0,0,0.35); }
.theme-dark .pres-card--unsaved {
    border-color: #2E86AB;
    box-shadow: 0 0 0 3px rgba(46,134,171,0.2) !important;
}

/* ── Cabeçalho do card (prescrição — azul) ── */
.theme-dark .pres-card-head {
    background: linear-gradient(135deg, #0f172a, #152032);
    border-bottom-color: #334155;
}
.theme-dark .pres-card-num     { color: #7dd3fc; }
.theme-dark .pres-card-date    { color: #94a3b8; }
.theme-dark .pres-card-date::before { color: #475569; }

/* ── Cabeçalho do card (atestado — roxo) ── */
.theme-dark .cert-card .cert-card-head {
    background: linear-gradient(135deg, #1a0f2e, #1e1533);
    border-bottom-color: rgba(123,31,162,0.3);
}
.theme-dark .cert-card--unsaved {
    border-color: #7B1FA2 !important;
    box-shadow: 0 0 0 3px rgba(123,31,162,0.2) !important;
}
.theme-dark .cert-num { color: #c4b5fd; }

/* ── Badges da prescrição ── */
.theme-dark .pres-validity--active {
    background: rgba(46,125,50,0.2);
    color: #86efac;
}
.theme-dark .pres-validity--expired {
    background: rgba(198,40,40,0.2);
    color: #fca5a5;
}
.theme-dark .pres-unsaved-badge {
    background: rgba(230,81,0,0.15);
    color: #fdba74;
    border-color: rgba(230,81,0,0.3);
}

/* ── Badges do atestado ── */
.theme-dark .cert-days-badge {
    background: rgba(106,27,154,0.2);
    color: #c4b5fd;
}
.theme-dark .cert-cid-badge {
    background: rgba(69,39,160,0.2);
    color: #a5b4fc;
}

/* ── Botões de ação ── */
.theme-dark .pres-btn--edit {
    background: rgba(230,81,0,0.15);
    color: #fdba74;
    border-color: rgba(230,81,0,0.3);
}
.theme-dark .pres-btn--edit:hover   { background: rgba(230,81,0,0.25); }

.theme-dark .pres-btn--print {
    background: rgba(26,110,150,0.18);
    color: #7dd3fc;
    border-color: rgba(46,134,171,0.3);
}
.theme-dark .pres-btn--print:hover  { background: rgba(26,110,150,0.28); }

.theme-dark .pres-btn--remove {
    background: rgba(198,40,40,0.15);
    color: #fca5a5;
    border-color: rgba(198,40,40,0.3);
}
.theme-dark .pres-btn--remove:hover { background: rgba(198,40,40,0.25); }

/* ── Lista de medicamentos ── */
.theme-dark .pres-med-name { color: #f1f5f9; }
.theme-dark .pres-med-row:not(:last-child) { border-bottom-color: #334155; }

.theme-dark .pres-tag--dose { background: rgba(21,101,192,0.18);  color: #93c5fd; }
.theme-dark .pres-tag--freq { background: rgba(27,94,32,0.2);     color: #86efac; }
.theme-dark .pres-tag--dur  { background: rgba(230,81,0,0.15);    color: #fdba74; }
.theme-dark .pres-tag--qty  { background: rgba(106,27,154,0.2);   color: #c4b5fd; }

/* ── Rodapé de orientações (prescrição — amarelo) ── */
.theme-dark .pres-instructions {
    background: rgba(249,168,37,0.08);
    border-top-color: rgba(249,168,37,0.2);
}
.theme-dark .pres-instructions-label { color: #d4a96a; }
.theme-dark .pres-instructions-text  { color: #c8a876; }

/* ── Corpo do atestado ── */
.theme-dark .cert-period-row    { color: #cbd5e1; }
.theme-dark .cert-period-label  { color: #c4b5fd; }
.theme-dark .cert-period-value  { color: #f1f5f9; }
.theme-dark .cert-detail-row    { border-top-color: #334155; }
.theme-dark .cert-detail-label  { color: #c4b5fd; }
.theme-dark .cert-detail-text   { color: #cbd5e1; }

/* ── Rodapé de observações do atestado (roxo) ── */
.theme-dark .cert-obs-footer {
    background: rgba(123,31,162,0.1);
    border-top-color: rgba(123,31,162,0.25);
}
.theme-dark .cert-obs-label { color: #c4b5fd; }
.theme-dark .cert-obs-text  { color: #a78bfa; }

/* ================================================================
   ALERGIA MODAL — AllergyModal.razor.css
   ================================================================ */
.theme-dark .allergy-type {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}
.theme-dark .allergy-type:hover {
    border-color: #fca5a5;
    background: rgba(220, 53, 69, 0.1);
}
.theme-dark .allergy-type.selected {
    border-color: #dc2626;
    background: rgba(220, 53, 69, 0.15);
}
.theme-dark .allergy-type-icon { color: #fca5a5; }

.theme-dark .severity-level {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}
.theme-dark .severity-level:hover { border-color: #fca5a5; background: rgba(220,53,69,0.08); }

.theme-dark .severity-mild           { border-color: #d97706; color: #fde68a; }
.theme-dark .severity-mild.selected  { background: rgba(217,119,6,0.15); border-color: #d97706; }
.theme-dark .severity-moderate           { border-color: #ea580c; color: #fdba74; }
.theme-dark .severity-moderate.selected  { background: rgba(234,88,12,0.15); border-color: #ea580c; }
.theme-dark .severity-severe             { border-color: #dc2626; color: #fca5a5; }
.theme-dark .severity-severe.selected    { background: rgba(220,38,38,0.15); border-color: #dc2626; }

.theme-dark .symptom-tag             { background: #1e293b; color: #94a3b8; }
.theme-dark .symptom-tag:hover,
.theme-dark .symptom-tag.active      { background: #dc2626; color: white; }

.theme-dark .allergen-suggestion {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}
.theme-dark .allergen-suggestion:hover { background: #1e293b; border-color: #475569; }

.theme-dark .alert-warning { background: rgba(133,100,4,0.15); color: #fde68a; border-color: rgba(133,100,4,0.3); }
.theme-dark .alert-danger  { background: rgba(114,28,36,0.15); color: #fca5a5; border-color: rgba(114,28,36,0.3); }
.theme-dark .allergy-summary { color: #94a3b8; }

/* ================================================================
   MEDICAÇÃO MODAL — MedicationModal.razor.css
   ================================================================ */
.theme-dark .status-option {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}
.theme-dark .status-active              { border-color: #22c55e; color: #86efac; }
.theme-dark .status-active.selected     { background: rgba(34,197,94,0.12); border-color: #22c55e; }
.theme-dark .status-paused              { border-color: #eab308; color: #fde68a; }
.theme-dark .status-paused.selected     { background: rgba(234,179,8,0.12); border-color: #eab308; }
.theme-dark .status-discontinued        { border-color: #dc2626; color: #fca5a5; }
.theme-dark .status-discontinued.selected { background: rgba(220,38,38,0.12); border-color: #dc2626; }

.theme-dark .frequency-preset          { background: #1e293b; color: #94a3b8; border: 1px solid #334155; }
.theme-dark .frequency-preset:hover,
.theme-dark .frequency-preset.active   { background: #0d9488; color: white; }

.theme-dark .indication-tag            { background: #1e293b; color: #94a3b8; }
.theme-dark .indication-tag:hover,
.theme-dark .indication-tag.selected   { background: #0d9488; color: white; }

.theme-dark .alert-info { background: rgba(12,84,96,0.2); color: #67e8f9; border-color: rgba(12,84,96,0.35); }

.theme-dark .search-results {
    background: #1e293b;
    border-color: #334155;
}
.theme-dark .search-result-item  { border-bottom-color: #334155; color: #cbd5e1; }
.theme-dark .search-result-item:hover { background: #0f172a; }
.theme-dark .medication-name     { color: #7dd3fc; }
.theme-dark .medication-info     { color: #94a3b8; }
.theme-dark .medication-summary  { color: #94a3b8; }

/* ================================================================
   GENERIC / UTILITÁRIOS
   ================================================================ */
.theme-dark .summary-divider { background-color: #334155; }
.theme-dark .form-footer     { border-top-color: #334155; }
.theme-dark .footer-hint     { color: #475569; }

/* Scrollbar global no tema escuro */
.theme-dark *::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.12);
}
.theme-dark *::-webkit-scrollbar-track {
    background-color: transparent;
}
