/**
 * DistHub dark mode — surfaces, text, forms, cards (load after module CSS).
 * Requires html.disthub-root.theme-dark (toggle in sidebar).
 */

.disthub-root.theme-dark {
  --dh-v2-page: var(--dh-page);
  --dh-v2-surface: var(--dh-surface);
  --dh-v2-border: var(--dh-border);
  --dh-v2-green-soft: rgba(30, 64, 175, 0.22);
  --dh-v2-green-dark: #93c5fd;
}

/* ——— Forms & inputs (module-wide) ——— */
.disthub-root.theme-dark input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
.disthub-root.theme-dark select,
.disthub-root.theme-dark textarea,
.disthub-root.theme-dark .assign-field-input,
.disthub-root.theme-dark .assign-input,
.disthub-root.theme-dark .dh-daily-toolbar .assign-input,
.disthub-root.theme-dark .filter-area-input,
.disthub-root.theme-dark .insights-toolbar input,
.disthub-root.theme-dark .insights-toolbar select,
.disthub-root.theme-dark .bill-toolbar-form input,
.disthub-root.theme-dark .bill-toolbar-form select {
  background: var(--dh-bg);
  border-color: var(--dh-border);
  color: var(--dh-text);
}

.disthub-root.theme-dark input::placeholder,
.disthub-root.theme-dark textarea::placeholder {
  color: var(--dh-muted);
  opacity: 0.85;
}

.disthub-root.theme-dark .sidebar-theme-icon-btn {
  background: var(--dh-surface);
  border-color: var(--dh-border);
  color: var(--dh-text);
}

.disthub-root.theme-dark .sidebar-version {
  color: var(--dh-muted);
}

/* ——— Sidebar toggle (hamburger) — readable on light & dark pages ——— */
.disthub-root.theme-dark .main-topbar-toggle {
  background: var(--dh-surface);
  border-color: var(--dh-border);
  color: var(--dh-text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.disthub-root.theme-dark .main-topbar-toggle:hover {
  background: rgba(30, 64, 175, 0.2);
  border-color: rgba(96, 165, 250, 0.45);
  color: #60a5fa;
}

.disthub-root.theme-dark .main-topbar-toggle.is-sidebar-open {
  background: rgba(30, 64, 175, 0.28);
  border-color: #60a5fa;
  color: #60a5fa;
}

.disthub-root.theme-dark .main-topbar-hamburger {
  opacity: 1;
}

/* Teal hero pages: keep a light button but use dark icon lines */
.disthub-root.theme-dark .main:has(.assign-hero) .main-topbar-toggle {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(255, 255, 255, 0.55);
  color: #212529;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}

.disthub-root.theme-dark .main:has(.assign-hero) .main-topbar-toggle:hover,
.disthub-root.theme-dark .main:has(.assign-hero) .main-topbar-toggle.is-sidebar-open {
  background: #fff;
  border-color: #fff;
  color: #93c5fd;
}

/* ——— Assign: light panels forced to theme tokens ——— */
.disthub-root.theme-dark .assign-search-inner,
.disthub-root.theme-dark .assign-filter-popover,
.disthub-root.theme-dark .assign-area-popover,
.disthub-root.theme-dark .assign-status-segment,
.disthub-root.theme-dark .assign-bottom-bar,
.disthub-root.theme-dark .assign-workflow-hint,
.disthub-root.theme-dark .bill-assign-multi-card,
.disthub-root.theme-dark .bill-assign-emp,
.disthub-root.theme-dark .bill-assign-foot,
.disthub-root.theme-dark .bill-assign-input,
.disthub-root.theme-dark .assign-roster-chip {
  background: var(--dh-bg);
  border-color: var(--dh-border);
  color: var(--dh-text);
}

.disthub-root.theme-dark .bill-assign-multi-head,
.disthub-root.theme-dark .bill-assign-head {
  background: var(--dh-surface);
  border-color: var(--dh-border);
  color: var(--dh-text);
}

.disthub-root.theme-dark .bill-assign-multi-title,
.disthub-root.theme-dark .bill-assign-title,
.disthub-root.theme-dark .bill-assign-emp-name,
.disthub-root.theme-dark .assign-roster-name {
  color: var(--dh-text);
}

.disthub-root.theme-dark .bill-assign-multi-sub,
.disthub-root.theme-dark .bill-assign-multi-help,
.disthub-root.theme-dark .assign-roster-meta {
  color: var(--dh-muted);
}

/* ——— Assign bill list: dark cards + readable text (fixes white card / invisible labels) ——— */
.disthub-root.theme-dark .assign-list .assign-row,
.disthub-root.theme-dark .assign-list .assign-row.assign-row--inline.bill-card,
.disthub-root.theme-dark .bill-card-list .assign-row,
.disthub-root.theme-dark .bill-card-list .bill-card,
.disthub-root.theme-dark .assign-page .assign-row.bill-card {
  background: var(--dh-surface) !important;
  border-color: var(--dh-border) !important;
  color: var(--dh-text);
}

.disthub-root.theme-dark .assign-row--pending,
.disthub-root.theme-dark .assign-row--delivered,
.disthub-root.theme-dark .assign-row--paid,
.disthub-root.theme-dark .assign-row--unpaid,
.disthub-root.theme-dark .assign-row--undelivered {
  background: var(--dh-surface) !important;
}

.disthub-root.theme-dark .assign-row .assign-row-party,
.disthub-root.theme-dark .assign-row .assign-row-amt,
.disthub-root.theme-dark .assign-row-card-mid .assign-row-party,
.disthub-root.theme-dark .assign-row-card-right .assign-row-amt {
  color: var(--dh-text) !important;
}

.disthub-root.theme-dark .assign-row .assign-row-address,
.disthub-root.theme-dark .assign-row .assign-row-sub,
.disthub-root.theme-dark .assign-row .assign-row-driver,
.disthub-root.theme-dark .assign-row .assign-row-driver span {
  color: var(--dh-muted) !important;
}

.disthub-root.theme-dark .assign-row .assign-row-area {
  color: #60a5fa !important;
}

.disthub-root.theme-dark .assign-row-sub--loc .assign-row-salesman,
.disthub-root.theme-dark .assign-row-sub--loc .assign-row-salesman span {
  color: #93c5fd !important;
}

.disthub-root.theme-dark .assign-hisab-hint,
.disthub-root.theme-dark .assign-hisab-hint--rules,
.disthub-root.theme-dark .assign-hisab-hint--workflow {
  background: var(--dh-bg) !important;
  border-color: var(--dh-border) !important;
  color: var(--dh-text) !important;
}

.disthub-root.theme-dark .assign-hisab-hint.dh-muted,
.disthub-root.theme-dark .assign-hisab-hint--workflow.dh-muted {
  color: var(--dh-muted) !important;
}

.disthub-root.theme-dark .assign-hisab-hint strong {
  color: var(--dh-text);
}

.disthub-root.theme-dark .assign-hisab-hint--workflow a {
  color: #60a5fa !important;
}

.disthub-root.theme-dark .assign-tag {
  background: rgba(51, 65, 85, 0.45);
  color: var(--dh-muted);
  border-color: var(--dh-border);
}

.disthub-root.theme-dark .assign-tag--delivered {
  background: rgba(37, 99, 235, 0.22);
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.35);
}

.disthub-root.theme-dark .assign-tag--paid {
  background: rgba(22, 163, 74, 0.22);
  color: #93c5fd;
  border-color: rgba(74, 222, 128, 0.35);
}

.disthub-root.theme-dark .assign-tag--unpaid {
  background: rgba(217, 119, 6, 0.22);
  color: #fcd34d;
  border-color: rgba(251, 191, 36, 0.35);
}

.disthub-root.theme-dark .assign-tag--pending {
  background: rgba(51, 65, 85, 0.55);
  color: #cbd5e1;
  border-color: var(--dh-border);
}

.disthub-root.theme-dark .assign-tag--undelivered {
  background: rgba(234, 88, 12, 0.22);
  color: #fdba74;
  border-color: rgba(251, 146, 60, 0.35);
}

.disthub-root.theme-dark .assign-tag--cash {
  background: rgba(13, 148, 136, 0.18);
  color: #60a5fa;
  border-color: rgba(45, 212, 191, 0.35);
}

.disthub-root.theme-dark .assign-tag--debit {
  background: rgba(185, 28, 28, 0.18);
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.35);
}

.disthub-root.theme-dark .assign-tag--hisab {
  background: rgba(67, 56, 202, 0.22);
  color: #c4b5fd;
  border-color: rgba(196, 181, 253, 0.35);
}

.disthub-root.theme-dark .assign-bottom-strip--totals,
.disthub-root.theme-dark .assign-empty,
.disthub-root.theme-dark .assign-roster-section {
  background: var(--dh-surface) !important;
  border-color: var(--dh-border) !important;
  color: var(--dh-text);
}

.disthub-root.theme-dark .assign-stat {
  background: var(--dh-surface);
  border-color: var(--dh-border);
  color: var(--dh-text);
}

.disthub-root.theme-dark .assign-stat-num,
.disthub-root.theme-dark .assign-row-party,
.disthub-root.theme-dark .assign-row-amt,
.disthub-root.theme-dark .assign-row-meta,
.disthub-root.theme-dark .assign-row-salesman {
  color: var(--dh-text);
}

/* ——— Sales bills / shared bill cards ——— */
.disthub-root.theme-dark .bill-card,
.disthub-root.theme-dark li.bill-card {
  background: var(--dh-surface) !important;
  border-color: var(--dh-border) !important;
  color: var(--dh-text);
}

.disthub-root.theme-dark .bill-card:hover {
  background: rgba(30, 64, 175, 0.14) !important;
  border-color: rgba(96, 165, 250, 0.4) !important;
}

.disthub-root.theme-dark .bill-card-party,
.disthub-root.theme-dark .bill-card-amt {
  color: var(--dh-text) !important;
}

.disthub-root.theme-dark .bill-card-party-sub,
.disthub-root.theme-dark .bill-card-meta,
.disthub-root.theme-dark .bill-card-date {
  color: var(--dh-muted) !important;
}

.disthub-root.theme-dark .bill-card-kg {
  background: rgba(22, 163, 74, 0.2);
  color: #93c5fd;
}

.disthub-root.theme-dark .main .dh-muted,
.disthub-root.theme-dark .content .dh-muted,
.disthub-root.theme-dark .assign-empty-text {
  color: var(--dh-muted);
}

.disthub-root.theme-dark .main strong,
.disthub-root.theme-dark .content strong {
  color: var(--dh-text);
}

/* ——— Employee hisab bill tabs ——— */
.disthub-root.theme-dark .hisab-bill-tab__party,
.disthub-root.theme-dark .hisab-bill-tab__amt {
  color: var(--dh-text) !important;
}

.disthub-root.theme-dark .hisab-bill-tab__meta,
.disthub-root.theme-dark .hisab-bill-tab__date {
  color: var(--dh-muted) !important;
}

.disthub-root.theme-dark .hisab-bill-tab__area {
  color: #60a5fa !important;
}

.disthub-root.theme-dark .hisab-bill-tab__kind--cash {
  background: rgba(22, 163, 74, 0.22);
  color: #93c5fd;
}

.disthub-root.theme-dark .hisab-bill-tab__kind--debit {
  background: rgba(185, 28, 28, 0.22);
  color: #fca5a5;
}

/* ——— Bill excel / sales bills lists ——— */
.disthub-root.theme-dark .bill-list-filter {
  background: var(--dh-surface);
  border-color: var(--dh-border);
  color: var(--dh-text);
}

.disthub-root.theme-dark .bill-list-filter--warn.bill-list-filter--active,
.disthub-root.theme-dark .bill-list-stat--warn {
  background: rgba(217, 119, 6, 0.2);
  color: #fcd34d;
}

.disthub-root.theme-dark .bill-list-filter--new.bill-list-filter--active,
.disthub-root.theme-dark .bill-list-stat--new {
  background: rgba(37, 99, 235, 0.2);
  color: #93c5fd;
}

.disthub-root.theme-dark .bill-list-stat--skip {
  background: rgba(51, 65, 85, 0.45);
  color: var(--dh-muted);
}

.disthub-root.theme-dark .bill-list-resolve tbody tr:nth-child(even) {
  background: rgba(20, 28, 39, 0.45);
}

.disthub-root.theme-dark .bill-list-resolve tbody tr:hover {
  background: rgba(22, 163, 74, 0.12);
}

.disthub-root.theme-dark .bill-list-resolve th {
  background: rgba(22, 163, 74, 0.18);
  color: #93c5fd;
}

.disthub-root.theme-dark .bill-list-resolve td {
  color: var(--dh-text);
  border-color: var(--dh-border);
}

.disthub-root.theme-dark .bill-list-stat--similar,
.disthub-root.theme-dark .bill-list-badge--similar {
  background: rgba(217, 119, 6, 0.2);
  color: #fcd34d;
}

.disthub-root.theme-dark .unpaid-bill-card,
.disthub-root.theme-dark .manage-hisab-row,
.disthub-root.theme-dark .party-card,
.disthub-root.theme-dark .perm-card {
  background: var(--dh-surface) !important;
  border-color: var(--dh-border) !important;
  color: var(--dh-text);
}

/* ——— Toggle / chip / segment buttons (Receipt·Expense, filters, tabs) ——— */
.disthub-root.theme-dark .dh-daily-manual-type-opt {
  background: var(--dh-bg) !important;
  border-color: var(--dh-border) !important;
  color: var(--dh-text) !important;
}

.disthub-root.theme-dark .dh-daily-manual-type-opt:has(input:checked) {
  background: rgba(30, 64, 175, 0.22) !important;
  border-color: #60a5fa !important;
  color: #60a5fa !important;
}

.disthub-root.theme-dark .assign-chip {
  background: var(--dh-bg);
  border: 1px solid var(--dh-border);
  color: var(--dh-text);
  box-shadow: none;
}

.disthub-root.theme-dark .assign-chip.is-active {
  background: rgba(30, 64, 175, 0.22);
  border-color: #60a5fa;
  color: #60a5fa;
}

.disthub-root.theme-dark .assign-chip--cash.is-active {
  color: #86efac;
  border-color: rgba(74, 222, 128, 0.45);
  background: rgba(22, 163, 74, 0.18);
}

.disthub-root.theme-dark .assign-chip--debit.is-active {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(185, 28, 28, 0.18);
}

.disthub-root.theme-dark .assign-chip--reassign.is-active {
  color: #c4b5fd;
  border-color: rgba(196, 181, 253, 0.45);
  background: rgba(109, 40, 217, 0.2);
}

.disthub-root.theme-dark .assign-hero-links .assign-chip:not(.is-active) {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.38);
  color: rgba(255, 255, 255, 0.95);
}

.disthub-root.theme-dark .assign-hero-links .assign-chip.is-active {
  background: var(--dh-surface);
  border-color: var(--dh-border);
  color: #60a5fa;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.disthub-root.theme-dark .assign-hero-links .assign-chip--cash.is-active {
  color: #86efac;
}

.disthub-root.theme-dark .assign-hero-links .assign-chip--debit.is-active {
  color: #fca5a5;
}

.disthub-root.theme-dark .assign-hero-links .assign-chip--reassign.is-active {
  color: #c4b5fd;
}

.disthub-root.theme-dark .assign-date-chip {
  background: rgba(37, 99, 235, 0.18);
  border-color: rgba(147, 197, 253, 0.35);
  color: #93c5fd;
}

.disthub-root.theme-dark .assign-date-chip.is-active,
.disthub-root.theme-dark .assign-date-chip:hover {
  background: rgba(37, 99, 235, 0.32);
  border-color: #93c5fd;
  color: #dbeafe;
}

.disthub-root.theme-dark .bill-kind-segment {
  background: var(--dh-surface);
  border-color: var(--dh-border);
}

.disthub-root.theme-dark .bill-kind-segment .bill-kind-seg {
  color: var(--dh-muted);
}

.disthub-root.theme-dark .bill-kind-segment .bill-kind-seg:hover:not(.is-on) {
  background: rgba(51, 65, 85, 0.45);
  color: var(--dh-text);
}

.disthub-root.theme-dark .bill-kind-segment .bill-kind-seg.is-on {
  background: rgba(51, 65, 85, 0.65);
  color: var(--dh-text);
  box-shadow: none;
}

.disthub-root.theme-dark .bill-kind-segment .bill-kind-seg--cash.is-on {
  background: linear-gradient(180deg, #3b82f6 0%, #1e40af 100%);
  color: #fff;
}

.disthub-root.theme-dark .bill-kind-segment .bill-kind-seg--debit.is-on {
  background: linear-gradient(180deg, #f87171 0%, #dc2626 100%);
  color: #fff;
}

.disthub-root.theme-dark .bill-kind-segment .bill-kind-seg--cash:not(.is-on) {
  color: #60a5fa;
}

.disthub-root.theme-dark .bill-kind-segment .bill-kind-seg--debit:not(.is-on) {
  color: #fca5a5;
}

.disthub-root.theme-dark .assign-status-segment {
  background: var(--dh-bg);
  border-color: var(--dh-border);
}

.disthub-root.theme-dark .assign-status-btn {
  color: var(--dh-muted);
}

.disthub-root.theme-dark .assign-status-btn:hover:not(:disabled) {
  background: rgba(51, 65, 85, 0.45);
  color: var(--dh-text);
}

.disthub-root.theme-dark .assign-status-btn--paid:not(.is-active),
.disthub-root.theme-dark .assign-status-btn--delivered:not(.is-active),
.disthub-root.theme-dark .assign-status-btn--delivered_paid:not(.is-active) {
  color: #4ade80;
}

.disthub-root.theme-dark .assign-status-btn--undelivered:not(.is-active) {
  color: #fdba74;
}

.disthub-root.theme-dark .assign-status-btn--unpaid:not(.is-active),
.disthub-root.theme-dark .assign-status-btn--delivered_unpaid:not(.is-active) {
  color: #f87171;
}

.disthub-root.theme-dark .pill-group {
  background: var(--dh-surface);
  border-color: var(--dh-border);
}

.disthub-root.theme-dark .pill-group a.is-active,
.disthub-root.theme-dark .pill-group span.is-active {
  background: rgba(30, 64, 175, 0.22);
  color: #60a5fa;
}

.disthub-root.theme-dark .pill-group a,
.disthub-root.theme-dark .pill-group span {
  color: var(--dh-muted);
}

.disthub-root.theme-dark .pill-group a:hover {
  color: var(--dh-text);
  background: rgba(51, 65, 85, 0.4);
}

.disthub-root.theme-dark .dh-expense-tab {
  color: var(--dh-muted);
}

.disthub-root.theme-dark .dh-expense-tab:hover {
  color: var(--dh-text);
  background: rgba(30, 64, 175, 0.14);
}

.disthub-root.theme-dark .dh-expense-tab.is-active {
  background: var(--dh-surface) !important;
  color: #60a5fa !important;
  border-bottom-color: #60a5fa !important;
}

.disthub-root.theme-dark .dh-expense-tab-count {
  background: rgba(30, 64, 175, 0.22);
  color: #93c5fd;
}

.disthub-root.theme-dark .dh-expense-tab:not(.is-active) .dh-expense-tab-count {
  background: rgba(51, 65, 85, 0.45);
  color: var(--dh-muted);
}

.disthub-root.theme-dark .assign-btn--ghost,
.disthub-root.theme-dark .dh-daily-toolbar .assign-btn--ghost {
  background: var(--dh-bg);
  border-color: var(--dh-border);
  color: var(--dh-text);
}

.disthub-root.theme-dark .assign-roster-summary-item {
  background: var(--dh-bg);
  border-color: var(--dh-border);
  color: var(--dh-text);
}

.disthub-root.theme-dark .assign-roster-summary-item--new {
  background: rgba(217, 119, 6, 0.18);
  border-color: rgba(251, 191, 36, 0.35);
  color: #fcd34d;
}

.disthub-root.theme-dark .assign-roster-summary-item--done {
  background: rgba(22, 163, 74, 0.18);
  border-color: rgba(74, 222, 128, 0.35);
  color: #93c5fd;
}

.disthub-root.theme-dark .bill-photo-steps .assign-chip {
  background: var(--dh-bg);
  border: 1px solid var(--dh-border);
  color: var(--dh-muted);
}

.disthub-root.theme-dark .bill-photo-steps .assign-chip.is-active,
.disthub-root.theme-dark .bill-photo-steps .assign-chip.is-done {
  background: rgba(22, 163, 74, 0.2);
  border-color: rgba(74, 222, 128, 0.35);
  color: #93c5fd;
}

.disthub-root.theme-dark .dh-daily-notes-footer,
.disthub-root.theme-dark .daily-hisab-page .dh-daily-notes-card .hisab-denom-right .hisab-input--qty,
.disthub-root.theme-dark .daily-hisab-page .dh-daily-notes-card .hisab-denom-right .hisab-input--coins {
  background: var(--dh-bg) !important;
  border-color: var(--dh-border) !important;
  color: var(--dh-text) !important;
}

.disthub-root.theme-dark .daily-hisab-expense-types-page .dh-expense-field-input {
  background: var(--dh-bg);
  border-color: var(--dh-border);
  color: var(--dh-text);
}

.disthub-root.theme-dark .assign-hero-pill:not(.assign-hero-pill--count) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: #eff6ff;
}

/* ——— Home dashboard ——— */
.disthub-root.theme-dark .home-dash-action-card,
.disthub-root.theme-dark .home-dash-status,
.disthub-root.theme-dark .home-dash-module,
.disthub-root.theme-dark .home-dash-team-card {
  background: var(--dh-surface);
  border-color: var(--dh-border);
  color: var(--dh-text);
  box-shadow: var(--dh-shadow);
}

.disthub-root.theme-dark .home-dash-action-card--warn,
.disthub-root.theme-dark .home-dash-action-card--info,
.disthub-root.theme-dark .home-dash-action-card--alert {
  background: var(--dh-surface);
}

.disthub-root.theme-dark .home-dash-action-card--warn {
  border-color: rgba(251, 146, 60, 0.45);
}

.disthub-root.theme-dark .home-dash-action-card--info {
  border-color: rgba(96, 165, 250, 0.45);
}

.disthub-root.theme-dark .home-dash-action-card--alert {
  border-color: rgba(251, 146, 60, 0.55);
}

.disthub-root.theme-dark .home-dash-action-num,
.disthub-root.theme-dark .home-dash-module-name,
.disthub-root.theme-dark .home-dash-team-name,
.disthub-root.theme-dark .home-dash-status-foot strong {
  color: var(--dh-text);
}

.disthub-root.theme-dark .home-dash-action-step {
  background: rgba(45, 212, 191, 0.15);
  color: #60a5fa;
}

.disthub-root.theme-dark .home-dash-action-card--warn .home-dash-action-step,
.disthub-root.theme-dark .home-dash-action-card--alert .home-dash-action-step {
  background: rgba(251, 146, 60, 0.18);
  color: #fdba74;
}

.disthub-root.theme-dark .home-dash-module--alert {
  background: var(--dh-surface);
  border-color: rgba(251, 146, 60, 0.45);
}

.disthub-root.theme-dark .home-dash-team-head {
  background: rgba(30, 64, 175, 0.18);
  border-bottom-color: rgba(96, 165, 250, 0.28);
  color: #93c5fd;
}

.disthub-root.theme-dark .home-dash-team-list li + li {
  border-top-color: var(--dh-border);
}

.disthub-root.theme-dark .home-dash-pill--paid {
  background: rgba(22, 163, 74, 0.18);
  border-color: rgba(74, 222, 128, 0.35);
  color: #93c5fd;
}

.disthub-root.theme-dark .home-dash-pill--unpaid {
  background: rgba(217, 119, 6, 0.18);
  border-color: rgba(251, 191, 36, 0.35);
  color: #fcd34d;
}

.disthub-root.theme-dark .home-dash-pill--undelivered {
  background: rgba(185, 28, 28, 0.18);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}

.disthub-root.theme-dark .home-dash-pill--pending {
  background: rgba(51, 65, 85, 0.45);
  border-color: var(--dh-border);
  color: var(--dh-muted);
}

.disthub-root.theme-dark .home-dash-pill--delivered {
  background: rgba(8, 145, 178, 0.18);
  border-color: rgba(103, 232, 249, 0.35);
  color: #67e8f9;
}

.disthub-root.theme-dark .home-dash-badge--complete {
  background: rgba(22, 163, 74, 0.22);
  color: #93c5fd;
}

.disthub-root.theme-dark .home-dash-badge--work-pending {
  background: rgba(217, 119, 6, 0.22);
  color: #fcd34d;
}

/* ——— Employee Hisab ——— */
.disthub-root.theme-dark .hisab-list-legend {
  background: rgba(30, 64, 175, 0.22);
  border-color: rgba(96, 165, 250, 0.38);
  color: #dbeafe;
}

.disthub-root.theme-dark .hisab-list-legend__tick {
  color: #93c5fd;
}

.disthub-root.theme-dark .assign-page--hisab .hisab-bill-tab.assign-row.assign-row--hisab {
  background: var(--dh-surface);
  border-color: var(--dh-border);
  box-shadow: var(--dh-shadow);
}

.disthub-root.theme-dark .assign-page--hisab .hisab-bill-tab.assign-row.assign-row--hisab:hover {
  border-color: rgba(96, 165, 250, 0.4);
}

.disthub-root.theme-dark .hisab-bill-tab .assign-row-party,
.disthub-root.theme-dark .hisab-bill-tab .assign-row-amt,
.disthub-root.theme-dark .hisab-bill-tab .hisab-row-status-label {
  color: var(--dh-text);
}

.disthub-root.theme-dark .hisab-bill-tab__party,
.disthub-root.theme-dark .hisab-bill-tab__meta,
.disthub-root.theme-dark .hisab-bill-tab__amt,
.disthub-root.theme-dark .hisab-bill-tab__date {
  color: var(--dh-text);
}

/* ——— Hisab cards (employee / daily / calc) ——— */
.disthub-root.theme-dark .hisab-card {
  background: var(--dh-surface);
  border-color: var(--dh-border);
  box-shadow: var(--dh-shadow);
}

.disthub-root.theme-dark .hisab-card-head {
  background: var(--dh-bg);
  border-bottom-color: var(--dh-border);
}

.disthub-root.theme-dark .hisab-card-title,
.disthub-root.theme-dark .hisab-denom-note,
.disthub-root.theme-dark .hisab-denom-amt,
.disthub-root.theme-dark .hisab-total-value {
  color: var(--dh-text);
}

.disthub-root.theme-dark .hisab-card-sub,
.disthub-root.theme-dark .hisab-denom-eq,
.disthub-root.theme-dark .hisab-total-label {
  color: var(--dh-muted);
}

.disthub-root.theme-dark .hisab-denom {
  background: var(--dh-bg);
  border-color: var(--dh-border);
}

.disthub-root.theme-dark .hisab-input,
.disthub-root.theme-dark .hisab-input--qty,
.disthub-root.theme-dark .hisab-input--coins,
.disthub-root.theme-dark .hisab-input--money {
  background: var(--dh-bg);
  border-color: var(--dh-border);
  color: var(--dh-text);
}

.disthub-root.theme-dark .hisab-totals {
  background: var(--dh-bg);
  border-top-color: var(--dh-border);
}

.disthub-root.theme-dark .hisab-eq {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(96, 165, 250, 0.35);
  color: var(--dh-text);
}

/* ——— Daily Hisab ——— */
.disthub-root.theme-dark .dh-daily-kpi-card,
.disthub-root.theme-dark .dh-daily-notes-card,
.disthub-root.theme-dark .dh-daily-manual-card,
.disthub-root.theme-dark .dh-daily-line,
.disthub-root.theme-dark .dh-daily-step {
  background: var(--dh-surface);
  border-color: var(--dh-border);
  color: var(--dh-text);
}

.disthub-root.theme-dark .dh-daily-kpi-label,
.disthub-root.theme-dark .dh-daily-section-hint,
.disthub-root.theme-dark .dh-daily-col-head {
  color: var(--dh-muted);
}

.disthub-root.theme-dark .dh-daily-kpi-value,
.disthub-root.theme-dark .dh-daily-line strong {
  color: var(--dh-text);
}

.disthub-root.theme-dark .daily-hisab-page .dh-daily-notes-card .hisab-denom {
  background: var(--dh-bg);
  border-color: var(--dh-border);
}

/* ——— Manage / tables / modals ——— */
.disthub-root.theme-dark .dh-table-wrap,
.disthub-root.theme-dark .manage-hisab-card,
.disthub-root.theme-dark .assign-page--manage-hisab .manage-hisab-date-panel,
.disthub-root.theme-dark .dh-modal-panel,
.disthub-root.theme-dark .dh-modal-body,
.disthub-root.theme-dark .filter-area-popover,
.disthub-root.theme-dark .stat-tile {
  background: var(--dh-surface);
  border-color: var(--dh-border);
  color: var(--dh-text);
}

.disthub-root.theme-dark table th {
  background: var(--dh-bg);
  color: var(--dh-muted);
}

.disthub-root.theme-dark table td {
  color: var(--dh-text);
  border-color: var(--dh-border);
}

.disthub-root.theme-dark .assign-page--manage-hisab .manage-hisab-date-panel {
  border-color: rgba(96, 165, 250, 0.28);
  background: linear-gradient(180deg, rgba(30, 64, 175, 0.16) 0%, var(--dh-surface) 48%);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
}

.disthub-root.theme-dark .manage-hisab-date-panel__title {
  color: #93c5fd;
}

.disthub-root.theme-dark .manage-hisab-date-chip--stored {
  color: var(--dh-muted);
  background: var(--dh-bg);
  border-color: var(--dh-border);
}

.disthub-root.theme-dark .manage-hisab-date-chip--target {
  color: #93c5fd;
  background: rgba(30, 64, 175, 0.22);
  border-color: rgba(96, 165, 250, 0.38);
}

.disthub-root.theme-dark .manage-hisab-date-panel__hint {
  color: var(--dh-muted);
}

.disthub-root.theme-dark table tbody tr:nth-child(even) {
  background: rgba(20, 28, 39, 0.45);
}

.disthub-root.theme-dark .dh-modal-head {
  background: var(--dh-surface);
  border-bottom-color: var(--dh-border);
  color: var(--dh-text);
}

.disthub-root.theme-dark .btn-secondary,
.disthub-root.theme-dark .assign-btn-secondary {
  background: var(--dh-bg);
  border-color: var(--dh-border);
  color: var(--dh-text);
}

.disthub-root.theme-dark .btn-secondary:hover,
.disthub-root.theme-dark .assign-btn-secondary:hover {
  background: rgba(51, 65, 85, 0.5);
  border-color: var(--dh-muted);
}

/* ——— Bill excel / insights ——— */
.disthub-root.theme-dark .insights-toolbar,
.disthub-root.theme-dark .bill-toolbar-form,
.disthub-root.theme-dark .bill-canvas-bag-panel,
.disthub-root.theme-dark .bill-canvas-bag-block {
  background: var(--dh-surface);
  border-color: var(--dh-border);
}

.disthub-root.theme-dark .bill-canvas-bag-block-title,
.disthub-root.theme-dark .bill-view-meta,
.disthub-root.theme-dark .bill-view-no {
  color: var(--dh-text);
}

.disthub-root.theme-dark .dup-group-head {
  background: var(--dh-bg);
  color: var(--dh-text);
}

/* ——— UI v2 (when used) ——— */
.disthub-root.theme-dark .dh-ui-v2 .assign-hero,
.disthub-root.theme-dark.dh-ui-v2 .assign-hero {
  background: var(--dh-surface);
  border-color: var(--dh-border);
}

.disthub-root.theme-dark .dh-ui-v2 .assign-hero-title {
  color: var(--dh-text);
}

.disthub-root.theme-dark .dh-ui-v2 .assign-hero-pill {
  background: var(--dh-bg);
  border-color: var(--dh-border);
  color: var(--dh-muted);
}

.disthub-root.theme-dark .dh-ui-v2 .assign-toolbar,
.disthub-root.theme-dark .dh-ui-v2 .assign-stat-card,
.disthub-root.theme-dark .dh-ui-v2 .dh-table-card {
  background: var(--dh-surface);
  border-color: var(--dh-border);
}

.disthub-root.theme-dark .dh-ui-v2 .assign-stat-card strong,
.disthub-root.theme-dark .dh-ui-v2 .dh-table-card td {
  color: var(--dh-text);
}

/* ——— Sidebar navigation (inactive items were too dim) ——— */
.disthub-root.theme-dark .sidebar .nav-section-label {
  color: #6c757d;
}

.disthub-root.theme-dark .sidebar .nav-item svg,
.disthub-root.theme-dark .sidebar .nav-item .nav-icon-svg {
  opacity: 1;
}

/* ——— Permissions ——— */
.disthub-root.theme-dark .perm-panel,
.disthub-root.theme-dark .perm-legend {
  background: var(--dh-surface);
  border-color: var(--dh-border);
  color: var(--dh-text);
}

.disthub-root.theme-dark .perm-panel-title,
.disthub-root.theme-dark .perm-access-title,
.disthub-root.theme-dark .perm-td-name,
.disthub-root.theme-dark .perm-check,
.disthub-root.theme-dark .perm-username-readonly {
  color: var(--dh-text);
}

.disthub-root.theme-dark .perm-access-hint,
.disthub-root.theme-dark .perm-matrix thead th {
  color: var(--dh-muted);
}

.disthub-root.theme-dark .perm-matrix th[scope="row"] {
  color: var(--dh-text);
}

.disthub-root.theme-dark .perm-panel table tbody tr:nth-child(even) {
  background: rgba(51, 65, 85, 0.35);
}

.disthub-root.theme-dark .perm-panel table td,
.disthub-root.theme-dark .perm-panel table th {
  border-color: var(--dh-border);
}

.disthub-root.theme-dark .perm-matrix th,
.disthub-root.theme-dark .perm-matrix td {
  border-color: var(--dh-border);
}

/* ——— Missing bill series ——— */
.disthub-root.theme-dark .dh-ms-toolbar-hint,
.disthub-root.theme-dark .dh-ms-empty,
.disthub-root.theme-dark .dh-ms-panel-head {
  background: var(--dh-bg);
  border-color: var(--dh-border);
  color: var(--dh-text);
}

.disthub-root.theme-dark .dh-ms-panel-title,
.disthub-root.theme-dark .dh-ms-empty-title {
  color: var(--dh-text);
}

.disthub-root.theme-dark .dh-ms-panel-lead,
.disthub-root.theme-dark .dh-ms-empty-text,
.disthub-root.theme-dark .dh-ms-toolbar-hint {
  color: var(--dh-muted);
}

.disthub-root.theme-dark .missing-chip {
  background: rgba(234, 88, 12, 0.18);
  border-color: rgba(251, 146, 60, 0.45);
  color: #fdba74;
}

/* ——— Office Hisab grids ——— */
.disthub-root.theme-dark .dh-office-panel-head,
.disthub-root.theme-dark .dh-office-table thead th {
  background: var(--dh-bg);
  color: var(--dh-muted);
}

.disthub-root.theme-dark .dh-office-panel-title {
  color: var(--dh-text);
}

.disthub-root.theme-dark .dh-office-panel-desc {
  color: var(--dh-muted);
}

.disthub-root.theme-dark .dh-office-td-note,
.disthub-root.theme-dark .dh-office-td-qty,
.disthub-root.theme-dark .dh-office-td-amt,
.disthub-root.theme-dark .dh-office-qty-input {
  background: var(--dh-surface);
  color: var(--dh-text);
  border-color: var(--dh-border);
}

.disthub-root.theme-dark .dh-office-table th,
.disthub-root.theme-dark .dh-office-table td {
  border-color: var(--dh-border);
}

/* ——— Add bill modal ——— */
.disthub-root.theme-dark .bill-add-party-list-wrap {
  background: var(--dh-bg);
  color: var(--dh-text);
}

.disthub-root.theme-dark .bill-add-party-item-name {
  color: var(--dh-text);
}

.disthub-root.theme-dark .bill-add-party-item:hover,
.disthub-root.theme-dark .bill-add-party-item:focus-visible {
  background: var(--dh-surface);
}

.disthub-root.theme-dark .bill-add-kind-chip {
  background: var(--dh-bg);
  border-color: var(--dh-border);
  color: var(--dh-text);
}

.disthub-root.theme-dark .bill-add-kind-chip:has(input:checked) {
  background: rgba(30, 64, 175, 0.22);
  border-color: #60a5fa;
  color: #60a5fa;
}

.disthub-root.theme-dark .bill-add-kind-chip--debit:has(input:checked) {
  background: rgba(234, 88, 12, 0.2);
  border-color: #fb923c;
  color: #fdba74;
}

.disthub-root.theme-dark .bill-add-vcn-row,
.disthub-root.theme-dark .bill-add-footer {
  background: var(--dh-bg);
  border-color: var(--dh-border);
}

.disthub-root.theme-dark .bill-add-vcn-prefix {
  background: var(--dh-surface);
  color: var(--dh-text);
}

/* ——— Hisab calculation footer / KPIs ——— */
.disthub-root.theme-dark .hisab-complete-bar,
.disthub-root.theme-dark .hisab-kpi,
.disthub-root.theme-dark .hisab-eq {
  background: var(--dh-surface);
  border-color: var(--dh-border);
  color: var(--dh-text);
}

.disthub-root.theme-dark .hisab-complete-title,
.disthub-root.theme-dark .hisab-complete-sub,
.disthub-root.theme-dark .hisab-kpi-value,
.disthub-root.theme-dark .hisab-eq-num {
  color: var(--dh-text);
}

.disthub-root.theme-dark .hisab-kpi-label,
.disthub-root.theme-dark .hisab-eq-label,
.disthub-root.theme-dark .hisab-eq-op {
  color: var(--dh-muted);
}

.disthub-root.theme-dark .hisab-eq-total {
  color: #93c5fd;
}

.disthub-root.theme-dark .fab-bar--hisab .fab-bar-inner {
  background: var(--dh-surface);
  border: 1px solid var(--dh-border);
  color: var(--dh-text);
}

.disthub-root.theme-dark .fab-bar--hisab .fab-hisab-hint,
.disthub-root.theme-dark .fab-bar--hisab .fab-hisab-lead {
  color: var(--dh-text);
}

.disthub-root.theme-dark .fab-bar--hisab .fab-selected-total--unpaid {
  background: rgba(220, 38, 38, 0.14);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fca5a5;
}

.disthub-root.theme-dark .fab-bar--hisab .fab-selected-total--unpaid .fab-selected-total-meta {
  color: #f87171;
}

.disthub-root.theme-dark .fab-bar--hisab .fab-selected-total--unpaid .fab-selected-total-amt {
  color: #fecaca;
}

.disthub-root.theme-dark .fab-bar--hisab .fab-selected-total--paid {
  background: rgba(22, 163, 74, 0.14);
  border-color: rgba(74, 222, 128, 0.35);
  color: #93c5fd;
}

.disthub-root.theme-dark .fab-bar--hisab .fab-selected-total--paid .fab-selected-total-meta {
  color: #4ade80;
}

.disthub-root.theme-dark .fab-bar--hisab .fab-selected-total--paid .fab-selected-total-amt {
  color: #bbf7d0;
}

.disthub-root.theme-dark .assign-hisab-kpi {
  background: var(--dh-surface);
  border-color: var(--dh-border);
}

.disthub-root.theme-dark .assign-hisab-kpi-l {
  color: var(--dh-muted);
}

.disthub-root.theme-dark .assign-hisab-kpi-v {
  color: var(--dh-text);
}

.disthub-root.theme-dark .hisab-mini-btn:not(.hisab-mini-btn--ghost):not(.hisab-mini-btn--danger) {
  background: var(--dh-bg);
  border-color: var(--dh-border);
  color: var(--dh-text);
}

.disthub-root.theme-dark .hisab-block-head,
.disthub-root.theme-dark .hisab-block-sub {
  color: var(--dh-text);
}

/* White secondary buttons on dark pages */
.disthub-root.theme-dark .btn-outline-light,
.disthub-root.theme-dark .assign-hero .btn-secondary,
.disthub-root.theme-dark .page-hero .btn-secondary,
.disthub-root.theme-dark .dh-office-hero .btn-secondary {
  background: var(--dh-bg);
  border-color: var(--dh-border);
  color: var(--dh-text);
}

/* ——— Print / PDF preview: keep paper white, force dark ink ——— */
.disthub-root.theme-dark .pdf-stage {
  background: #0f1419;
}

.disthub-root.theme-dark .pdf-page,
.disthub-root.theme-dark .pdf-page-wrap .oh-page,
.disthub-root.theme-dark .oh-screen-register-wrap .oh-page {
  background: #fff !important;
  color: #111827 !important;
}

.disthub-root.theme-dark .pdf-page .sheet,
.disthub-root.theme-dark .pdf-page-wrap .oh-page,
.disthub-root.theme-dark .oh-screen-register-wrap .oh-page {
  color: #111827 !important;
}

.disthub-root.theme-dark .pdf-page table th,
.disthub-root.theme-dark .pdf-page table td,
.disthub-root.theme-dark .pdf-page .t th,
.disthub-root.theme-dark .pdf-page .t td,
.disthub-root.theme-dark .pdf-page-wrap .oh-page table th,
.disthub-root.theme-dark .pdf-page-wrap .oh-page table td,
.disthub-root.theme-dark .oh-screen-register-wrap .oh-page table th,
.disthub-root.theme-dark .oh-screen-register-wrap .oh-page table td {
  color: #111827 !important;
  border-color: #bfc7d1;
}

.disthub-root.theme-dark .pdf-page table tbody tr:nth-child(even),
.disthub-root.theme-dark .pdf-page-wrap .oh-page table tbody tr:nth-child(even),
.disthub-root.theme-dark .oh-screen-register-wrap .oh-page table tbody tr:nth-child(even) {
  background: transparent;
}

.disthub-root.theme-dark .pdf-page table th,
.disthub-root.theme-dark .pdf-page .t th {
  background: #eef2f7 !important;
  color: #111827 !important;
}

.disthub-root.theme-dark .pdf-page .boxTitle,
.disthub-root.theme-dark .pdf-page .hdr,
.disthub-root.theme-dark .pdf-page .hdr .title,
.disthub-root.theme-dark .pdf-page .hdr .sub {
  color: inherit;
}

.disthub-root.theme-dark .pdf-page .totRow,
.disthub-root.theme-dark .pdf-page .totBox {
  color: #111827 !important;
}
