/* ===== Manalia Super Brand Theme System ===== */

html[data-theme],
html[data-theme] body {
    background: var(--bg) !important;
    color: var(--text) !important;
}

html[data-theme] .content,
html[data-theme] .main,
html[data-theme] .page-body {
    background: transparent !important;
    color: var(--text) !important;
}

/* Surfaces */
html[data-theme] .panel,
html[data-theme] .topbar,
html[data-theme] .card,
html[data-theme] .stat-card,
html[data-theme] .mini-stat-card,
html[data-theme] .dashboard-card,
html[data-theme] .manager-kpi,
html[data-theme] .funnel-item,
html[data-theme] .ops-grid a,
html[data-theme] .manager-alert,
html[data-theme] .mini-row,
html[data-theme] .manager-empty,
html[data-theme] .reception-stat-card,
html[data-theme] .reception-card,
html[data-theme] .reception-money-mini,
html[data-theme] .reception-panel-metrics > div,
html[data-theme] .quick-patient,
html[data-theme] .service-row,
html[data-theme] .invoice-ux-card,
html[data-theme] .invoice-native-tabs,
html[data-theme] .invoice-native-tabs-head,
html[data-theme] .invoice-tabs-shell,
html[data-theme] .table-responsive,
html[data-theme] .table-wrapper,
html[data-theme] .table-wrap,
html[data-theme] .manalia-table-wrap,
html[data-theme] .filter-box,
html[data-theme] .filters-box,
html[data-theme] .search-box,
html[data-theme] .manalia-filter-box,
html[data-theme] .followups-filter-box,
html[data-theme] .discount-create-box,
html[data-theme] .discounts-filter-box,
html[data-theme] .activity-log-summary .mini-stat-card,
html[data-theme] .discounts-summary .mini-stat-card,
html[data-theme] .list-pagination-summary .mini-stat-card,
html[data-theme] .infinite-summary,
html[data-theme] .empty-soft,
html[data-theme] .help-card,
html[data-theme] .log-json-box,
html[data-theme] .modal-content,
html[data-theme] .dropdown-menu {
    background: var(--card) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

/* Soft cards */
html[data-theme] .stat-card,
html[data-theme] .mini-stat-card,
html[data-theme] .manager-kpi,
html[data-theme] .dashboard-kpi,
html[data-theme] [class*="stat-card-"] {
    background:
        radial-gradient(circle at 88% 82%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 30%),
        linear-gradient(135deg, var(--card), color-mix(in srgb, var(--card) 88%, var(--accent))) !important;
}

/* Text */
html[data-theme] h1,
html[data-theme] h2,
html[data-theme] h3,
html[data-theme] h4,
html[data-theme] h5,
html[data-theme] h6,
html[data-theme] strong,
html[data-theme] label,
html[data-theme] .panel-head h2,
html[data-theme] .stat-card strong,
html[data-theme] .mini-stat-card strong,
html[data-theme] .manager-kpi strong,
html[data-theme] .funnel-item strong {
    color: var(--text) !important;
}

html[data-theme] p,
html[data-theme] small,
html[data-theme] .text-muted,
html[data-theme] .muted,
html[data-theme] .panel-head p,
html[data-theme] .stat-card span,
html[data-theme] .mini-stat-card span,
html[data-theme] .manager-kpi span,
html[data-theme] .funnel-item span {
    color: var(--muted) !important;
}

/* Forms */
html[data-theme] .form-control,
html[data-theme] .form-select,
html[data-theme] input,
html[data-theme] select,
html[data-theme] textarea {
    background: color-mix(in srgb, var(--card) 88%, var(--bg)) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

html[data-theme] .form-control::placeholder,
html[data-theme] input::placeholder,
html[data-theme] textarea::placeholder {
    color: var(--muted) !important;
    opacity: .9;
}

/* Tables */
html[data-theme] table,
html[data-theme] .table {
    --bs-table-bg: transparent !important;
    --bs-table-color: var(--text) !important;
    --bs-table-border-color: var(--border) !important;
    color: var(--text) !important;
}

html[data-theme] table th,
html[data-theme] table td,
html[data-theme] .table th,
html[data-theme] .table td {
    background: transparent !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

html[data-theme] table thead th,
html[data-theme] .table thead th {
    background: color-mix(in srgb, var(--card) 82%, var(--bg)) !important;
    color: var(--text) !important;
}

/* Buttons and Bootstrap utility colors */
html[data-theme] .btn-primary {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
}

html[data-theme] .btn-light,
html[data-theme] .btn-outline-dark,
html[data-theme] .bg-light,
html[data-theme] .badge.bg-light {
    background: color-mix(in srgb, var(--card) 82%, var(--bg)) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

html[data-theme] .text-dark {
    color: var(--text) !important;
}

/* Tabs */
html[data-theme] .invoice-native-tabs-nav button,
html[data-theme] .invoice-tab-btn,
html[data-theme] .live-tab-btn,
html[data-theme] .reception-more-actions summary,
html[data-theme] .reception-more-actions > div {
    background: color-mix(in srgb, var(--card) 86%, var(--bg)) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

html[data-theme] .invoice-native-tabs-nav button.active,
html[data-theme] .invoice-tab-btn.active,
html[data-theme] .live-tab-btn.active,
html[data-theme] .nav-menu a.active {
    background: var(--sidebar-active-bg) !important;
    color: var(--sidebar-active-text) !important;
    border-color: var(--sidebar-active-bg) !important;
}

/* Select2 */
html[data-theme] .select2-container--default .select2-selection--single,
html[data-theme] .select2-container--default .select2-selection--multiple,
html[data-theme] .select2-dropdown {
    background: color-mix(in srgb, var(--card) 92%, var(--bg)) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

html[data-theme] .select2-container--default .select2-selection__rendered,
html[data-theme] .select2-results__option {
    color: var(--text) !important;
}

/* Sidebar */
html[data-theme] .sidebar {
    background: var(--sidebar-bg) !important;
    color: var(--sidebar-text) !important;
}

html[data-theme] .sidebar .brand-box,
html[data-theme] .sidebar .nav-group,
html[data-theme] .sidebar .nav-group summary {
    background: var(--sidebar-group-bg) !important;
    color: var(--sidebar-text) !important;
    border-color: var(--border) !important;
}

html[data-theme] .sidebar a,
html[data-theme] .sidebar span,
html[data-theme] .sidebar small,
html[data-theme] .sidebar strong {
    color: var(--sidebar-text) !important;
}

/* Global search */
html[data-theme] .global-search-box {
    background: color-mix(in srgb, var(--card) 92%, var(--bg)) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

html[data-theme] .global-search-box input {
    background: transparent !important;
    color: var(--text) !important;
}

html[data-theme] .global-search-box input::placeholder {
    color: var(--muted) !important;
    opacity: .95;
}

html[data-theme] .global-search-box i {
    color: var(--accent) !important;
}

html[data-theme] .global-search-results {
    background: var(--card) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

/* Decorative overlays */
html[data-theme="dark"] .stat-card::before,
html[data-theme="dark"] .stat-card::after {
    opacity: .12 !important;
}

/* ===== Hospital Admin Full Dark Theme v0.6.32 ===== */

html[data-theme="dark"],
html[data-theme="dark"] body {
    color-scheme: dark;
    background:
        radial-gradient(circle at 18% 8%, rgba(56, 189, 248, .10), transparent 30%),
        radial-gradient(circle at 82% 18%, rgba(52, 211, 153, .08), transparent 28%),
        linear-gradient(180deg, #070B13 0%, #0A1020 100%) !important;
    color: var(--text) !important;
}

html[data-theme="dark"] .app-shell,
html[data-theme="dark"] .content,
html[data-theme="dark"] main,
html[data-theme="dark"] .page-body {
    background: transparent !important;
    color: var(--text) !important;
}

/* Main surfaces */
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .card,
html[data-theme="dark"] .super-brand-panel,
html[data-theme="dark"] .settings-card,
html[data-theme="dark"] .setting-card,
html[data-theme="dark"] .form-section,
html[data-theme="dark"] .table-responsive,
html[data-theme="dark"] .table-wrapper,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .manalia-table-wrap,
html[data-theme="dark"] .filter-box,
html[data-theme="dark"] .filters-box,
html[data-theme="dark"] .manalia-filter-box,
html[data-theme="dark"] .discount-create-box,
html[data-theme="dark"] .discounts-filter-box,
html[data-theme="dark"] .followups-filter-box,
html[data-theme="dark"] .invoice-ux-card,
html[data-theme="dark"] .invoice-native-tabs,
html[data-theme="dark"] .invoice-tabs-shell,
html[data-theme="dark"] .reception-card,
html[data-theme="dark"] .reception-stat-card,
html[data-theme="dark"] .reception-money-mini,
html[data-theme="dark"] .quick-patient,
html[data-theme="dark"] .service-row,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] fieldset {
    background: #0F172A !important;
    color: #EAF2FF !important;
    border-color: #1E293B !important;
    box-shadow: 0 22px 70px rgba(0, 0, 0, .32) !important;
}

/* nested brand/settings cards */
html[data-theme="dark"] .brand-settings-form > div,
html[data-theme="dark"] .brand-settings-form .row,
html[data-theme="dark"] .brand-settings-form .col,
html[data-theme="dark"] .brand-settings-form [class*="col-"],
html[data-theme="dark"] .brand-settings-form .form-group,
html[data-theme="dark"] .brand-settings-form .mb-3,
html[data-theme="dark"] .brand-settings-form .mb-4,
html[data-theme="dark"] .super-brand-panel > div {
    background: transparent !important;
    color: #EAF2FF !important;
    border-color: #1E293B !important;
}

/* Cards with soft medical gradient */
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .mini-stat-card,
html[data-theme="dark"] .manager-kpi,
html[data-theme="dark"] .dashboard-kpi,
html[data-theme="dark"] [class*="stat-card-"] {
    background:
        radial-gradient(circle at 88% 78%, rgba(52, 211, 153, .12), transparent 30%),
        linear-gradient(135deg, #0F172A 0%, #111C2F 100%) !important;
    color: #EAF2FF !important;
    border-color: #1E293B !important;
    box-shadow: 0 22px 70px rgba(0, 0, 0, .30) !important;
}

/* Typography */
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] label,
html[data-theme="dark"] strong,
html[data-theme="dark"] .panel-head h2,
html[data-theme="dark"] .super-brand-panel h2,
html[data-theme="dark"] .super-brand-panel h3 {
    color: #EAF2FF !important;
    opacity: 1 !important;
}

html[data-theme="dark"] p,
html[data-theme="dark"] small,
html[data-theme="dark"] span,
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .muted,
html[data-theme="dark"] .panel-head p,
html[data-theme="dark"] .stat-card span,
html[data-theme="dark"] .mini-stat-card span {
    color: #94A3B8 !important;
}

/* Inputs */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select {
    background: #111C2F !important;
    color: #EAF2FF !important;
    border-color: #243449 !important;
    box-shadow: none !important;
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus {
    border-color: #38BDF8 !important;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, .16) !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #64748B !important;
    opacity: .95 !important;
}

/* Color inputs: visible swatches */
html[data-theme="dark"] input[type="color"] {
    background: #111C2F !important;
    border-color: #243449 !important;
    min-height: 42px !important;
    padding: 4px !important;
}

/* File inputs */
html[data-theme="dark"] input[type="file"]::file-selector-button {
    background: #1E293B !important;
    color: #EAF2FF !important;
    border: 0 !important;
    border-inline-end: 1px solid #243449 !important;
}

/* Buttons */
html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .btn-success {
    background: linear-gradient(135deg, #38BDF8, #34D399) !important;
    border-color: transparent !important;
    color: #06121F !important;
    font-weight: 900 !important;
}

html[data-theme="dark"] .btn-light,
html[data-theme="dark"] .btn-outline-dark,
html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .badge.bg-light {
    background: #111C2F !important;
    color: #EAF2FF !important;
    border-color: #243449 !important;
}

/* Sidebar */
html[data-theme="dark"] .sidebar {
    background: #08111F !important;
    border-color: #1E293B !important;
    color: #DCEBFF !important;
    box-shadow: 0 26px 80px rgba(0, 0, 0, .42) !important;
}

html[data-theme="dark"] .sidebar .brand-box,
html[data-theme="dark"] .sidebar .nav-group,
html[data-theme="dark"] .sidebar .nav-group summary {
    background: #111C2F !important;
    color: #DCEBFF !important;
    border-color: #243449 !important;
}

html[data-theme="dark"] .sidebar a,
html[data-theme="dark"] .sidebar span,
html[data-theme="dark"] .sidebar small,
html[data-theme="dark"] .sidebar strong {
    color: #DCEBFF !important;
}

html[data-theme="dark"] .sidebar a.active,
html[data-theme="dark"] .sidebar .nav-menu a.active {
    background: linear-gradient(135deg, #38BDF8, #34D399) !important;
    color: #06121F !important;
}

/* Tables */
html[data-theme="dark"] table,
html[data-theme="dark"] .table {
    --bs-table-bg: transparent !important;
    --bs-table-color: #EAF2FF !important;
    --bs-table-border-color: #1E293B !important;
    color: #EAF2FF !important;
}

html[data-theme="dark"] table th,
html[data-theme="dark"] table td,
html[data-theme="dark"] .table th,
html[data-theme="dark"] .table td {
    background: transparent !important;
    color: #EAF2FF !important;
    border-color: #1E293B !important;
}

html[data-theme="dark"] table thead th,
html[data-theme="dark"] .table thead th {
    background: #111C2F !important;
    color: #EAF2FF !important;
}

/* Select2 */
html[data-theme="dark"] .select2-container--default .select2-selection--single,
html[data-theme="dark"] .select2-container--default .select2-selection--multiple,
html[data-theme="dark"] .select2-dropdown {
    background: #111C2F !important;
    color: #EAF2FF !important;
    border-color: #243449 !important;
}

html[data-theme="dark"] .select2-container--default .select2-selection__rendered,
html[data-theme="dark"] .select2-results__option {
    color: #EAF2FF !important;
}

html[data-theme="dark"] .select2-results__option--highlighted {
    background: linear-gradient(135deg, #38BDF8, #34D399) !important;
    color: #06121F !important;
}

/* Global search */
html[data-theme="dark"] .global-search-box {
    background: #111C2F !important;
    border-color: #243449 !important;
}

html[data-theme="dark"] .global-search-box input {
    background: transparent !important;
    color: #EAF2FF !important;
}

html[data-theme="dark"] .global-search-box input::placeholder {
    color: #94A3B8 !important;
}

/* kill hardcoded white utility blocks */
html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .white,
html[data-theme="dark"] [style*="background:#fff"],
html[data-theme="dark"] [style*="background: #fff"],
html[data-theme="dark"] [style*="background-color:#fff"],
html[data-theme="dark"] [style*="background-color: #fff"] {
    background: #0F172A !important;
    color: #EAF2FF !important;
}


/* ===== v0.6.33 UI consistency polish ===== */

/* 1) Queue button: match project buttons instead of random blue outline */
html[data-theme] a[href*="queue"],
html[data-theme] .queue-btn,
html[data-theme] .btn-queue,
html[data-theme] .dashboard-queue-btn,
html[data-theme] .manager-dashboard a.btn-outline-primary,
html[data-theme] .manager-dashboard .btn-outline-primary {
    background: color-mix(in srgb, var(--card) 88%, var(--bg)) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    box-shadow: none !important;
}

html[data-theme] a[href*="queue"]:hover,
html[data-theme] .queue-btn:hover,
html[data-theme] .btn-queue:hover,
html[data-theme] .dashboard-queue-btn:hover,
html[data-theme] .manager-dashboard a.btn-outline-primary:hover,
html[data-theme] .manager-dashboard .btn-outline-primary:hover {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: var(--sidebar-active-text, #06121F) !important;
}

/* 2) Dashboard hero: reduce heavy gradient, make it a premium card surface */
html[data-theme] .manager-dashboard .manager-hero,
html[data-theme] .manager-hero {
    background:
        radial-gradient(circle at 12% 18%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 28%),
        linear-gradient(135deg, color-mix(in srgb, var(--card) 92%, var(--primary)), color-mix(in srgb, var(--card) 84%, var(--accent))) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    box-shadow: 0 22px 60px color-mix(in srgb, var(--text) 14%, transparent) !important;
}

html[data-theme="dark"] .manager-dashboard .manager-hero,
html[data-theme="dark"] .manager-hero {
    background:
        radial-gradient(circle at 10% 16%, rgba(56, 189, 248, .10), transparent 30%),
        radial-gradient(circle at 88% 20%, rgba(52, 211, 153, .10), transparent 30%),
        linear-gradient(135deg, #0F172A 0%, #111C2F 100%) !important;
    border-color: #1E293B !important;
    color: #EAF2FF !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .30) !important;
}

html[data-theme="dark"] .manager-dashboard .manager-hero h1,
html[data-theme="dark"] .manager-dashboard .manager-hero h2,
html[data-theme="dark"] .manager-dashboard .manager-hero h3,
html[data-theme="dark"] .manager-hero h1,
html[data-theme="dark"] .manager-hero h2,
html[data-theme="dark"] .manager-hero h3 {
    color: #EAF2FF !important;
}

html[data-theme="dark"] .manager-dashboard .manager-hero p,
html[data-theme="dark"] .manager-dashboard .manager-hero small,
html[data-theme="dark"] .manager-hero p,
html[data-theme="dark"] .manager-hero small {
    color: #94A3B8 !important;
}

html[data-theme="dark"] .manager-dashboard .manager-hero .btn,
html[data-theme="dark"] .manager-hero .btn {
    background: #111C2F !important;
    color: #EAF2FF !important;
    border-color: #243449 !important;
}

html[data-theme="dark"] .manager-dashboard .manager-hero .btn:hover,
html[data-theme="dark"] .manager-hero .btn:hover {
    background: linear-gradient(135deg, #38BDF8, #34D399) !important;
    color: #06121F !important;
    border-color: transparent !important;
}

/* 3) Super Brand sections: proper surface in both modes */
html[data-theme] .brand-section {
    border: 1px solid var(--border) !important;
    background: color-mix(in srgb, var(--card) 94%, var(--bg)) !important;
    color: var(--text) !important;
    border-radius: 22px !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .brand-section {
    background: #0F172A !important;
    border-color: #1E293B !important;
    color: #EAF2FF !important;
    box-shadow: 0 18px 54px rgba(0,0,0,.22) !important;
}

html[data-theme="dark"] .brand-section h1,
html[data-theme="dark"] .brand-section h2,
html[data-theme="dark"] .brand-section h3,
html[data-theme="dark"] .brand-section h4,
html[data-theme="dark"] .brand-section label,
html[data-theme="dark"] .brand-section strong {
    color: #EAF2FF !important;
    opacity: 1 !important;
}

html[data-theme="dark"] .brand-section p,
html[data-theme="dark"] .brand-section small,
html[data-theme="dark"] .brand-section span,
html[data-theme="dark"] .brand-section .text-muted {
    color: #94A3B8 !important;
}

/* Super Brand color cards inside brand sections */
html[data-theme] .brand-section .color-card,
html[data-theme] .brand-section .brand-color-card,
html[data-theme] .brand-section .brand-color-item,
html[data-theme] .brand-section .form-control,
html[data-theme] .brand-section .form-select {
    border-color: var(--border) !important;
}

html[data-theme="dark"] .brand-section .color-card,
html[data-theme="dark"] .brand-section .brand-color-card,
html[data-theme="dark"] .brand-section .brand-color-item {
    background: #111C2F !important;
    border-color: #243449 !important;
    color: #EAF2FF !important;
}

html[data-theme="dark"] .brand-section input,
html[data-theme="dark"] .brand-section select,
html[data-theme="dark"] .brand-section textarea,
html[data-theme="dark"] .brand-section .form-control,
html[data-theme="dark"] .brand-section .form-select {
    background: #111C2F !important;
    color: #EAF2FF !important;
    border-color: #243449 !important;
}

html[data-theme="dark"] .brand-section input[type="color"] {
    background: #111C2F !important;
    border-color: #243449 !important;
}

/* Prevent light cards from leaking inside settings/super-brand */
html[data-theme="dark"] .super-brand-panel .brand-section,
html[data-theme="dark"] .super-brand-panel .panel,
html[data-theme="dark"] .super-brand-panel .card {
    background: #0F172A !important;
    border-color: #1E293B !important;
    color: #EAF2FF !important;
}


/* ===== v0.6.34 Select2 dark text contrast fix ===== */
html[data-theme="dark"] .select2-container,
html[data-theme="dark"] .select2-container * {
    color: #EAF2FF !important;
}

html[data-theme="dark"] .select2-container--default .select2-selection--single,
html[data-theme="dark"] .select2-container--default .select2-selection--multiple {
    background: #111C2F !important;
    border-color: #243449 !important;
    color: #EAF2FF !important;
}

html[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered,
html[data-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__rendered,
html[data-theme="dark"] .select2-container--default .select2-selection__placeholder {
    color: #EAF2FF !important;
    opacity: 1 !important;
}

html[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #94A3B8 transparent transparent transparent !important;
}

html[data-theme="dark"] .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #94A3B8 transparent !important;
}

html[data-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: #1E293B !important;
    border-color: #243449 !important;
    color: #EAF2FF !important;
}

html[data-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #94A3B8 !important;
}

html[data-theme="dark"] .select2-dropdown,
html[data-theme="dark"] .select2-search__field {
    background: #111C2F !important;
    color: #EAF2FF !important;
    border-color: #243449 !important;
}

html[data-theme="dark"] .select2-results__option {
    background: #111C2F !important;
    color: #EAF2FF !important;
}

html[data-theme="dark"] .select2-results__option--selected {
    background: #1E293B !important;
    color: #EAF2FF !important;
}

html[data-theme="dark"] .select2-results__option--highlighted {
    background: linear-gradient(135deg, #38BDF8, #34D399) !important;
    color: #06121F !important;
}


/* ===== Dashboard KPI dark-mode readability (v0.6.35) ===== */
html[data-theme="dark"] .manager-dashboard {
    --dash-ink: #F1F5F9;
    --dash-muted: #CBD5E1;
    --dash-green: #34D399;
    --dash-green-soft: rgba(52, 211, 153, .14);
    --dash-blue: #60A5FA;
    --dash-blue-soft: rgba(96, 165, 250, .14);
    --dash-cyan: #22D3EE;
    --dash-cyan-soft: rgba(34, 211, 238, .14);
    --dash-red: #F87171;
    --dash-red-soft: rgba(248, 113, 113, .14);
    --dash-purple: #A78BFA;
    --dash-purple-soft: rgba(167, 139, 250, .14);
    --dash-amber: #FBBF24;
    --dash-amber-soft: rgba(251, 191, 36, .14);
}

/* Override light-mode KPI gradients that leak into dark mode */
html[data-theme="dark"] .manager-dashboard .manager-kpi,
html[data-theme="dark"] .manager-dashboard .manager-panel.card,
html[data-theme="dark"] .manager-dashboard .manager-panel {
    background:
        radial-gradient(circle at 88% 78%, rgba(52, 211, 153, .10), transparent 32%),
        linear-gradient(160deg, #0F172A 0%, #111C2F 100%) !important;
    border-color: #1E293B !important;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .28) !important;
}

html[data-theme="dark"] .manager-dashboard .kpi-income {
    background:
        radial-gradient(circle at 92% 82%, rgba(52, 211, 153, .18), transparent 34%),
        linear-gradient(160deg, #0F172A 0%, #0F2318 100%) !important;
}

html[data-theme="dark"] .manager-dashboard .kpi-month {
    background:
        radial-gradient(circle at 92% 82%, rgba(96, 165, 250, .18), transparent 34%),
        linear-gradient(160deg, #0F172A 0%, #0F1A2E 100%) !important;
}

html[data-theme="dark"] .manager-dashboard .kpi-net {
    background:
        radial-gradient(circle at 92% 82%, rgba(34, 211, 238, .18), transparent 34%),
        linear-gradient(160deg, #0F172A 0%, #0F1E28 100%) !important;
}

html[data-theme="dark"] .manager-dashboard .kpi-debt {
    background:
        radial-gradient(circle at 92% 82%, rgba(248, 113, 113, .18), transparent 34%),
        linear-gradient(160deg, #0F172A 0%, #231418 100%) !important;
}

html[data-theme="dark"] .manager-dashboard .kpi-patient {
    background:
        radial-gradient(circle at 92% 82%, rgba(167, 139, 250, .18), transparent 34%),
        linear-gradient(160deg, #0F172A 0%, #18142A 100%) !important;
}

html[data-theme="dark"] .manager-dashboard .kpi-follow {
    background:
        radial-gradient(circle at 92% 82%, rgba(251, 191, 36, .18), transparent 34%),
        linear-gradient(160deg, #0F172A 0%, #231C0F 100%) !important;
}

/* KPI labels & sub-labels */
html[data-theme="dark"] .manager-dashboard .manager-kpi span {
    color: #CBD5E1 !important;
    opacity: 1 !important;
}

html[data-theme="dark"] .manager-dashboard .manager-kpi small {
    color: #94A3B8 !important;
    opacity: 1 !important;
}

/* KPI amounts — bright semantic colors for financial readability */
html[data-theme="dark"] .manager-dashboard .manager-kpi strong {
    color: #F8FAFC !important;
    opacity: 1 !important;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .18);
}

html[data-theme="dark"] .manager-dashboard .kpi-income strong {
    color: #6EE7B7 !important;
}

html[data-theme="dark"] .manager-dashboard .kpi-month strong {
    color: #93C5FD !important;
}

html[data-theme="dark"] .manager-dashboard .kpi-net strong {
    color: #67E8F9 !important;
}

html[data-theme="dark"] .manager-dashboard .kpi-debt strong {
    color: #FCA5A5 !important;
}

html[data-theme="dark"] .manager-dashboard .kpi-patient strong {
    color: #C4B5FD !important;
}

html[data-theme="dark"] .manager-dashboard .kpi-follow strong {
    color: #FCD34D !important;
}

/* KPI icons in dark mode */
html[data-theme="dark"] .manager-dashboard .manager-kpi i {
    background: rgba(255, 255, 255, .06) !important;
    color: #E2E8F0 !important;
}

html[data-theme="dark"] .manager-dashboard .kpi-income i {
    background: rgba(52, 211, 153, .16) !important;
    color: #6EE7B7 !important;
}

html[data-theme="dark"] .manager-dashboard .kpi-month i {
    background: rgba(96, 165, 250, .16) !important;
    color: #93C5FD !important;
}

html[data-theme="dark"] .manager-dashboard .kpi-net i {
    background: rgba(34, 211, 238, .16) !important;
    color: #67E8F9 !important;
}

html[data-theme="dark"] .manager-dashboard .kpi-debt i {
    background: rgba(248, 113, 113, .16) !important;
    color: #FCA5A5 !important;
}

html[data-theme="dark"] .manager-dashboard .kpi-patient i {
    background: rgba(167, 139, 250, .16) !important;
    color: #C4B5FD !important;
}

html[data-theme="dark"] .manager-dashboard .kpi-follow i {
    background: rgba(251, 191, 36, .16) !important;
    color: #FCD34D !important;
}

/* Funnel & ops grid numbers */
html[data-theme="dark"] .manager-dashboard .funnel-item,
html[data-theme="dark"] .manager-dashboard .ops-grid a,
html[data-theme="dark"] .manager-dashboard .mini-row,
html[data-theme="dark"] .manager-dashboard .manager-empty {
    background: linear-gradient(160deg, #0F172A 0%, #111C2F 100%) !important;
    border-color: #1E293B !important;
    color: #EAF2FF !important;
}

html[data-theme="dark"] .manager-dashboard .funnel-item strong,
html[data-theme="dark"] .manager-dashboard .ops-grid a strong {
    color: #F8FAFC !important;
}

html[data-theme="dark"] .manager-dashboard .funnel-item span,
html[data-theme="dark"] .manager-dashboard .ops-grid a span {
    color: #94A3B8 !important;
}

html[data-theme="dark"] .manager-dashboard .manager-alert.warning {
    background: linear-gradient(160deg, #1A1708 0%, #231C0F 100%) !important;
    border-color: #78350F !important;
}

html[data-theme="dark"] .manager-dashboard .manager-alert.warning strong {
    color: #FCD34D !important;
}

html[data-theme="dark"] .manager-dashboard .manager-alert.danger {
    background: linear-gradient(160deg, #1A0F12 0%, #231418 100%) !important;
    border-color: #7F1D1D !important;
}

html[data-theme="dark"] .manager-dashboard .manager-alert.danger strong {
    color: #FCA5A5 !important;
}


/* ===== Global alias: --card-bg used by patients/reception search boxes ===== */
html[data-theme] {
    --card-bg: var(--card);
}


/* ===== Reception smart dark-mode readability (v0.6.35) ===== */
html[data-theme="dark"] .reception-panel-v2,
html[data-theme="dark"] .reception-patient-card,
html[data-theme="dark"] .reception-empty-create {
    background:
        radial-gradient(circle at 90% 84%, rgba(56, 189, 248, .10), transparent 34%),
        linear-gradient(160deg, #0F172A 0%, #111C2F 100%) !important;
    color: #EAF2FF !important;
    border-color: #1E293B !important;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .28) !important;
}

html[data-theme="dark"] .reception-stat-card {
    background: linear-gradient(160deg, #0F172A 0%, #111C2F 100%) !important;
}

html[data-theme="dark"] .reception-stat-card span {
    color: #CBD5E1 !important;
    opacity: 1 !important;
}

html[data-theme="dark"] .reception-stat-card strong {
    color: #F8FAFC !important;
    opacity: 1 !important;
}

html[data-theme="dark"] .reception-hero-v2 p {
    color: rgba(255, 255, 255, .94) !important;
    opacity: 1 !important;
}

html[data-theme="dark"] .reception-panel-title h2 {
    color: #F8FAFC !important;
}

html[data-theme="dark"] .reception-panel-title p,
html[data-theme="dark"] .reception-empty-state,
html[data-theme="dark"] .reception-selected-empty,
html[data-theme="dark"] .reception-patient-identity p,
html[data-theme="dark"] .reception-queue-head p,
html[data-theme="dark"] .reception-queue-head small {
    color: #CBD5E1 !important;
    opacity: 1 !important;
}

html[data-theme="dark"] .reception-patient-card strong {
    color: #F8FAFC !important;
}

html[data-theme="dark"] .reception-patient-card small,
html[data-theme="dark"] .reception-patient-card small span {
    color: #94A3B8 !important;
}

html[data-theme="dark"] .reception-search-shell .form-control {
    background: #111C2F !important;
    color: #EAF2FF !important;
    border: 1px solid #243449 !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .reception-search-shell .form-control::placeholder {
    color: #94A3B8 !important;
    opacity: 1 !important;
}

html[data-theme="dark"] .reception-tab-buttons button {
    color: #EAF2FF !important;
    border-color: #243449 !important;
}

html[data-theme="dark"] .reception-tab-buttons button.active {
    color: #06121F !important;
}


/* ===== Patients list dark-mode readability (v0.6.35) ===== */
html[data-theme="dark"] .patients-quick-search {
    background: linear-gradient(160deg, #0F172A 0%, #111C2F 100%) !important;
    border-color: #1E293B !important;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .24) !important;
}

html[data-theme="dark"] .patients-quick-search input[type="search"] {
    background: #111C2F !important;
    color: #EAF2FF !important;
    border-color: #243449 !important;
}

html[data-theme="dark"] .patients-quick-search input[type="search"]::placeholder {
    color: #94A3B8 !important;
    opacity: 1 !important;
}

html[data-theme="dark"] .patients-quick-search-hint {
    color: #CBD5E1 !important;
}

html[data-theme="dark"] .patients-quick-search-hint strong {
    color: #F8FAFC !important;
}

html[data-theme="dark"] .crm-collapsible-filter,
html[data-theme="dark"] .patients-filter-box {
    background: #0F172A !important;
    border-color: #1E293B !important;
}

html[data-theme="dark"] .crm-collapsible-filter summary,
html[data-theme="dark"] .patients-filter-box > summary {
    color: #EAF2FF !important;
    background: rgba(255, 255, 255, .04) !important;
}

html[data-theme="dark"] .crm-collapsible-filter summary::before,
html[data-theme="dark"] .fa-summary-toggle {
    background: #111C2F !important;
    color: #EAF2FF !important;
    border-color: #243449 !important;
}

html[data-theme="dark"] .crm-collapsible-filter-body,
html[data-theme="dark"] .patients-filter-body {
    background: #111C2F !important;
    border-color: #1E293B !important;
}

html[data-theme="dark"] .patients-page .alert-light {
    background: #111C2F !important;
    color: #CBD5E1 !important;
    border-color: #1E293B !important;
}

html[data-theme="dark"] .patients-table .badge.bg-primary-subtle.text-dark {
    background: rgba(56, 189, 248, .16) !important;
    color: #BAE6FD !important;
    border-color: rgba(56, 189, 248, .32) !important;
}

html[data-theme="dark"] .btn-danger {
    background: #DC2626 !important;
    border-color: #EF4444 !important;
    color: #FFFFFF !important;
}

html[data-theme="dark"] .btn-danger:hover,
html[data-theme="dark"] .btn-danger:focus {
    background: #B91C1C !important;
    border-color: #FCA5A5 !important;
    color: #FFFFFF !important;
}

html[data-theme="dark"] .btn-outline-danger {
    background: rgba(248, 113, 113, .08) !important;
    border-color: #F87171 !important;
    color: #FCA5A5 !important;
}

html[data-theme="dark"] .btn-outline-danger:hover,
html[data-theme="dark"] .btn-outline-danger:focus {
    background: rgba(248, 113, 113, .18) !important;
    border-color: #FCA5A5 !important;
    color: #FEE2E2 !important;
}

html[data-theme="dark"] .btn-outline-success {
    background: rgba(52, 211, 153, .08) !important;
    border-color: #34D399 !important;
    color: #6EE7B7 !important;
}

html[data-theme="dark"] .btn-outline-dark {
    background: #111C2F !important;
    border-color: #475569 !important;
    color: #E2E8F0 !important;
}

html[data-theme="dark"] .btn-outline-dark:hover {
    background: #1E293B !important;
    border-color: #94A3B8 !important;
    color: #F8FAFC !important;
}


/* ===== Update reports dark-mode readability (v0.6.35) ===== */
html[data-theme="dark"] .update-reports-page .infinite-summary {
    background: linear-gradient(160deg, #0F172A 0%, #111C2F 100%) !important;
    border-color: #1E293B !important;
    color: #CBD5E1 !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .22) !important;
}

html[data-theme="dark"] .update-reports-page .infinite-summary b {
    color: #F8FAFC !important;
}

html[data-theme="dark"] .update-reports-page .milaro-filter-box,
html[data-theme="dark"] .update-reports-page .update-reports-filter {
    background: #0F172A !important;
    border-color: #1E293B !important;
    color: #EAF2FF !important;
}

html[data-theme="dark"] .update-reports-page .milaro-filter-box > summary,
html[data-theme="dark"] .update-reports-page .update-reports-filter > summary {
    color: #EAF2FF !important;
}

html[data-theme="dark"] .update-reports-page .milaro-filter-box > summary small,
html[data-theme="dark"] .update-reports-page .update-reports-filter > summary small {
    color: #CBD5E1 !important;
    opacity: 1 !important;
}

html[data-theme="dark"] .update-reports-page .milaro-filter-body {
    background: transparent !important;
}

html[data-theme="dark"] .update-reports-table .fw-semibold,
html[data-theme="dark"] .update-reports-table td > div:first-child {
    color: #F8FAFC !important;
}

html[data-theme="dark"] .update-reports-table .small.text-muted,
html[data-theme="dark"] .update-reports-table td .text-muted {
    color: #B6C2D1 !important;
    opacity: 1 !important;
}

html[data-theme="dark"] .update-reports-table td {
    color: #E2E8F0 !important;
}

html[data-theme="dark"] .update-reports-table .badge.bg-light.text-dark {
    background: rgba(148, 163, 184, .14) !important;
    color: #E2E8F0 !important;
    border-color: rgba(148, 163, 184, .32) !important;
}

html[data-theme="dark"] .btn-outline-info {
    background: rgba(56, 189, 248, .10) !important;
    border-color: #38BDF8 !important;
    color: #7DD3FC !important;
}

html[data-theme="dark"] .btn-outline-info:hover,
html[data-theme="dark"] .btn-outline-info:focus {
    background: rgba(56, 189, 248, .20) !important;
    border-color: #7DD3FC !important;
    color: #E0F2FE !important;
}

html[data-theme="dark"] .btn-outline-primary {
    background: rgba(56, 189, 248, .10) !important;
    border-color: #38BDF8 !important;
    color: #BAE6FD !important;
}

html[data-theme="dark"] .btn-outline-primary:hover,
html[data-theme="dark"] .btn-outline-primary:focus {
    background: rgba(56, 189, 248, .20) !important;
    border-color: #7DD3FC !important;
    color: #E0F2FE !important;
}

html[data-theme="dark"] .btn-dark {
    background: #1E293B !important;
    border-color: #334155 !important;
    color: #F8FAFC !important;
}

html[data-theme="dark"] .btn-dark:hover {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #FFFFFF !important;
}

/* Shared milaro filter boxes (update reports, users, debts, etc.) */
html[data-theme="dark"] .milaro-filter-box,
html[data-theme="dark"] .users-filter-box,
html[data-theme="dark"] .debts-filter-box,
html[data-theme="dark"] .staff-earnings-filter,
html[data-theme="dark"] .activity-log-filter,
html[data-theme="dark"] .update-reports-filter {
    background: #0F172A !important;
    border-color: #1E293B !important;
    color: #EAF2FF !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .20) !important;
}

html[data-theme="dark"] .milaro-filter-box > summary,
html[data-theme="dark"] .users-filter-box > summary,
html[data-theme="dark"] .debts-filter-box > summary,
html[data-theme="dark"] .staff-earnings-filter > summary,
html[data-theme="dark"] .activity-log-filter > summary,
html[data-theme="dark"] .update-reports-filter > summary {
    color: #EAF2FF !important;
    background: rgba(255, 255, 255, .04) !important;
}

html[data-theme="dark"] .milaro-filter-box > summary small,
html[data-theme="dark"] .users-filter-box > summary small,
html[data-theme="dark"] .debts-filter-box > summary small,
html[data-theme="dark"] .staff-earnings-filter > summary small,
html[data-theme="dark"] .activity-log-filter > summary small,
html[data-theme="dark"] .update-reports-filter > summary small {
    color: #CBD5E1 !important;
    opacity: 1 !important;
}

html[data-theme="dark"] .infinite-summary {
    background: linear-gradient(160deg, #0F172A 0%, #111C2F 100%) !important;
    border-color: #1E293B !important;
    color: #CBD5E1 !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .22) !important;
}

html[data-theme="dark"] .infinite-summary b {
    color: #F8FAFC !important;
}


/* ===== Cross-page color polish v0.6.36 (dashboard, reception, appointments, settings) ===== */

/* --- Global appointment status pills --- */
html[data-theme="dark"] .status-pill,
html[data-theme="dark"] .status-pill.status-pending,
html[data-theme="dark"] .status-pending,
html[data-theme="dark"] .manager-dashboard .status-pending,
html[data-theme="dark"] .manager-dashboard .status-confirmed,
html[data-theme="dark"] .status-pill.status-confirmed,
html[data-theme="dark"] .status-confirmed {
    background: rgba(59, 130, 246, .18) !important;
    color: #93C5FD !important;
    border: 1px solid rgba(147, 197, 253, .30) !important;
}

html[data-theme="dark"] .status-pill.status-checked_in,
html[data-theme="dark"] .status-checked_in,
html[data-theme="dark"] .manager-dashboard .status-checked_in {
    background: rgba(52, 211, 153, .16) !important;
    color: #6EE7B7 !important;
    border: 1px solid rgba(110, 231, 183, .30) !important;
}

html[data-theme="dark"] .status-pill.status-in_service,
html[data-theme="dark"] .status-in_service,
html[data-theme="dark"] .manager-dashboard .status-in_service {
    background: rgba(167, 139, 250, .16) !important;
    color: #C4B5FD !important;
    border: 1px solid rgba(196, 181, 253, .30) !important;
}

html[data-theme="dark"] .status-pill.status-completed,
html[data-theme="dark"] .status-pill.status-done,
html[data-theme="dark"] .status-completed,
html[data-theme="dark"] .status-done,
html[data-theme="dark"] .manager-dashboard .status-completed {
    background: rgba(52, 211, 153, .14) !important;
    color: #86EFAC !important;
    border: 1px solid rgba(134, 239, 172, .28) !important;
}

html[data-theme="dark"] .status-pill.status-cancelled,
html[data-theme="dark"] .status-cancelled,
html[data-theme="dark"] .manager-dashboard .status-cancelled {
    background: rgba(248, 113, 113, .16) !important;
    color: #FCA5A5 !important;
    border: 1px solid rgba(252, 165, 165, .30) !important;
}

html[data-theme="dark"] .status-pill.status-no_show,
html[data-theme="dark"] .status-no_show,
html[data-theme="dark"] .manager-dashboard .status-no_show {
    background: rgba(251, 191, 36, .16) !important;
    color: #FCD34D !important;
    border: 1px solid rgba(252, 211, 77, .30) !important;
}

html[data-theme="light"] .status-pill {
    border: 1px solid transparent;
}

/* --- Dashboard --- */
html[data-theme="dark"] .manager-dashboard {
    background: transparent !important;
}

html[data-theme="dark"] .manager-dashboard .dash-change.neutral {
    background: rgba(148, 163, 184, .14) !important;
    color: #CBD5E1 !important;
}

html[data-theme="dark"] .manager-dashboard .btn.btn-sm {
    background: rgba(52, 211, 153, .12) !important;
    border-color: #243449 !important;
    color: #6EE7B7 !important;
}

html[data-theme="dark"] .manager-dashboard .btn.btn-sm:hover {
    background: rgba(52, 211, 153, .22) !important;
    color: #A7F3D0 !important;
}

html[data-theme="light"] .manager-dashboard .manager-hero .btn.btn-light,
html[data-theme="light"] .manager-dashboard .manager-hero-actions .btn.btn-light {
    background: rgba(255, 255, 255, .88) !important;
    color: #172033 !important;
    border-color: rgba(255, 255, 255, .55) !important;
}

html[data-theme="light"] .manager-dashboard .btn.btn-sm {
    background: var(--dash-primary-soft, #eef5e8) !important;
    border-color: #dbe3d2 !important;
    color: var(--dash-primary, #53693f) !important;
}

html[data-theme="dark"] .manager-dashboard .manager-hero .btn.btn-light {
    background: #111C2F !important;
    color: #EAF2FF !important;
    border-color: #243449 !important;
}

html[data-theme] .notification-queue-health-panel .notification-queue-health-card {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    min-height: 118px;
    padding: 22px;
    border-radius: 26px;
    border: 1px solid color-mix(in srgb, var(--border) 86%, transparent) !important;
    background:
        radial-gradient(circle at 88% 82%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 32%),
        linear-gradient(145deg, color-mix(in srgb, var(--card) 97%, #ffffff), color-mix(in srgb, var(--card) 90%, var(--accent))) !important;
    box-shadow: 0 14px 34px color-mix(in srgb, var(--text) 10%, transparent) !important;
}

html[data-theme] .notification-queue-health-panel .notification-queue-health-card::before {
    content: "";
    position: absolute;
    inset: auto -34px -42px auto;
    width: 128px;
    height: 128px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 20%, transparent);
    z-index: -1;
}

html[data-theme] .notification-queue-health-panel .notification-queue-health-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 16% 18%, rgba(255, 255, 255, .52), transparent 28%),
        radial-gradient(circle at 88% 22%, rgba(255, 255, 255, .24), transparent 22%);
    z-index: -1;
}

html[data-theme] .notification-queue-health-panel .notification-queue-health-card span {
    color: var(--muted) !important;
    font-size: 14px;
}

html[data-theme] .notification-queue-health-panel .notification-queue-health-card strong {
    display: block;
    margin-top: 12px;
    font-size: 27px;
    font-weight: 950;
    color: var(--text) !important;
    letter-spacing: -.2px;
}

html[data-theme] .notification-queue-health-panel .notification-queue-health-card strong.text-danger {
    color: #ef4444 !important;
}

html[data-theme] .notification-queue-health-panel .notification-queue-health-card:hover {
    border-color: color-mix(in srgb, var(--accent) 38%, var(--border)) !important;
}

html[data-theme="dark"] .notification-queue-health-panel .notification-queue-health-card {
    border-color: rgba(148, 163, 184, .28) !important;
    background:
        radial-gradient(circle at 90% 82%, rgba(56, 189, 248, .14), transparent 34%),
        linear-gradient(160deg, rgba(15, 23, 42, .88) 0%, rgba(17, 28, 47, .94) 100%) !important;
    box-shadow: 0 20px 52px rgba(0, 0, 0, .30) !important;
}

html[data-theme="dark"] .notification-queue-health-panel .notification-queue-health-card span {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .notification-queue-health-panel .notification-queue-health-card strong {
    color: #f8fafc !important;
}

html[data-theme="dark"] .notification-queue-health-panel .notification-queue-health-card strong.text-danger {
    color: #fca5a5 !important;
}

html[data-theme="light"] .notification-queue-health-panel .notification-queue-health-card {
    border-color: rgba(148, 163, 184, .30) !important;
    background:
        radial-gradient(circle at 88% 82%, rgba(56, 189, 248, .12), transparent 34%),
        linear-gradient(145deg, rgba(255, 255, 255, .98) 0%, rgba(241, 245, 249, .98) 100%) !important;
}

/* --- Reception smart --- */
html[data-theme="dark"] .reception-hero-v2 p {
    color: rgba(255, 255, 255, .94) !important;
    opacity: 1 !important;
}

html[data-theme="light"] .reception-hero-v2 p {
    color: rgba(255, 255, 255, .92) !important;
    opacity: 1 !important;
}

html[data-theme="dark"] .reception-mini-appointment {
    border-color: #243449 !important;
    color: #E2E8F0 !important;
}

html[data-theme="dark"] .reception-command .alert-light,
html[data-theme="dark"] #receptionNewPatientModal .alert-light,
html[data-theme="dark"] .reception-panel-v2 .alert-light {
    background: #111C2F !important;
    color: #CBD5E1 !important;
    border-color: #1E293B !important;
}

html[data-theme="light"] .reception-stat-card span,
html[data-theme="light"] .reception-panel-title p {
    color: var(--muted) !important;
}

html[data-theme="light"] .reception-stat-card strong {
    color: var(--text-strong, var(--text)) !important;
}

/* --- Appointments --- */
html[data-theme="dark"] .appointments-filter-box {
    background: #0F172A !important;
    border-color: #1E293B !important;
    color: #EAF2FF !important;
}

html[data-theme="dark"] .appointments-filter-box > summary {
    color: #EAF2FF !important;
    background: rgba(255, 255, 255, .04) !important;
}

html[data-theme="dark"] .appointments-filter-box > summary small {
    color: #CBD5E1 !important;
}

html[data-theme="dark"] .appointments-filter-box > summary::before {
    background: #111C2F !important;
    color: #EAF2FF !important;
    border-color: #243449 !important;
}

html[data-theme="dark"] .appointments-filter-box > summary b {
    background: rgba(56, 189, 248, .14) !important;
    color: #BAE6FD !important;
    border-color: rgba(56, 189, 248, .28) !important;
}

html[data-theme="dark"] .appointments-filter-body {
    background: #111C2F !important;
    border-color: #1E293B !important;
}

html[data-theme="dark"] .appointments-page .alert-light {
    background: #111C2F !important;
    color: #CBD5E1 !important;
    border-color: #1E293B !important;
}

html[data-theme="light"] .appointments-filter-box {
    background: var(--card2, #f9fafb) !important;
    border-color: var(--border) !important;
}

html[data-theme="light"] .appointments-filter-body {
    background: var(--card, #fff) !important;
}

/* --- Settings --- */
html[data-theme="dark"] .danger-zone-panel {
    background: linear-gradient(160deg, #1A0F12 0%, #231418 100%) !important;
    border-color: rgba(248, 113, 113, .32) !important;
    color: #FECACA !important;
}

html[data-theme="dark"] .danger-zone-panel .panel-head h2 {
    color: #FCA5A5 !important;
}

html[data-theme="dark"] .danger-zone-panel .panel-head p,
html[data-theme="dark"] .danger-zone-panel p,
html[data-theme="dark"] .danger-zone-panel li {
    color: #FECACA !important;
}

html[data-theme="dark"] .settings-count {
    background: rgba(129, 140, 248, .16) !important;
    color: #C7D2FE !important;
    border: 1px solid rgba(165, 180, 252, .24) !important;
}

html[data-theme="dark"] .settings-card-head p {
    color: #94A3B8 !important;
}

html[data-theme="dark"] .settings-modern-page .alert-light,
html[data-theme="dark"] .settings-modern-page .setting-field .text-muted {
    color: #94A3B8 !important;
}

html[data-theme="dark"] .message-template-preview-body.bg-light,
html[data-theme="dark"] .settings-modern-page pre.bg-light {
    background: #111C2F !important;
    color: #E2E8F0 !important;
    border: 1px solid #243449 !important;
}

html[data-theme="light"] .settings-card-head p {
    color: var(--muted) !important;
}

html[data-theme="light"] .danger-zone-panel {
    background: #fffafa !important;
    border-color: rgba(220, 38, 38, .22) !important;
}

html[data-theme="light"] .danger-zone-panel .panel-head h2 {
    color: #991b1b !important;
}

/* --- Shared alerts / soft surfaces --- */
html[data-theme="dark"] .alert-light {
    background: #111C2F !important;
    color: #CBD5E1 !important;
    border-color: #1E293B !important;
}

html[data-theme="light"] .alert-light {
    background: var(--card2, #f8fafc) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

html[data-theme="dark"] pre.bg-light,
html[data-theme="dark"] .bg-light-subtle {
    background: #111C2F !important;
    color: #E2E8F0 !important;
    border-color: #243449 !important;
}


/* ===== Outline buttons readability (settings & global) v0.6.36.1 ===== */
html[data-theme="dark"] .btn-outline-secondary,
html[data-theme="dark"] a.btn-outline-secondary {
    background: rgba(148, 163, 184, .08) !important;
    border-color: #94A3B8 !important;
    color: #E2E8F0 !important;
}

html[data-theme="dark"] .btn-outline-secondary:hover,
html[data-theme="dark"] .btn-outline-secondary:focus,
html[data-theme="dark"] a.btn-outline-secondary:hover,
html[data-theme="dark"] a.btn-outline-secondary:focus {
    background: rgba(148, 163, 184, .16) !important;
    border-color: #CBD5E1 !important;
    color: #F8FAFC !important;
}

html[data-theme="dark"] .btn-outline-primary,
html[data-theme="dark"] a.btn-outline-primary {
    background: rgba(56, 189, 248, .12) !important;
    border-color: #7DD3FC !important;
    color: #E0F2FE !important;
}

html[data-theme="dark"] .btn-outline-primary:hover,
html[data-theme="dark"] .btn-outline-primary:focus,
html[data-theme="dark"] a.btn-outline-primary:hover,
html[data-theme="dark"] a.btn-outline-primary:focus {
    background: rgba(56, 189, 248, .22) !important;
    border-color: #BAE6FD !important;
    color: #FFFFFF !important;
}

html[data-theme="light"] .btn-outline-secondary,
html[data-theme="light"] a.btn-outline-secondary {
    background: transparent !important;
    border-color: #94A3B8 !important;
    color: #475569 !important;
}

html[data-theme="light"] .btn-outline-secondary:hover,
html[data-theme="light"] a.btn-outline-secondary:hover {
    background: #F1F5F9 !important;
    border-color: #64748B !important;
    color: #1E293B !important;
}

html[data-theme="light"] .btn-outline-primary,
html[data-theme="light"] a.btn-outline-primary {
    background: transparent !important;
    border-color: var(--accent, #38bdf8) !important;
    color: #0369A1 !important;
}

html[data-theme="light"] .btn-outline-primary:hover,
html[data-theme="light"] a.btn-outline-primary:hover {
    background: rgba(56, 189, 248, .10) !important;
    border-color: #0284C7 !important;
    color: #0C4A6E !important;
}

html[data-theme="dark"] .card .card-body h2,
html[data-theme="dark"] .card .card-body .h5 {
    color: #F8FAFC !important;
}


/* ===== Global dark mode sweep v0.6.37 (all pages) ===== */

/* Semantic alerts — override generic flattening in app.css */
html[data-theme="dark"] .alert-success {
    background: rgba(52, 211, 153, .12) !important;
    border-color: rgba(110, 231, 183, .32) !important;
    color: #A7F3D0 !important;
}

html[data-theme="dark"] .alert-danger {
    background: rgba(248, 113, 113, .12) !important;
    border-color: rgba(252, 165, 165, .32) !important;
    color: #FECACA !important;
}

html[data-theme="dark"] .alert-warning {
    background: rgba(251, 191, 36, .12) !important;
    border-color: rgba(252, 211, 77, .32) !important;
    color: #FDE68A !important;
}

html[data-theme="dark"] .alert-info {
    background: rgba(56, 189, 248, .12) !important;
    border-color: rgba(125, 211, 252, .32) !important;
    color: #BAE6FD !important;
}

html[data-theme="dark"] .alert-secondary {
    background: rgba(148, 163, 184, .12) !important;
    border-color: rgba(203, 213, 225, .28) !important;
    color: #CBD5E1 !important;
}

/* Universal collapsible filters (finance, payments, invoices, etc.) */
html[data-theme="dark"] [class*="-filter-box"],
html[data-theme="dark"] .crm-collapsible-filter {
    background: #0F172A !important;
    border-color: #1E293B !important;
    color: #EAF2FF !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .20) !important;
}

html[data-theme="dark"] [class*="-filter-box"] > summary,
html[data-theme="dark"] .crm-collapsible-filter > summary {
    color: #EAF2FF !important;
    background: rgba(255, 255, 255, .04) !important;
}

html[data-theme="dark"] [class*="-filter-box"] > summary small,
html[data-theme="dark"] .crm-collapsible-filter > summary small {
    color: #CBD5E1 !important;
    opacity: 1 !important;
}

html[data-theme="dark"] [class*="-filter-box"] > summary::before,
html[data-theme="dark"] .crm-collapsible-filter > summary::before {
    background: #111C2F !important;
    border-color: #243449 !important;
    color: #EAF2FF !important;
}

html[data-theme="dark"] [class*="-filter-box"] > summary b,
html[data-theme="dark"] .crm-collapsible-filter > summary b {
    background: rgba(56, 189, 248, .14) !important;
    color: #BAE6FD !important;
    border-color: rgba(56, 189, 248, .28) !important;
}

html[data-theme="dark"] [class*="-filter-body"],
html[data-theme="dark"] .crm-collapsible-filter-body,
html[data-theme="dark"] .milaro-filter-body {
    background: #111C2F !important;
    border-color: #1E293B !important;
    color: #EAF2FF !important;
}

/* Finance KPI & summary cards */
html[data-theme="dark"] .finance-kpi-card,
html[data-theme="dark"] .finance-expenses-summary-card,
html[data-theme="dark"] .settlement-create-box {
    background: linear-gradient(160deg, #0F172A 0%, #111C2F 100%) !important;
    border-color: #1E293B !important;
    color: #EAF2FF !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .22) !important;
}

html[data-theme="dark"] .finance-kpi-card.income {
    background: linear-gradient(160deg, #0F172A 0%, #0F2318 100%) !important;
}

html[data-theme="dark"] .finance-kpi-card.expense,
html[data-theme="dark"] .finance-expenses-summary-card.total {
    background: linear-gradient(160deg, #1A1708 0%, #231C0F 100%) !important;
    border-color: #78350F !important;
}

html[data-theme="dark"] .finance-kpi-card.net.negative {
    background: linear-gradient(160deg, #1A0F12 0%, #231418 100%) !important;
    border-color: #7F1D1D !important;
}

html[data-theme="dark"] .finance-kpi-card span,
html[data-theme="dark"] .finance-expenses-summary-card span {
    color: #CBD5E1 !important;
}

html[data-theme="dark"] .finance-kpi-card strong,
html[data-theme="dark"] .finance-expenses-summary-card strong {
    color: #F8FAFC !important;
}

html[data-theme="dark"] .finance-kpi-card small {
    color: #94A3B8 !important;
}

/* Global badges (headers, cards, modals — not only tables) */
html[data-theme="dark"] .badge.bg-light,
html[data-theme="dark"] .badge.bg-light.text-dark {
    background: rgba(148, 163, 184, .14) !important;
    color: #E2E8F0 !important;
    border-color: rgba(148, 163, 184, .32) !important;
}

html[data-theme="dark"] .badge.bg-info.text-dark {
    background: rgba(56, 189, 248, .16) !important;
    color: #BAE6FD !important;
    border-color: rgba(56, 189, 248, .30) !important;
}

html[data-theme="dark"] .badge.bg-warning.text-dark {
    background: rgba(251, 191, 36, .16) !important;
    color: #FCD34D !important;
    border-color: rgba(252, 211, 77, .30) !important;
}

html[data-theme="dark"] .badge.bg-primary-subtle.text-dark {
    background: rgba(56, 189, 248, .16) !important;
    color: #BAE6FD !important;
    border-color: rgba(56, 189, 248, .30) !important;
}

html[data-theme="dark"] .badge.bg-success-subtle.text-success {
    background: rgba(52, 211, 153, .14) !important;
    color: #6EE7B7 !important;
    border-color: rgba(110, 231, 183, .28) !important;
}

html[data-theme="dark"] .badge.bg-dark {
    background: #334155 !important;
    color: #F8FAFC !important;
    border-color: #475569 !important;
}

/* More outline button variants */
html[data-theme="dark"] .btn-outline-warning,
html[data-theme="dark"] a.btn-outline-warning {
    background: rgba(251, 191, 36, .10) !important;
    border-color: #FBBF24 !important;
    color: #FCD34D !important;
}

html[data-theme="dark"] .btn-outline-warning:hover,
html[data-theme="dark"] a.btn-outline-warning:hover {
    background: rgba(251, 191, 36, .20) !important;
    border-color: #FCD34D !important;
    color: #FEF3C7 !important;
}

html[data-theme="dark"] .btn-outline-light,
html[data-theme="dark"] a.btn-outline-light {
    background: rgba(255, 255, 255, .08) !important;
    border-color: rgba(255, 255, 255, .35) !important;
    color: #F8FAFC !important;
}

html[data-theme="dark"] .btn-outline-light:hover,
html[data-theme="dark"] a.btn-outline-light:hover {
    background: rgba(255, 255, 255, .16) !important;
    border-color: rgba(255, 255, 255, .50) !important;
    color: #FFFFFF !important;
}

/* Global soft surfaces */
html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .border.rounded-4.bg-light,
html[data-theme="dark"] .border.rounded.bg-light {
    background: #111C2F !important;
    color: #E2E8F0 !important;
    border-color: #243449 !important;
}

html[data-theme="dark"] .stat-card.danger {
    background: linear-gradient(160deg, #1A0F12 0%, #231418 100%) !important;
    border-color: #7F1D1D !important;
}

html[data-theme="dark"] .stat-card.danger strong {
    color: #FCA5A5 !important;
}

html[data-theme="dark"] .stat-card.danger span {
    color: #FECACA !important;
}

/* Pagination */
html[data-theme="dark"] .page-link {
    background: #111C2F !important;
    border-color: #243449 !important;
    color: #CBD5E1 !important;
}

html[data-theme="dark"] .page-item.active .page-link {
    background: linear-gradient(135deg, #38BDF8, #34D399) !important;
    border-color: transparent !important;
    color: #06121F !important;
}

html[data-theme="dark"] .page-item.disabled .page-link {
    background: #0F172A !important;
    color: #64748B !important;
}

/* XMind / invoice pickers */
html[data-theme="dark"] .xmind-select-control,
html[data-theme="dark"] .xmind-dropdown,
html[data-theme="dark"] .xmind-selected-box {
    background: #111C2F !important;
    color: #EAF2FF !important;
    border-color: #243449 !important;
}

html[data-theme="dark"] .xmind-result-row {
    background: #0F172A !important;
    border-color: #1E293B !important;
    color: #E2E8F0 !important;
}

html[data-theme="dark"] .xmind-result-row:hover {
    background: rgba(56, 189, 248, .10) !important;
}

html[data-theme="dark"] .xmind-control-clear {
    background: #1E293B !important;
    color: #CBD5E1 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .xmind-result-main small,
html[data-theme="dark"] .xmind-empty,
html[data-theme="dark"] .xmind-loading {
    color: #94A3B8 !important;
}

/* Form panels with inline light backgrounds */
html[data-theme="dark"] .invoice-create-card,
html[data-theme="dark"] .invoice-create-field,
html[data-theme="dark"] .appointment-form-card,
html[data-theme="dark"] .appointment-field {
    background: #111C2F !important;
    border-color: #243449 !important;
    color: #EAF2FF !important;
}

html[data-theme="dark"] .appointment-form-card {
    box-shadow: 0 18px 45px rgba(0, 0, 0, .28) !important;
}

html[data-theme="dark"] .invoice-create-field .form-label,
html[data-theme="dark"] .appointment-field .form-label,
html[data-theme="dark"] .appointment-section-title {
    color: #CBD5E1 !important;
}

html[data-theme="dark"] .appointment-actions {
    background: linear-gradient(180deg, rgba(15, 23, 42, .76), #0F172A 38%) !important;
    border-top-color: #1E293B !important;
}

html[data-theme="dark"] .doctor-payment-type-card {
    background: #111C2F !important;
    border-color: #243449 !important;
    color: #EAF2FF !important;
}

html[data-theme="dark"] .doctor-payment-type-card span {
    color: #94A3B8 !important;
}

html[data-theme="dark"] .doctor-payment-type-card.active {
    background: rgba(56, 189, 248, .12) !important;
    border-color: rgba(56, 189, 248, .40) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .24) !important;
}

html[data-theme="dark"] .doctor-payment-ladder-box {
    background: #0F172A !important;
    border-color: #1E293B !important;
    color: #EAF2FF !important;
}

/* Layout chrome */
html[data-theme="dark"] .stock-count-operational-lock-v1 {
    background: linear-gradient(160deg, #1A1708 0%, #231C0F 100%) !important;
    border-color: #92400E !important;
    color: #FDE68A !important;
}

html[data-theme="dark"] .brand-preview-img {
    background: #111C2F !important;
    border-color: #243449 !important;
}

html[data-theme="dark"] .manalia-version-badge-v1 {
    color: rgba(226, 232, 240, .45) !important;
}

/* Reception dropdown (appointment card inline override) */
html[data-theme="dark"] .reception-more-actions summary,
html[data-theme="dark"] .reception-more-actions > div {
    background: #111C2F !important;
    border-color: #243449 !important;
    color: #EAF2FF !important;
}

/* Improved muted text readability on dark surfaces */
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .form-text.text-muted,
html[data-theme="dark"] td .text-muted,
html[data-theme="dark"] .panel .text-muted {
    color: #B6C2D1 !important;
    opacity: 1 !important;
}

html[data-theme="dark"] .fw-semibold,
html[data-theme="dark"] td .fw-semibold {
    color: #F1F5F9 !important;
}

/* Legacy reception page surfaces */
html[data-theme="dark"] .reception-page .reception-stat-card,
html[data-theme="dark"] .reception-page .reception-card,
html[data-theme="dark"] .reception-page .reception-money-mini,
html[data-theme="dark"] .reception-page .service-row {
    background: linear-gradient(160deg, #0F172A 0%, #111C2F 100%) !important;
    border-color: #1E293B !important;
    color: #EAF2FF !important;
}

html[data-theme="dark"] .reception-page .reception-stat-card span {
    color: #CBD5E1 !important;
}

html[data-theme="dark"] .reception-page .reception-stat-card strong {
    color: #F8FAFC !important;
}

/* List group / help blocks */
html[data-theme="dark"] .list-group-item {
    background: #111C2F !important;
    border-color: #1E293B !important;
    color: #E2E8F0 !important;
}

html[data-theme="dark"] .list-group-item.active {
    background: rgba(56, 189, 248, .16) !important;
    border-color: rgba(56, 189, 248, .32) !important;
    color: #E0F2FE !important;
}

html[data-theme="dark"] .help-card,
html[data-theme="dark"] .empty-soft {
    background: #111C2F !important;
    border-color: #1E293B !important;
    color: #CBD5E1 !important;
}

/* Invoice ended-contract option highlight */
html[data-theme="dark"] option.contract-option-ended,
html[data-theme="dark"] .contract-option-ended {
    background: rgba(248, 113, 113, .14) !important;
    color: #FCA5A5 !important;
}


/* ===== Global light mode polish v0.6.37 ===== */
html[data-theme="light"] .alert-success {
    background: #ECFDF5 !important;
    border-color: #86EFAC !important;
    color: #14532D !important;
}

html[data-theme="light"] .alert-danger {
    background: #FEF2F2 !important;
    border-color: #FCA5A5 !important;
    color: #991B1B !important;
}

html[data-theme="light"] .alert-warning {
    background: #FFFBEB !important;
    border-color: #FCD34D !important;
    color: #92400E !important;
}

html[data-theme="light"] .alert-info {
    background: #EFF6FF !important;
    border-color: #93C5FD !important;
    color: #1E40AF !important;
}

html[data-theme="light"] .alert-secondary {
    background: #F1F5F9 !important;
    border-color: #CBD5E1 !important;
    color: #475569 !important;
}

html[data-theme="light"] .text-muted,
html[data-theme="light"] .form-text.text-muted {
    color: #64748B !important;
}

html[data-theme="light"] [class*="-filter-box"],
html[data-theme="light"] .crm-collapsible-filter {
    background: var(--card2, #F9FAFB) !important;
    border-color: var(--border) !important;
}

html[data-theme="light"] [class*="-filter-body"],
html[data-theme="light"] .crm-collapsible-filter-body {
    background: var(--card, #FFFFFF) !important;
}

html[data-theme="light"] .finance-kpi-card,
html[data-theme="light"] .finance-expenses-summary-card {
    border-color: var(--border) !important;
}

html[data-theme="light"] .infinite-summary {
    background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(248, 250, 252, .96)) !important;
    color: #64748B !important;
    border-color: rgba(148, 163, 184, .28) !important;
}

html[data-theme="light"] .infinite-summary b {
    color: #0F172A !important;
}
