/* ==========================================================================
   FinanseMT dark theme
   Scope rule: every selector is bound to html[data-theme="dark"].
   ========================================================================== */

html[data-theme="dark"] {
    color-scheme: dark;

    --bg-app: #0B0D10;
    --bg-app-soft: #111418;
    --bg-card: #181C22;
    --bg-card-soft: #14181D;
    --bg-card-hover: #222832;

    --bg-navbar: #090D13;
    --bg-navbar-active: #1D2633;

    --surface-0: #0B0D10;
    --surface-1: #111418;
    --surface-2: #181C22;
    --surface-3: #222832;
    --surface-4: #2B333F;

    --border-subtle: rgba(148, 163, 184, 0.08);
    --border-soft: rgba(148, 163, 184, 0.06);
    --border-strong: rgba(148, 163, 184, 0.16);
    --border-focus: rgba(59, 130, 246, 0.48);

    --text-primary: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;
    --text-label: #64748B;
    --text-disabled: #64748B;

    --primary: #3B82F6;
    --primary-strong: #2563EB;
    --primary-soft: rgba(59, 130, 246, 0.12);
    --primary-hover: rgba(59, 130, 246, 0.08);

    --success: #22C55E;
    --success-soft: rgba(34, 197, 94, 0.12);
    --warning: #FDBA74;
    --warning-strong: #F97316;
    --warning-soft: rgba(249, 115, 22, 0.14);
    --danger: #EF4444;
    --danger-soft: rgba(239, 68, 68, 0.14);
    --info: #93C5FD;
    --info-soft: rgba(59, 130, 246, 0.14);

    --shadow-card: 0 12px 32px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(248, 250, 252, 0.035);
    --shadow-card-soft: 0 8px 24px rgba(0, 0, 0, 0.20), inset 0 1px 0 rgba(248, 250, 252, 0.03);
    --shadow-menu: 0 18px 46px rgba(0, 0, 0, 0.34);
    --ring: rgba(59, 130, 246, 0.12);

    --ns-bg: var(--surface-0);
    --ns-surface: var(--surface-2);
    --ns-surface-alt: var(--surface-1);
    --ns-surface-muted: var(--surface-3);
    --ns-border: var(--border-subtle);
    --ns-border-strong: var(--border-strong);
    --ns-border-soft: rgba(148, 163, 184, 0.05);
    --ns-card-border: var(--border-subtle);

    --ns-text: var(--text-primary);
    --ns-text-muted: var(--text-secondary);
    --ns-text-soft: var(--text-muted);
    --ns-label: var(--text-label);

    --ns-primary: var(--primary);
    --ns-primary-strong: var(--primary-strong);
    --ns-primary-weak: var(--primary-soft);
    --ns-primary-icon-bg: rgba(59, 130, 246, 0.12);
    --ns-primary-text: #F8FAFC;

    --ns-link: #60A5FA;
    --ns-link-visited: #93C5FD;

    --ns-success: var(--success);
    --ns-success-bg: var(--success-soft);
    --ns-danger: var(--danger);
    --ns-danger-bg: var(--danger-soft);
    --ns-warning: var(--warning);
    --ns-warning-bg: var(--warning-soft);
    --ns-info: var(--info);
    --ns-info-bg: var(--info-soft);

    --ns-topbar-bg: var(--bg-navbar);
    --ns-topbar-bg-strong: #111418;
    --ns-topbar-text: var(--text-primary);
    --ns-topbar-text-nav: var(--text-secondary);
    --ns-topbar-text-dim: var(--text-muted);
    --ns-topbar-hover: var(--surface-3);
    --ns-topbar-active: var(--bg-navbar-active);
    --ns-topbar-active-line: var(--primary);
    --ns-topbar-divider: rgba(148, 163, 184, 0.12);
    --ns-topbar-brand-bg: rgba(59, 130, 246, 0.16);
    --ns-topbar-brand-fg: #DBEAFE;

    --ns-menu-bg: var(--surface-2);
    --ns-menu-border: var(--border-strong);
    --ns-menu-text: var(--text-secondary);
    --ns-menu-hover: var(--surface-3);
    --ns-menu-shadow: var(--shadow-menu);

    --ns-card-shadow: var(--shadow-card-soft);

    --bg: var(--surface-0);
    --surface: var(--surface-2);
    --card: var(--surface-2);
    --card-2: var(--surface-1);
    --card-3: var(--surface-3);
    --border: var(--border-subtle);
    --primary-contrast: #F8FAFC;
    --text-tertiary: var(--text-muted);
    --muted: var(--text-muted);
    --success-bg: var(--success-soft);
    --warning-bg: var(--warning-soft);
    --danger-bg: var(--danger-soft);
    --shadow-sm: var(--shadow-card-soft);
    --shadow-md: var(--shadow-menu);
    --control-bg: var(--surface-3);
    --control-border: rgba(148, 163, 184, 0.10);
    --control-text: var(--text-primary);
    --control-border-hover: rgba(59, 130, 246, 0.45);
    --control-placeholder: #64748B;
    --card-border: var(--border-subtle);

    --auth-bg: var(--surface-0);
    --auth-card: var(--surface-2);
    --auth-border: var(--border-subtle);
    --auth-soft: var(--surface-1);
    --auth-text: var(--text-primary);
    --auth-muted: var(--text-muted);
    --auth-label: var(--text-label);
    --auth-input: var(--surface-3);
    --auth-input-border: rgba(148, 163, 184, 0.10);
    --auth-input-hover: rgba(59, 130, 246, 0.45);
    --auth-primary: var(--primary-strong);
    --auth-primary-hover: var(--primary);
    --auth-danger: #FCA5A5;
    --auth-danger-bg: var(--danger-soft);
    --auth-danger-border: rgba(239, 68, 68, 0.25);
    --auth-ring: var(--ring);
    --auth-shadow: var(--shadow-card);
}

html[data-theme="dark"],
html[data-theme="dark"] body {
    background: var(--surface-0);
}

html[data-theme="dark"] body {
    color: var(--text-secondary);
}

html[data-theme="dark"] body:not(.print-body) {
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.035), transparent 26%),
        linear-gradient(180deg, #0B0D10 0%, #111418 100%) !important;
}

html[data-theme="dark"] ::selection {
    background: rgba(59, 130, 246, 0.32);
    color: var(--text-primary);
}

html[data-theme="dark"] * {
    scrollbar-color: #3B424D #101317;
}

html[data-theme="dark"] *::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

html[data-theme="dark"] *::-webkit-scrollbar-track {
    background: #101317;
}

html[data-theme="dark"] *::-webkit-scrollbar-thumb {
    background: #3B424D;
    border: 2px solid #101317;
    border-radius: 999px;
}

/* Layout */
html[data-theme="dark"] .app-shell,
html[data-theme="dark"] .main,
html[data-theme="dark"] .content,
html[data-theme="dark"] .page,
html[data-theme="dark"] .page-content,
html[data-theme="dark"] .container,
html[data-theme="dark"] .ns-content,
html[data-theme="dark"] .dashboard-shell,
html[data-theme="dark"] .trips-page,
html[data-theme="dark"] .trip-detail-page,
html[data-theme="dark"] .reports-page,
html[data-theme="dark"] .admin-page,
html[data-theme="dark"] .stawki-shell,
html[data-theme="dark"] #stawki-shell,
html[data-theme="dark"] .bulk-shell,
html[data-theme="dark"] .antenna-shell {
    color: var(--text-secondary);
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] strong,
html[data-theme="dark"] .title,
html[data-theme="dark"] .page-title,
html[data-theme="dark"] .ns-page-title,
html[data-theme="dark"] .trip-title,
html[data-theme="dark"] .card-title,
html[data-theme="dark"] .section-title,
html[data-theme="dark"] .account-card-title {
    color: var(--text-primary);
}

html[data-theme="dark"] p,
html[data-theme="dark"] small,
html[data-theme="dark"] .muted,
html[data-theme="dark"] .subtitle,
html[data-theme="dark"] .page-subtitle,
html[data-theme="dark"] .description,
html[data-theme="dark"] .account-card-subtitle,
html[data-theme="dark"] .account-heading p,
html[data-theme="dark"] .help-text,
html[data-theme="dark"] .hint,
html[data-theme="dark"] .meta,
html[data-theme="dark"] .trip-meta {
    color: var(--text-muted);
}

html[data-theme="dark"] a {
    color: #60A5FA;
}

html[data-theme="dark"] hr {
    border-color: rgba(148, 163, 184, 0.08);
}

/* Navbar */
html[data-theme="dark"] .ns-topbar {
    background: rgba(9, 11, 14, 0.96);
    border-bottom-color: rgba(148, 163, 184, 0.12);
    box-shadow: 0 1px 0 rgba(248, 250, 252, 0.03);
    backdrop-filter: saturate(1.15) blur(12px);
}

html[data-theme="dark"] .ns-topbar a,
html[data-theme="dark"] .ns-topbar button,
html[data-theme="dark"] .ns-nav-item {
    color: var(--text-secondary);
}

html[data-theme="dark"] .ns-nav-item:hover,
html[data-theme="dark"] .ns-nav-group:hover > .ns-nav-item {
    background: rgba(248, 250, 252, 0.04);
    color: var(--text-primary);
}

html[data-theme="dark"] .ns-nav-item.is-active {
    background: rgba(248, 250, 252, 0.065);
    color: var(--text-primary);
}

html[data-theme="dark"] .ns-topbar-brand-mark {
    background: rgba(59, 130, 246, 0.16) !important;
    border: 1px solid rgba(96, 165, 250, 0.18);
    color: #DBEAFE !important;
}

html[data-theme="dark"] .ns-menu,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .menu,
html[data-theme="dark"] .popover,
html[data-theme="dark"] .autocomplete-results,
html[data-theme="dark"] .autocomplete-list,
html[data-theme="dark"] .typeahead-menu,
html[data-theme="dark"] .hms-panel {
    background: var(--surface-2) !important;
    border-color: var(--border-strong) !important;
    color: var(--text-secondary) !important;
    box-shadow: var(--shadow-menu) !important;
}

html[data-theme="dark"] .ns-menu-header,
html[data-theme="dark"] .dropdown-header,
html[data-theme="dark"] .menu-header {
    color: var(--text-label) !important;
}

html[data-theme="dark"] .ns-menu-item,
html[data-theme="dark"] .dropdown-item,
html[data-theme="dark"] .menu-item,
html[data-theme="dark"] .autocomplete-option,
html[data-theme="dark"] .hms-option,
html[data-theme="dark"] .hms-panel label {
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] .ns-menu-item:hover,
html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .menu-item:hover,
html[data-theme="dark"] .autocomplete-option:hover,
html[data-theme="dark"] .hms-option:hover,
html[data-theme="dark"] .hms-panel label:hover {
    background: var(--surface-3) !important;
    color: var(--text-primary) !important;
}

/* Core surfaces */
html[data-theme="dark"] .card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .box,
html[data-theme="dark"] .section,
html[data-theme="dark"] .tile,
html[data-theme="dark"] .widget,
html[data-theme="dark"] .account-header,
html[data-theme="dark"] .account-card,
html[data-theme="dark"] .dashboard-card,
html[data-theme="dark"] .dashboard-panel,
html[data-theme="dark"] .dashboard-filterbar,
html[data-theme="dark"] .dashboard-chart-card,
html[data-theme="dark"] .trips-list-card,
html[data-theme="dark"] .trip-card,
html[data-theme="dark"] .trip-row,
html[data-theme="dark"] .trip-detail-card,
html[data-theme="dark"] .trip-section,
html[data-theme="dark"] .trip-page-header,
html[data-theme="dark"] .finance-panel,
html[data-theme="dark"] .finance-card,
html[data-theme="dark"] .finance-side,
html[data-theme="dark"] .finance-ledger-panel,
html[data-theme="dark"] .finance-ledger-summary,
html[data-theme="dark"] .finance-accordion,
html[data-theme="dark"] .pax-card,
html[data-theme="dark"] .crew-card,
html[data-theme="dark"] .transport-card,
html[data-theme="dark"] .transport-segment-card,
html[data-theme="dark"] .transport-incoming-card,
html[data-theme="dark"] .rejs-card,
html[data-theme="dark"] .extra-card,
html[data-theme="dark"] .commission-card,
html[data-theme="dark"] .reports-card,
html[data-theme="dark"] .reports-panel,
html[data-theme="dark"] .reports-section,
html[data-theme="dark"] .reports-toolbar,
html[data-theme="dark"] .bulk-card,
html[data-theme="dark"] .bulk-panel,
html[data-theme="dark"] .bulk-section,
html[data-theme="dark"] .admin-card,
html[data-theme="dark"] .admin-panel,
html[data-theme="dark"] .stawki-card,
html[data-theme="dark"] .stawki-panel,
html[data-theme="dark"] .program-card,
html[data-theme="dark"] .program-panel,
html[data-theme="dark"] .notes-card,
html[data-theme="dark"] .notes-panel,
html[data-theme="dark"] .notes-item,
html[data-theme="dark"] .notes-editor,
html[data-theme="dark"] .hybrid-card,
html[data-theme="dark"] .hybrid-day-card,
html[data-theme="dark"] .hybrid-work-panel,
html[data-theme="dark"] .hybrid-split-panel,
html[data-theme="dark"] .antenna-card,
html[data-theme="dark"] .ks-filter,
html[data-theme="dark"] .ks-region,
html[data-theme="dark"] .ks-extra,
html[data-theme="dark"] .ks-grand,
html[data-theme="dark"] .symi-card,
html[data-theme="dark"] .paxos-card {
    background: linear-gradient(180deg, #181C22 0%, #12161B 100%) !important;
    border-color: var(--border-subtle) !important;
    color: var(--text-secondary) !important;
    box-shadow: var(--shadow-card-soft) !important;
}

html[data-theme="dark"] .section-soft,
html[data-theme="dark"] .inner-surface,
html[data-theme="dark"] .summary-card,
html[data-theme="dark"] .summary-section,
html[data-theme="dark"] .summary-row,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .value-card,
html[data-theme="dark"] .list-row,
html[data-theme="dark"] .detail-row,
html[data-theme="dark"] .accordion-body,
html[data-theme="dark"] .reports-row,
html[data-theme="dark"] .bulk-row,
html[data-theme="dark"] .hybrid-work-row,
html[data-theme="dark"] .antenna-row,
html[data-theme="dark"] .notes-row {
    background: rgba(248, 250, 252, 0.018) !important;
    border-color: rgba(148, 163, 184, 0.06) !important;
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] .card:hover,
html[data-theme="dark"] .panel:hover,
html[data-theme="dark"] .trip-row:hover,
html[data-theme="dark"] .list-row:hover,
html[data-theme="dark"] .detail-row:hover,
html[data-theme="dark"] .bulk-row:hover,
html[data-theme="dark"] .antenna-row:hover,
html[data-theme="dark"] .hybrid-work-row:hover,
html[data-theme="dark"] .notes-row:hover {
    background: linear-gradient(180deg, #222832 0%, #191E25 100%) !important;
    border-color: rgba(148, 163, 184, 0.14) !important;
}

html[data-theme="dark"] [style*="background:#fff"],
html[data-theme="dark"] [style*="background: #fff"],
html[data-theme="dark"] [style*="background:#FFF"],
html[data-theme="dark"] [style*="background: #FFF"],
html[data-theme="dark"] [style*="background:#ffffff"],
html[data-theme="dark"] [style*="background: #ffffff"],
html[data-theme="dark"] [style*="background:#FFFFFF"],
html[data-theme="dark"] [style*="background: #FFFFFF"],
html[data-theme="dark"] [style*="background:white"],
html[data-theme="dark"] [style*="background: white"],
html[data-theme="dark"] [style*="background-color:#fff"],
html[data-theme="dark"] [style*="background-color: #fff"],
html[data-theme="dark"] [style*="background-color:#FFFFFF"],
html[data-theme="dark"] [style*="background-color: #FFFFFF"] {
    background: var(--surface-2) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-subtle) !important;
}

html[data-theme="dark"] [style*="background:#F8FAFC"],
html[data-theme="dark"] [style*="background: #F8FAFC"],
html[data-theme="dark"] [style*="background:#F9FAFB"],
html[data-theme="dark"] [style*="background: #F9FAFB"],
html[data-theme="dark"] [style*="background:#F3F4F6"],
html[data-theme="dark"] [style*="background: #F3F4F6"],
html[data-theme="dark"] [style*="background:#F1F5F9"],
html[data-theme="dark"] [style*="background: #F1F5F9"],
html[data-theme="dark"] [style*="background:#FBFCFE"],
html[data-theme="dark"] [style*="background: #FBFCFE"],
html[data-theme="dark"] [style*="background-color:#F8FAFC"],
html[data-theme="dark"] [style*="background-color: #F8FAFC"],
html[data-theme="dark"] [style*="background-color:#F9FAFB"],
html[data-theme="dark"] [style*="background-color: #F9FAFB"],
html[data-theme="dark"] [style*="background-color:#F3F4F6"],
html[data-theme="dark"] [style*="background-color: #F3F4F6"],
html[data-theme="dark"] [style*="background-color:#F1F5F9"],
html[data-theme="dark"] [style*="background-color: #F1F5F9"],
html[data-theme="dark"] [style*="background-color:#FBFCFE"],
html[data-theme="dark"] [style*="background-color: #FBFCFE"] {
    background: var(--surface-1) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-subtle) !important;
}

html[data-theme="dark"] [style*="background:#EFF6FF"],
html[data-theme="dark"] [style*="background: #EFF6FF"],
html[data-theme="dark"] [style*="background-color:#EFF6FF"],
html[data-theme="dark"] [style*="background-color: #EFF6FF"] {
    background: rgba(59, 130, 246, 0.10) !important;
    border-color: rgba(59, 130, 246, 0.22) !important;
    color: #BFDBFE !important;
}

html[data-theme="dark"] [style*="background:#ECFDF3"],
html[data-theme="dark"] [style*="background: #ECFDF3"],
html[data-theme="dark"] [style*="background-color:#ECFDF3"],
html[data-theme="dark"] [style*="background-color: #ECFDF3"] {
    background: rgba(34, 197, 94, 0.12) !important;
    border-color: rgba(34, 197, 94, 0.22) !important;
    color: #4ADE80 !important;
}

html[data-theme="dark"] [style*="background:#fff7ed"],
html[data-theme="dark"] [style*="background: #fff7ed"],
html[data-theme="dark"] [style*="background:#FFF7ED"],
html[data-theme="dark"] [style*="background: #FFF7ED"],
html[data-theme="dark"] .warning-panel,
html[data-theme="dark"] .alert-warning {
    background: rgba(249, 115, 22, 0.12) !important;
    border-color: rgba(249, 115, 22, 0.24) !important;
    color: #FDBA74 !important;
}

html[data-theme="dark"] [style*="background:#FFF7F7"],
html[data-theme="dark"] [style*="background: #FFF7F7"],
html[data-theme="dark"] .danger-panel,
html[data-theme="dark"] .alert-danger {
    background: rgba(239, 68, 68, 0.12) !important;
    border-color: rgba(239, 68, 68, 0.24) !important;
    color: #FCA5A5 !important;
}

html[data-theme="dark"] [style*="color:#111827"],
html[data-theme="dark"] [style*="color: #111827"],
html[data-theme="dark"] [style*="color:#0f172a"],
html[data-theme="dark"] [style*="color: #0f172a"],
html[data-theme="dark"] [style*="color:#0F172A"],
html[data-theme="dark"] [style*="color: #0F172A"],
html[data-theme="dark"] [style*="color:black"],
html[data-theme="dark"] [style*="color: black"] {
    color: var(--text-primary) !important;
}

html[data-theme="dark"] [style*="color:#334155"],
html[data-theme="dark"] [style*="color: #334155"],
html[data-theme="dark"] [style*="color:#374151"],
html[data-theme="dark"] [style*="color: #374151"],
html[data-theme="dark"] [style*="color:#475569"],
html[data-theme="dark"] [style*="color: #475569"] {
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] [style*="color:#64748B"],
html[data-theme="dark"] [style*="color: #64748B"],
html[data-theme="dark"] [style*="color:#6B7280"],
html[data-theme="dark"] [style*="color: #6B7280"],
html[data-theme="dark"] [style*="color:#7C8798"],
html[data-theme="dark"] [style*="color: #7C8798"],
html[data-theme="dark"] [style*="color:#9CA3AF"],
html[data-theme="dark"] [style*="color: #9CA3AF"] {
    color: var(--text-muted) !important;
}

/* KPI and metrics */
html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .finance-kpi,
html[data-theme="dark"] .dashboard-kpi,
html[data-theme="dark"] .metric-box,
html[data-theme="dark"] .metabase-metric-box,
html[data-theme="dark"] .hybrid-kpi,
html[data-theme="dark"] .antenna-kpi,
html[data-theme="dark"] .rm-kpi {
    background: linear-gradient(180deg, #1B2028 0%, #13171D 100%) !important;
    border-color: rgba(148, 163, 184, 0.08) !important;
    box-shadow: var(--shadow-card) !important;
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] .kpi-card .icon,
html[data-theme="dark"] .kpi-icon,
html[data-theme="dark"] .metric-icon,
html[data-theme="dark"] .finance-kpi-icon,
html[data-theme="dark"] .dashboard-kpi-icon,
html[data-theme="dark"] .trip-metric-icon {
    background: rgba(59, 130, 246, 0.12) !important;
    border: 1px solid rgba(59, 130, 246, 0.18) !important;
    color: #93C5FD !important;
}

html[data-theme="dark"] .kpi-value,
html[data-theme="dark"] .metric-value,
html[data-theme="dark"] .dashboard-kpi-value,
html[data-theme="dark"] .finance-kpi-value,
html[data-theme="dark"] .symi-kpi-value,
html[data-theme="dark"] .paxos-kpi-value,
html[data-theme="dark"] .antenna-kpi strong,
html[data-theme="dark"] .value,
html[data-theme="dark"] .amount,
html[data-theme="dark"] .money,
html[data-theme="dark"] .currency {
    color: var(--text-primary) !important;
    font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] .kpi-label,
html[data-theme="dark"] .metric-label,
html[data-theme="dark"] .dashboard-kpi-label,
html[data-theme="dark"] .finance-kpi-label,
html[data-theme="dark"] .label,
html[data-theme="dark"] label,
html[data-theme="dark"] th,
html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .account-eyebrow,
html[data-theme="dark"] .antenna-field label {
    color: var(--text-label) !important;
}

/* Forms */
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .input,
html[data-theme="dark"] .select,
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .field-control,
html[data-theme="dark"] .filter-control,
html[data-theme="dark"] .account-page input[type="password"],
html[data-theme="dark"] .account-page input[type="text"],
html[data-theme="dark"] .antenna-field select,
html[data-theme="dark"] .transport-input-control,
html[data-theme="dark"] .transport-form input,
html[data-theme="dark"] .transport-form select,
html[data-theme="dark"] .transport-form textarea,
html[data-theme="dark"] .rejs-form input,
html[data-theme="dark"] .rejs-form select,
html[data-theme="dark"] .rejs-form textarea,
html[data-theme="dark"] .extra-form input,
html[data-theme="dark"] .extra-form select,
html[data-theme="dark"] .extra-form textarea,
html[data-theme="dark"] .reports-filter input,
html[data-theme="dark"] .reports-filter select,
html[data-theme="dark"] .bulk-field input,
html[data-theme="dark"] .bulk-field select,
html[data-theme="dark"] .bulk-field textarea,
html[data-theme="dark"] .trd-row input,
html[data-theme="dark"] .trd-row select,
html[data-theme="dark"] .trd-field input,
html[data-theme="dark"] .trd-field select {
    background: var(--surface-3) !important;
    border-color: rgba(148, 163, 184, 0.10) !important;
    color: var(--text-primary) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: var(--text-label) !important;
}

html[data-theme="dark"] input:hover:not([disabled]):not([readonly]),
html[data-theme="dark"] select:hover:not([disabled]),
html[data-theme="dark"] textarea:hover:not([disabled]):not([readonly]),
html[data-theme="dark"] .form-control:hover,
html[data-theme="dark"] .field-control:hover {
    border-color: rgba(59, 130, 246, 0.45) !important;
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .field-control:focus {
    border-color: var(--border-focus) !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12) !important;
    outline: none !important;
}

html[data-theme="dark"] input[readonly],
html[data-theme="dark"] textarea[readonly],
html[data-theme="dark"] input[disabled],
html[data-theme="dark"] select[disabled],
html[data-theme="dark"] textarea[disabled],
html[data-theme="dark"] .is-disabled,
html[data-theme="dark"] [aria-disabled="true"] {
    background: rgba(100, 116, 139, 0.10) !important;
    border-color: rgba(148, 163, 184, 0.07) !important;
    color: var(--text-disabled) !important;
    opacity: 1 !important;
}

html[data-theme="dark"] option,
html[data-theme="dark"] optgroup {
    background: var(--surface-3);
    color: var(--text-primary);
}

html[data-theme="dark"] input[type="checkbox"],
html[data-theme="dark"] input[type="radio"] {
    accent-color: var(--primary);
}

/* Buttons */
html[data-theme="dark"] .btn,
html[data-theme="dark"] button,
html[data-theme="dark"] input[type="submit"],
html[data-theme="dark"] input[type="button"],
html[data-theme="dark"] .button {
    border-color: rgba(148, 163, 184, 0.12);
}

html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .primary,
html[data-theme="dark"] button.primary,
html[data-theme="dark"] .button-primary,
html[data-theme="dark"] .ns-btn-primary,
html[data-theme="dark"] .auth-btn {
    background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%) !important;
    border-color: rgba(96, 165, 250, 0.42) !important;
    color: #F8FAFC !important;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.20) !important;
}

html[data-theme="dark"] .btn-primary:hover,
html[data-theme="dark"] .primary:hover,
html[data-theme="dark"] button.primary:hover,
html[data-theme="dark"] .button-primary:hover,
html[data-theme="dark"] .ns-btn-primary:hover,
html[data-theme="dark"] .auth-btn:hover {
    filter: brightness(1.07);
}

html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] .btn-outline,
html[data-theme="dark"] .btn-ghost,
html[data-theme="dark"] .secondary,
html[data-theme="dark"] .button-secondary,
html[data-theme="dark"] .button-outline,
html[data-theme="dark"] .ns-btn-secondary,
html[data-theme="dark"] .ns-btn-outline,
html[data-theme="dark"] .trip-nav-btn,
html[data-theme="dark"] .theme-choice,
html[data-theme="dark"] .trd-icon-btn,
html[data-theme="dark"] .trd-add-toggle,
html[data-theme="dark"] .trd-cancel-add-btn {
    background: rgba(248, 250, 252, 0.03) !important;
    border-color: rgba(148, 163, 184, 0.10) !important;
    color: var(--text-secondary) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .btn-secondary:hover,
html[data-theme="dark"] .btn-outline:hover,
html[data-theme="dark"] .btn-ghost:hover,
html[data-theme="dark"] .secondary:hover,
html[data-theme="dark"] .button-secondary:hover,
html[data-theme="dark"] .button-outline:hover,
html[data-theme="dark"] .ns-btn-secondary:hover,
html[data-theme="dark"] .ns-btn-outline:hover,
html[data-theme="dark"] .trip-nav-btn:hover,
html[data-theme="dark"] .theme-choice:hover,
html[data-theme="dark"] .trd-icon-btn:hover,
html[data-theme="dark"] .trd-add-toggle:hover,
html[data-theme="dark"] .trd-cancel-add-btn:hover {
    background: rgba(248, 250, 252, 0.06) !important;
    color: var(--text-primary) !important;
}

html[data-theme="dark"] .trip-nav-btn.is-active,
html[data-theme="dark"] .tab.is-active,
html[data-theme="dark"] .tab.active,
html[data-theme="dark"] .theme-choice.is-active,
html[data-theme="dark"] .theme-choice[aria-pressed="true"] {
    background: rgba(59, 130, 246, 0.12) !important;
    border-color: rgba(59, 130, 246, 0.42) !important;
    color: #BFDBFE !important;
}

html[data-theme="dark"] .btn-danger,
html[data-theme="dark"] .danger,
html[data-theme="dark"] .button-danger {
    background: rgba(239, 68, 68, 0.12) !important;
    border-color: rgba(239, 68, 68, 0.26) !important;
    color: #FCA5A5 !important;
}

/* Tables */
html[data-theme="dark"] table,
html[data-theme="dark"] .table,
html[data-theme="dark"] .data-table,
html[data-theme="dark"] .reports-table,
html[data-theme="dark"] .reports-table-wrap,
html[data-theme="dark"] .finance-ledger-table,
html[data-theme="dark"] .bulk-table,
html[data-theme="dark"] .stawki-table,
html[data-theme="dark"] .program-table,
html[data-theme="dark"] .admin-table,
html[data-theme="dark"] .notes-table {
    background: var(--surface-2) !important;
    border-color: var(--border-subtle) !important;
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] thead,
html[data-theme="dark"] table thead tr,
html[data-theme="dark"] .table-head,
html[data-theme="dark"] .list-head,
html[data-theme="dark"] .reports-table thead,
html[data-theme="dark"] .finance-ledger-table thead,
html[data-theme="dark"] .bulk-table thead {
    background: rgba(248, 250, 252, 0.025) !important;
}

html[data-theme="dark"] th,
html[data-theme="dark"] .table-header-cell,
html[data-theme="dark"] .reports-table th,
html[data-theme="dark"] .reports-table-wrap th,
html[data-theme="dark"] .finance-ledger-table th,
html[data-theme="dark"] .bulk-table th {
    border-color: rgba(148, 163, 184, 0.05) !important;
    color: var(--text-label) !important;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

html[data-theme="dark"] td,
html[data-theme="dark"] .table-cell,
html[data-theme="dark"] .reports-table td,
html[data-theme="dark"] .reports-table-wrap td,
html[data-theme="dark"] .finance-ledger-table td,
html[data-theme="dark"] .bulk-table td {
    background: transparent !important;
    border-color: rgba(148, 163, 184, 0.05) !important;
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] tbody tr,
html[data-theme="dark"] .table-row,
html[data-theme="dark"] .report-row {
    background: transparent !important;
    border-color: rgba(148, 163, 184, 0.05) !important;
}

html[data-theme="dark"] tbody tr:nth-child(even),
html[data-theme="dark"] .table-row:nth-child(even),
html[data-theme="dark"] .report-row:nth-child(even) {
    background: rgba(248, 250, 252, 0.012) !important;
}

html[data-theme="dark"] tbody tr:hover,
html[data-theme="dark"] tbody tr:hover td,
html[data-theme="dark"] .table-row:hover,
html[data-theme="dark"] .report-row:hover {
    background: rgba(59, 130, 246, 0.035) !important;
}

/* Badges, status and alerts */
html[data-theme="dark"] .badge,
html[data-theme="dark"] .chip,
html[data-theme="dark"] .pill,
html[data-theme="dark"] .status,
html[data-theme="dark"] .tag,
html[data-theme="dark"] .account-status,
html[data-theme="dark"] .antenna-pill,
html[data-theme="dark"] .trip-status,
html[data-theme="dark"] .hms-badge {
    background: rgba(148, 163, 184, 0.10) !important;
    border-color: rgba(148, 163, 184, 0.12) !important;
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] .badge-success,
html[data-theme="dark"] .chip-success,
html[data-theme="dark"] .status-success,
html[data-theme="dark"] .is-success,
html[data-theme="dark"] .account-status--success {
    background: rgba(34, 197, 94, 0.12) !important;
    border-color: rgba(34, 197, 94, 0.22) !important;
    color: #4ADE80 !important;
}

html[data-theme="dark"] .badge-warning,
html[data-theme="dark"] .chip-warning,
html[data-theme="dark"] .status-warning,
html[data-theme="dark"] .is-warning,
html[data-theme="dark"] .account-status--warning,
html[data-theme="dark"] .real-pax-missing {
    background: rgba(249, 115, 22, 0.14) !important;
    border-color: rgba(249, 115, 22, 0.26) !important;
    color: #FDBA74 !important;
}

html[data-theme="dark"] .badge-danger,
html[data-theme="dark"] .chip-danger,
html[data-theme="dark"] .status-danger,
html[data-theme="dark"] .is-danger,
html[data-theme="dark"] .is-loss,
html[data-theme="dark"] .negative {
    background: rgba(239, 68, 68, 0.12) !important;
    border-color: rgba(239, 68, 68, 0.22) !important;
    color: #FCA5A5 !important;
}

html[data-theme="dark"] .badge-primary,
html[data-theme="dark"] .chip-primary,
html[data-theme="dark"] .status-primary,
html[data-theme="dark"] .is-info,
html[data-theme="dark"] .is-active {
    border-color: rgba(59, 130, 246, 0.24);
}

html[data-theme="dark"] .positive,
html[data-theme="dark"] .profit,
html[data-theme="dark"] .is-profit,
html[data-theme="dark"] .text-success {
    color: #22C55E !important;
}

html[data-theme="dark"] .loss,
html[data-theme="dark"] .text-danger {
    color: #EF4444 !important;
}

html[data-theme="dark"] .alert,
html[data-theme="dark"] .flash,
html[data-theme="dark"] .toast,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .empty,
html[data-theme="dark"] .hybrid-empty-small,
html[data-theme="dark"] .metabase-empty,
html[data-theme="dark"] .antenna-empty {
    background: rgba(248, 250, 252, 0.03) !important;
    border-color: rgba(148, 163, 184, 0.10) !important;
    color: var(--text-secondary) !important;
}

/* Modals, overlays, dialogs */
html[data-theme="dark"] .modal,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .modal-dialog,
html[data-theme="dark"] .dialog,
html[data-theme="dark"] .popup,
html[data-theme="dark"] .confirm-dialog,
html[data-theme="dark"] .reports-modal,
html[data-theme="dark"] .stawki-modal,
html[data-theme="dark"] .notes-modal-dialog,
html[data-theme="dark"] .bulk-modal,
html[data-theme="dark"] .driver-fuel-modal,
html[data-theme="dark"] .sales-modal {
    background: linear-gradient(180deg, #181C22 0%, #12161B 100%) !important;
    border-color: var(--border-strong) !important;
    color: var(--text-secondary) !important;
    box-shadow: var(--shadow-menu) !important;
}

html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer,
html[data-theme="dark"] .dialog-header,
html[data-theme="dark"] .dialog-footer,
html[data-theme="dark"] .reports-modal-header,
html[data-theme="dark"] .notes-modal-header {
    border-color: rgba(148, 163, 184, 0.08) !important;
}

html[data-theme="dark"] .modal-backdrop,
html[data-theme="dark"] .overlay,
html[data-theme="dark"] .reports-modal-overlay,
html[data-theme="dark"] .stawki-modal-overlay,
html[data-theme="dark"] .notes-modal-overlay {
    background: rgba(2, 6, 23, 0.72) !important;
}

html[data-theme="dark"] .tooltip,
html[data-theme="dark"] [role="tooltip"],
html[data-theme="dark"] .chart-tooltip,
html[data-theme="dark"] .recharts-tooltip-wrapper .recharts-default-tooltip {
    background: var(--surface-3) !important;
    border-color: rgba(148, 163, 184, 0.12) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35) !important;
}

/* Flatpickr */
html[data-theme="dark"] .flatpickr-calendar,
html[data-theme="dark"] .dashboard-flatpickr {
    background: var(--surface-2) !important;
    border-color: var(--border-strong) !important;
    box-shadow: var(--shadow-menu) !important;
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] .flatpickr-months,
html[data-theme="dark"] .flatpickr-weekdays,
html[data-theme="dark"] .flatpickr-current-month,
html[data-theme="dark"] .flatpickr-weekday {
    background: var(--surface-2) !important;
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] .flatpickr-day {
    color: var(--text-secondary) !important;
    border-color: transparent !important;
}

html[data-theme="dark"] .flatpickr-day:hover,
html[data-theme="dark"] .flatpickr-day:focus {
    background: rgba(59, 130, 246, 0.10) !important;
    border-color: rgba(59, 130, 246, 0.20) !important;
}

html[data-theme="dark"] .flatpickr-day.selected,
html[data-theme="dark"] .flatpickr-day.startRange,
html[data-theme="dark"] .flatpickr-day.endRange {
    background: var(--primary-strong) !important;
    border-color: var(--primary-strong) !important;
    color: #F8FAFC !important;
}

html[data-theme="dark"] .flatpickr-day.prevMonthDay,
html[data-theme="dark"] .flatpickr-day.nextMonthDay,
html[data-theme="dark"] .flatpickr-day.disabled {
    color: var(--text-disabled) !important;
}

html[data-theme="dark"] .flatpickr-time,
html[data-theme="dark"] .numInputWrapper input {
    background: var(--surface-3) !important;
    color: var(--text-primary) !important;
}

/* Dashboard and charts */
html[data-theme="dark"] .chart-card,
html[data-theme="dark"] .chart-container,
html[data-theme="dark"] .chart-wrap,
html[data-theme="dark"] .metabase-frame-card,
html[data-theme="dark"] .metabase-frame-wrap,
html[data-theme="dark"] canvas,
html[data-theme="dark"] svg.recharts-surface {
    background: transparent !important;
}

html[data-theme="dark"] .metabase-guide,
html[data-theme="dark"] .metabase-frame-card {
    background: linear-gradient(180deg, #181C22 0%, #12161B 100%) !important;
}

/* Trip list */
html[data-theme="dark"] .trips-toolbar,
html[data-theme="dark"] .home-toolbar,
html[data-theme="dark"] .filters-card,
html[data-theme="dark"] .filterbar,
html[data-theme="dark"] .date-switcher,
html[data-theme="dark"] .summary-strip {
    background: var(--surface-2) !important;
    border-color: var(--border-subtle) !important;
    box-shadow: var(--shadow-card-soft) !important;
}

html[data-theme="dark"] .home-toolbar .btn,
html[data-theme="dark"] .home-toolbar button,
html[data-theme="dark"] .date-nav-trigger,
html[data-theme="dark"] .toolbar-nav-btn,
html[data-theme="dark"] .daily-filter-submit,
html[data-theme="dark"] .btn.btn-ghost.toolbar-nav-btn {
    background: rgba(248, 250, 252, 0.03) !important;
    border-color: rgba(148, 163, 184, 0.12) !important;
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] .home-toolbar .btn:hover,
html[data-theme="dark"] .home-toolbar button:hover,
html[data-theme="dark"] .date-nav-trigger:hover,
html[data-theme="dark"] .toolbar-nav-btn:hover,
html[data-theme="dark"] .daily-filter-submit:hover,
html[data-theme="dark"] .btn.btn-ghost.toolbar-nav-btn:hover {
    background: rgba(59, 130, 246, 0.10) !important;
    border-color: rgba(59, 130, 246, 0.28) !important;
    color: var(--text-primary) !important;
}

html[data-theme="dark"] .trip-row,
html[data-theme="dark"] .trip-list-row {
    border-bottom-color: rgba(148, 163, 184, 0.05) !important;
}

html[data-theme="dark"] .trip-row .trip-name,
html[data-theme="dark"] .trip-list-row .trip-name {
    color: #93C5FD !important;
}

/* Trip detail */
html[data-theme="dark"] .trip-header,
html[data-theme="dark"] .trip-hero,
html[data-theme="dark"] .trip-top,
html[data-theme="dark"] .trip-page-header,
html[data-theme="dark"] .trip-detail-header {
    background: transparent !important;
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] .trip-header h1,
html[data-theme="dark"] .trip-hero h1,
html[data-theme="dark"] .trip-page-header h1,
html[data-theme="dark"] .trip-detail-header h1,
html[data-theme="dark"] .trip-header strong,
html[data-theme="dark"] .trip-hero strong,
html[data-theme="dark"] .trip-page-header strong,
html[data-theme="dark"] .trip-detail-header strong,
html[data-theme="dark"] .trip-header .value,
html[data-theme="dark"] .trip-hero .value,
html[data-theme="dark"] .trip-page-header .value,
html[data-theme="dark"] .trip-detail-header .value {
    color: var(--text-primary) !important;
}

html[data-theme="dark"] .trip-page-tabs,
html[data-theme="dark"] .tabs,
html[data-theme="dark"] .tabbar {
    border-color: rgba(148, 163, 184, 0.08) !important;
}

html[data-theme="dark"] .trip-page-tabs .trip-nav-btn,
html[data-theme="dark"] .trip-page-tabs button,
html[data-theme="dark"] .tabbar .trip-nav-btn,
html[data-theme="dark"] .tabs .tab,
html[data-theme="dark"] .tabs button {
    background: transparent !important;
    border-color: transparent !important;
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] .trip-page-tabs .trip-nav-btn:hover,
html[data-theme="dark"] .trip-page-tabs button:hover,
html[data-theme="dark"] .tabbar .trip-nav-btn:hover,
html[data-theme="dark"] .tabs .tab:hover,
html[data-theme="dark"] .tabs button:hover {
    background: rgba(248, 250, 252, 0.04) !important;
    color: var(--text-primary) !important;
}

html[data-theme="dark"] .trip-page-tabs .trip-nav-btn.is-active,
html[data-theme="dark"] .trip-page-tabs button.is-active,
html[data-theme="dark"] .tabbar .trip-nav-btn.is-active,
html[data-theme="dark"] .tabs .tab.is-active,
html[data-theme="dark"] .tabs button.is-active {
    background: rgba(59, 130, 246, 0.12) !important;
    border-color: rgba(59, 130, 246, 0.42) !important;
    color: #BFDBFE !important;
}

html[data-theme="dark"] .pax-view-v2-surface,
html[data-theme="dark"] .pax-view-v2-card,
html[data-theme="dark"] .pax-view-v2-panel,
html[data-theme="dark"] .pax-v2-surface,
html[data-theme="dark"] .pax-v2-card,
html[data-theme="dark"] .pax-v2-panel {
    background: linear-gradient(180deg, #181C22 0%, #12161B 100%) !important;
    border-color: var(--border-subtle) !important;
    color: var(--text-secondary) !important;
    box-shadow: var(--shadow-card-soft) !important;
}

/* Trip detail late-template overrides */
html[data-theme="dark"] .finance-kpi,
html[data-theme="dark"] .finance-kpi--profit,
html[data-theme="dark"] .finance-kpi--margin,
html[data-theme="dark"] .pax-comparison-card,
html[data-theme="dark"] .pax-edit-panel-card,
html[data-theme="dark"] .pax-kpi-card,
html[data-theme="dark"] .kadra-enterprise-card,
html[data-theme="dark"] .transport-summary,
html[data-theme="dark"] .transport-details,
html[data-theme="dark"] .transport-cost-module,
html[data-theme="dark"] .extra-cost-card,
html[data-theme="dark"] .commission-add-row,
html[data-theme="dark"] .kadra-add-footer {
    background: linear-gradient(180deg, #181C22 0%, #12161B 100%) !important;
    border-color: var(--border-subtle) !important;
    color: var(--text-secondary) !important;
    box-shadow: var(--shadow-card-soft) !important;
}

html[data-theme="dark"] .pax-status-bar-v2,
html[data-theme="dark"] .pax-status-bar-v2--warn,
html[data-theme="dark"] .transport-badge,
html[data-theme="dark"] .kadra-role-badge,
html[data-theme="dark"] .badge-extra,
html[data-theme="dark"] .badge-extra--transport {
    background: rgba(249, 115, 22, 0.14) !important;
    border-color: rgba(249, 115, 22, 0.24) !important;
    color: #FDBA74 !important;
}

html[data-theme="dark"] .pax-comparison-card__title-icon,
html[data-theme="dark"] .pax-edit-panel-card__title-icon,
html[data-theme="dark"] .pax-kpi-card__icon,
html[data-theme="dark"] .summary-icon-tile,
html[data-theme="dark"] .extra-cost-icon-tile,
html[data-theme="dark"] .commission-icon-tile,
html[data-theme="dark"] .index-circle {
    background: rgba(59, 130, 246, 0.12) !important;
    border-color: rgba(59, 130, 246, 0.18) !important;
    color: #BFDBFE !important;
}

html[data-theme="dark"] .finance-kpi *,
html[data-theme="dark"] .pax-comparison-card *,
html[data-theme="dark"] .pax-edit-panel-card *,
html[data-theme="dark"] .pax-kpi-card *,
html[data-theme="dark"] .kadra-enterprise-card *,
html[data-theme="dark"] .transport-summary *,
html[data-theme="dark"] .transport-details *,
html[data-theme="dark"] .transport-cost-module *,
html[data-theme="dark"] .extra-cost-card *,
html[data-theme="dark"] .commission-add-row * {
    color: inherit;
}

html[data-theme="dark"] .finance-kpi strong,
html[data-theme="dark"] .finance-kpi .value,
html[data-theme="dark"] .pax-kpi-card__value,
html[data-theme="dark"] .kadra-person-name,
html[data-theme="dark"] .extra-cost-card-title,
html[data-theme="dark"] .commission-add-row h2,
html[data-theme="dark"] #sekcja-prowizje h2 {
    color: var(--text-primary) !important;
}

html[data-theme="dark"] .finance-panel td,
html[data-theme="dark"] .finance-ledger-panel td,
html[data-theme="dark"] .finance-card td,
html[data-theme="dark"] .finance-table td,
html[data-theme="dark"] .details-table td,
html[data-theme="dark"] .pax-comparison-card td {
    background: transparent !important;
    color: var(--text-secondary) !important;
    border-color: rgba(148, 163, 184, 0.05) !important;
}

html[data-theme="dark"] .finance-panel tr:nth-child(even) td,
html[data-theme="dark"] .finance-ledger-panel tr:nth-child(even) td,
html[data-theme="dark"] .finance-card tr:nth-child(even) td,
html[data-theme="dark"] .finance-table tr:nth-child(even) td,
html[data-theme="dark"] .details-table tr:nth-child(even) td,
html[data-theme="dark"] .pax-comparison-card tr:nth-child(even) td {
    background: rgba(248, 250, 252, 0.018) !important;
}

html[data-theme="dark"] .finance-panel td strong,
html[data-theme="dark"] .finance-ledger-panel td strong,
html[data-theme="dark"] .finance-card td strong,
html[data-theme="dark"] .finance-table td strong,
html[data-theme="dark"] .details-table td strong,
html[data-theme="dark"] .pax-comparison-card td strong {
    color: var(--text-primary) !important;
}

html[data-theme="dark"] .stt-btn,
html[data-theme="dark"] .action-btn,
html[data-theme="dark"] .action-secondary,
html[data-theme="dark"] .transport-expand-btn,
html[data-theme="dark"] .transport-summary-chevron,
html[data-theme="dark"] .kadra-prem-add-outline,
html[data-theme="dark"] .kadra-tool-btn,
html[data-theme="dark"] .kadra-add-footer__toggle,
html[data-theme="dark"] .extra-cost-outline-btn,
html[data-theme="dark"] .commission-add-toggle,
html[data-theme="dark"] .notes-modal-close {
    background: rgba(248, 250, 252, 0.03) !important;
    border-color: rgba(148, 163, 184, 0.12) !important;
    color: var(--text-secondary) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .stt-btn:hover,
html[data-theme="dark"] .action-btn:hover,
html[data-theme="dark"] .action-secondary:hover,
html[data-theme="dark"] .transport-expand-btn:hover,
html[data-theme="dark"] .transport-summary-chevron:hover,
html[data-theme="dark"] .kadra-prem-add-outline:hover,
html[data-theme="dark"] .kadra-tool-btn:hover,
html[data-theme="dark"] .kadra-add-footer__toggle:hover,
html[data-theme="dark"] .extra-cost-outline-btn:hover,
html[data-theme="dark"] .commission-add-toggle:hover,
html[data-theme="dark"] .notes-modal-close:hover {
    background: rgba(59, 130, 246, 0.10) !important;
    border-color: rgba(59, 130, 246, 0.28) !important;
    color: var(--text-primary) !important;
}

html[data-theme="dark"] .extra-cost-select,
html[data-theme="dark"] .extra-cost-input,
html[data-theme="dark"] .transport-cost-module input,
html[data-theme="dark"] .transport-cost-module select,
html[data-theme="dark"] .transport-details input,
html[data-theme="dark"] .transport-details select,
html[data-theme="dark"] .pax-edit-panel-card input,
html[data-theme="dark"] .pax-edit-panel-card select {
    background: var(--surface-3) !important;
    border-color: rgba(148, 163, 184, 0.10) !important;
    color: var(--text-primary) !important;
}

html[data-theme="dark"] .finance-ledger-table tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.015) !important;
}

html[data-theme="dark"] .finance-ledger-table .group-row,
html[data-theme="dark"] .finance-ledger-table .section-row,
html[data-theme="dark"] .finance-accordion-header,
html[data-theme="dark"] .accordion-header {
    background: rgba(248, 250, 252, 0.025) !important;
    color: var(--text-primary) !important;
    border-color: rgba(148, 163, 184, 0.06) !important;
}

html[data-theme="dark"] .finance-ledger-table .total-row,
html[data-theme="dark"] .total-row,
html[data-theme="dark"] .sum-row {
    background: rgba(59, 130, 246, 0.07) !important;
    color: var(--text-primary) !important;
}

/* Reports */
html[data-theme="dark"] .reports-filters,
html[data-theme="dark"] .reports-filterbar,
html[data-theme="dark"] .report-filters,
html[data-theme="dark"] .report-filterbar,
html[data-theme="dark"] .filters-panel {
    background: linear-gradient(180deg, #181C22 0%, #12161B 100%) !important;
    border-color: var(--border-subtle) !important;
    color: var(--text-secondary) !important;
    box-shadow: var(--shadow-card-soft) !important;
}

html[data-theme="dark"] .reports-filters label,
html[data-theme="dark"] .reports-filterbar label,
html[data-theme="dark"] .report-filters label,
html[data-theme="dark"] .report-filterbar label {
    color: var(--text-label) !important;
}

html[data-theme="dark"] .reports-filters input,
html[data-theme="dark"] .reports-filters select,
html[data-theme="dark"] .reports-filterbar input,
html[data-theme="dark"] .reports-filterbar select,
html[data-theme="dark"] .report-filters input,
html[data-theme="dark"] .report-filters select,
html[data-theme="dark"] .report-filterbar input,
html[data-theme="dark"] .report-filterbar select {
    background: var(--surface-3) !important;
    border-color: rgba(148, 163, 184, 0.10) !important;
    color: var(--text-primary) !important;
}

html[data-theme="dark"] #sekcja-paxy,
html[data-theme="dark"] #sekcja-kadra,
html[data-theme="dark"] #sekcja-transport,
html[data-theme="dark"] #sekcja-rejsy,
html[data-theme="dark"] #sekcja-kdw,
html[data-theme="dark"] #sekcja-prowizje {
    color: var(--text-secondary);
}

html[data-theme="dark"] .transport-segment-header,
html[data-theme="dark"] .transport-incoming-head,
html[data-theme="dark"] .rejs-header,
html[data-theme="dark"] .extra-header,
html[data-theme="dark"] .pax-section-header,
html[data-theme="dark"] .crew-section-header {
    background: rgba(248, 250, 252, 0.02) !important;
    border-color: rgba(148, 163, 184, 0.06) !important;
    color: var(--text-primary) !important;
}

html[data-theme="dark"] .transport-incoming-row,
html[data-theme="dark"] .rejs-incoming-row,
html[data-theme="dark"] .pax-row,
html[data-theme="dark"] .crew-row,
html[data-theme="dark"] .extra-row,
html[data-theme="dark"] .commission-row,
html[data-theme="dark"] .trd-row {
    background: rgba(248, 250, 252, 0.018) !important;
    border-color: rgba(148, 163, 184, 0.06) !important;
}

html[data-theme="dark"] #sekcja-finanse .finance-kpi-row--dual .finance-kpi .label,
html[data-theme="dark"] #finance-ledger-panel-koszty > .finance-ledger-panel-body > .finance-ledger-summary:first-of-type span,
html[data-theme="dark"] #sekcja-finanse .finance-ledger-table thead th {
    color: var(--text-label) !important;
    border-color: rgba(148, 163, 184, 0.06) !important;
}

html[data-theme="dark"] #sekcja-finanse .finance-kpi-value--margin,
html[data-theme="dark"] .finance-metric-cell strong,
html[data-theme="dark"] #sekcja-finanse .finance-ledger-panel .finance-side-head-inner h3,
html[data-theme="dark"] #finance-ledger-panel-koszty > .finance-ledger-panel-body > .finance-ledger-summary:first-of-type strong,
html[data-theme="dark"] .ks-region-name,
html[data-theme="dark"] .ks-region-total,
html[data-theme="dark"] .ks-contractor-total,
html[data-theme="dark"] .ks-grand-val,
html[data-theme="dark"] .rm-title,
html[data-theme="dark"] .rm-pair__count,
html[data-theme="dark"] .rv-pol-val,
html[data-theme="dark"] .rv-year__title,
html[data-theme="dark"] .roz-year__title {
    color: var(--text-primary) !important;
}

html[data-theme="dark"] #sekcja-finanse .finance-ledger-table,
html[data-theme="dark"] #sekcja-finanse .finance-ledger-table tbody td,
html[data-theme="dark"] .ks-table td:first-child,
html[data-theme="dark"] .ks-contractor-name,
html[data-theme="dark"] .ks-items-table td,
html[data-theme="dark"] .rm-cat__label {
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] .finance-metric-cell span,
html[data-theme="dark"] .ks-section-title,
html[data-theme="dark"] .ks-extra-header,
html[data-theme="dark"] .ks-filter label,
html[data-theme="dark"] .ks-region-total-lbl,
html[data-theme="dark"] .ks-grand-lbl {
    color: var(--text-label) !important;
}

html[data-theme="dark"] #sekcja-finanse .finance-ledger-panel,
html[data-theme="dark"] #sekcja-finanse .finance-ledger-panel > .finance-side-head--toggle,
html[data-theme="dark"] .ks-section-title,
html[data-theme="dark"] .ks-region-header,
html[data-theme="dark"] .ks-extra-header {
    background: rgba(248, 250, 252, 0.025) !important;
    border-color: rgba(148, 163, 184, 0.08) !important;
}

html[data-theme="dark"] #sekcja-finanse .finance-ledger-panel-body {
    background: transparent !important;
}

/* Reports */
html[data-theme="dark"] .reports-shell,
html[data-theme="dark"] .reports-layout,
html[data-theme="dark"] .report-shell,
html[data-theme="dark"] .report-view {
    color: var(--text-secondary);
}

html[data-theme="dark"] .report-settings,
html[data-theme="dark"] .reports-settings,
html[data-theme="dark"] .column-settings,
html[data-theme="dark"] .view-settings {
    background: var(--surface-2) !important;
    border-color: var(--border-subtle) !important;
}

html[data-theme="dark"] .report-total,
html[data-theme="dark"] .report-summary,
html[data-theme="dark"] .report-kpi,
html[data-theme="dark"] .report-group,
html[data-theme="dark"] .reports-summary-card {
    background: linear-gradient(180deg, #181C22 0%, #12161B 100%) !important;
    border-color: rgba(148, 163, 184, 0.08) !important;
    box-shadow: var(--shadow-card-soft) !important;
}

html[data-theme="dark"] .reports-info-box,
html[data-theme="dark"] .reports-edit-meta,
html[data-theme="dark"] .reports-modal-head,
html[data-theme="dark"] .reports-modal-body {
    background: var(--surface-1) !important;
    border-color: rgba(148, 163, 184, 0.08) !important;
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] .reports-modal-head h4,
html[data-theme="dark"] .reports-edit-meta-cell strong,
html[data-theme="dark"] .reports-modal-dialog .reports-edit-field input:not([type="checkbox"]),
html[data-theme="dark"] .reports-modal-dialog .reports-edit-field select {
    color: var(--text-primary) !important;
}

html[data-theme="dark"] .reports-modal-dialog .reports-edit-field input:not([type="checkbox"]),
html[data-theme="dark"] .reports-modal-dialog .reports-edit-field select {
    background: var(--surface-3) !important;
    border-color: rgba(148, 163, 184, 0.10) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .reports-edit-meta-cell span,
html[data-theme="dark"] .reports-modal-dialog .reports-edit-field > label {
    color: var(--text-label) !important;
}

/* Management, rates, imports */
html[data-theme="dark"] .admin-import,
html[data-theme="dark"] .import-panel,
html[data-theme="dark"] .import-card,
html[data-theme="dark"] .rates-card,
html[data-theme="dark"] .rate-card,
html[data-theme="dark"] .rate-row,
html[data-theme="dark"] .program-row,
html[data-theme="dark"] .stawki-row {
    background: rgba(248, 250, 252, 0.018) !important;
    border-color: rgba(148, 163, 184, 0.06) !important;
    color: var(--text-secondary) !important;
}

/* Notes */
html[data-theme="dark"] .notes-sidebar,
html[data-theme="dark"] .notes-main,
html[data-theme="dark"] .notes-list,
html[data-theme="dark"] .notes-editor,
html[data-theme="dark"] .notes-thread,
html[data-theme="dark"] .notes-card {
    background: var(--surface-2) !important;
    border-color: var(--border-subtle) !important;
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] .notes-modal-head,
html[data-theme="dark"] .notes-tabs,
html[data-theme="dark"] .notes-pane-body,
html[data-theme="dark"] .notes-scope-subtitle,
html[data-theme="dark"] .notes-tab-btn {
    background: var(--surface-1) !important;
    border-color: rgba(148, 163, 184, 0.08) !important;
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] .notes-modal-head h3,
html[data-theme="dark"] .notes-text-input {
    color: var(--text-primary) !important;
}

html[data-theme="dark"] .notes-tab-btn:hover,
html[data-theme="dark"] .notes-tab-btn.is-active {
    background: rgba(59, 130, 246, 0.12) !important;
    border-color: rgba(59, 130, 246, 0.28) !important;
    color: #BFDBFE !important;
}

html[data-theme="dark"] .notes-checkbox {
    background: var(--surface-3) !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
}

html[data-theme="dark"] .notes-checkbox:checked {
    background: var(--primary-strong) !important;
    border-color: var(--primary-strong) !important;
}

html[data-theme="dark"] .notes-checkbox:checked::after {
    border-right-color: #F8FAFC;
    border-bottom-color: #F8FAFC;
}

/* Mobile-ish responsive pages inside the desktop app */
html[data-theme="dark"] .hybrid-day-side,
html[data-theme="dark"] .antenna-day-side,
html[data-theme="dark"] .account-policy,
html[data-theme="dark"] .auth-secret,
html[data-theme="dark"] .readonly-box,
html[data-theme="dark"] .readonly-panel {
    background: var(--surface-1) !important;
    border-color: rgba(148, 163, 184, 0.08) !important;
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] .account-qr-surface,
html[data-theme="dark"] .auth-qr {
    background: #F8FAFC !important;
    border-color: rgba(148, 163, 184, 0.30) !important;
    color-scheme: light;
}

/* Pagination */
html[data-theme="dark"] .pagination,
html[data-theme="dark"] .pager {
    color: var(--text-secondary);
}

html[data-theme="dark"] .pagination a,
html[data-theme="dark"] .pagination button,
html[data-theme="dark"] .pager a,
html[data-theme="dark"] .pager button,
html[data-theme="dark"] .page-link {
    background: rgba(248, 250, 252, 0.03) !important;
    border-color: rgba(148, 163, 184, 0.10) !important;
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] .pagination a:hover,
html[data-theme="dark"] .pagination button:hover,
html[data-theme="dark"] .pager a:hover,
html[data-theme="dark"] .pager button:hover,
html[data-theme="dark"] .page-link:hover,
html[data-theme="dark"] .page-link.active {
    background: rgba(59, 130, 246, 0.12) !important;
    border-color: rgba(59, 130, 246, 0.30) !important;
    color: #BFDBFE !important;
}

/* Auth */
html[data-theme="dark"] .auth-card {
    background: linear-gradient(180deg, #181C22 0%, #12161B 100%);
    border-color: var(--border-subtle);
    box-shadow: var(--shadow-card);
}

html[data-theme="dark"] .auth-mark {
    background: rgba(59, 130, 246, 0.16);
    border: 1px solid rgba(96, 165, 250, 0.18);
    color: #DBEAFE;
}

/* High-specificity legacy overrides loaded from page-local styles. */
html[data-theme="dark"] .trips-list-card #home-all-filters-form .toolbar-nav-btn,
html[data-theme="dark"] .home-toolbar #day-notes-open-btn,
html[data-theme="dark"] .trips-list-card #home-all-filters-form select,
html[data-theme="dark"] .trips-list-card #home-all-filters-form input[type="text"] {
    background: rgba(248, 250, 252, 0.03) !important;
    border-color: rgba(148, 163, 184, 0.12) !important;
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] .trips-list-card #home-all-filters-form .toolbar-nav-btn:hover,
html[data-theme="dark"] .home-toolbar #day-notes-open-btn:hover,
html[data-theme="dark"] .trips-list-card #home-all-filters-form select:hover,
html[data-theme="dark"] .trips-list-card #home-all-filters-form input[type="text"]:hover {
    background: rgba(59, 130, 246, 0.10) !important;
    border-color: rgba(59, 130, 246, 0.28) !important;
    color: var(--text-primary) !important;
}

html[data-theme="dark"] #sekcja-finanse .finance-kpi-row--dual .finance-kpi {
    background: linear-gradient(180deg, #1B2028 0%, #13171D 100%) !important;
    border-color: rgba(148, 163, 184, 0.08) !important;
    box-shadow: var(--shadow-card-soft) !important;
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] #sekcja-finanse .finance-kpi-row--dual .finance-kpi:hover {
    border-color: rgba(59, 130, 246, 0.18) !important;
}

html[data-theme="dark"] #sekcja-finanse .finance-kpi-row--dual .finance-kpi .label {
    color: var(--text-label) !important;
}

html[data-theme="dark"] #sekcja-finanse .finance-kpi-value--profit:not(.is-negative) {
    color: #22C55E !important;
}

html[data-theme="dark"] #sekcja-finanse .finance-kpi-value--profit.is-negative,
html[data-theme="dark"] #sekcja-finanse .finance-kpi-value--margin.is-negative {
    color: #EF4444 !important;
}

html[data-theme="dark"] #sekcja-finanse .finance-kpi-value--margin {
    color: var(--text-primary) !important;
}

html[data-theme="dark"] #sekcja-finanse .finance-kpi-value--margin.is-warn {
    color: #FDBA74 !important;
}

html[data-theme="dark"] #sekcja-finanse .finance-ledger-table td,
html[data-theme="dark"] #sekcja-finanse table td {
    background: transparent !important;
    color: var(--text-secondary) !important;
    border-color: rgba(148, 163, 184, 0.05) !important;
}

html[data-theme="dark"] #sekcja-finanse .finance-ledger-table tr:nth-child(even) td,
html[data-theme="dark"] #sekcja-finanse table tr:nth-child(even) td {
    background: rgba(248, 250, 252, 0.018) !important;
}

html[data-theme="dark"] #sekcja-finanse td strong,
html[data-theme="dark"] #sekcja-finanse strong,
html[data-theme="dark"] #sekcja-finanse .finance-ledger-table tbody td:first-child strong,
html[data-theme="dark"] #sekcja-finanse .finance-metric-cell strong,
html[data-theme="dark"] #sekcja-finanse th,
html[data-theme="dark"] #sekcja-finanse .num {
    color: var(--text-primary) !important;
}

html[data-theme="dark"] #sekcja-paxy .pax-view-v2-surface,
html[data-theme="dark"] #sekcja-paxy .pax-comparison-card,
html[data-theme="dark"] #sekcja-paxy .pax-edit-panel-card,
html[data-theme="dark"] #sekcja-paxy .pax-kpi-card {
    background: linear-gradient(180deg, #181C22 0%, #12161B 100%) !important;
    border-color: rgba(148, 163, 184, 0.08) !important;
    color: var(--text-secondary) !important;
    box-shadow: var(--shadow-card-soft) !important;
}

html[data-theme="dark"] #sekcja-paxy .pax-status-bar-v2--ok,
html[data-theme="dark"] #sekcja-paxy .pax-status-bar-v2--warn {
    background: rgba(249, 115, 22, 0.14) !important;
    border-color: rgba(249, 115, 22, 0.24) !important;
}

html[data-theme="dark"] #sekcja-paxy .pax-status-bar-v2--ok .pax-status-bar-v2__title {
    color: #4ADE80 !important;
}

html[data-theme="dark"] #sekcja-paxy .pax-status-bar-v2--warn .pax-status-bar-v2__title {
    color: #FDBA74 !important;
}

html[data-theme="dark"] #sekcja-paxy .pax-status-bar-v2__subtitle,
html[data-theme="dark"] #sekcja-paxy .pax-comparison-card__title,
html[data-theme="dark"] #sekcja-paxy .pax-kpi-card__value {
    color: var(--text-primary) !important;
}

html[data-theme="dark"] #sekcja-transport .transport-cost-module,
html[data-theme="dark"] #sekcja-transport .transport-summary,
html[data-theme="dark"] #sekcja-transport .transport-details {
    background: linear-gradient(180deg, #181C22 0%, #12161B 100%) !important;
    border-color: rgba(148, 163, 184, 0.08) !important;
    color: var(--text-secondary) !important;
    box-shadow: var(--shadow-card-soft) !important;
}

html[data-theme="dark"] #sekcja-transport .transport-cost-module input,
html[data-theme="dark"] #sekcja-transport .transport-cost-module select,
html[data-theme="dark"] #sekcja-transport .transport-cost-module .input-with-suffix input.transport-input-control,
html[data-theme="dark"] #sekcja-transport .transport-cost-module .transport-input-control,
html[data-theme="dark"] #sekcja-transport .transport-details input,
html[data-theme="dark"] #sekcja-transport .transport-details select {
    background: var(--surface-3) !important;
    border-color: rgba(148, 163, 184, 0.10) !important;
    color: var(--text-primary) !important;
}

html[data-theme="dark"] #sekcja-transport .transport-expand-btn,
html[data-theme="dark"] #sekcja-transport .transport-summary-chevron {
    background: rgba(248, 250, 252, 0.03) !important;
    border-color: rgba(148, 163, 184, 0.12) !important;
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] #sekcja-kdw .extra-cost-select,
html[data-theme="dark"] #sekcja-kdw .extra-cost-input {
    background: var(--surface-3) !important;
    border-color: rgba(148, 163, 184, 0.10) !important;
    color: var(--text-primary) !important;
}

/* Neutral premium cleanup: notes and TO DO were heavily light-mode styled. */
html[data-theme="dark"] .notes-todo-layout {
    --todo-blue: #7AA7F7;
    --todo-blue-strong: #93B8FF;
    --todo-border: rgba(148, 163, 184, 0.08);
    --todo-border-strong: rgba(148, 163, 184, 0.14);
    --todo-bg: transparent;
    --todo-card: var(--surface-2);
    --todo-text: var(--text-primary);
    --todo-muted: var(--text-muted);
    --todo-soft: var(--text-label);
    background: transparent !important;
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] .notes-todo-section,
html[data-theme="dark"] .notes-todo-guides-card {
    background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface-1) 100%) !important;
    border-color: rgba(148, 163, 184, 0.08) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(248, 250, 252, 0.035) !important;
}

html[data-theme="dark"] .notes-todo-section-head,
html[data-theme="dark"] .notes-todo-guides-head {
    background: rgba(248, 250, 252, 0.018) !important;
    border-bottom-color: rgba(148, 163, 184, 0.08) !important;
    color: var(--text-label) !important;
}

html[data-theme="dark"] .notes-todo-section-head .count,
html[data-theme="dark"] .notes-todo-guides-count {
    background: rgba(122, 167, 247, 0.10) !important;
    border-color: rgba(122, 167, 247, 0.18) !important;
    color: #AFCBFF !important;
}

html[data-theme="dark"] .notes-todo-group {
    background: transparent !important;
    border-bottom-color: rgba(148, 163, 184, 0.07) !important;
}

html[data-theme="dark"] .notes-todo-group:hover {
    background: rgba(248, 250, 252, 0.025) !important;
}

html[data-theme="dark"] .notes-todo-group.is-complete {
    background: rgba(34, 197, 94, 0.035) !important;
}

html[data-theme="dark"] .notes-todo-group-link,
html[data-theme="dark"] .notes-todo-guides-title h2,
html[data-theme="dark"] .notes-todo-guides-table td {
    color: var(--text-primary) !important;
}

html[data-theme="dark"] .notes-todo-group-link {
    color: #B8C7DA !important;
}

html[data-theme="dark"] .notes-todo-group-link:hover {
    color: #AFCBFF !important;
}

html[data-theme="dark"] .notes-todo-group-meta,
html[data-theme="dark"] .notes-todo-group-date,
html[data-theme="dark"] .notes-todo-guides-title span,
html[data-theme="dark"] .notes-todo-guides-date,
html[data-theme="dark"] .notes-todo-guides-muted {
    color: var(--text-muted) !important;
}

html[data-theme="dark"] .notes-todo-group-date,
html[data-theme="dark"] .notes-todo-group--day .notes-todo-group-date {
    background: rgba(248, 250, 252, 0.045) !important;
    border-color: rgba(148, 163, 184, 0.12) !important;
    color: #B8C7DA !important;
}

html[data-theme="dark"] .notes-todo-group-count {
    background: rgba(245, 158, 11, 0.11) !important;
    border-color: rgba(245, 158, 11, 0.22) !important;
    color: #FBBF24 !important;
}

html[data-theme="dark"] .notes-todo-group.is-complete .notes-todo-group-count {
    background: rgba(34, 197, 94, 0.11) !important;
    border-color: rgba(34, 197, 94, 0.20) !important;
    color: #4ADE80 !important;
}

html[data-theme="dark"] .notes-todo-group-toggle,
html[data-theme="dark"] .notes-modal-close {
    background: rgba(248, 250, 252, 0.035) !important;
    border-color: rgba(148, 163, 184, 0.12) !important;
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] .notes-todo-group-toggle:hover,
html[data-theme="dark"] .notes-modal-close:hover {
    background: rgba(248, 250, 252, 0.07) !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
    color: var(--text-primary) !important;
}

html[data-theme="dark"] .notes-todo-group.is-collapsed .notes-todo-group-toggle {
    background: rgba(122, 167, 247, 0.10) !important;
    border-color: rgba(122, 167, 247, 0.20) !important;
    color: #AFCBFF !important;
}

html[data-theme="dark"] .notes-editor.is-todo-list,
html[data-theme="dark"] .notes-editor.is-todo-list .notes-list,
html[data-theme="dark"] .notes-editor.is-todo-list .notes-list-wrap {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .notes-editor.is-todo-list .notes-item {
    background: rgba(248, 250, 252, 0.026) !important;
    border: 1px solid rgba(148, 163, 184, 0.07) !important;
    border-radius: 8px !important;
    padding: 0 10px !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .notes-editor.is-todo-list .notes-item:hover {
    background: rgba(248, 250, 252, 0.045) !important;
    border-color: rgba(148, 163, 184, 0.12) !important;
}

html[data-theme="dark"] .notes-editor.is-todo-list .notes-checkbox,
html[data-theme="dark"] .notes-checkbox {
    background: rgba(248, 250, 252, 0.055) !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
}

html[data-theme="dark"] .notes-editor.is-todo-list .notes-checkbox:checked,
html[data-theme="dark"] .notes-checkbox:checked {
    background: #2563EB !important;
    border-color: #3B82F6 !important;
}

html[data-theme="dark"] .notes-editor.is-todo-list .notes-text-input,
html[data-theme="dark"] .notes-text-input {
    color: var(--text-primary) !important;
}

html[data-theme="dark"] .notes-editor.is-todo-list .notes-text-input::placeholder,
html[data-theme="dark"] .notes-text-input::placeholder {
    color: var(--text-label) !important;
}

html[data-theme="dark"] .notes-editor.is-todo-list .notes-item.is-done .notes-text-input {
    color: var(--text-muted) !important;
}

html[data-theme="dark"] .notes-modal-dialog,
html[data-theme="dark"] .notes-modal-head,
html[data-theme="dark"] .notes-tabs,
html[data-theme="dark"] .notes-pane-body,
html[data-theme="dark"] .notes-editor,
html[data-theme="dark"] .notes-item,
html[data-theme="dark"] .notes-scope-subtitle,
html[data-theme="dark"] .notes-tab-btn {
    background: var(--surface-2) !important;
    border-color: rgba(148, 163, 184, 0.08) !important;
}

html[data-theme="dark"] .notes-pane-body,
html[data-theme="dark"] .notes-tabs,
html[data-theme="dark"] .notes-modal-head {
    background: var(--surface-1) !important;
}

html[data-theme="dark"] .notes-item:hover,
html[data-theme="dark"] .notes-tab-btn:hover {
    background: rgba(248, 250, 252, 0.045) !important;
}

html[data-theme="dark"] .notes-tab-btn.is-active {
    background: rgba(122, 167, 247, 0.10) !important;
    border-color: rgba(122, 167, 247, 0.22) !important;
    color: #AFCBFF !important;
}

html[data-theme="dark"] .notes-todo-guides-table th {
    background: rgba(248, 250, 252, 0.025) !important;
    border-bottom-color: rgba(148, 163, 184, 0.08) !important;
    color: var(--text-label) !important;
}

html[data-theme="dark"] .notes-todo-guides-table td {
    border-top-color: rgba(148, 163, 184, 0.055) !important;
}

html[data-theme="dark"] .notes-todo-guides-table tbody tr:hover {
    background: rgba(248, 250, 252, 0.035) !important;
}

html[data-theme="dark"] .notes-empty,
html[data-theme="dark"] .notes-todo-guides-card > .notes-empty {
    background: rgba(248, 250, 252, 0.025) !important;
    border-color: rgba(148, 163, 184, 0.10) !important;
    color: var(--text-muted) !important;
}

/* Final neutral hardening: keep dark mode graphite, not navy, across late page styles. */
html[data-theme="dark"] :where(
    .card,
    .panel,
    .box,
    .widget,
    [class$="-card"],
    [class*="-card "],
    [class$="-panel"],
    [class*="-panel "],
    [class$="-box"],
    [class*="-box "],
    [class$="-tile"],
    [class*="-tile "]
) {
    background: linear-gradient(180deg, #181C22 0%, #12161B 100%) !important;
    border-color: rgba(148, 163, 184, 0.08) !important;
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] :where(
    .card,
    .panel,
    .box,
    .widget,
    [class$="-card"],
    [class*="-card "],
    [class$="-panel"],
    [class*="-panel "],
    [class$="-box"],
    [class*="-box "],
    [class$="-tile"],
    [class*="-tile "]
):hover {
    border-color: rgba(148, 163, 184, 0.14) !important;
}

html[data-theme="dark"] :where(
    .content,
    .main,
    .page,
    .trips-page,
    .trip-detail-page,
    .dashboard-shell,
    .notes-todo-layout
) {
    background: transparent !important;
}

html[data-theme="dark"] :where(
    .trips-list-card,
    .trips-toolbar,
    .trips-table-header,
    .summary-strip,
    .date-switcher,
    .stt-stats-grid
) {
    background: var(--surface-1) !important;
    border-color: rgba(148, 163, 184, 0.08) !important;
}

html[data-theme="dark"] :where(
    .trip-row,
    .trip-list-row,
    .reports-table tr,
    .reports-table td,
    .dashboard-mini-table tbody tr,
    .stt-trip-list,
    .stt-trip-links,
    .stt-trip-link
) {
    background: transparent !important;
}

html[data-theme="dark"] :where(.trip-row, .trip-list-row) {
    border-color: rgba(148, 163, 184, 0.075) !important;
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] :where(.trip-row:hover, .trip-list-row:hover, tbody tr:hover, .stt-trip-link:hover) {
    background: rgba(248, 250, 252, 0.035) !important;
}

html[data-theme="dark"] :where(.trips-table-header, thead, thead tr, thead th) {
    background: rgba(248, 250, 252, 0.026) !important;
    color: var(--text-label) !important;
    border-color: rgba(148, 163, 184, 0.07) !important;
}

html[data-theme="dark"] :where(tbody tr:nth-child(even), tbody tr:nth-child(odd), tbody td) {
    background-color: transparent !important;
}

html[data-theme="dark"] :where(.stt-stats-card) {
    background: linear-gradient(180deg, #181C22 0%, #12161B 100%) !important;
    border-color: rgba(148, 163, 184, 0.08) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(248, 250, 252, 0.035) !important;
}

html[data-theme="dark"] :where(.stt-stats-bar) {
    background: rgba(248, 250, 252, 0.08) !important;
}

html[data-theme="dark"] :where(.stt-stats-label, .stt-stats-legend-count) {
    color: var(--text-primary) !important;
}

html[data-theme="dark"] :where(.stt-stats-total, .stt-stats-legend-label, .stt-stats-legend-pct, .stt-expand-btn) {
    color: var(--text-muted) !important;
}

html[data-theme="dark"] :where(
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
    textarea,
    select,
    .date-switcher button,
    .date-nav-trigger,
    .toolbar-nav-btn,
    .hms-trigger,
    .notes-button,
    .btn:not(.btn-primary):not(.btn-danger),
    button:not(.btn-primary):not(.btn-danger)
) {
    background: var(--surface-3) !important;
    border-color: rgba(148, 163, 184, 0.12) !important;
    color: var(--text-primary) !important;
}

html[data-theme="dark"] :where(
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):hover,
    textarea:hover,
    select:hover,
    .date-switcher button:hover,
    .date-nav-trigger:hover,
    .toolbar-nav-btn:hover,
    .hms-trigger:hover,
    .notes-button:hover,
    .btn:not(.btn-primary):not(.btn-danger):hover,
    button:not(.btn-primary):not(.btn-danger):hover
) {
    background: var(--surface-4) !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
}

html[data-theme="dark"] :where(.ns-topbar, .ns-menu, .dropdown-menu, .hms-panel) {
    background: #12161B !important;
}

html[data-theme="dark"] :where(.ns-nav-item.is-active) {
    background: rgba(248, 250, 252, 0.065) !important;
    box-shadow: inset 0 -2px 0 #3B82F6 !important;
}

/* Explicit print reset: dark mode should not burn ink or hide text. */
@media print {
    html[data-theme="dark"],
    html[data-theme="dark"] body {
        background: #fff !important;
        color: #111827 !important;
        color-scheme: light;
    }

    html[data-theme="dark"] * {
        box-shadow: none !important;
        text-shadow: none !important;
    }

    html[data-theme="dark"] .card,
    html[data-theme="dark"] .panel,
    html[data-theme="dark"] .section,
    html[data-theme="dark"] table,
    html[data-theme="dark"] th,
    html[data-theme="dark"] td {
        background: #fff !important;
        color: #111827 !important;
        border-color: #D1D5DB !important;
    }
}
