@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    --primary: #026aa7;
    --sidebar-bg: #026aa7;
    --sidebar-active: rgba(255, 255, 255, 0.15);
    --background: #f4f7f9;
    --text-dark: #172b4d;
    --text-muted: #5e6c84;
    --border-color: #dfe1e6;
    --success-green: #00966d;
    --view-blue: #0891b2;
    --table-header-bg: #f4f5f7;
    --header-card-bg: #101828;
    --font-main: 'Inter', sans-serif;
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 70px;
    --top-header-height: 64px;
    --card-bg: #ffffff;
    --input-bg: #ffffff;
}

#components-reconnect-modal:not([open]) {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

[data-theme="dark"] {
    --primary: #38bdf8;
    --sidebar-bg: #0f172a;
    --background: #090d16;
    --text-dark: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --table-header-bg: #0f172a;
    --header-card-bg: #1e293b;
    --card-bg: #1e293b;
    --input-bg: #0f172a;
}

/* Theme Switcher Toggle Pill Bar */
.theme-toggle-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    border-radius: 30px;
    padding: 3px;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    width: 100%;
}

[data-theme="dark"] .theme-toggle-bar {
    background: #0f172a;
    border-color: #334155;
}

.theme-toggle-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    z-index: 2;
    transition: all 0.3s ease;
    border: none;
    background: transparent;
    cursor: pointer;
}

.theme-toggle-option.active {
    color: #ffffff;
    background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

[data-theme="dark"] .theme-toggle-option.active {
    background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
    color: #0f172a;
}

.theme-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #1e293b;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.theme-icon-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .theme-icon-btn {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .theme-icon-btn:hover {
    background: #334155;
    border-color: #475569;
}

/* Comprehensive Dark Theme Global Overrides */
[data-theme="dark"] body,
[data-theme="dark"] .app-container,
[data-theme="dark"] .main-content,
[data-theme="dark"] .op-wrapper,
[data-theme="dark"] .exec-dashboard,
[data-theme="dark"] .ip-wrapper,
[data-theme="dark"] .inv-wrapper,
[data-theme="dark"] .dashboard-container,
[data-theme="dark"] .page-container,
[data-theme="dark"] .dch-page-container,
[data-theme="dark"] .re-container {
    background-color: #090d16 !important;
    background: #090d16 !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .top-header {
    background-color: #0f172a !important;
    border-bottom: 1px solid #1e293b !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
}

/* All Cards, Panels, Filter Bars & Wrappers */
[data-theme="dark"] .card,
[data-theme="dark"] .op-header,
[data-theme="dark"] .filter-bar,
[data-theme="dark"] .kpi-card,
[data-theme="dark"] .chart-card,
[data-theme="dark"] .panel-card,
[data-theme="dark"] .kpi-card-exec,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .table-card,
[data-theme="dark"] .filters-card,
[data-theme="dark"] .items-main-card,
[data-theme="dark"] .cm-header-card,
[data-theme="dark"] .cm-table-card,
[data-theme="dark"] .lab-header-card,
[data-theme="dark"] .dc-top-section,
[data-theme="dark"] .dc-bottom-section,
[data-theme="dark"] .dc-panel,
[data-theme="dark"] .dc-panel-type-container,
[data-theme="dark"] .dc-footer-card,
[data-theme="dark"] .dc-table-wrapper,
[data-theme="dark"] .re-card,
[data-theme="dark"] .re-card-header,
[data-theme="dark"] .re-main-panel,
[data-theme="dark"] .re-side-panel,
[data-theme="dark"] .re-table-container,
[data-theme="dark"] .re-footer-bar,
[data-theme="dark"] .re-action-bar,
[data-theme="dark"] .tm-footer,
[data-theme="dark"] .tm-elite-header,
[data-theme="dark"] .doctor-card,
[data-theme="dark"] .metric-card,
[data-theme="dark"] .item-card,
[data-theme="dark"] .template-card,
[data-theme="dark"] .modal-form-card,
[data-theme="dark"] .action-popup-card,
[data-theme="dark"] .qa-popup,
[data-theme="dark"] .restricted-card,
[data-theme="dark"] .update-panel,
[data-theme="dark"] .board-panel,
[data-theme="dark"] .no-records-card,
[data-theme="dark"] .operating-branch-card,
[data-theme="dark"] .summary-card,
[data-theme="dark"] .data-card,
[data-theme="dark"] .table-container,
[data-theme="dark"] .doctor-modal,
[data-theme="dark"] .bg-white,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .profile-card,
[data-theme="dark"] .search-bar,
[data-theme="dark"] .calendar-main-container,
[data-theme="dark"] .calendar-top-bar,
[data-theme="dark"] .slot-card,
[data-theme="dark"] .slot-card-v2,
[data-theme="dark"] .day-doctor-section,
[data-theme="dark"] .calendar-grid-wrapper,
[data-theme="dark"] .login-card {
    background-color: #1e293b !important;
    background: #1e293b !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
}

/* Card Titles, Headlines & Prominent Text */
[data-theme="dark"] .header-title h1,
[data-theme="dark"] .chart-header h3,
[data-theme="dark"] .panel-header h3,
[data-theme="dark"] .kpi-value,
[data-theme="dark"] .metric-num,
[data-theme="dark"] .welcome-title,
[data-theme="dark"] .doctor-name,
[data-theme="dark"] .header-text h2,
[data-theme="dark"] .modal-header h3,
[data-theme="dark"] .filter-info strong,
[data-theme="dark"] .qa-popup-title h4,
[data-theme="dark"] .qa-tile span,
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5 {
    color: #f8fafc !important;
}

[data-theme="dark"] .header-title p,
[data-theme="dark"] .chart-sub,
[data-theme="dark"] .kpi-label,
[data-theme="dark"] .kpi-foot,
[data-theme="dark"] .filter-label,
[data-theme="dark"] .filter-info,
[data-theme="dark"] .qa-tile small,
[data-theme="dark"] .text-muted,
[data-theme="dark"] .welcome-subtitle,
[data-theme="dark"] .hero-subtext,
[data-theme="dark"] .form-col label {
    color: #94a3b8 !important;
}

[data-theme="dark"] .calendar-popup,
[data-theme="dark"] .calendar-inline {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .calendar-day:hover:not(.disabled) {
    background-color: #334155 !important;
}

/* Tables, Inputs, Selects, Pagination & Scheduling Portals */
[data-theme="dark"] .medico-table,
[data-theme="dark"] .custom-table,
[data-theme="dark"] .sharp-table,
[data-theme="dark"] .exec-table,
[data-theme="dark"] table {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .medico-table th,
[data-theme="dark"] .custom-table th,
[data-theme="dark"] .sharp-table th,
[data-theme="dark"] .exec-table th,
[data-theme="dark"] table th {
    background-color: #0f172a !important;
    background: #0f172a !important;
    color: #38bdf8 !important;
    border-bottom-color: #334155 !important;
    border-right-color: #1e293b !important;
}

[data-theme="dark"] .medico-table td,
[data-theme="dark"] .custom-table td,
[data-theme="dark"] .sharp-table td,
[data-theme="dark"] .exec-table td,
[data-theme="dark"] table td {
    background-color: #1e293b !important;
    background: #1e293b !important;
    color: #e2e8f0 !important;
    border-bottom-color: #334155 !important;
}

[data-theme="dark"] .medico-table td span,
[data-theme="dark"] .custom-table td span,
[data-theme="dark"] table td span {
    color: #e2e8f0 !important;
}

[data-theme="dark"] .medico-table tr:hover td,
[data-theme="dark"] .custom-table tbody tr:hover td,
[data-theme="dark"] .sharp-table tbody tr:hover td,
[data-theme="dark"] table tbody tr:hover td {
    background-color: #0f172a !important;
}

[data-theme="dark"] table tbody tr:nth-child(even) td,
[data-theme="dark"] .medico-table tbody tr:nth-child(even) td,
[data-theme="dark"] .custom-table tbody tr:nth-child(even) td,
[data-theme="dark"] .lc-table-row:nth-child(even) td {
    background-color: #0f172a !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] table tbody tr:nth-child(odd) td,
[data-theme="dark"] .medico-table tbody tr:nth-child(odd) td,
[data-theme="dark"] .custom-table tbody tr:nth-child(odd) td,
[data-theme="dark"] .lc-table-row:nth-child(odd) td {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .filter-control,
[data-theme="dark"] .filter-input,
[data-theme="dark"] select.walkin-input,
[data-theme="dark"] .form-control,
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background-color: #0f172a !important;
    background: #0f172a !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .filter-control option,
[data-theme="dark"] select option {
    background-color: #0f172a !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .filter-group label,
[data-theme="dark"] .form-group label {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .dashboard-title h1,
[data-theme="dark"] .dashboard-title p {
    color: #f8fafc !important;
}

[data-theme="dark"] .pagination-footer {
    background-color: #1e293b !important;
    border-top-color: #334155 !important;
}

[data-theme="dark"] .pagination-info {
    color: #94a3b8 !important;
}

[data-theme="dark"] .pagination-info-highlight {
    color: #38bdf8 !important;
}

[data-theme="dark"] .pagination-btns .page-btn {
    background-color: #0f172a !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .pagination-btns .page-btn.active {
    background-color: #0284c7 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .btn-header-action.secondary {
    background: #1e293b !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .btn-table-action {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #38bdf8 !important;
}

/* Dark Mode Row Highlights & Badges Global Overrides */
[data-theme="dark"] tr.vip-row td,
[data-theme="dark"] .medico-table tr.vip-row td,
[data-theme="dark"] .recent-checkins-table tr.vip-row td {
    background-color: #2b2306 !important;
    color: #fef08a !important;
    border-bottom-color: #713f12 !important;
}

[data-theme="dark"] tr.vip-row td span,
[data-theme="dark"] .medico-table tr.vip-row td span {
    color: #fef08a !important;
}

[data-theme="dark"] tr.vip-row:hover td,
[data-theme="dark"] .medico-table tr.vip-row:hover td {
    background-color: #3b3009 !important;
}

[data-theme="dark"] tr.ip-referred-row td,
[data-theme="dark"] .medico-table tr.ip-referred-row td,
[data-theme="dark"] .recent-checkins-table tr.ip-referred-row td {
    background-color: #092c1b !important;
    color: #86efac !important;
    border-bottom-color: #14532d !important;
}

[data-theme="dark"] tr.ip-referred-row td span,
[data-theme="dark"] .medico-table tr.ip-referred-row td span {
    color: #86efac !important;
}

[data-theme="dark"] tr.ip-referred-row:hover td,
[data-theme="dark"] .medico-table tr.ip-referred-row:hover td {
    background-color: #0e3d26 !important;
}

[data-theme="dark"] tr.vip-row.ip-referred-row td,
[data-theme="dark"] .medico-table tr.vip-row.ip-referred-row td {
    background: linear-gradient(90deg, #2b2306 0%, #092c1b 100%) !important;
}

[data-theme="dark"] .badge-type.walkin {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #fbbf24 !important;
    border-color: #78350f !important;
}

[data-theme="dark"] .badge-type.online {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #60a5fa !important;
    border-color: #1e3a8a !important;
}

[data-theme="dark"] .btn-bill-status.unpaid {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #fca5a5 !important;
    border-color: #7f1d1d !important;
}

[data-theme="dark"] .btn-bill-status.paid {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #6ee7b7 !important;
    border-color: #064e3b !important;
}

[data-theme="dark"] .status-badge.waiting,
[data-theme="dark"] .status-select.waiting {
    background-color: #451a03 !important;
    color: #fde68a !important;
    border-color: #78350f !important;
}

[data-theme="dark"] .status-badge.in_consultation,
[data-theme="dark"] .status-select.in_consultation {
    background-color: #1e3a8a !important;
    color: #bfdbfe !important;
    border-color: #1d4ed8 !important;
}

[data-theme="dark"] .status-badge.admitted,
[data-theme="dark"] .status-select.admitted {
    background-color: rgba(59, 130, 246, 0.2) !important;
    background: rgba(59, 130, 246, 0.2) !important;
    color: #93c5fd !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
}

[data-theme="dark"] .status-badge.completed,
[data-theme="dark"] .status-badge.discharged,
[data-theme="dark"] .status-select.completed {
    background-color: #064e3b !important;
    color: #a7f3d0 !important;
    border-color: #047857 !important;
}

/* Master Pages Dark Mode Global Rules */
[data-theme="dark"] .referral-page {
    background-color: #090d16 !important;
    background: #090d16 !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .lab-header-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .lab-title-text {
    color: #f8fafc !important;
}

[data-theme="dark"] .status-text {
    color: #94a3b8 !important;
}

[data-theme="dark"] .directory-section {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .lc-table thead tr {
    background: #0f172a !important;
    border-bottom-color: #334155 !important;
}

[data-theme="dark"] .lc-table th {
    color: #38bdf8 !important;
}

[data-theme="dark"] .lc-table td {
    background-color: #1e293b !important;
    border-bottom-color: #334155 !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .lc-table-row:hover td,
[data-theme="dark"] .lc-table tbody tr:hover td {
    background-color: #0f172a !important;
}

[data-theme="dark"] .lc-rounded-pill-input,
[data-theme="dark"] .lab-input {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .search-icon i,
[data-theme="dark"] .search-icon span {
    color: #94a3b8 !important;
}

[data-theme="dark"] .lc-btn {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #38bdf8 !important;
}

[data-theme="dark"] .lc-btn:hover {
    background-color: #1e293b !important;
    border-color: #475569 !important;
    color: #7dd3fc !important;
}

[data-theme="dark"] .lc-btn span {
    color: #38bdf8 !important;
}

[data-theme="dark"] .modal-form-card,
[data-theme="dark"] .modal-header-bar,
[data-theme="dark"] .modal-body,
[data-theme="dark"] .modal-footer-bar {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .modal-header-bar h3 {
    color: #38bdf8 !important;
}

/* Test Master / Test Construction Comprehensive Dark Mode */
[data-theme="dark"] .tm-elite-container {
    background: #090d16 !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .tm-elite-header {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .tm-elite-header h1,
[data-theme="dark"] .tm-page-title {
    color: #f8fafc !important;
}

[data-theme="dark"] .tm-compact-card,
[data-theme="dark"] .tm-elite-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .tm-card-title-text {
    color: #818cf8 !important;
}

[data-theme="dark"] .tm-card-icon {
    background: #312e81 !important;
    color: #818cf8 !important;
}

[data-theme="dark"] .tm-elite-label {
    color: #94a3b8 !important;
}

[data-theme="dark"] .tm-elite-input,
[data-theme="dark"] select.tm-elite-input,
[data-theme="dark"] textarea.tm-elite-input,
[data-theme="dark"] .tm-inline-input,
[data-theme="dark"] .tm-subtests-input,
[data-theme="dark"] .tm-param-input,
[data-theme="dark"] .tm-footer-textarea {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

[data-theme="dark"] select.tm-elite-input option,
[data-theme="dark"] select.tm-elite-red-select option {
    background-color: #0f172a !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .tm-btn-outline {
    background: #0f172a !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .tm-btn-outline:hover {
    background: #1e293b !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .tm-btn-collapse {
    background: #312e81 !important;
    color: #c7d2fe !important;
    border-color: #4338ca !important;
}

[data-theme="dark"] .bl-age-box {
    background: #0f172a !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .bl-age-input {
    color: #f8fafc !important;
}

[data-theme="dark"] .bl-age-lbl {
    color: #64748b !important;
}

[data-theme="dark"] .tm-elite-checkbox-box {
    background: #0f172a !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .tm-elite-checkbox-label {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .tm-elite-checkbox-item.active .tm-elite-checkbox-label {
    color: #38bdf8 !important;
}

/* Sub Tests Column Dark Mode */
[data-theme="dark"] .tm-subtests-header {
    background: #0f172a !important;
}

[data-theme="dark"] .tm-subtests-search-bar {
    background: #1e293b !important;
    border-bottom-color: #334155 !important;
}

[data-theme="dark"] .tm-subtests-dropdown {
    background: #0f172a !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .tm-subtests-dropdown-item {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .tm-subtests-table-container {
    background: #1e293b !important;
}

[data-theme="dark"] .tm-subtests-footer {
    background: #1e293b !important;
    border-top-color: #334155 !important;
}

[data-theme="dark"] .tm-footer-msg-header {
    background: #0f172a !important;
    border-bottom-color: #334155 !important;
}

[data-theme="dark"] .tm-footer-msg-body {
    background: #1e293b !important;
}

[data-theme="dark"] .tm-param-table th {
    background: #0f172a !important;
    color: #38bdf8 !important;
    border-bottom: 2px solid #334155 !important;
}

[data-theme="dark"] .tm-param-table td {
    background: #1e293b !important;
    color: #f8fafc !important;
    border-bottom: 1px solid #334155 !important;
}

[data-theme="dark"] .tm-param-row:hover,
[data-theme="dark"] .tm-param-row:hover td {
    background: #0f172a !important;
}

[data-theme="dark"] .tm-param-row.active,
[data-theme="dark"] .tm-param-row.active td {
    background: #1e3a8a !important;
}

[data-theme="dark"] .tm-param-sno {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .tm-param-row.active .tm-param-sno {
    color: #60a5fa !important;
}

/* Normal Values Red Card Dark Mode */
[data-theme="dark"] .tm-elite-red-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .tm-elite-red-header {
    background: linear-gradient(135deg, #312e81 0%, #1e1b4b 100%) !important;
}

[data-theme="dark"] .tm-elite-red-select {
    background: #0f172a !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .tm-elite-tab-row {
    background: #0f172a !important;
    border-bottom-color: #334155 !important;
}

[data-theme="dark"] .tm-elite-tab {
    color: #94a3b8 !important;
}

[data-theme="dark"] .tm-elite-tab.active {
    color: #38bdf8 !important;
    background: #1e293b !important;
    border-bottom-color: #38bdf8 !important;
}

[data-theme="dark"] .normal-values-body,
[data-theme="dark"] .tm-normal-values-body {
    background: #1e293b !important;
}

[data-theme="dark"] .tm-calc-box,
[data-theme="dark"] .tm-range-box {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .tm-section-title {
    color: #f8fafc !important;
}

[data-theme="dark"] .tm-rte-wrapper {
    background: #0f172a !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .e-richtexteditor,
[data-theme="dark"] .e-toolbar,
[data-theme="dark"] .e-rte-content,
[data-theme="dark"] .e-rte-content .e-content {
    background-color: #0f172a !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .e-toolbar .e-toolbar-item .e-tbar-btn,
[data-theme="dark"] .e-toolbar .e-toolbar-item .e-tbar-btn .e-icons {
    background: transparent !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .tm-age-table th {
    background: #0f172a !important;
    color: #38bdf8 !important;
    border-bottom: 2px solid #334155 !important;
}

[data-theme="dark"] .tm-age-table td {
    background: #1e293b !important;
    color: #f8fafc !important;
    border-bottom: 1px solid #334155 !important;
}

[data-theme="dark"] .tm-age-input {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .tm-specimen-pill {
    background: rgba(225, 29, 72, 0.2) !important;
    color: #fecdd3 !important;
    border: 1px solid rgba(225, 29, 72, 0.4) !important;
}

/* Modals Dark Mode */
[data-theme="dark"] .tm-modal-content,
[data-theme="dark"] .tm-popup-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .tm-modal-header {
    color: #f8fafc !important;
    border-bottom-color: #334155 !important;
}

[data-theme="dark"] .tm-modal-table th {
    background: #0f172a !important;
    color: #38bdf8 !important;
    border-bottom-color: #334155 !important;
}

[data-theme="dark"] .tm-modal-table td {
    background: #1e293b !important;
    color: #f8fafc !important;
    border-bottom-color: #334155 !important;
}

[data-theme="dark"] .tm-modal-row-action {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #38bdf8 !important;
}

html {
    font-size: 15px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

body {
    background-color: var(--background);
    background-image: url("https://www.transparenttextures.com/patterns/cubes.png");
    background-blend-mode: overlay;
    color: var(--text-dark);
    font-family: var(--font-main);
    font-size: 0.875rem;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0b4b70 0%, #0283c5 100%);
    color: white;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .logo-container div,
.sidebar.collapsed .sidebar-section-title,
.sidebar.collapsed .nav-item span {
    display: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 1rem;
}

.sidebar.collapsed .logo-container {
    justify-content: center;
    padding: 0;
}

.sidebar-header {
    padding: 1.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #ff00cc 0%, #3333ff 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.sidebar-section-title {
    font-size: 0.65rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    padding: 1.5rem 1rem 0.5rem;
    letter-spacing: 1px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s;
}

.nav-item:hover,
.nav-item.active {
    background: var(--sidebar-active);
    color: white;
}

.nav-item i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

/* Content Area Styling */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 1.5rem 2rem;
    width: calc(100% - var(--sidebar-width));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
}

.main-content.no-sidebar {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 0 !important;
}

.sidebar.collapsed+.top-header+.main-content,
.sidebar.collapsed~.main-content {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
}

.desktop-toggle {
    background: rgba(255, 255, 255, 0.1);
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
    flex-shrink: 0;
}

.desktop-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.sidebar.collapsed .desktop-toggle {
    position: absolute !important;
    right: -14px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
}

.sidebar.collapsed .sidebar-header {
    flex-direction: row !important;
    padding: 0.75rem 0.5rem !important;
    justify-content: center !important;
    position: relative !important;
    align-items: center !important;
}

/* Header Adjustments */
.top-header {
    height: var(--top-header-height);
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width);
    background: white;
    z-index: 999;
    display: none;
    /* Hidden on desktop since it's empty */
    align-items: center;
    justify-content: flex-end;
    padding: 0 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed+.top-header {
    left: var(--sidebar-collapsed-width);
}

.main-content {
    margin-top: 0;
}

/* Header Card Styling */
.header-card {
    background: var(--header-card-bg);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    color: white;
}

.header-title-container {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.header-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.header-text h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.header-text p {
    font-size: 0.7rem;
    font-weight: 700;
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-bar {
    background: white;
    border-radius: 999px;
    padding: 0.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 300px;
}

.search-bar i {
    color: var(--text-muted);
}

.search-bar input {
    border: none;
    outline: none;
    font-size: 0.9rem;
    flex: 1;
}

.btn-add-new {
    background: var(--view-blue);
    color: white;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Table Styling */
.table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.sharp-table {
    width: 100%;
    border-collapse: collapse;
}

.sharp-table thead {
    background: transparent;
}

.sharp-table th {
    padding: 1.25rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: left;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--primary);
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.sharp-table th:first-child {
    border-top-left-radius: 12px;
}

.sharp-table th:last-child {
    border-top-right-radius: 12px;
    border-right: none;
}

.sharp-table td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    vertical-align: middle;
}

.sharp-table tr:last-child td {
    border-bottom: none;
}

.ref-code {
    color: #0891b2;
    font-weight: 700;
}

.doctor-details {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ecfeff;
    color: #0891b2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.doctor-name {
    font-weight: 700;
    color: #101828;
}

.action-btns {
    display: flex;
    gap: 0.5rem;
}

.btn-action {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-action:hover {
    background: #f9fafb;
}

/* Modal Styling */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 2000;
}

.doctor-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1150px;
    max-width: 95vw;
    max-height: 90vh;
    background: white;
    border-radius: 16px;
    z-index: 2001;
    display: flex;
    flex-direction: column;
    overflow: visible;
    animation: modalIn 0.3s ease-out;
}

.doctor-modal form {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: visible;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.modal-header {
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
}

.form-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-col label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.form-control {
    background: #fdfdfd;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

.modal-footer {
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #fdfdfd;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

.btn-save {
    background: #0891b2;
    color: white;
    padding: 0.6rem 2.5rem;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    cursor: pointer;
}

.btn-delete-seq {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fee2e2;
    color: #dc2626;
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    border: 1.5px solid #fca5a5;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s;
}

.btn-delete-seq:hover:not(:disabled) {
    background: #fca5a5;
    border-color: #ef4444;
}

.btn-delete-seq:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Date Selection Styles */
.date-selector-wrapper {
    position: relative;
    width: 100%;
}

.calendar-popup,
.calendar-inline {
    background: white;
    border-radius: 12px;
    z-index: 100;
}

.calendar-popup {
    position: absolute;
    top: 100%;
    left: 0;
    width: 320px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    margin-top: 8px;
    padding: 1.25rem;
    animation: dropdownSlide 0.2s ease-out;
}

.calendar-inline {
    width: 100%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 0.65rem;
    border-radius: 12px;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.month-year-title {
    font-weight: 800;
    font-size: 0.88rem;
    color: #026aa7;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.header-nav {
    display: flex;
    gap: 0.25rem;
}

.nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #4a5568;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.nav-btn:hover {
    background: rgba(2, 106, 167, 0.08);
    color: #026aa7;
}

.calendar-grid {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 4px !important;
}

.day-label {
    text-align: center;
    font-size: 0.68rem;
    font-weight: 700;
    color: #a0aec0;
    padding-bottom: 0.4rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    border: 2px solid transparent;
}

.calendar-day:hover:not(.disabled) {
    background: #edf2f7;
}

.calendar-day.selected {
    background: #026aa7 !important;
    color: white !important;
    border-radius: 8px;
    font-weight: 800;
}

.calendar-day.today {
    border-color: #026aa7;
    color: #026aa7;
}

.calendar-day.disabled {
    color: #cbd5e0 !important;
    cursor: not-allowed !important;
    opacity: 0.4;
}

.calendar-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #edf2f7;
}

.footer-btn {
    font-size: 0.78rem;
    font-weight: 700;
    color: #026aa7;
    background: transparent;
    border: none;
    cursor: pointer;
}

.footer-btn:hover {
    text-decoration: underline;
}

/* --- Responsive Media Queries --- */

@media (min-width: 993px) {
    .mobile-nav-toggle {
        display: none;
    }
}



/* Tablets (<= 992px) */
@media (max-width: 992px) {
    :root {
        --sidebar-width: 280px;
        /* Drawer width */
    }

    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
        z-index: 2500;
        transition: transform 0.3s ease;
    }

    .desktop-toggle {
        display: none !important;
    }

    .sidebar.collapsed .logo-container div,
    .sidebar.collapsed .sidebar-section-title,
    .sidebar.collapsed .nav-item span {
        display: block !important;
    }

    .sidebar.collapsed .nav-item {
        justify-content: flex-start !important;
        padding: 0.75rem 1rem !important;
    }

    .sidebar.collapsed .logo-container {
        justify-content: flex-start !important;
        padding: 1.5rem 1rem !important;
    }

    .sidebar.show {
        transform: translateX(0) !important;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
    }

    .app-main-wrapper,
    .sidebar.collapsed~.app-main-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 0.75rem 0.5rem;
        margin-top: 0 !important;
    }

    .top-header {
        display: flex !important;
        /* Visible on mobile for hamburger menu */
        left: 0 !important;
        padding: 0 1.5rem;
        justify-content: space-between;
    }

    .mobile-nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: #f1f5f9;
        border-radius: 8px;
        cursor: pointer;
        color: var(--primary);
        font-size: 1.25rem;
        border: none;
    }

    .header-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .search-bar {
        width: 100%;
        max-width: 400px;
    }

    .doctor-modal {
        width: 95vw;
        height: 95vh;
        max-height: 95vh;
    }

    .form-row {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Phones (<= 768px) */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }

    .header-card {
        padding: 1.25rem;
    }

    .header-title-container {
        gap: 0.75rem;
    }

    .header-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-add-new {
        justify-content: center;
    }

    .modal-body {
        padding: 1.25rem;
    }

    .modal-footer {
        padding: 1.25rem;
    }

    .table-container {
        border-radius: 8px;
    }

    /* Make tables scrollable horizontally */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .sharp-table {
        min-width: 600px;
        /* Minimum width for table content */
    }
}

/* Sidebar Overlay Backdrop */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 2400;
    display: none;
}

.sidebar-overlay.show {
    display: block;
}

/* Hide number input spinners globally to prevent overlap with custom unit labels */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Global Alert / Error Box Styles */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    text-align: left;
    word-break: break-word;
}

.alert-danger {
    background-color: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    color: #991b1b !important;
}

.alert-danger .alert-icon {
    color: #dc2626 !important;
}

.alert-success {
    background-color: #f0fdf4 !important;
    border: 1px solid #bbf7d0 !important;
    color: #166534 !important;
}

.alert-success .alert-icon {
    color: #16a34a !important;
}

.alert-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-content {
    flex: 1;
}

/* Premium Custom Segmented Control Joined Styles */
.premium-segmented-control-joined {
    display: flex;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    height: 46px;
    width: 100%;
    max-width: 200px;
    box-sizing: border-box;
    overflow: hidden;
    background: #f8fafc;
    transition: all 0.2s ease;
}

.premium-segmented-control-joined:hover {
    border-color: #cbd5e1;
}

.segment-btn-joined {
    flex: 1;
    border: none;
    background: transparent;
    color: #475569;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.segment-btn-joined:first-child {
    border-right: 1px solid #e2e8f0;
}

.segment-btn-joined:hover:not(.active) {
    background: #f1f5f9;
    color: #0f172a;
}

.segment-btn-joined.btn-false.active {
    background: #64748b !important;
    color: white !important;
}

.segment-btn-joined.btn-true.active {
    background: #006b3c !important;
    color: white !important;
}

/* Schedule Checkboxes styling */
.schedule-checkboxes-group {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.schedule-check-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    margin: 0;
}

.schedule-check-input {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid #cbd5e1;
    border-radius: 4px;
    outline: none;
    background-color: #fff;
    cursor: pointer;
    display: grid;
    place-content: center;
    transition: all 0.2s ease;
    margin: 0;
}

.schedule-check-input:hover {
    border-color: #02659e;
    box-shadow: 0 0 0 3px rgba(2, 101, 158, 0.15);
}

.schedule-check-input:checked {
    background-color: #02659e;
    border-color: #02659e;
}

.schedule-check-input:checked::before {
    content: "";
    width: 10px;
    height: 10px;
    clip-path: polygon(14% 44%, 0 58%, 38% 96%, 100% 19%, 83% 5%, 38% 68%);
    background-color: white;
}

.schedule-check-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    user-select: none;
    cursor: pointer;
    transition: color 0.2s ease;
    margin: 0;
}

.schedule-check-item:hover .schedule-check-label {
    color: #02659e;
}

/* Pagination bar */
.pagination-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-btn {
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    color: #64748b !important;
    border-radius: 8px !important;
    width: 34px;
    height: 34px;
    font-size: 0.82rem;
    font-weight: 600;
    margin: 0 2px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.page-btn.active {
    background: #4f46e5 !important;
    color: #ffffff !important;
    border-color: #4f46e5 !important;
}

.page-btn:hover:not(.active):not(:disabled) {
    background: #f8fafc !important;
    color: #1e293b !important;
}

/* Action Popup Modal Styles */
.action-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 25, 40, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1200;
    animation: modalFadeIn 0.25s ease-out forwards;
}

.action-popup-card {
    width: min(420px, 96%);
    border-radius: 14px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #cfe4f2;
    box-shadow: 0 16px 36px rgba(3, 26, 46, 0.28);
    animation: modalScaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalScaleIn {
    from {
        transform: scale(0.95) translateY(12px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.action-popup-header {
    background: linear-gradient(135deg, #f0f3ff 0%, #e6ebff 100%);
    color: #312e81;
    padding: .9rem 1.2rem;
    font-size: 1.05rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(99, 102, 241, 0.15);
    font-family: 'Inter', 'Roboto', 'Segoe UI', sans-serif;
}

.action-popup-body {
    padding: 1rem;
    background: #f2f9ff;
    color: #0d3f5b;
    font-size: .96rem;
    text-align: left;
}

.action-popup-actions,
.action-popup-footer {
    display: flex;
    justify-content: flex-end;
    gap: .6rem;
    padding: .85rem 1rem 1rem;
    background: #f2f9ff;
    border-top: 1px solid #d5e9f7;
}

.popup-btn {
    min-width: 88px;
    border-radius: 8px;
    font-weight: 700;
    border: 1px solid transparent;
    padding: .45rem .9rem;
}

.popup-btn-cancel {
    background: #fff;
    color: #312e81;
    border-color: rgba(49, 46, 129, 0.35);
    transition: all 0.2s ease;
}

.popup-btn-cancel:hover {
    background: #f0f3ff;
    color: #1e1b4b;
    border-color: rgba(49, 46, 129, 0.6);
}

.popup-btn-delete {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
    transition: all 0.2s ease;
}

.popup-btn-delete:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.popup-btn-ok {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
    transition: all 0.2s ease;
}

/* ==========================================================================
   GLOBAL DARK MODE COMPREHENSIVE OVERRIDES
   ========================================================================== */
html[data-theme="dark"],
html[data-theme="dark"] body,
body.dark-mode {
    background-color: #090d16 !important;
    background: #090d16 !important;
    color: #f8fafc !important;
}

/* Master Page Backgrounds & Containers */
html[data-theme="dark"] .items-page,
html[data-theme="dark"] .purchase-page,
html[data-theme="dark"] .stock-page,
html[data-theme="dark"] .items-shell,
html[data-theme="dark"] .items-content {
    background-color: transparent !important;
    color: #f8fafc !important;
}

/* Header Cards Across Master Pages */
html[data-theme="dark"] .premium-header-card,
html[data-theme="dark"] .header-card,
html[data-theme="dark"] .cm-header-card,
html[data-theme="dark"] .lab-header-card,
html[data-theme="dark"] .dc-top-section,
html[data-theme="dark"] .op-header,
html[data-theme="dark"] .ip-header,
html[data-theme="dark"] .tm-elite-header,
html[data-theme="dark"] .re-card-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    border: 1px solid #334155 !important;
    color: #f8fafc !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .header-card-icon,
html[data-theme="dark"] .header-icon {
    background: #0f172a !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] .header-card-icon svg {
    stroke: #38bdf8 !important;
}

html[data-theme="dark"] .header-card-heading,
html[data-theme="dark"] .header-card-text h2,
html[data-theme="dark"] .header-card-text h1,
html[data-theme="dark"] .header-text h2 {
    color: #f8fafc !important;
}

html[data-theme="dark"] .header-card-subheading,
html[data-theme="dark"] .header-card-text p,
html[data-theme="dark"] .header-sub {
    color: #38bdf8 !important;
}

/* Header Controls & Search */
html[data-theme="dark"] .items-search,
html[data-theme="dark"] .search-input,
html[data-theme="dark"] .items-search-wrap input {
    background: #0f172a !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .items-search:focus,
html[data-theme="dark"] .search-input:focus {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15) !important;
    background: #0f172a !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .items-search-icon,
html[data-theme="dark"] .items-search-wrap i {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .view-toggle {
    background: #0f172a !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .view-toggle button {
    color: #94a3b8 !important;
    background: transparent !important;
}

html[data-theme="dark"] .view-toggle button.active {
    background: #1e293b !important;
    color: #38bdf8 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

/* Tables & Cards Main Structure */
html[data-theme="dark"] .items-main-card,
html[data-theme="dark"] .cm-table-card,
html[data-theme="dark"] .table-card,
html[data-theme="dark"] .directory-section,
html[data-theme="dark"] .re-card,
html[data-theme="dark"] .re-main-panel,
html[data-theme="dark"] .re-side-panel {
    background-color: #1e293b !important;
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35) !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] table.table.items-table thead tr th,
html[data-theme="dark"] .items-table th,
html[data-theme="dark"] .purchase-items-table-header th,
html[data-theme="dark"] table.table thead th,
html[data-theme="dark"] .medico-table th,
html[data-theme="dark"] .custom-table th,
html[data-theme="dark"] .sharp-table th,
html[data-theme="dark"] .exec-table th,
html[data-theme="dark"] table th,
html[data-theme="dark"] .lc-table th {
    background-color: #0f172a !important;
    background: #0f172a !important;
    color: #38bdf8 !important;
    border-bottom: 2px solid #334155 !important;
    border-right-color: #1e293b !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] table.items-table td,
html[data-theme="dark"] .items-table td,
html[data-theme="dark"] .medico-table td,
html[data-theme="dark"] .custom-table td,
html[data-theme="dark"] .sharp-table td,
html[data-theme="dark"] .exec-table td,
html[data-theme="dark"] table td,
html[data-theme="dark"] .lc-table td {
    background-color: #1e293b !important;
    background: #1e293b !important;
    color: #cbd5e1 !important;
    border-bottom: 1px solid #334155 !important;
}

html[data-theme="dark"] table.items-table tbody tr:hover td,
html[data-theme="dark"] .items-table tbody tr:hover td,
html[data-theme="dark"] table tbody tr:hover td {
    background-color: #0f172a !important;
}

html[data-theme="dark"] .items-table tr td:first-child {
    color: #38bdf8 !important;
}

html[data-theme="dark"] .items-table td:nth-child(2) {
    color: #818cf8 !important;
}

/* Force Light Colors for Text inside Table Cells in Dark Mode */
html[data-theme="dark"] table td strong,
html[data-theme="dark"] table td span:not(.badge):not([class*="status"]),
html[data-theme="dark"] table td div,
html[data-theme="dark"] table td[style*="color: #0f172a"],
html[data-theme="dark"] table td[style*="color:#0f172a"],
html[data-theme="dark"] table td[style*="color: #475569"],
html[data-theme="dark"] table td[style*="color:#475569"],
html[data-theme="dark"] table td[style*="color: #1e293b"],
html[data-theme="dark"] table td[style*="color:#1e293b"] {
    color: #f8fafc !important;
}

/* Footer / Pagination Controls */
html[data-theme="dark"] .display-controls,
html[data-theme="dark"] .pagination-footer,
html[data-theme="dark"] .dc-footer-card,
html[data-theme="dark"] .tm-footer,
html[data-theme="dark"] .re-footer-bar {
    background-color: #1e293b !important;
    background: #1e293b !important;
    border-top: 1px solid #334155 !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .total-count-text,
html[data-theme="dark"] .total-count-text span,
html[data-theme="dark"] .pagination-info {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .total-count-text strong {
    color: #38bdf8 !important;
}

html[data-theme="dark"] .page-btn,
html[data-theme="dark"] .pagination-bar .page-btn,
html[data-theme="dark"] .pagination-btns .page-btn {
    background-color: #0f172a !important;
    background: #0f172a !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .page-btn:hover:not(:disabled),
html[data-theme="dark"] .pagination-bar .page-btn:hover:not(:disabled) {
    background-color: #334155 !important;
    color: #38bdf8 !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .page-btn.active,
html[data-theme="dark"] .pagination-bar .page-btn.active,
html[data-theme="dark"] .pagination-btns .page-btn.active {
    background-color: #0284c7 !important;
    background: #0284c7 !important;
    color: #ffffff !important;
    border-color: #0284c7 !important;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.4) !important;
}

/* Action Buttons */
html[data-theme="dark"] .action-btn {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #38bdf8 !important;
}

html[data-theme="dark"] .action-btn:hover {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #7dd3fc !important;
}

html[data-theme="dark"] .action-btn.btn-edit {
    color: #38bdf8 !important;
}

html[data-theme="dark"] .action-btn.btn-delete {
    color: #f87171 !important;
}

/* Item Grid View Cards */
html[data-theme="dark"] .item-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] .item-card-head {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    color: #f8fafc !important;
    border-bottom: 1.5px solid #334155 !important;
}

html[data-theme="dark"] .card-item-code {
    color: #38bdf8 !important;
}

html[data-theme="dark"] .card-item-name {
    color: #f8fafc !important;
}

html[data-theme="dark"] .item-card-body {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .detail-row {
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .detail-row span {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .detail-row strong {
    color: #f8fafc !important;
}

/* Modals, Form Popups, Billing Cards & Typeahead */
html[data-theme="dark"] .modal-overlay,
html[data-theme="dark"] .action-popup-overlay {
    background: rgba(0, 0, 0, 0.75) !important;
}

html[data-theme="dark"] .modal-card,
html[data-theme="dark"] .action-popup-card,
html[data-theme="dark"] .modal-form-card,
html[data-theme="dark"] .modal-content {
    background-color: #1e293b !important;
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #f8fafc !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5) !important;
}

html[data-theme="dark"] .modal-header-bar,
html[data-theme="dark"] .modal-header {
    background: #0f172a !important;
    border-bottom: 1px solid #334155 !important;
}

html[data-theme="dark"] .modal-title,
html[data-theme="dark"] .modal-header-bar h3,
html[data-theme="dark"] .modal-header h3 {
    color: #f8fafc !important;
}

html[data-theme="dark"] .btn-close-modal {
    color: #94a3b8 !important;
    background: transparent !important;
}

html[data-theme="dark"] .btn-close-modal:hover {
    color: #f8fafc !important;
    background: #334155 !important;
}

html[data-theme="dark"] .form-section-title {
    color: #38bdf8 !important;
}

html[data-theme="dark"] .form-section-header {
    border-bottom-color: #334155 !important;
    border-top-color: #334155 !important;
}

html[data-theme="dark"] .field-label,
html[data-theme="dark"] label {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .premium-input,
html[data-theme="dark"] .purchase-item-input,
html[data-theme="dark"] .purchase-item-select,
html[data-theme="dark"] input.form-control,
html[data-theme="dark"] select.form-control,
html[data-theme="dark"] textarea.form-control {
    background-color: #0f172a !important;
    background: #0f172a !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .premium-input:focus,
html[data-theme="dark"] .purchase-item-input:focus,
html[data-theme="dark"] input.form-control:focus,
html[data-theme="dark"] select.form-control:focus {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15) !important;
}

html[data-theme="dark"] .premium-input:disabled,
html[data-theme="dark"] input:disabled,
html[data-theme="dark"] select:disabled {
    background: #1e293b !important;
    color: #38bdf8 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .bill-card-premium {
    background: #0f172a !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .bill-card-header-premium {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    color: #38bdf8 !important;
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .custom-typeahead-dropdown {
    background: #0f172a !important;
    border-color: #334155 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5) !important;
}

html[data-theme="dark"] .custom-typeahead-item {
    color: #f8fafc !important;
}

html[data-theme="dark"] .custom-typeahead-item:hover {
    background: #1e293b !important;
    color: #38bdf8 !important;
}

html[data-theme="dark"] .compact-summary-input {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .net-payable-wrapper-premium {
    border-top-color: #334155 !important;
}

html[data-theme="dark"] .net-payable-label-premium {
    color: #f8fafc !important;
}

html[data-theme="dark"] .net-payable-value-premium {
    color: #38bdf8 !important;
}

html[data-theme="dark"] .btn-dotted-add {
    background: #0f172a !important;
    border-color: #38bdf8 !important;
    color: #38bdf8 !important;
}

html[data-theme="dark"] .btn-dotted-add:hover {
    background: #1e293b !important;
    color: #7dd3fc !important;
}

html[data-theme="dark"] .roundoff-section div {
    background: #0f172a !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .btn-cancel-modal {
    background: #0f172a !important;
    color: #cbd5e1 !important;
    border: 1px solid #334155 !important;
}

html[data-theme="dark"] .btn-cancel-modal:hover {
    background: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .action-popup-header {
    color: #f8fafc !important;
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .action-popup-body,
html[data-theme="dark"] .action-popup-body p {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .action-popup-body strong {
    color: #38bdf8 !important;
}

html[data-theme="dark"] .popup-btn-cancel {
    background: #0f172a !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .form-check-label {
    color: #f8fafc !important;
}

/* Filter Groups & Report Toolbar Controls */
html[data-theme="dark"] .filter-group {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .filter-label {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .filter-label i {
    color: #38bdf8 !important;
}

html[data-theme="dark"] .filter-select,
html[data-theme="dark"] .filter-input-date {
    color: #f8fafc !important;
    background: transparent !important;
}

html[data-theme="dark"] .filter-select option {
    background: #0f172a !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .btn-report-preview {
    background: #0f172a !important;
    color: #38bdf8 !important;
    border-color: #38bdf8 !important;
}

html[data-theme="dark"] .btn-report-preview:hover:not(:disabled) {
    background: #1e293b !important;
    color: #7dd3fc !important;
    border-color: #7dd3fc !important;
}

html[data-theme="dark"] .btn-report-download {
    background: #15803d !important;
    border-color: #15803d !important;
    color: #ffffff !important;
}

/* Stock Adjustment Page Dark Mode & Alignment Overrides */
html[data-theme="dark"] .stock-adj-page {
    background: transparent !important;
}

html[data-theme="dark"] .filter-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] .table-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .table-card-header {
    background: #0f172a !important;
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .table-card-header h6 {
    color: #f8fafc !important;
}

html[data-theme="dark"] .table-card-footer {
    background: #0f172a !important;
    border-top-color: #334155 !important;
    color: #94a3b8 !important;
}

html[data-theme="dark"] .table-card-footer span,
html[data-theme="dark"] .table-card-footer strong {
    color: #f8fafc !important;
}

html[data-theme="dark"] .custom-table th {
    background-color: #0f172a !important;
    color: #38bdf8 !important;
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .custom-table td {
    background-color: #1e293b !important;
    color: #cbd5e1 !important;
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .custom-table tr:hover td {
    background-color: #0f172a !important;
}

html[data-theme="dark"] .table-active-row td {
    background-color: #0f172a !important;
}

html[data-theme="dark"] .batch-badge-blue,
html[data-theme="dark"] .batch-badge-dark {
    background: #0f172a !important;
    color: #38bdf8 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .qty-stepper-wrapper {
    background: #0f172a !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .stepper-input {
    color: #38bdf8 !important;
}

html[data-theme="dark"] .premium-input {
    background-color: #0f172a !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .custom-typeahead-dropdown {
    background: #0f172a !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
}

html[data-theme="dark"] .custom-typeahead-item {
    color: #f8fafc !important;
}

html[data-theme="dark"] .custom-typeahead-item:hover {
    background-color: #1e293b !important;
    color: #38bdf8 !important;
}

html[data-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}

/* Doctor Patient List Dark Mode Overrides */
html[data-theme="dark"] .dashboard-title h1 {
    color: #f8fafc !important;
}

html[data-theme="dark"] .btn-header-action {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #38bdf8 !important;
}

html[data-theme="dark"] .btn-header-action:hover:not(:disabled) {
    background: #1e293b !important;
    border-color: #38bdf8 !important;
    color: #7dd3fc !important;
}

html[data-theme="dark"] .btn-reset {
    background: #0f172a !important;
    border-color: #38bdf8 !important;
    color: #38bdf8 !important;
}

html[data-theme="dark"] .btn-reset:hover {
    background: #1e293b !important;
    color: #7dd3fc !important;
}

html[data-theme="dark"] .patient-id-badge {
    background: #0f172a !important;
    color: #38bdf8 !important;
    border: 1px solid #334155 !important;
}

html[data-theme="dark"] .time-badge {
    background: #0f172a !important;
    color: #f8fafc !important;
    border: 1px solid #334155 !important;
}

html[data-theme="dark"] .badge-walkin {
    background: #0f172a !important;
    color: #cbd5e1 !important;
    border: 1px solid #334155 !important;
}

/* VIP Dark Mode Overrides */
html[data-theme="dark"] .medico-table tr.vip-row td {
    background-color: rgba(245, 158, 11, 0.05) !important;
}

html[data-theme="dark"] .medico-table tr.vip-row:hover td {
    background-color: rgba(245, 158, 11, 0.1) !important;
}

html[data-theme="dark"] .medico-table td.vip-highlighted {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.22) 0%, rgba(180, 83, 9, 0.35) 100%) !important;
    border-left: 1.5px solid rgba(245, 158, 11, 0.45) !important;
    border-right: 1.5px solid rgba(245, 158, 11, 0.45) !important;
    box-shadow: inset 0 0 10px rgba(245, 158, 11, 0.12) !important;
}

html[data-theme="dark"] .medico-table tr.vip-row td.vip-highlighted {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.28) 0%, rgba(180, 83, 9, 0.4) 100%) !important;
}

html[data-theme="dark"] .medico-table tr:hover td.vip-highlighted,
html[data-theme="dark"] .medico-table tr.vip-row:hover td.vip-highlighted {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.38) 0%, rgba(180, 83, 9, 0.5) 100%) !important;
}

html[data-theme="dark"] .vip-badge {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(217, 119, 6, 0.35) 100%) !important;
    border: 1px solid rgba(251, 191, 36, 0.5) !important;
    color: #fbbf24 !important;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25) !important;
}

html[data-theme="dark"] .vip-badge i {
    color: #f59e0b !important;
}

html[data-theme="dark"] .vip-role-tag {
    background: rgba(217, 119, 6, 0.2) !important;
    border: 1px solid rgba(253, 224, 71, 0.35) !important;
    color: #fde047 !important;
}

html[data-theme="dark"] .btn-vip-active {
    background: linear-gradient(135deg, #b45309 0%, #d97706 100%) !important;
    border: 1.2px solid #f59e0b !important;
    color: #ffffff !important;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35) !important;
}

html[data-theme="dark"] .btn-vip-active:hover {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.5) !important;
}

html[data-theme="dark"] .btn-vip-active i {
    color: #fef08a !important;
}

html[data-theme="dark"] .btn-mark-vip {
    background: #0f172a !important;
    color: #94a3b8 !important;
    border: 1px solid #334155 !important;
}

html[data-theme="dark"] .btn-mark-vip:hover {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #fbbf24 !important;
    border-color: #f59e0b !important;
}

html[data-theme="dark"] .btn-mark-vip i {
    color: #64748b !important;
}

html[data-theme="dark"] .btn-mark-vip:hover i {
    color: #fbbf24 !important;
}

html[data-theme="dark"] .vip-cell-role {
    color: #fde047 !important;
}

html[data-theme="dark"] .vip-modal-container {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .vip-modal-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    border-bottom: 1px solid #334155 !important;
}

html[data-theme="dark"] .vip-modal-body input {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .btn-cancel-modal {
    background: #0f172a !important;
    border: 1px solid #334155 !important;
    color: #94a3b8 !important;
}

html[data-theme="dark"] .btn-cancel-modal:hover {
    background: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .patient-name {
    color: #f8fafc !important;
}

html[data-theme="dark"] .medico-table th {
    background: #0f172a !important;
    color: #38bdf8 !important;
    border-bottom: 2px solid #334155 !important;
}

html[data-theme="dark"] .medico-table td {
    background: #1e293b !important;
    color: #cbd5e1 !important;
    border-bottom: 1px solid #334155 !important;
}

html[data-theme="dark"] .medico-table tr:hover td {
    background: #0f172a !important;
}

html[data-theme="dark"] .filter-select,
html[data-theme="dark"] .filter-input {
    background: #0f172a !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .filter-select option {
    background: #0f172a !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .filter-card,
html[data-theme="dark"] .filters-card {
    background: #0f172a !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .table-card {
    background: #0f172a !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .pagination-footer {
    background: #0f172a !important;
    border-top: 1px solid #334155 !important;
}

html[data-theme="dark"] .pagination-info {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .pagination-info-highlight {
    color: #f8fafc !important;
}

html[data-theme="dark"] .pagination-btns .page-btn {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .pagination-btns .page-btn:hover:not(.active):not(:disabled) {
    background: #334155 !important;
    color: #38bdf8 !important;
}

html[data-theme="dark"] .pagination-btns .page-btn.active {
    background: #0284c7 !important;
    color: #ffffff !important;
}

/* CaseSheet Workspace Modal Dark Mode Overrides */
html[data-theme="dark"] .casesheet-modal {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .workspace-right {
    background: #0f172a !important;
    border-left: 1px solid #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .tabs-container {
    background: #0f172a !important;
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .tab-btn {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .tab-btn:hover {
    color: #38bdf8 !important;
}

html[data-theme="dark"] .tab-btn.active {
    color: #38bdf8 !important;
}

html[data-theme="dark"] .tab-btn.active::after {
    background: #38bdf8 !important;
}

html[data-theme="dark"] .tab-content {
    background: #0f172a !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .form-label,
html[data-theme="dark"] .history-block-label,
html[data-theme="dark"] .past-visits-label {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .form-control-input,
html[data-theme="dark"] .form-control-select,
html[data-theme="dark"] .form-control-textarea,
html[data-theme="dark"] .structured-table td input.table-input,
html[data-theme="dark"] .structured-table td select.table-input {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .form-control-input:disabled,
html[data-theme="dark"] .form-control-select:disabled,
html[data-theme="dark"] .form-control-textarea:disabled {
    background-color: #0f172a !important;
    color: #64748b !important;
}

html[data-theme="dark"] .vitals-side-card,
html[data-theme="dark"] .history-card,
html[data-theme="dark"] .structured-table-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .vitals-card-title,
html[data-theme="dark"] .vitals-section-title,
html[data-theme="dark"] .history-date {
    color: #38bdf8 !important;
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .vital-item {
    background: #0f172a !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .vital-name {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .vital-value {
    color: #f8fafc !important;
}

html[data-theme="dark"] .structured-table th {
    background: #0f172a !important;
    color: #38bdf8 !important;
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .structured-table td {
    background: #1e293b !important;
    color: #cbd5e1 !important;
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .casesheet-footer {
    background: #0f172a !important;
    border-top-color: #334155 !important;
}

html[data-theme="dark"] .past-visits-footer-selector {
    background: #1e293b !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .past-visit-pill-btn {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .past-visit-pill-btn:hover {
    background: rgba(56, 189, 248, 0.15) !important;
    color: #38bdf8 !important;
}

html[data-theme="dark"] .past-visit-pill-btn.active {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .btn-footer.btn-close {
    background: #1e293b !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .btn-footer.btn-close:hover {
    background: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .btn-footer.btn-draft {
    background: #0f172a !important;
    border-color: #38bdf8 !important;
    color: #38bdf8 !important;
}

html[data-theme="dark"] .btn-footer.btn-draft:hover:not(:disabled) {
    background: #1e293b !important;
    color: #7dd3fc !important;
}

html[data-theme="dark"] .autocomplete-dropdown,
html[data-theme="dark"] .inline-dropdown {
    background: #0f172a !important;
    border-color: #334155 !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5) !important;
}

html[data-theme="dark"] .autocomplete-item {
    color: #f8fafc !important;
    border-bottom-color: #1e293b !important;
}

html[data-theme="dark"] .autocomplete-item:hover,
html[data-theme="dark"] .autocomplete-item.active-focused {
    background: #1e293b !important;
    color: #38bdf8 !important;
    border-left: 4px solid #38bdf8 !important;
}

html[data-theme="dark"] .dosage-btn,
html[data-theme="dark"] .dosage-btn-sm {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .food-segmented-control {
    background: #1e293b !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .food-segmented-control .segment-btn {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .result-input-box {
    background: #0f172a !important;
    border-color: #334155 !important;
}

/* Test Master Dark Mode Overrides */
html[data-theme="dark"] .tm-elite-container {
    background: #0b0f19 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .tm-elite-header,
html[data-theme="dark"] .tm-elite-top-controls,
html[data-theme="dark"] .tm-top-actions-bar,
html[data-theme="dark"] .tm-section-header,
html[data-theme="dark"] .tm-footer,
html[data-theme="dark"] .tm-elite-sticky-footer {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .tm-elite-card,
html[data-theme="dark"] .tm-elite-red-card,
html[data-theme="dark"] .tm-modal-content {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .tm-elite-input,
html[data-theme="dark"] .tm-date-input,
html[data-theme="dark"] .tm-search-box input,
html[data-theme="dark"] .tm-search-wrapper input,
html[data-theme="dark"] .tm-age-input {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .tm-elite-tab-row {
    background: #0f172a !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .tm-elite-tab {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .tm-elite-tab.active {
    background: #1e293b !important;
    color: #38bdf8 !important;
    border-bottom-color: #38bdf8 !important;
}

html[data-theme="dark"] .tm-elite-table th,
html[data-theme="dark"] .tm-age-table th,
html[data-theme="dark"] .tm-modal-table th,
html[data-theme="dark"] .tm-param-table th {
    background: #0f172a !important;
    color: #38bdf8 !important;
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .tm-elite-table td,
html[data-theme="dark"] .tm-age-table td,
html[data-theme="dark"] .tm-modal-table td,
html[data-theme="dark"] .tm-param-table td {
    background: #1e293b !important;
    color: #cbd5e1 !important;
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .tm-param-row:hover td {
    background: #0f172a !important;
}

html[data-theme="dark"] .tm-user-name {
    color: #f8fafc !important;
}

html[data-theme="dark"] .tm-btn-outline {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .tm-btn-outline:hover {
    background: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .tm-actions-pill-row {
    background: #1e293b !important;
    border-color: #334155 !important;
}

/* Doctor Current Status Dark Mode Overrides */
html[data-theme="dark"] .dashboard-header {
    background: #0f172a !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .header-left h1 {
    color: #f8fafc !important;
}

html[data-theme="dark"] .btn-action-outline {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .btn-action-outline:hover {
    background: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .stat-card {
    background: #0f172a !important;
    border-color: #334155 !important;
    box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .stat-number {
    color: #f8fafc !important;
}

html[data-theme="dark"] .stat-label {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .panel-card {
    background: #0f172a !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 15px -4px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .panel-header {
    border-bottom-color: #1e293b !important;
}

html[data-theme="dark"] .panel-header h3 {
    color: #f8fafc !important;
}

html[data-theme="dark"] .panel-subtitle {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .form-label {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .search-select-input,
html[data-theme="dark"] .custom-input,
html[data-theme="dark"] .search-box input {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .search-select-dropdown {
    background: #0f172a !important;
    border-color: #334155 !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5) !important;
}

html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item.selected {
    background: #1e293b !important;
}

html[data-theme="dark"] .dropdown-item .item-name {
    color: #f8fafc !important;
}

html[data-theme="dark"] .active-doctor-preview {
    background: #1e293b !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .doctor-preview-info h4 {
    color: #f8fafc !important;
}

html[data-theme="dark"] .status-option-btn {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .status-option-btn:hover {
    background: #334155 !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .chip-btn {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .doctor-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .card-title-group h4 {
    color: #f8fafc !important;
}

html[data-theme="dark"] .card-specialty {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .info-row.remarks {
    background: #0f172a !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .card-quick-actions-bar {
    border-top-color: #334155 !important;
}

html[data-theme="dark"] .quick-status-dropdown,
html[data-theme="dark"] .table-status-dropdown {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .btn-card-edit,
html[data-theme="dark"] .btn-sm-action.edit {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #38bdf8 !important;
}

html[data-theme="dark"] .btn-card-edit:hover,
html[data-theme="dark"] .btn-sm-action.edit:hover {
    background: #1e293b !important;
    color: #7dd3fc !important;
}

html[data-theme="dark"] .view-toggle {
    background: #0f172a !important;
}

html[data-theme="dark"] .toggle-btn {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .toggle-btn.active {
    background: #1e293b !important;
    color: #38bdf8 !important;
}

html[data-theme="dark"] .filter-tabs {
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .tab-btn {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .tab-btn:hover {
    background: #1e293b !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .tab-btn.active {
    background: #1e293b !important;
    color: #38bdf8 !important;
}

html[data-theme="dark"] .custom-status-table th {
    background: #0f172a !important;
    color: #38bdf8 !important;
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .custom-status-table td {
    background: #1e293b !important;
    color: #cbd5e1 !important;
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .custom-status-table tr:hover td {
    background: #0f172a !important;
}

html[data-theme="dark"] .doc-name {
    color: #f8fafc !important;
}

html[data-theme="dark"] .spec-badge {
    background: #0f172a !important;
    color: #94a3b8 !important;
}

/* Master Pages Single View & Scrollable Table Container */
.referral-page {
    height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
}

.directory-section {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

.lc-table-container {
    flex: 1 !important;
    overflow-y: auto !important;
    max-height: calc(100vh - 260px) !important;
}

.lc-table thead tr {
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
}

.lc-table th {
    padding: 0.625rem 1.25rem !important;
}

.lc-table td {
    padding: 0.5rem 1.25rem !important;
}

/* Doctor Master (_1) Comprehensive Dark Mode Overrides */
html[data-theme="dark"] .referral-page {
    background-color: #0b0f19 !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .referral-page div[style*="background: #ffffff"],
html[data-theme="dark"] .referral-page div[style*="background:#ffffff"] {
    background: #0f172a !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 15px -3px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .referral-page h2,
html[data-theme="dark"] .referral-page h3,
html[data-theme="dark"] .referral-page h4 {
    color: #f8fafc !important;
}

html[data-theme="dark"] .referral-page span[style*="color: #0f172a"],
html[data-theme="dark"] .referral-page span[style*="color: #1e293b"],
html[data-theme="dark"] .referral-page span[style*="color: #334155"] {
    color: #f8fafc !important;
}

html[data-theme="dark"] .referral-page span[style*="color: #64748b"] {
    color: #94a3b8 !important;
}

/* Stat pills top bar */
html[data-theme="dark"] .referral-page div[style*="background: #f8fafc"] {
    background: #1e293b !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .referral-page div[style*="background: #f0fdf4"] {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}

html[data-theme="dark"] .referral-page div[style*="background: #fffbe6"] {
    background: rgba(245, 158, 11, 0.15) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
}

html[data-theme="dark"] .referral-page div[style*="background: #eff6ff"] {
    background: rgba(59, 130, 246, 0.15) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
}

/* Search input & Select dropdowns */
html[data-theme="dark"] .referral-page input[type="text"],
html[data-theme="dark"] .referral-page input[type="email"],
html[data-theme="dark"] .referral-page input[type="number"],
html[data-theme="dark"] .referral-page input[type="password"],
html[data-theme="dark"] .referral-page select,
html[data-theme="dark"] .referral-page textarea {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .referral-page select option {
    background: #1e293b !important;
    color: #f8fafc !important;
}

/* Role Filter tabs bar */
html[data-theme="dark"] .referral-page div[style*="background: #f1f5f9"] {
    background: #0f172a !important;
    border-color: #334155 !important;
}

/* Table styles */
html[data-theme="dark"] .referral-page tr[style*="background: #f8fafc"],
html[data-theme="dark"] .referral-page tr.table-hover-row {
    background: #0f172a !important;
}

html[data-theme="dark"] .referral-page tr.table-hover-row:hover {
    background: #1e293b !important;
}

html[data-theme="dark"] .referral-page tr[style*="background: #f8fafc"] th,
html[data-theme="dark"] .referral-page th {
    background: #0f172a !important;
    color: #38bdf8 !important;
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .referral-page td {
    border-bottom-color: #334155 !important;
    color: #cbd5e1 !important;
}

/* S.No badge # */
html[data-theme="dark"] .referral-page span[style*="background: #eef2ff"] {
    background: #1e293b !important;
    color: #818cf8 !important;
}

/* Specialty pill & qualification badge */
html[data-theme="dark"] .referral-page span[style*="background: #f8fafc"],
html[data-theme="dark"] .referral-page span[style*="background: #f1f5f9"] {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

/* OP Charge Slab pill */
html[data-theme="dark"] .referral-page span[style*="background: #f0fdf4"] {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
    color: #34d399 !important;
}

/* Action Buttons (Edit, View Profile, Delete) */
html[data-theme="dark"] .referral-page .action-hover-btn {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #38bdf8 !important;
}

html[data-theme="dark"] .referral-page .action-hover-btn:hover {
    background: #334155 !important;
    color: #7dd3fc !important;
}

/* Pagination Bar */
html[data-theme="dark"] .referral-page div[style*="border-top: 1px solid"] {
    background: #0f172a !important;
    border-top-color: #334155 !important;
}

html[data-theme="dark"] .referral-page button[style*="background: #ffffff"],
html[data-theme="dark"] .referral-page button[style*="background:#ffffff"] {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

/* Modal Form Styles for Doctor Master */
html[data-theme="dark"] .modal-form-card {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .modal-header-bar {
    background: #1e293b !important;
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .modal-header-bar h3 {
    color: #f8fafc !important;
}

html[data-theme="dark"] .modal-subtitle {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .modal-footer-bar {
    background: #1e293b !important;
    border-top-color: #334155 !important;
}

html[data-theme="dark"] .cm-label-top,
html[data-theme="dark"] .form-section-title {
    color: #f8fafc !important;
}

html[data-theme="dark"] .cm-input {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

/* Doctor Master Initials Avatar & Specific Role/Room Badges Dark Mode */
html[data-theme="dark"] .referral-page div[style*="background: #e0f2fe"],
html[data-theme="dark"] .referral-page div[style*="background:#e0f2fe"] {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    color: #38bdf8 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .referral-page span[style*="background: #d1fae5"],
html[data-theme="dark"] .referral-page span[style*="background:#d1fae5"] {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #34d399 !important;
}

html[data-theme="dark"] .referral-page span[style*="background: #dbeafe"],
html[data-theme="dark"] .referral-page span[style*="background:#dbeafe"] {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #60a5fa !important;
}

html[data-theme="dark"] .referral-page span[style*="background: #fef3c7"],
html[data-theme="dark"] .referral-page span[style*="background:#fef3c7"] {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #fbbf24 !important;
}

html[data-theme="dark"] .referral-page span[style*="background: #f3e8ff"],
html[data-theme="dark"] .referral-page span[style*="background:#f3e8ff"] {
    background: rgba(168, 85, 247, 0.15) !important;
    color: #c084fc !important;
}

/* Dark Mode Overrides for Slot Type Master */
html[data-theme="dark"] .badge-shortname {
    background: #1e293b !important;
    color: #38bdf8 !important;
    border: 1px solid #334155 !important;
}

html[data-theme="dark"] .visiting-yes-badge {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #34d399 !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
}

html[data-theme="dark"] .visiting-no-badge {
    background: #1e293b !important;
    color: #94a3b8 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .btn-action {
    background: #1e293b !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .btn-action.edit {
    color: #38bdf8 !important;
}

html[data-theme="dark"] .btn-action.delete {
    color: #f87171 !important;
}

html[data-theme="dark"] .btn-action:hover {
    background: #334155 !important;
}

/* Vitals Dashboard CSS Variables & Dark Mode Rules */
:root {
    --vitals-bg: #f7f5f0;
    --vitals-card-bg: #ffffff;
    --vitals-card-border: #eae7e1;
    --vitals-text-heading: #475569;
    --vitals-text-sub: #64748b;
    --vitals-sub-box-bg: #f8fafc;
    --vitals-sub-box-border: #e2e8f0;
    --vitals-drawer-bg: rgba(255, 255, 255, 0.85);
}

html[data-theme="dark"],
body.dark-mode,
html[data-theme="dark"] body {
    --vitals-bg: #090d16;
    --vitals-card-bg: #1e293b;
    --vitals-card-border: #334155;
    --vitals-text-heading: #f8fafc;
    --vitals-text-sub: #94a3b8;
    --vitals-sub-box-bg: #0f172a;
    --vitals-sub-box-border: #334155;
    --vitals-drawer-bg: rgba(15, 23, 42, 0.95);
}

html[data-theme="dark"] .vitals-dashboard-container,
body.dark-mode .vitals-dashboard-container {
    background-color: #090d16 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .vitals-card,
body.dark-mode .vitals-card,
html[data-theme="dark"] .vitals-chart-card,
body.dark-mode .vitals-chart-card,
html[data-theme="dark"] .vitals-kpi-card,
body.dark-mode .vitals-kpi-card,
html[data-theme="dark"] div[class*="vitals-card"],
body.dark-mode div[class*="vitals-card"] {
    background-color: #1e293b !important;
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4) !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .vitals-card-title,
body.dark-mode .vitals-card-title {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .vitals-card-heading,
body.dark-mode .vitals-card-heading {
    color: #f8fafc !important;
}

html[data-theme="dark"] .vitals-card-sub,
body.dark-mode .vitals-card-sub {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .vitals-sub-box,
body.dark-mode .vitals-sub-box {
    background-color: #0f172a !important;
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .vitals-item-label,
body.dark-mode .vitals-item-label,
html[data-theme="dark"] .vitals-legend-label,
body.dark-mode .vitals-legend-label {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .vitals-item-val,
body.dark-mode .vitals-item-val,
html[data-theme="dark"] .vitals-legend-val,
body.dark-mode .vitals-legend-val {
    color: #f8fafc !important;
}

html[data-theme="dark"] .vitals-dept-tabs,
body.dark-mode .vitals-dept-tabs {
    background-color: #0f172a !important;
    border: 1px solid #334155 !important;
}

html[data-theme="dark"] .vitals-drawer-panel,
body.dark-mode .vitals-drawer-panel {
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border-left: 1px solid #334155 !important;
    color: #f8fafc !important;
    box-shadow: -15px 0 45px rgba(0, 0, 0, 0.5) !important;
}

/* Dark Mode Overrides for Vitals Entry (VitalsMaster) Page */
html[data-theme="dark"] .vitals-filter-toolbar,
body.dark-mode .vitals-filter-toolbar {
    background-color: #1e293b !important;
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .vitals-search-box input,
body.dark-mode .vitals-search-box input {
    background-color: #0f172a !important;
    background: #0f172a !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .vitals-filter-select,
body.dark-mode .vitals-filter-select {
    background-color: #0f172a !important;
    background: #0f172a !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .vitals-filter-select-icon,
body.dark-mode .vitals-filter-select-icon,
html[data-theme="dark"] .vitals-search-icon,
body.dark-mode .vitals-search-icon {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .vitals-btn-clear,
body.dark-mode .vitals-btn-clear {
    background-color: #0f172a !important;
    background: #0f172a !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .vitals-btn-clear:hover,
body.dark-mode .vitals-btn-clear:hover {
    background-color: #334155 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .vitals-legend-bar,
body.dark-mode .vitals-legend-bar {
    background-color: #1e293b !important;
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .legend-title,
body.dark-mode .legend-title {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .vitals-page-size-select,
body.dark-mode .vitals-page-size-select {
    background-color: #0f172a !important;
    background: #0f172a !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .legend-badge.pending,
body.dark-mode .legend-badge.pending {
    background-color: #334155 !important;
    color: #cbd5e1 !important;
}

/* Dark Mode Overrides for Doctor Group Master Badges & Text */
html[data-theme="dark"] .badge-token-group,
body.dark-mode .badge-token-group {
    background-color: #312e81 !important;
    color: #a5b4fc !important;
    border: 1px solid rgba(165, 180, 252, 0.3) !important;
}

html[data-theme="dark"] .badge-token-doctor,
body.dark-mode .badge-token-doctor {
    background-color: #78350f !important;
    color: #fde68a !important;
    border: 1px solid rgba(253, 230, 138, 0.3) !important;
}

html[data-theme="dark"] .badge-active,
body.dark-mode .badge-active {
    background-color: #064e3b !important;
    color: #6ee7b7 !important;
    border: 1px solid rgba(110, 231, 183, 0.3) !important;
}

html[data-theme="dark"] .badge-inactive,
body.dark-mode .badge-inactive {
    background-color: #7f1d1d !important;
    color: #fca5a5 !important;
    border: 1px solid rgba(252, 165, 165, 0.3) !important;
}

/* Dark Mode Overrides for Patient Tracking Master (OGScreen) */
html[data-theme="dark"] .og-page,
body.dark-mode .og-page {
    background-color: #0f172a !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .lab-header-card,
body.dark-mode .lab-header-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .lab-title-text,
body.dark-mode .lab-title-text {
    color: #f8fafc !important;
}

html[data-theme="dark"] .status-text,
body.dark-mode .status-text {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .bg-indigo-50,
body.dark-mode .bg-indigo-50 {
    background: #1e293b !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .search-input,
body.dark-mode .search-input,
html[data-theme="dark"] .doctor-filter-select,
body.dark-mode .doctor-filter-select {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .search-icon-left,
body.dark-mode .search-icon-left,
html[data-theme="dark"] .select-arrow-icon-right,
body.dark-mode .select-arrow-icon-right {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .btn-toggle-completed,
body.dark-mode .btn-toggle-completed {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #a5b4fc !important;
}

html[data-theme="dark"] .btn-toggle-completed:hover,
body.dark-mode .btn-toggle-completed:hover {
    background-color: #1e293b !important;
    color: #c7d2fe !important;
}

html[data-theme="dark"] .stat-card,
body.dark-mode .stat-card,
html[data-theme="dark"] .date-picker-card,
body.dark-mode .date-picker-card {
    background-color: #1e293b !important;
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] .stat-label,
body.dark-mode .stat-label {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .stat-value,
body.dark-mode .stat-value {
    color: #f8fafc !important;
}

html[data-theme="dark"] .date-picker-input,
body.dark-mode .date-picker-input {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .reception-card,
body.dark-mode .reception-card {
    background-color: #1e293b !important;
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] .card-header-flex,
body.dark-mode .card-header-flex {
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .card-section-title,
body.dark-mode .card-section-title {
    color: #f8fafc !important;
}

html[data-theme="dark"] .icon-indigo-badge,
body.dark-mode .icon-indigo-badge {
    background-color: #312e81 !important;
    color: #a5b4fc !important;
}

html[data-theme="dark"] .recent-checkins-table th,
body.dark-mode .recent-checkins-table th {
    background-color: #0f172a !important;
    border-bottom-color: #334155 !important;
    color: #38bdf8 !important;
}

html[data-theme="dark"] .recent-checkins-table td,
body.dark-mode .recent-checkins-table td {
    border-bottom-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .recent-checkins-table tr:hover td,
body.dark-mode .recent-checkins-table tr:hover td {
    background-color: #0f172a !important;
}

html[data-theme="dark"] .col-sno,
body.dark-mode .col-sno,
html[data-theme="dark"] .col-time,
body.dark-mode .col-time,
html[data-theme="dark"] .notes-input-cell,
body.dark-mode .notes-input-cell {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .table-footer,
body.dark-mode .table-footer {
    background-color: #1e293b !important;
    border-top-color: #334155 !important;
}

html[data-theme="dark"] .footer-info-text,
body.dark-mode .footer-info-text {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .pagination-btn,
body.dark-mode .pagination-btn {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .pagination-btn.active,
body.dark-mode .pagination-btn.active {
    background-color: #4f46e5 !important;
    border-color: #4f46e5 !important;
    color: #ffffff !important;
}

/* Dark Mode Overrides for Reception Portal */
html[data-theme="dark"] .reception-page,
body.dark-mode .reception-page {
    background-color: #0f172a !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .lab-header-card,
body.dark-mode .lab-header-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .lab-title-text,
body.dark-mode .lab-title-text {
    color: #f8fafc !important;
}

html[data-theme="dark"] .status-text,
body.dark-mode .status-text {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .bg-indigo-50,
body.dark-mode .bg-indigo-50 {
    background: #1e293b !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .reception-card,
body.dark-mode .reception-card {
    background-color: #1e293b !important;
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] .card-header-flex,
body.dark-mode .card-header-flex {
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .card-section-title,
body.dark-mode .card-section-title {
    color: #f8fafc !important;
}

html[data-theme="dark"] .icon-indigo-badge,
body.dark-mode .icon-indigo-badge {
    background-color: #312e81 !important;
    color: #a5b4fc !important;
}

html[data-theme="dark"] .queue-status-badge,
body.dark-mode .queue-status-badge {
    background-color: #312e81 !important;
    color: #a5b4fc !important;
}

html[data-theme="dark"] .field-uppercase-label,
body.dark-mode .field-uppercase-label {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .patient-id-control,
body.dark-mode .patient-id-control {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .search-results-dropdown,
body.dark-mode .search-results-dropdown {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .search-result-item,
body.dark-mode .search-result-item {
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .search-result-item:hover,
body.dark-mode .search-result-item:hover {
    background-color: #0f172a !important;
}

html[data-theme="dark"] .result-name,
body.dark-mode .result-name {
    color: #f8fafc !important;
}

html[data-theme="dark"] .result-sub,
body.dark-mode .result-sub {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .patient-found-banner,
body.dark-mode .patient-found-banner {
    background: #0f172a !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .patient-full-name,
body.dark-mode .patient-full-name {
    color: #f8fafc !important;
}

html[data-theme="dark"] .patient-sub-detail,
body.dark-mode .patient-sub-detail {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .mrn-badge-pill,
body.dark-mode .mrn-badge-pill {
    background-color: #312e81 !important;
    color: #a5b4fc !important;
}

html[data-theme="dark"] .btn-outline-modify,
body.dark-mode .btn-outline-modify {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .btn-outline-modify:hover,
body.dark-mode .btn-outline-modify:hover {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .patient-not-found-banner,
body.dark-mode .patient-not-found-banner {
    background-color: #422006 !important;
    border-color: #78350f !important;
    color: #fef08a !important;
}

html[data-theme="dark"] .recent-checkins-table th,
body.dark-mode .recent-checkins-table th {
    background-color: #0f172a !important;
    border-bottom-color: #334155 !important;
    color: #38bdf8 !important;
}

html[data-theme="dark"] .recent-checkins-table td,
body.dark-mode .recent-checkins-table td {
    border-bottom-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .recent-checkins-table tr:hover td,
body.dark-mode .recent-checkins-table tr:hover td {
    background-color: #0f172a !important;
}

html[data-theme="dark"] .recent-checkins-table .text-dark,
body.dark-mode .recent-checkins-table .text-dark,
html[data-theme="dark"] .table-icon-text,
body.dark-mode .table-icon-text {
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .modal-container,
body.dark-mode .modal-container {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .modal-header,
body.dark-mode .modal-header,
html[data-theme="dark"] .modal-footer,
body.dark-mode .modal-footer {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .modal-title,
body.dark-mode .modal-title {
    color: #38bdf8 !important;
}

html[data-theme="dark"] .btn-secondary,
body.dark-mode .btn-secondary {
    background-color: #0f172a !important;
    border: 1px solid #334155 !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .form-control-input,
body.dark-mode .form-control-input,
html[data-theme="dark"] .form-control-select,
body.dark-mode .form-control-select {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

/* Dark Mode Overrides for Appointment Pre-Booking */
html[data-theme="dark"] .prebooking-page,
body.dark-mode .prebooking-page {
    background-color: #0f172a !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .recent-table-wrapper,
body.dark-mode .recent-table-wrapper {
    background-color: #1e293b !important;
    background: #1e293b !important;
}

html[data-theme="dark"] .btn-action-edit,
body.dark-mode .btn-action-edit,
html[data-theme="dark"] .btn-action-delete,
body.dark-mode .btn-action-delete,
html[data-theme="dark"] .btn-action-check,
body.dark-mode .btn-action-check {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .btn-action-edit:hover,
body.dark-mode .btn-action-edit:hover {
    background-color: #312e81 !important;
    border-color: #4f46e5 !important;
    color: #a5b4fc !important;
}

html[data-theme="dark"] .btn-action-delete:hover,
body.dark-mode .btn-action-delete:hover {
    background-color: #7f1d1d !important;
    border-color: #ef4444 !important;
    color: #fca5a5 !important;
}

html[data-theme="dark"] .textarea-control,
body.dark-mode .textarea-control {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

/* Dark Mode Overrides for Lab Settings */
html[data-theme="dark"] .ls-viewport,
body.dark-mode .ls-viewport {
    background-color: #0f172a !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .ls-hero-card,
body.dark-mode .ls-hero-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .ls-hero-heading,
body.dark-mode .ls-hero-heading {
    color: #f8fafc !important;
}

html[data-theme="dark"] .ls-hero-subheading,
body.dark-mode .ls-hero-subheading {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .ls-hero-icon,
body.dark-mode .ls-hero-icon {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #a5b4fc !important;
}

html[data-theme="dark"] .ls-nav-sidebar,
body.dark-mode .ls-nav-sidebar,
html[data-theme="dark"] .ls-details-panel,
body.dark-mode .ls-details-panel {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] .ls-nav-header,
body.dark-mode .ls-nav-header {
    border-bottom-color: #334155 !important;
    color: #94a3b8 !important;
}

html[data-theme="dark"] .ls-category-btn,
body.dark-mode .ls-category-btn {
    background-color: #0f172a !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .ls-category-btn:hover,
body.dark-mode .ls-category-btn:hover {
    background-color: #1e293b !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .ls-category-btn.active,
body.dark-mode .ls-category-btn.active {
    background: #312e81 !important;
    border-color: #6366f1 !important;
}

html[data-theme="dark"] .ls-cat-title,
body.dark-mode .ls-cat-title {
    color: #f8fafc !important;
}

html[data-theme="dark"] .ls-cat-sub,
body.dark-mode .ls-cat-sub {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .ls-section-main-title,
body.dark-mode .ls-section-main-title {
    color: #f8fafc !important;
}

html[data-theme="dark"] .ls-section-sub-title,
body.dark-mode .ls-section-sub-title {
    color: #94a3b8 !important;
}

.ls-grid-2 {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    margin-bottom: 12px !important;
}

.ls-grid-3 {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 12px !important;
}

html[data-theme="dark"] .ls-feature-card,
body.dark-mode .ls-feature-card {
    background-color: #0f172a !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .ls-feature-card:hover,
body.dark-mode .ls-feature-card:hover {
    background-color: #1e293b !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .ls-feature-title,
body.dark-mode .ls-feature-title {
    color: #f8fafc !important;
}

html[data-theme="dark"] .ls-feature-desc,
body.dark-mode .ls-feature-desc {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .ls-form-label,
body.dark-mode .ls-form-label {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .ls-form-input,
body.dark-mode .ls-form-input,
html[data-theme="dark"] .ls-form-select,
body.dark-mode .ls-form-select,
html[data-theme="dark"] .ls-form-textarea,
body.dark-mode .ls-form-textarea {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .ls-dropzone-wrapper,
body.dark-mode .ls-dropzone-wrapper,
html[data-theme="dark"] .ls-signee-card,
body.dark-mode .ls-signee-card {
    background-color: #0f172a !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .ls-dropzone-area,
body.dark-mode .ls-dropzone-area,
html[data-theme="dark"] .ls-sig-dropzone,
body.dark-mode .ls-sig-dropzone {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .ls-dropzone-area .text-dark,
body.dark-mode .ls-dropzone-area .text-dark,
html[data-theme="dark"] .ls-dropzone-wrapper .text-dark,
body.dark-mode .ls-dropzone-wrapper .text-dark,
html[data-theme="dark"] .ls-sig-dropzone .text-dark,
body.dark-mode .ls-sig-dropzone .text-dark {
    color: #f8fafc !important;
}

html[data-theme="dark"] .ls-dropzone-area .text-secondary,
body.dark-mode .ls-dropzone-area .text-secondary,
html[data-theme="dark"] .ls-dropzone-wrapper .text-secondary,
body.dark-mode .ls-dropzone-wrapper .text-secondary,
html[data-theme="dark"] .ls-sig-dropzone .text-secondary,
body.dark-mode .ls-sig-dropzone .text-secondary {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .ls-status-pill,
body.dark-mode .ls-status-pill {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .ls-status-pill.info,
body.dark-mode .ls-status-pill.info {
    background-color: #0c4a6e !important;
    border-color: #0284c7 !important;
    color: #e0f2fe !important;
}

html[data-theme="dark"] .ls-status-pill.info code,
body.dark-mode .ls-status-pill.info code {
    color: #38bdf8 !important;
    background-color: transparent !important;
}

html[data-theme="dark"] .ls-status-pill.success,
body.dark-mode .ls-status-pill.success {
    background-color: #14532d !important;
    border-color: #16a34a !important;
    color: #dcfce7 !important;
}

.ls-signee-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
}

.ls-signee-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ls-signee-icon-box {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.ls-signee-icon-box.primary {
    background: #e0e7ff;
    color: #4338ca;
}

.ls-signee-icon-box.rose {
    background: #ffe4e6;
    color: #e11d48;
}

.ls-signee-title {
    font-size: 0.8rem;
    font-weight: 800;
    color: #1e293b;
}

.ls-btn-browse-sig {
    background: #4f46e5;
    color: #ffffff;
    border: none;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    transition: all 0.15s ease;
}

.ls-btn-browse-sig:hover {
    background: #4338ca;
}

.ls-btn-browse-sig.rose {
    background: #e11d48;
}

.ls-btn-browse-sig.rose:hover {
    background: #be123c;
}

html[data-theme="dark"] .ls-signee-header,
body.dark-mode .ls-signee-header {
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .ls-signee-title,
body.dark-mode .ls-signee-title {
    color: #f8fafc !important;
}

html[data-theme="dark"] .ls-signee-icon-box.primary,
body.dark-mode .ls-signee-icon-box.primary,
html[data-theme="dark"] .ls-sig-icon-box.primary,
body.dark-mode .ls-sig-icon-box.primary {
    background-color: #312e81 !important;
    color: #a5b4fc !important;
}

html[data-theme="dark"] .ls-signee-icon-box.rose,
body.dark-mode .ls-signee-icon-box.rose,
html[data-theme="dark"] .ls-sig-icon-box.rose,
body.dark-mode .ls-sig-icon-box.rose {
    background-color: #881337 !important;
    color: #fda4af !important;
}

.ls-margin-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    padding: 12px 14px;
}

.ls-margin-card.rose {
    background: #fff1f2;
    border-color: #fecdd3;
}

html[data-theme="dark"] .ls-margin-card,
body.dark-mode .ls-margin-card {
    background-color: #0f172a !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .ls-margin-card.rose,
body.dark-mode .ls-margin-card.rose {
    background-color: #1f1424 !important;
    border-color: #881337 !important;
}

html[data-theme="dark"] .ls-margin-card .text-primary,
body.dark-mode .ls-margin-card .text-primary {
    color: #818cf8 !important;
}

html[data-theme="dark"] .ls-margin-card .text-danger,
body.dark-mode .ls-margin-card .text-danger {
    color: #fb7185 !important;
}

html[data-theme="dark"] .bg-indigo-soft,
body.dark-mode .bg-indigo-soft {
    background-color: #312e81 !important;
    color: #a5b4fc !important;
}

html[data-theme="dark"] .bg-purple-soft,
body.dark-mode .bg-purple-soft {
    background-color: #581c87 !important;
    color: #d8b4fe !important;
}

html[data-theme="dark"] .bg-cyan-soft,
body.dark-mode .bg-cyan-soft {
    background-color: #164e63 !important;
    color: #67e8f9 !important;
}

html[data-theme="dark"] .bg-blue-soft,
body.dark-mode .bg-blue-soft {
    background-color: #1e3a8a !important;
    color: #93c5fd !important;
}

html[data-theme="dark"] .bg-emerald-soft,
body.dark-mode .bg-emerald-soft {
    background-color: #064e3b !important;
    color: #6ee7b7 !important;
}

html[data-theme="dark"] .bg-rose-soft,
body.dark-mode .bg-rose-soft {
    background-color: #881337 !important;
    color: #fda4af !important;
}

/* ==================== USER RIGHTS / SECURITY CONTROL CENTER DARK MODE ==================== */
html[data-theme="dark"] .user-rights-container,
body.dark-mode .user-rights-container {
    background: #0b1329 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .glass-morphic,
body.dark-mode .glass-morphic {
    background: #111c38 !important;
    border-color: #1e293b !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .title-text h1,
body.dark-mode .title-text h1 {
    color: #f8fafc !important;
}

html[data-theme="dark"] .title-text p,
body.dark-mode .title-text p {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .config-label,
body.dark-mode .config-label {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .custom-select,
body.dark-mode .custom-select,
html[data-theme="dark"] .matrix-input-text,
body.dark-mode .matrix-input-text {
    background: #0b1329 !important;
    border-color: #1e293b !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .custom-select option,
body.dark-mode .custom-select option {
    background-color: #0b1329 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .role-pill,
body.dark-mode .role-pill {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #94a3b8 !important;
}

html[data-theme="dark"] .role-pill:hover,
body.dark-mode .role-pill:hover {
    background: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .role-pill.active,
body.dark-mode .role-pill.active {
    background: #0ea5e9 !important;
    border-color: #0ea5e9 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .matrix-header,
body.dark-mode .matrix-header {
    background: #111c38 !important;
    border-bottom-color: #1e293b !important;
}

html[data-theme="dark"] .matrix-header h3,
body.dark-mode .matrix-header h3 {
    color: #f8fafc !important;
}

html[data-theme="dark"] .matrix-info,
body.dark-mode .matrix-info {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .matrix-table th,
body.dark-mode .matrix-table th {
    color: #94a3b8 !important;
    border-bottom-color: #1e293b !important;
}

html[data-theme="dark"] .matrix-table td,
body.dark-mode .matrix-table td {
    background: #0b1329 !important;
    border-top-color: #1e293b !important;
    border-bottom-color: #1e293b !important;
}

html[data-theme="dark"] .matrix-table tr td:first-child,
body.dark-mode .matrix-table tr td:first-child {
    border-left-color: #1e293b !important;
}

html[data-theme="dark"] .matrix-table tr td:last-child,
body.dark-mode .matrix-table tr td:last-child {
    border-right-color: #1e293b !important;
}

html[data-theme="dark"] .module-name,
body.dark-mode .module-name {
    color: #f8fafc !important;
}

html[data-theme="dark"] .module-desc,
body.dark-mode .module-desc {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .level-option,
body.dark-mode .level-option {
    background: #0b1329 !important;
    border-color: #1e293b !important;
}

html[data-theme="dark"] .level-option i,
body.dark-mode .level-option i {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .level-option span,
body.dark-mode .level-option span {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .level-option.active,
body.dark-mode .level-option.active {
    border-color: #0ea5e9 !important;
    background: rgba(14, 165, 233, 0.15) !important;
}

html[data-theme="dark"] .level-option.active i,
body.dark-mode .level-option.active i {
    color: #38bdf8 !important;
}

html[data-theme="dark"] .level-option.active span,
body.dark-mode .level-option.active span {
    color: #38bdf8 !important;
}

/* ==================== USER MASTER PAGINATION STYLES ==================== */
.table-pagination-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 10px 10px;
}

.table-pagination-footer .pagination-info,
.pagination-info {
    font-size: 0.78rem;
    color: #64748b;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pg-numbers {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 9px;
    border-radius: 6px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pg-btn:hover:not(:disabled) {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

.pg-btn.active {
    background: #4f46e5 !important;
    border-color: #4f46e5 !important;
    color: #ffffff !important;
    font-weight: 700;
}

.pg-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Dark Mode Overrides for Table Pagination Footer */
html[data-theme="dark"] .table-pagination-footer,
body.dark-mode .table-pagination-footer {
    background: #0f172a !important;
    border-top-color: #1e293b !important;
}

html[data-theme="dark"] .table-pagination-footer .pagination-info,
body.dark-mode .table-pagination-footer .pagination-info,
html[data-theme="dark"] .pagination-info,
body.dark-mode .pagination-info {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .pg-btn,
body.dark-mode .pg-btn {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .pg-btn:hover:not(:disabled),
body.dark-mode .pg-btn:hover:not(:disabled) {
    background: #334155 !important;
    color: #ffffff !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .pg-btn.active,
body.dark-mode .pg-btn.active {
    background: #4f46e5 !important;
    border-color: #4f46e5 !important;
    color: #ffffff !important;
}

/* Prevent browser autofill background yellow/blue overlay & popup styling */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-background-clip: text;
    -webkit-text-fill-color: inherit !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Global Confirm Card Modal UI */
.confirm-card-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 440px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    animation: confirmModalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1301;
}

@keyframes confirmModalPop {
    from {
        opacity: 0;
        transform: translate(-50%, -46%) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.confirm-card-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    position: relative;
}

.confirm-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.confirm-card-icon.red {
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid #fee2e2;
}

.confirm-card-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.confirm-card-subtitle {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
}

.confirm-card-close {
    position: absolute;
    top: -4px;
    right: -4px;
    background: transparent;
    border: none;
    font-size: 1.35rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.confirm-card-close:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.confirm-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.confirm-card-body p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: #334155;
    line-height: 1.5;
}

.confirm-card-warning {
    background: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: #856404;
    font-weight: 600;
}

.confirm-card-warning i {
    font-size: 0.95rem;
    margin-top: 1px;
    flex-shrink: 0;
}

.confirm-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 0.5rem;
}

.btn-confirm-cancel {
    height: 38px;
    padding: 0 1.15rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-confirm-cancel:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-confirm-action {
    height: 38px;
    padding: 0 1.25rem;
    font-size: 0.82rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.15s ease;
}

.btn-confirm-action.red {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
}

.btn-confirm-action.red:hover:not(:disabled) {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 6px 14px rgba(220, 38, 38, 0.3);
}

.btn-confirm-action:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

[data-theme="dark"] .confirm-card-modal {
    background: #1e293b;
    border: 1px solid #334155;
    box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .confirm-card-title {
    color: #f8fafc;
}

[data-theme="dark"] .confirm-card-subtitle {
    color: #94a3b8;
}

[data-theme="dark"] .confirm-card-body p {
    color: #cbd5e1;
}

[data-theme="dark"] .confirm-card-close:hover {
    color: #ffffff;
    background: #334155;
}

[data-theme="dark"] .btn-confirm-cancel {
    background: #0f172a;
    border-color: #334155;
    color: #94a3b8;
}

[data-theme="dark"] .btn-confirm-cancel:hover {
    background: #334155;
    color: #ffffff;
}

/* ========================================================= */
/* REPORT PREVIEW MODAL STYLING (PHARMACY BILLING & STOCK)   */
/* ========================================================= */
.report-preview-modal-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(15, 23, 42, 0.75) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    animation: reportPreviewFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    margin: 0 !important;
    padding: 1.5rem !important;
    box-sizing: border-box !important;
}

@keyframes reportPreviewFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.report-preview-modal-dialog {
    background: #ffffff !important;
    border-radius: 16px !important;
    width: min(1280px, 96vw) !important;
    height: 92vh !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.2) !important;
    overflow: hidden !important;
    border: 1px solid #cbd5e1 !important;
    position: relative !important;
}

.report-preview-modal-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 12px 20px !important;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    border-bottom: 1px solid #e2e8f0 !important;
    gap: 12px !important;
    flex-wrap: nowrap !important;
    flex-shrink: 0 !important;
    overflow-x: auto !important;
}

.report-preview-header-brand {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex-shrink: 0 !important;
}

.report-preview-header-icon {
    font-size: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    background: #eef2ff !important;
    border: 1px solid #c7d2fe !important;
    border-radius: 10px !important;
    line-height: 1 !important;
}

.report-preview-title {
    margin: 0 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    letter-spacing: -0.2px !important;
}

.report-preview-subtitle {
    margin: 2px 0 0 0 !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    letter-spacing: 0.6px !important;
}

.report-preview-header-right {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: nowrap !important;
    flex-shrink: 0 !important;
}

.report-preview-filters {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    flex-shrink: 0 !important;
}

.report-preview-filters .filter-group {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: #f1f5f9 !important;
    padding: 4px 10px !important;
    border-radius: 8px !important;
    border: 1px solid #cbd5e1 !important;
    transition: all 0.2s ease !important;
}

.report-preview-filters .filter-group:hover,
.report-preview-filters .filter-group:focus-within {
    border-color: #6366f1 !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12) !important;
}

.report-preview-filters .filter-label {
    font-size: 11.5px !important;
    font-weight: 700 !important;
    color: #475569 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    white-space: nowrap !important;
    text-transform: uppercase !important;
    letter-spacing: 0.4px !important;
}

.report-preview-filters .filter-label i {
    color: #6366f1 !important;
}

.report-preview-filters .filter-select,
.report-preview-filters .filter-input-date {
    height: 28px !important;
    border: none !important;
    background: transparent !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    outline: none !important;
    padding: 0 4px !important;
    font-family: inherit !important;
    cursor: pointer !important;
}

.report-preview-filters .filter-select:focus,
.report-preview-filters .filter-input-date:focus {
    outline: none !important;
}

.report-preview-header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.btn-modal-print {
    padding: 7px 16px !important;
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3) !important;
    transition: all 0.15s ease !important;
}

.btn-modal-print:hover:not(:disabled) {
    background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%) !important;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.4) !important;
    transform: translateY(-1px) !important;
}

.btn-modal-print:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

.btn-modal-download {
    padding: 7px 16px !important;
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.3) !important;
    transition: all 0.15s ease !important;
}

.btn-modal-download:hover:not(:disabled) {
    background: linear-gradient(135deg, #15803d 0%, #166534 100%) !important;
    box-shadow: 0 4px 10px rgba(22, 163, 74, 0.4) !important;
    transform: translateY(-1px) !important;
}

.btn-modal-download:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

.btn-modal-close {
    width: 34px !important;
    height: 34px !important;
    border-radius: 8px !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #64748b !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.15s ease !important;
    padding: 0 !important;
}

.btn-modal-close:hover {
    background: #fee2e2 !important;
    color: #dc2626 !important;
    border-color: #fca5a5 !important;
    transform: scale(1.05) !important;
}

.report-preview-modal-body {
    flex: 1 !important;
    position: relative !important;
    overflow: hidden !important;
    background: #334155 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.report-preview-iframe {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    display: block !important;
}

.report-preview-loading-overlay {
    position: absolute !important;
    inset: 0 !important;
    background: rgba(15, 23, 42, 0.45) !important;
    backdrop-filter: blur(2px) !important;
    -webkit-backdrop-filter: blur(2px) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10 !important;
    gap: 12px !important;
    pointer-events: none !important;
}

.report-preview-loading-overlay .spinner-border {
    width: 2.75rem !important;
    height: 2.75rem !important;
    color: #818cf8 !important;
}

.report-preview-loading-overlay .loading-text {
    color: #ffffff !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    letter-spacing: 0.2px !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6) !important;
}

.report-preview-error-overlay {
    position: absolute !important;
    inset: 0 !important;
    background: rgba(255, 255, 255, 0.96) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10 !important;
    gap: 8px !important;
}

/* Dark mode support */
[data-theme="dark"] .report-preview-modal-dialog {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8) !important;
}

[data-theme="dark"] .report-preview-modal-header {
    background: #0f172a !important;
    border-bottom-color: #334155 !important;
}

[data-theme="dark"] .report-preview-header-icon {
    background: #1e1b4b !important;
    border-color: #3730a3 !important;
}

[data-theme="dark"] .report-preview-title {
    color: #f8fafc !important;
}

[data-theme="dark"] .report-preview-subtitle {
    color: #94a3b8 !important;
}

[data-theme="dark"] .report-preview-filters .filter-group {
    background: #1e293b !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .report-preview-filters .filter-label {
    color: #94a3b8 !important;
}

[data-theme="dark"] .report-preview-filters .filter-select,
[data-theme="dark"] .report-preview-filters .filter-input-date {
    color: #f8fafc !important;
}

[data-theme="dark"] .btn-modal-close {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .btn-modal-close:hover {
    background: #450a0a !important;
    color: #f87171 !important;
    border-color: #7f1d1d !important;
}

[data-theme="dark"] .report-preview-loading-overlay,
[data-theme="dark"] .report-preview-error-overlay {
    background: rgba(15, 23, 42, 0.96) !important;
    color: #f8fafc !important;
}