:root {
    --hc-dark-navy: #040b1d;
    --hc-dark-navy-alt: #071437;
    --hc-dark-panel: #0d1f3f;
    --hc-dark-panel-alt: #152a4f;
    --hc-dark-border: #1f335f;
    --hc-dark-muted: #9fb4e0;
    --hc-dark-gold: #f5d67a;
    --hc-dark-gold-strong: #ffe8a3;
    --hc-dark-error: #f29f9f;
}

.theme-dark {
    color-scheme: dark;
}

.theme-dark body,
.theme-dark .sb-nav-fixed #layoutSidenav #layoutSidenav_content {
    background-color: var(--hc-dark-navy);
    color: var(--hc-dark-gold);
}

.theme-dark a {
    color: var(--hc-dark-gold-strong);
}

.theme-dark a:hover {
    color: #ffffff;
}

.theme-dark .navbar.navbar-dark,
.theme-dark .sb-topnav {
    background-color: #06112b !important;
    border-bottom: 1px solid var(--hc-dark-border);
}

.theme-dark .topbar-breadcrumb .breadcrumb-item,
.theme-dark .topbar-breadcrumb .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.8);
}

.theme-dark #layoutSidenav_nav,
.theme-dark .sb-sidenav {
    background-color: #050e24;
    color: var(--hc-dark-gold);
}

.theme-dark .sb-sidenav .sb-sidenav-menu .nav-link {
    color: var(--hc-dark-gold);
}

.theme-dark .sb-sidenav .sb-sidenav-menu .nav-link.active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.08);
}

.theme-dark .card,
.theme-dark .modal-content,
.theme-dark .list-group-item,
.theme-dark .dropdown-menu,
.theme-dark .table,
.theme-dark .alert {
    background-color: var(--hc-dark-panel);
    color: var(--hc-dark-gold);
    border-color: var(--hc-dark-border);
}

.theme-dark .card-header,
.theme-dark .table thead,
.theme-dark .dropdown-menu .dropdown-header {
    background-color: var(--hc-dark-panel-alt);
    border-color: var(--hc-dark-border);
    color: var(--hc-dark-gold-strong);
}

.theme-dark .table thead,
.theme-dark .table thead tr,
.theme-dark .table thead th,
.theme-dark .table thead td {
    background-color: #1a2436 !important;
    color: var(--hc-dark-gold) !important;
}

.theme-dark .card-header.bg-light,
.theme-dark .card-header.bg-white,
.theme-dark .card-header.bg-body {
    background-color: var(--hc-dark-panel-alt) !important;
    color: var(--hc-dark-gold-strong) !important;
}

.theme-dark .table,
.theme-dark .table th,
.theme-dark .table td {
    color: var(--hc-dark-gold);
}

.theme-dark .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(18, 42, 85, 0.85);
    color: var(--hc-dark-gold);
}

.theme-dark .table-striped > tbody > tr:nth-of-type(even) > * {
    background-color: rgba(11, 28, 56, 0.88);
    color: var(--hc-dark-gold);
}

.theme-dark .table-hover > tbody > tr:hover > * {
    background-color: rgba(255, 255, 255, 0.08);
}

.theme-dark .table-light,
.theme-dark .table .table-light,
.theme-dark .table thead.table-light tr,
.theme-dark .table .bg-light {
    background-color: var(--hc-dark-panel-alt) !important;
    color: var(--hc-dark-gold);
}

.theme-dark .card.bg-light,
.theme-dark .card .bg-light,
.theme-dark .bg-light,
.theme-dark .bg-white {
    background-color: var(--hc-dark-panel) !important;
    color: var(--hc-dark-gold);
}

.theme-dark .form-control,
.theme-dark .form-select,
.theme-dark .input-group-text,
.theme-dark .form-control:focus,
.theme-dark .form-select:focus {
    background-color: #0b1c3a;
    color: var(--hc-dark-gold);
    border-color: var(--hc-dark-border);
}

.theme-dark .form-text,
.theme-dark .text-muted {
    color: var(--hc-dark-muted) !important;
}

.theme-dark .form-check-input {
    background-color: #12264a;
    border-color: var(--hc-dark-border);
}

.theme-dark .form-check-input:checked {
    background-color: var(--hc-dark-gold);
    border-color: var(--hc-dark-gold);
}

.theme-dark .btn-primary {
    background-color: #1d4d8f;
    border-color: #1d4d8f;
    color: #fff;
}

.theme-dark .btn-primary:hover {
    background-color: #2360b5;
    border-color: #2360b5;
}

.theme-dark .btn-outline-secondary {
    color: var(--hc-dark-gold);
    border-color: var(--hc-dark-border);
}

.theme-dark .btn-outline-secondary:hover {
    background-color: var(--hc-dark-panel-alt);
    color: #fff;
}

.theme-dark .alert-warning {
    background-color: rgba(255, 193, 7, 0.12);
    border-color: rgba(255, 193, 7, 0.45);
    color: var(--hc-dark-gold-strong);
}

.theme-dark .alert-info {
    background-color: rgba(13, 110, 253, 0.12);
    border-color: rgba(13, 110, 253, 0.4);
    color: #bcd4ff;
}

.theme-dark .alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.45);
    color: var(--hc-dark-error);
}

.theme-dark .modal-header,
.theme-dark .modal-footer {
    border-color: var(--hc-dark-border);
}

.theme-dark .dropdown-item,
.theme-dark .list-group-item {
    color: var(--hc-dark-gold);
}

.theme-dark .badge.text-dark {
    color: var(--hc-dark-gold-strong) !important;
}

.theme-dark .badge.bg-light {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid var(--hc-dark-border);
}

.theme-dark .banking-summary {
    background: linear-gradient(135deg, #0d1f3f, #0b1b37);
    border-color: var(--hc-dark-border);
}

.theme-dark .banking-summary-item {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--hc-dark-border);
}

.theme-dark .banking-account-card.is-active {
    border-color: rgba(245, 214, 122, 0.5);
    box-shadow: 0 6px 18px rgba(245, 214, 122, 0.12);
}

.theme-dark .banking-account-details {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--hc-dark-border);
}

.theme-dark .banking-wage {
    border-left-color: rgba(245, 214, 122, 0.6);
}

.theme-dark .dropdown-item:hover,
.theme-dark .list-group-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.theme-dark .nav-tabs .nav-link {
    color: var(--hc-dark-gold);
    border-color: transparent;
}

.theme-dark .nav-tabs .nav-link.active {
    background-color: var(--hc-dark-panel-alt);
    border-color: var(--hc-dark-border);
    color: #ffffff;
}

.theme-dark .nav-pills .nav-link {
    background-color: rgba(13, 31, 63, 0.9);
    border: 1px solid rgba(159, 180, 224, 0.25);
    color: #ffffff;
}

.theme-dark .nav-pills .nav-link:hover,
.theme-dark .nav-pills .nav-link:focus {
    background-color: var(--hc-dark-panel-alt);
    border-color: var(--hc-dark-gold-strong);
    color: var(--hc-dark-gold-strong);
}

.theme-dark .nav-pills .nav-link.active {
    background-color: rgba(13, 31, 63, 0.85);
    border-color: var(--hc-dark-gold);
    color: var(--hc-dark-gold);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

.theme-dark .archais-hunting-grid-wrapper {
    background-color: var(--hc-dark-panel);
    border-color: var(--hc-dark-border);
}

.theme-dark .archais-hunting-cell {
    background-color: #0b1c3a;
    border-color: rgba(159, 180, 224, 0.25);
}

.theme-dark .archais-hunting-cell.state-open {
    background-color: #1b2f57;
}

.theme-dark .archais-hunting-cell.state-checked_out {
    background-color: #b8922c;
}

.theme-dark .archais-hunting-cell.state-restricted {
    background-color: #060b14;
}

.theme-dark .archais-hunting-legend .legend-swatch {
    border-color: rgba(159, 180, 224, 0.35);
}

.theme-dark .nav-link.link-dark {
    color: var(--hc-dark-gold);
}

.theme-dark .nav-link.link-dark:hover,
.theme-dark .nav-link.link-dark:focus {
    color: var(--hc-dark-gold-strong);
}

.theme-dark .nav-pills .nav-link.link-dark {
    color: #ffffff !important;
}

.theme-dark .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--hc-dark-gold) !important;
}

.theme-dark .dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--hc-dark-panel-alt);
    color: #fff !important;
    border-color: var(--hc-dark-border);
}

.theme-dark .dataTables_wrapper .dataTables_filter input,
.theme-dark .dataTables_wrapper .dataTables_length select {
    background-color: #0b1c3a;
    border-color: var(--hc-dark-border);
    color: var(--hc-dark-gold);
}

.theme-dark .cluster-status-title,
.theme-dark .cluster-side-header h2,
.theme-dark .cluster-row-title,
.theme-dark .cluster-mini-stat strong,
.theme-dark .cluster-hover-title {
    color: #ffffff;
}

.theme-dark .cluster-status-subtitle,
.theme-dark .cluster-status-metrics,
.theme-dark .cluster-pin-toggle,
.theme-dark .cluster-side-kicker,
.theme-dark .cluster-row-subtitle,
.theme-dark .cluster-row-meta,
.theme-dark .cluster-garrison-types,
.theme-dark .cluster-panel-note,
.theme-dark .cluster-hover-card {
    color: #cbd5e1;
}

.theme-dark .cluster-status-toolbar,
.theme-dark .cluster-side-panel,
.theme-dark .cluster-member-row,
.theme-dark .cluster-garrison-row,
.theme-dark .cluster-pin-toggle {
    background-color: var(--hc-dark-panel);
    border-color: var(--hc-dark-border);
}

.theme-dark .cluster-map-surface,
.theme-dark .cluster-panel-note,
.theme-dark .cluster-mini-stat {
    background-color: #071427;
    border-color: var(--hc-dark-border);
}

.theme-dark .cluster-map-loading {
    background: rgba(7, 20, 39, 0.78);
    color: #cbd5e1;
}

.theme-dark .cluster-status-cell {
    background-color: #0b1c3a;
    border-color: rgba(159, 180, 224, 0.24);
}

.theme-dark .cluster-status-cell.has-system {
    background-color: #12335f;
}

.theme-dark .cluster-status-cell.has-named-system {
    background-color: #263d7a;
    border-color: rgba(129, 140, 248, 0.36);
}

.theme-dark .key-system-square {
    background-color: #263d7a;
    border-color: rgba(129, 140, 248, 0.36);
}

.theme-dark .cluster-status-cell.has-members.has-system {
    background: linear-gradient(135deg, #12335f, #0b1c3a);
}

.theme-dark .cluster-status-cell.has-members.has-named-system {
    background: linear-gradient(135deg, #263d7a, #0b1c3a);
}

.theme-dark .cluster-member-pin::before,
.theme-dark .cluster-member-pin::after {
    background: rgba(11, 28, 58, 0.94);
    border-color: rgba(129, 140, 248, 0.26);
}

.theme-dark .cluster-status-garrison-marker {
    background: rgba(190, 18, 60, 0.18);
    border-color: rgba(248, 113, 113, 0.32);
    color: #fecdd3;
}

.theme-dark .cluster-status-cell.mode-garrisons .cluster-status-garrison-marker,
.theme-dark .cluster-status-cell:hover .cluster-status-garrison-marker,
.theme-dark .cluster-status-cell.is-selected .cluster-status-garrison-marker {
    background: #be123c;
    color: #ffffff;
}

.theme-dark .cluster-status-scan-marker {
    background: rgba(15, 118, 110, 0.18);
    border-color: rgba(45, 212, 191, 0.34);
}

.theme-dark .cluster-status-cell.mode-scans .cluster-status-scan-marker,
.theme-dark .cluster-status-cell:hover .cluster-status-scan-marker,
.theme-dark .cluster-status-cell.is-selected .cluster-status-scan-marker {
    background: #0f766e;
}

.theme-dark .cluster-status-cell.outside-sector {
    background-color: #06101f;
}

.theme-dark .cluster-hover-card {
    background: rgba(11, 28, 58, 0.98);
    border-color: var(--hc-dark-border);
}

.theme-dark .cluster-hover-members span,
.theme-dark .cluster-chip {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: var(--hc-dark-border);
    color: var(--hc-dark-gold);
}

/* --- Broad dark mode polish pass --- */
.theme-dark {
    --hc-dark-text: #f4f7ff;
    --hc-dark-text-soft: #dbe6fb;
    --hc-dark-text-muted: #aebfe3;
    --hc-dark-surface: #0b1c3a;
    --hc-dark-surface-2: #10264a;
    --hc-dark-surface-3: #17325d;
    --hc-dark-line: rgba(159, 180, 224, 0.28);
    --hc-dark-line-strong: rgba(245, 214, 122, 0.34);
    --hc-dark-shadow: rgba(0, 0, 0, 0.35);
    --bs-body-bg: var(--hc-dark-navy);
    --bs-body-color: var(--hc-dark-text);
    --bs-secondary-color: var(--hc-dark-text-muted);
    --bs-tertiary-color: rgba(174, 191, 227, 0.7);
    --bs-border-color: var(--hc-dark-line);
    --bs-link-color: var(--hc-dark-gold-strong);
    --bs-link-hover-color: #ffffff;
    --bs-card-bg: var(--hc-dark-panel);
    --bs-card-color: var(--hc-dark-text);
    --bs-card-border-color: var(--hc-dark-line);
    --bs-table-color: var(--hc-dark-text);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--hc-dark-line);
    color: var(--hc-dark-text);
}

.theme-dark body,
.theme-dark .sb-nav-fixed #layoutSidenav #layoutSidenav_content {
    background:
        radial-gradient(circle at top left, rgba(29, 78, 216, 0.16), transparent 28rem),
        linear-gradient(180deg, #07122b 0%, var(--hc-dark-navy) 14rem);
    color: var(--hc-dark-text);
}

.theme-dark main,
.theme-dark #layoutSidenav_content,
.theme-dark .container,
.theme-dark .container-fluid {
    color: var(--hc-dark-text);
}

.theme-dark h1,
.theme-dark h2,
.theme-dark h3,
.theme-dark h4,
.theme-dark h5,
.theme-dark h6,
.theme-dark .h1,
.theme-dark .h2,
.theme-dark .h3,
.theme-dark .h4,
.theme-dark .h5,
.theme-dark .h6,
.theme-dark .fw-semibold,
.theme-dark .fw-bold,
.theme-dark strong,
.theme-dark dt {
    color: var(--hc-dark-text);
}

.theme-dark p,
.theme-dark li,
.theme-dark dd,
.theme-dark label,
.theme-dark .form-label,
.theme-dark .metric-note,
.theme-dark .dashboard-definition dd {
    color: var(--hc-dark-text-soft);
}

.theme-dark .small:not(.text-primary):not(.text-secondary):not(.text-success):not(.text-danger):not(.text-warning):not(.text-info):not(.text-muted):not(.text-dark),
.theme-dark .extra-small:not(.text-primary):not(.text-secondary):not(.text-success):not(.text-danger):not(.text-warning):not(.text-info):not(.text-muted):not(.text-dark) {
    color: var(--hc-dark-text-soft);
}

.theme-dark .text-muted,
.theme-dark .text-secondary,
.theme-dark .text-body-secondary,
.theme-dark .text-black-50,
.theme-dark .text-dark,
.theme-dark .text-body,
.theme-dark .form-text,
.theme-dark .metric-label,
.theme-dark .defense-hub-metrics dt,
.theme-dark .cluster-side-kicker,
.theme-dark .cluster-row-subtitle,
.theme-dark .cluster-row-meta,
.theme-dark .cluster-garrison-types,
.theme-dark .cluster-empty-state,
.theme-dark .cluster-panel-section h3 span,
.theme-dark .cluster-mini-stat span,
.theme-dark .cluster-garrison-stats,
.theme-dark .cluster-map-key,
.theme-dark .cluster-status-metrics,
.theme-dark .dashboard-definition dt {
    color: var(--hc-dark-text-muted) !important;
}

.theme-dark .metric-value,
.theme-dark .defense-hub-metrics dd,
.theme-dark .cluster-status-metrics strong,
.theme-dark .cluster-panel-section h3,
.theme-dark .cluster-mini-stat strong,
.theme-dark .cluster-row-title,
.theme-dark .cluster-hover-title,
.theme-dark .cluster-side-header h2 {
    color: var(--hc-dark-text) !important;
}

.theme-dark .text-primary {
    color: #9ec5fe !important;
}

.theme-dark .text-success {
    color: #75b798 !important;
}

.theme-dark .text-danger {
    color: #f1aeb5 !important;
}

.theme-dark .text-warning {
    color: #ffda6a !important;
}

.theme-dark .text-info {
    color: #9eeaf9 !important;
}

.theme-dark a:not(.btn):not(.nav-link):not(.dropdown-item):not(.list-group-item):not(.holopage-scope-chip) {
    color: var(--hc-dark-gold-strong);
}

.theme-dark a:not(.btn):not(.nav-link):not(.dropdown-item):not(.list-group-item):not(.holopage-scope-chip):hover {
    color: #ffffff;
}

.theme-dark hr {
    border-color: var(--hc-dark-line);
    opacity: 1;
}

.theme-dark .card,
.theme-dark .dashboard-card,
.theme-dark .officer-tool-card,
.theme-dark .defense-hub-card,
.theme-dark .production-hub-card,
.theme-dark .defense-cluster-map-card,
.theme-dark .defense-cluster-detail-card,
.theme-dark .modal-content,
.theme-dark .popover,
.theme-dark .toast,
.theme-dark .accordion-item,
.theme-dark .list-group-item {
    background: linear-gradient(180deg, rgba(16, 38, 74, 0.98), rgba(11, 28, 58, 0.98));
    border-color: var(--hc-dark-line) !important;
    color: var(--hc-dark-text);
    box-shadow: 0 0.65rem 1.4rem rgba(0, 0, 0, 0.18);
}

.theme-dark .card-header,
.theme-dark .card-footer,
.theme-dark .modal-header,
.theme-dark .modal-footer,
.theme-dark .accordion-header,
.theme-dark .accordion-button,
.theme-dark .dropdown-header {
    background: rgba(23, 50, 93, 0.72) !important;
    border-color: var(--hc-dark-line) !important;
    color: var(--hc-dark-text);
}

.theme-dark .card-header.bg-light,
.theme-dark .card-header.bg-white,
.theme-dark .card-header.bg-body,
.theme-dark .card-header.bg-transparent {
    background: rgba(23, 50, 93, 0.42) !important;
}

.theme-dark .card-body,
.theme-dark .modal-body,
.theme-dark .accordion-body {
    color: var(--hc-dark-text-soft);
}

.theme-dark .bg-light,
.theme-dark .bg-white,
.theme-dark .bg-body,
.theme-dark .bg-body-tertiary,
.theme-dark .bg-secondary-subtle,
.theme-dark .bg-primary-subtle,
.theme-dark .bg-info-subtle,
.theme-dark .bg-warning-subtle,
.theme-dark .bg-success-subtle,
.theme-dark .bg-danger-subtle {
    background-color: var(--hc-dark-surface-2) !important;
    color: var(--hc-dark-text) !important;
    border-color: var(--hc-dark-line) !important;
}

.theme-dark .border,
.theme-dark .border-top,
.theme-dark .border-end,
.theme-dark .border-bottom,
.theme-dark .border-start {
    border-color: var(--hc-dark-line) !important;
}

.theme-dark .shadow,
.theme-dark .shadow-sm,
.theme-dark .shadow-lg {
    box-shadow: 0 0.75rem 1.5rem var(--hc-dark-shadow) !important;
}

.theme-dark .table,
.theme-dark .table-responsive,
.theme-dark .defense-cluster-entity-table,
.theme-dark .cluster-scan-table {
    color: var(--hc-dark-text);
    border-color: var(--hc-dark-line);
}

.theme-dark .table > :not(caption) > * > * {
    background-color: rgba(11, 28, 58, 0.76);
    border-color: var(--hc-dark-line);
    color: var(--hc-dark-text-soft);
}

.theme-dark .table thead,
.theme-dark .table thead tr,
.theme-dark .table thead th,
.theme-dark .table thead td,
.theme-dark .table-light,
.theme-dark .table .table-light,
.theme-dark .table thead.table-light tr {
    background-color: var(--hc-dark-surface-3) !important;
    color: var(--hc-dark-text) !important;
    border-color: var(--hc-dark-line) !important;
}

.theme-dark .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(16, 38, 74, 0.9);
    color: var(--hc-dark-text-soft);
}

.theme-dark .table-striped > tbody > tr:nth-of-type(even) > * {
    background-color: rgba(8, 22, 47, 0.9);
    color: var(--hc-dark-text-soft);
}

.theme-dark .table-hover > tbody > tr:hover > *,
.theme-dark .table-active,
.theme-dark .table-primary,
.theme-dark .table-primary > * {
    background-color: rgba(245, 214, 122, 0.12) !important;
    color: var(--hc-dark-text) !important;
}

.theme-dark .form-control,
.theme-dark .form-select,
.theme-dark .form-control:focus,
.theme-dark .form-select:focus,
.theme-dark .input-group-text,
.theme-dark textarea,
.theme-dark .tox-tinymce {
    background-color: rgba(7, 20, 39, 0.92);
    border-color: var(--hc-dark-line);
    color: var(--hc-dark-text);
}

.theme-dark .form-control::placeholder,
.theme-dark textarea::placeholder {
    color: rgba(174, 191, 227, 0.68);
}

.theme-dark .form-control:focus,
.theme-dark .form-select:focus {
    border-color: rgba(245, 214, 122, 0.72);
    box-shadow: 0 0 0 0.2rem rgba(245, 214, 122, 0.14);
}

.theme-dark .form-control:disabled,
.theme-dark .form-control[readonly],
.theme-dark .form-select:disabled {
    background-color: rgba(7, 20, 39, 0.64);
    color: rgba(174, 191, 227, 0.64);
}

.theme-dark .form-check-label {
    color: var(--hc-dark-text-soft);
}

.theme-dark .form-check-input {
    background-color: rgba(7, 20, 39, 0.92);
    border-color: var(--hc-dark-line);
}

.theme-dark .form-check-input:checked {
    background-color: #1d4d8f;
    border-color: #6ea8fe;
}

.theme-dark .btn-light,
.theme-dark .btn-outline-light,
.theme-dark .btn-secondary,
.theme-dark .btn-outline-secondary {
    background-color: rgba(16, 38, 74, 0.86);
    border-color: var(--hc-dark-line);
    color: var(--hc-dark-text);
}

.theme-dark .btn-light:hover,
.theme-dark .btn-outline-light:hover,
.theme-dark .btn-secondary:hover,
.theme-dark .btn-outline-secondary:hover,
.theme-dark .btn-light:focus,
.theme-dark .btn-outline-light:focus,
.theme-dark .btn-secondary:focus,
.theme-dark .btn-outline-secondary:focus {
    background-color: var(--hc-dark-surface-3);
    border-color: var(--hc-dark-line-strong);
    color: #ffffff;
}

.theme-dark .btn-link {
    color: var(--hc-dark-gold-strong);
}

.theme-dark .badge.bg-light,
.theme-dark .badge.bg-white,
.theme-dark .badge.text-dark,
.theme-dark .badge.bg-secondary,
.theme-dark .badge.text-secondary {
    background-color: rgba(159, 180, 224, 0.14) !important;
    border: 1px solid var(--hc-dark-line);
    color: var(--hc-dark-text-soft) !important;
}

.theme-dark .badge.bg-warning.text-dark {
    background-color: rgba(245, 214, 122, 0.18) !important;
    border-color: rgba(245, 214, 122, 0.4);
    color: var(--hc-dark-gold-strong) !important;
}

.theme-dark .dropdown-menu {
    background: #08162f;
    border-color: var(--hc-dark-line);
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.34);
}

.theme-dark .dropdown-item,
.theme-dark .dropdown-menu .dropdown-item {
    color: var(--hc-dark-text-soft);
}

.theme-dark .dropdown-item:hover,
.theme-dark .dropdown-item:focus,
.theme-dark .dropdown-item.active,
.theme-dark .dropdown-item:active,
.theme-dark .list-group-item-action:hover,
.theme-dark .list-group-item-action:focus,
.theme-dark .list-group-item.active {
    background-color: rgba(245, 214, 122, 0.12);
    color: #ffffff;
}

.theme-dark .nav-tabs {
    border-bottom-color: var(--hc-dark-line);
}

.theme-dark .nav-tabs .nav-link {
    color: var(--hc-dark-text-muted);
}

.theme-dark .nav-tabs .nav-link:hover,
.theme-dark .nav-tabs .nav-link:focus {
    border-color: transparent;
    color: var(--hc-dark-gold-strong);
}

.theme-dark .nav-tabs .nav-link.active {
    background-color: var(--hc-dark-surface-2);
    border-color: var(--hc-dark-line) var(--hc-dark-line) var(--hc-dark-surface-2);
    color: #ffffff;
}

.theme-dark .nav-pills .nav-link,
.theme-dark .defense-hub-nav .nav-link {
    background-color: rgba(16, 38, 74, 0.72);
    border: 1px solid var(--hc-dark-line);
    color: var(--hc-dark-text-soft);
}

.theme-dark .nav-pills .nav-link:hover,
.theme-dark .nav-pills .nav-link:focus,
.theme-dark .defense-hub-nav .nav-link:hover,
.theme-dark .defense-hub-nav .nav-link:focus {
    border-color: var(--hc-dark-line-strong);
    color: var(--hc-dark-gold-strong);
}

.theme-dark .nav-pills .nav-link.active,
.theme-dark .defense-hub-nav .nav-link.active {
    background-color: rgba(245, 214, 122, 0.14);
    border-color: rgba(245, 214, 122, 0.55);
    color: #ffffff;
}

.theme-dark .breadcrumb,
.theme-dark .breadcrumb-item,
.theme-dark .breadcrumb-item.active {
    color: var(--hc-dark-text-muted);
}

.theme-dark .pagination .page-link {
    background-color: rgba(16, 38, 74, 0.86);
    border-color: var(--hc-dark-line);
    color: var(--hc-dark-text-soft);
}

.theme-dark .pagination .page-link:hover,
.theme-dark .pagination .page-item.active .page-link {
    background-color: rgba(245, 214, 122, 0.16);
    border-color: rgba(245, 214, 122, 0.48);
    color: #ffffff;
}

.theme-dark .alert {
    border-color: var(--hc-dark-line);
    color: var(--hc-dark-text-soft);
}

.theme-dark .alert-success {
    background-color: rgba(25, 135, 84, 0.16);
    border-color: rgba(25, 135, 84, 0.42);
    color: #b9f2d0;
}

.theme-dark .alert-primary {
    background-color: rgba(13, 110, 253, 0.15);
    border-color: rgba(110, 168, 254, 0.42);
    color: #cfe2ff;
}

.theme-dark .alert-secondary,
.theme-dark .alert-light {
    background-color: rgba(159, 180, 224, 0.12);
    border-color: var(--hc-dark-line);
    color: var(--hc-dark-text-soft);
}

.theme-dark .alert-warning .text-muted,
.theme-dark .alert-info .text-muted,
.theme-dark .alert-success .text-muted,
.theme-dark .alert-danger .text-muted,
.theme-dark .alert-primary .text-muted {
    color: rgba(244, 247, 255, 0.78) !important;
}

.theme-dark .dataTables_wrapper,
.theme-dark .dt-container {
    color: var(--hc-dark-text-soft);
}

.theme-dark .dataTables_wrapper .dataTables_info,
.theme-dark .dataTables_wrapper .dataTables_length,
.theme-dark .dataTables_wrapper .dataTables_filter,
.theme-dark .dt-info,
.theme-dark .dt-length,
.theme-dark .dt-search {
    color: var(--hc-dark-text-muted) !important;
}

.theme-dark .dataTables_wrapper .dataTables_filter input,
.theme-dark .dataTables_wrapper .dataTables_length select,
.theme-dark .dt-search input,
.theme-dark .dt-length select {
    background-color: rgba(7, 20, 39, 0.92);
    border-color: var(--hc-dark-line);
    color: var(--hc-dark-text);
}

.theme-dark .dataTables_wrapper .dataTables_paginate .paginate_button,
.theme-dark .dt-paging .page-link {
    background: rgba(16, 38, 74, 0.84) !important;
    border-color: var(--hc-dark-line) !important;
    color: var(--hc-dark-text-soft) !important;
}

.theme-dark .dataTables_wrapper .dataTables_paginate .paginate_button.current,
.theme-dark .dataTables_wrapper .dataTables_paginate .paginate_button:hover,
.theme-dark .dt-paging .page-item.active .page-link,
.theme-dark .dt-paging .page-link:hover {
    background: rgba(245, 214, 122, 0.15) !important;
    border-color: rgba(245, 214, 122, 0.48) !important;
    color: #ffffff !important;
}

.theme-dark .metric-block,
.theme-dark .metric-cell,
.theme-dark .banking-summary-item,
.theme-dark .banking-account-details,
.theme-dark .command-panel,
.theme-dark .dashboard-notification,
.theme-dark .cluster-panel-note,
.theme-dark .cluster-mini-stat,
.theme-dark .cluster-member-row,
.theme-dark .cluster-garrison-row,
.theme-dark .defense-cluster-station,
.theme-dark .neshig-legend-pill {
    background-color: rgba(7, 20, 39, 0.48);
    border-color: var(--hc-dark-line);
    color: var(--hc-dark-text-soft);
}

.theme-dark .banking-summary {
    background: linear-gradient(135deg, rgba(16, 38, 74, 0.96), rgba(7, 20, 39, 0.96));
    border-color: var(--hc-dark-line);
}

.theme-dark .banking-account-card.is-active,
.theme-dark .command-panel:hover {
    border-color: rgba(245, 214, 122, 0.46) !important;
    box-shadow: 0 0.75rem 1.5rem rgba(245, 214, 122, 0.08) !important;
}

.theme-dark .metric-progress-shell {
    background: rgba(7, 20, 39, 0.72);
    border-color: var(--hc-dark-line);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.28);
}

.theme-dark .hub-access-chip {
    background: rgba(159, 180, 224, 0.12);
    border-color: var(--hc-dark-line);
    color: var(--hc-dark-text-soft);
}

.theme-dark .hub-module-icon {
    background: linear-gradient(135deg, rgba(110, 168, 254, 0.22), rgba(245, 214, 122, 0.08));
    color: #9ec5fe;
}

.theme-dark .defense-hub-card .hub-module-icon {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.24), rgba(110, 168, 254, 0.1));
    color: #ffda6a;
}

.theme-dark .production-hub-card .hub-module-icon {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.24), rgba(110, 168, 254, 0.1));
    color: #75b798;
}

.theme-dark .notification-dot.dot-info {
    background: rgba(110, 168, 254, 0.18);
    color: #9ec5fe;
}

.theme-dark .notification-dot.dot-success {
    background: rgba(25, 135, 84, 0.18);
    color: #75b798;
}

.theme-dark .notification-dot.dot-warning {
    background: rgba(255, 193, 7, 0.2);
    color: #ffda6a;
}

.theme-dark .notification-dot.dot-alert {
    background: rgba(253, 126, 20, 0.2);
    color: #feb272;
}

.theme-dark .notification-dot.dot-danger {
    background: rgba(220, 53, 69, 0.2);
    color: #f1aeb5;
}

.theme-dark .notification-dot.dot-notice {
    background: rgba(159, 180, 224, 0.14);
    color: var(--hc-dark-text-muted);
}

.theme-dark .profile-assignment-list .list-group-item {
    background: transparent;
    box-shadow: none;
}

.theme-dark .profile-assignment-list .list-group-item + .list-group-item {
    border-top-color: var(--hc-dark-line);
}

.theme-dark .neshig-map-wrapper {
    background: #050b17;
    border-color: var(--hc-dark-line);
}

.theme-dark .neshig-map-table {
    border-color: rgba(159, 180, 224, 0.5);
    color: var(--hc-dark-text-soft);
}

.theme-dark .neshig-map-table th.neshig-axis,
.theme-dark .neshig-map-table td.neshig-cell:not(.state-void)::after {
    border-color: rgba(159, 180, 224, 0.34);
}

.theme-dark .neshig-map-table .neshig-axis,
.theme-dark .neshig-map-table th.neshig-axis {
    background: rgba(7, 20, 39, 0.92);
    color: var(--hc-dark-text);
}

.theme-dark .neshig-legend-pill {
    background: rgba(16, 38, 74, 0.82);
}

.theme-dark .defense-cluster-cell,
.theme-dark .cluster-status-cell {
    color: var(--hc-dark-text-soft);
}

.theme-dark .defense-cluster-cell {
    background: var(--hc-dark-surface);
    border-color: var(--hc-dark-line);
}

.theme-dark .defense-cluster-cell.has-system {
    background: linear-gradient(135deg, #12335f, #0b1c3a);
}

.theme-dark .defense-cluster-cell.outside-sector {
    background: #06101f;
    border-color: rgba(159, 180, 224, 0.16);
}

.theme-dark .defense-cluster-cell.is-selected {
    background: rgba(245, 214, 122, 0.14);
    border-color: rgba(245, 214, 122, 0.72);
}

.theme-dark .cluster-coord-label,
.theme-dark .cluster-status-coord {
    color: rgba(219, 230, 251, 0.58);
}

.theme-dark .cluster-side-panel,
.theme-dark .cluster-status-toolbar,
.theme-dark .cluster-map-surface {
    background: linear-gradient(180deg, rgba(11, 28, 58, 0.98), rgba(7, 20, 39, 0.98));
    border-color: var(--hc-dark-line);
}

.theme-dark .cluster-side-tabs {
    border-bottom-color: var(--hc-dark-line);
}

.theme-dark .cluster-side-tabs button {
    color: var(--hc-dark-text-muted);
}

.theme-dark .cluster-side-tabs button:hover {
    color: var(--hc-dark-gold-strong);
}

.theme-dark .cluster-side-tabs button.active {
    background: rgba(245, 214, 122, 0.12);
    border-bottom-color: var(--hc-dark-gold);
    color: #ffffff;
}

.theme-dark .cluster-hover-card {
    background: rgba(8, 22, 47, 0.98);
    color: var(--hc-dark-text-soft);
    border-color: var(--hc-dark-line);
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.4);
}

.theme-dark .cluster-hover-members span,
.theme-dark .cluster-chip {
    background-color: rgba(159, 180, 224, 0.12);
    border-color: var(--hc-dark-line);
    color: var(--hc-dark-text-soft);
}

.theme-dark .cluster-member-stack img,
.theme-dark .key-avatar {
    border-color: rgba(244, 247, 255, 0.9);
    background-color: #ffffff;
}

.theme-dark .cluster-member-count {
    border-color: rgba(244, 247, 255, 0.9);
    background: #050b17;
    color: #ffffff;
}

.theme-dark .cluster-health {
    color: var(--hc-dark-text-muted);
}

.theme-dark .cluster-health::after {
    background: rgba(159, 180, 224, 0.18);
}

.theme-dark .cluster-garrison-stats strong,
.theme-dark .cluster-garrison-stats a {
    color: #f1aeb5;
}

/* --- Dark mode layout polish: density, radius, shadows --- */
.theme-dark {
    --hc-dark-radius-sm: 0.42rem;
    --hc-dark-radius: 0.58rem;
    --hc-dark-radius-lg: 0.68rem;
    --hc-dark-shadow-rest: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 0.28rem 0.7rem rgba(0, 0, 0, 0.14);
    --hc-dark-shadow-lift: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 0.7rem 1.35rem rgba(0, 0, 0, 0.24);
    --hc-dark-shadow-float: 0 1rem 2.2rem rgba(0, 0, 0, 0.42);
}

.theme-dark .card,
.theme-dark .dashboard-card,
.theme-dark .officer-tool-card,
.theme-dark .defense-hub-card,
.theme-dark .production-hub-card,
.theme-dark .defense-cluster-map-card,
.theme-dark .defense-cluster-detail-card,
.theme-dark .banking-summary,
.theme-dark .cluster-map-surface,
.theme-dark .cluster-side-panel,
.theme-dark .cluster-status-toolbar,
.theme-dark .accordion-item,
.theme-dark .list-group-item {
    border-radius: var(--hc-dark-radius);
    box-shadow: var(--hc-dark-shadow-rest);
}

.theme-dark .card:hover,
.theme-dark .officer-tool-card:hover,
.theme-dark .defense-hub-card:hover,
.theme-dark .production-hub-card:hover,
.theme-dark .dashboard-notification:hover {
    box-shadow: var(--hc-dark-shadow-lift);
}

.theme-dark .modal-content,
.theme-dark .dropdown-menu,
.theme-dark .popover,
.theme-dark .toast,
.theme-dark .cluster-hover-card {
    border-radius: var(--hc-dark-radius);
    box-shadow: var(--hc-dark-shadow-float);
}

.theme-dark .shadow-sm {
    box-shadow: var(--hc-dark-shadow-rest) !important;
}

.theme-dark .shadow {
    box-shadow: var(--hc-dark-shadow-lift) !important;
}

.theme-dark .shadow-lg {
    box-shadow: var(--hc-dark-shadow-float) !important;
}

.theme-dark .card-header,
.theme-dark .card-footer,
.theme-dark .modal-header,
.theme-dark .modal-footer,
.theme-dark .accordion-button {
    min-height: 2.75rem;
    padding: 0.62rem 0.85rem;
    background: rgba(23, 50, 93, 0.38) !important;
}

.theme-dark .card-body,
.theme-dark .modal-body,
.theme-dark .accordion-body {
    padding: 0.95rem;
}

.theme-dark .card-header h1,
.theme-dark .card-header h2,
.theme-dark .card-header h3,
.theme-dark .card-header h4,
.theme-dark .card-header h5,
.theme-dark .card-header h6,
.theme-dark .card-header .h1,
.theme-dark .card-header .h2,
.theme-dark .card-header .h3,
.theme-dark .card-header .h4,
.theme-dark .card-header .h5,
.theme-dark .card-header .h6 {
    line-height: 1.25;
}

.theme-dark .card-header .small,
.theme-dark .card-header .extra-small,
.theme-dark .cluster-side-kicker,
.theme-dark .metric-label,
.theme-dark .dashboard-definition dt {
    letter-spacing: 0.055em;
}

.theme-dark .metric-grid,
.theme-dark .banking-summary-grid,
.theme-dark .banking-account-metrics,
.theme-dark .cluster-mini-grid,
.theme-dark .cluster-row-list {
    gap: 0.62rem;
}

.theme-dark .metric-block,
.theme-dark .metric-cell,
.theme-dark .banking-summary-item,
.theme-dark .banking-account-details,
.theme-dark .command-panel,
.theme-dark .dashboard-notification,
.theme-dark .cluster-panel-note,
.theme-dark .cluster-mini-stat,
.theme-dark .cluster-member-row,
.theme-dark .cluster-garrison-row,
.theme-dark .defense-cluster-station,
.theme-dark .hub-access-chip {
    border-radius: var(--hc-dark-radius-sm);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.theme-dark .metric-block,
.theme-dark .banking-account-details,
.theme-dark .cluster-panel-note {
    padding: 0.68rem;
}

.theme-dark .metric-cell,
.theme-dark .banking-summary-item,
.theme-dark .cluster-mini-stat {
    padding: 0.52rem 0.64rem;
}

.theme-dark .cluster-member-row,
.theme-dark .cluster-garrison-row {
    padding: 0.58rem;
}

.theme-dark .metric-label {
    margin-bottom: 0.18rem;
    font-size: 0.68rem;
}

.theme-dark .metric-value {
    font-size: 1.04rem;
    line-height: 1.25;
}

.theme-dark .metric-note {
    margin-top: 0.24rem;
}

.theme-dark .table {
    margin-bottom: 0;
}

.theme-dark .table > :not(caption) > * > * {
    padding: 0.55rem 0.65rem;
    vertical-align: middle;
}

.theme-dark .table-sm > :not(caption) > * > * {
    padding: 0.38rem 0.52rem;
}

.theme-dark .table thead th,
.theme-dark .table thead td {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.theme-dark .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(13, 31, 63, 0.86);
}

.theme-dark .table-striped > tbody > tr:nth-of-type(even) > * {
    background-color: rgba(8, 22, 47, 0.82);
}

.theme-dark .table-hover > tbody > tr:hover > * {
    background-color: rgba(110, 168, 254, 0.12) !important;
}

.theme-dark .btn {
    min-height: 2.18rem;
    border-radius: var(--hc-dark-radius-sm);
    font-weight: 600;
    line-height: 1.2;
    box-shadow: none;
}

.theme-dark .btn-sm {
    min-height: 1.86rem;
    padding: 0.32rem 0.62rem;
    font-size: 0.82rem;
}

.theme-dark .btn-lg {
    min-height: 2.68rem;
}

.theme-dark .btn-primary {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.theme-dark .btn-primary:hover,
.theme-dark .btn-primary:focus {
    box-shadow: 0 0.4rem 0.9rem rgba(29, 78, 216, 0.22);
}

.theme-dark .btn-light,
.theme-dark .btn-outline-light,
.theme-dark .btn-secondary,
.theme-dark .btn-outline-secondary {
    border-color: rgba(159, 180, 224, 0.32);
}

.theme-dark .form-control,
.theme-dark .form-select,
.theme-dark .input-group-text {
    min-height: 2.18rem;
    border-radius: var(--hc-dark-radius-sm);
}

.theme-dark .form-control-sm,
.theme-dark .form-select-sm,
.theme-dark .input-group-sm > .form-control,
.theme-dark .input-group-sm > .form-select,
.theme-dark .input-group-sm > .input-group-text {
    min-height: 1.86rem;
    padding-top: 0.32rem;
    padding-bottom: 0.32rem;
}

.theme-dark .badge {
    border-radius: 0.36rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.theme-dark .nav-tabs .nav-link,
.theme-dark .nav-pills .nav-link,
.theme-dark .defense-hub-nav .nav-link {
    border-radius: var(--hc-dark-radius-sm);
}

/* --- App design system token bridge --- */
.theme-dark {
    --app-color-page: var(--hc-dark-navy);
    --app-color-surface: rgba(16, 38, 74, 0.96);
    --app-color-surface-raised: rgba(18, 45, 88, 0.98);
    --app-color-surface-muted: rgba(7, 20, 39, 0.56);
    --app-color-text: var(--hc-dark-text);
    --app-color-text-soft: var(--hc-dark-text-soft);
    --app-color-text-muted: var(--hc-dark-text-muted);
    --app-color-border: var(--hc-dark-line);
    --app-color-border-strong: rgba(245, 214, 122, 0.34);
    --app-color-primary: #9ec5fe;
    --app-color-primary-soft: rgba(110, 168, 254, 0.16);
    --app-color-accent: var(--hc-dark-gold);
    --app-color-success: #75b798;
    --app-color-warning: #ffda6a;
    --app-color-danger: #f1aeb5;
    --app-color-info: #9eeaf9;
    --app-radius-xs: var(--hc-dark-radius-sm);
    --app-radius-sm: var(--hc-dark-radius-sm);
    --app-radius: var(--hc-dark-radius);
    --app-radius-lg: var(--hc-dark-radius-lg);
    --app-shadow-rest: var(--hc-dark-shadow-rest);
    --app-shadow-lift: var(--hc-dark-shadow-lift);
    --app-shadow-float: var(--hc-dark-shadow-float);
}

.theme-dark .app-page-title,
.theme-dark .app-section-title,
.theme-dark .app-stat-value {
    color: var(--app-color-text);
}

.theme-dark .app-page-subtitle,
.theme-dark .app-section-subtitle,
.theme-dark .app-eyebrow,
.theme-dark .app-section-kicker,
.theme-dark .app-stat-label,
.theme-dark .app-stat-note,
.theme-dark .app-field-label,
.theme-dark .app-help {
    color: var(--app-color-text-muted);
}

.theme-dark .app-card,
.theme-dark .app-toolbar,
.theme-dark .app-filter-bar,
.theme-dark .app-section-strip,
.theme-dark .app-table-shell {
    background: var(--app-color-surface);
    border-color: var(--app-color-border);
    color: var(--app-color-text-soft);
    box-shadow: var(--app-shadow-rest);
}

.theme-dark .app-card-header {
    background: rgba(23, 50, 93, 0.38);
    border-color: var(--app-color-border);
}

.theme-dark .app-stat,
.theme-dark .app-empty-state {
    background: var(--app-color-surface-muted);
    border-color: var(--app-color-border);
    color: var(--app-color-text-soft);
}

.theme-dark .app-chip {
    background: rgba(159, 180, 224, 0.12);
    border-color: var(--app-color-border);
    color: var(--app-color-text-soft);
}

.theme-dark .app-chip:hover,
.theme-dark a.app-chip:hover {
    border-color: var(--app-color-border-strong);
    color: var(--hc-dark-gold-strong);
}

.theme-dark .app-data-table,
.theme-dark .table-responsive > .table:not(.neshig-map-table) {
    color: var(--app-color-text-soft);
}

.theme-dark .app-data-table > :not(caption) > * > *,
.theme-dark .table-responsive > .table:not(.neshig-map-table) > :not(caption) > * > * {
    border-color: var(--app-color-border);
}

.theme-dark .app-data-table thead th,
.theme-dark .app-data-table thead td,
.theme-dark .table-responsive > .table:not(.neshig-map-table) thead th,
.theme-dark .table-responsive > .table:not(.neshig-map-table) thead td {
    color: var(--app-color-text-muted);
}

.theme-dark .app-data-table.table-hover > tbody > tr:hover > *,
.theme-dark .table-responsive > .table-hover:not(.neshig-map-table) > tbody > tr:hover > * {
    background-color: rgba(110, 168, 254, 0.12);
}

/* --- Cluster map dedicated dark polish --- */
.theme-dark .cluster-status-container {
    --cluster-surface: rgba(16, 38, 74, 0.96);
    --cluster-surface-muted: rgba(7, 20, 39, 0.56);
    --cluster-line: var(--hc-dark-line);
    --cluster-line-strong: rgba(245, 214, 122, 0.34);
    --cluster-text: var(--hc-dark-text);
    --cluster-text-soft: var(--hc-dark-text-soft);
    --cluster-text-muted: var(--hc-dark-text-muted);
}

.theme-dark .cluster-status-title,
.theme-dark .cluster-status-metrics strong {
    color: var(--cluster-text);
}

.theme-dark .cluster-status-subtitle,
.theme-dark .cluster-status-metrics,
.theme-dark .cluster-status-metrics span {
    color: var(--cluster-text-muted);
}

.theme-dark .cluster-mode-switch,
.theme-dark .cluster-command-bar,
.theme-dark .cluster-map-surface-tools,
.theme-dark .cluster-side-header,
.theme-dark .cluster-side-tabs {
    background: rgba(7, 20, 39, 0.68);
    border-color: var(--cluster-line);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.theme-dark .cluster-mode-switch .btn {
    border-color: transparent;
}

.theme-dark .cluster-status-metrics span,
.theme-dark .cluster-pin-toggle {
    background: rgba(159, 180, 224, 0.09);
    border-color: var(--cluster-line);
    color: var(--cluster-text-muted);
}

.theme-dark .cluster-map-workspace {
    background:
        radial-gradient(circle at 30% 16%, rgba(37, 99, 235, 0.14), transparent 22rem),
        radial-gradient(circle at 18px 18px, rgba(159, 180, 224, 0.08) 1px, transparent 1px),
        linear-gradient(180deg, rgba(11, 28, 58, 0.98), rgba(5, 11, 23, 0.98));
    background-size: auto, 36px 36px, auto;
}

.theme-dark .cluster-map-surface-tools .btn {
    background: transparent;
    color: var(--cluster-text-soft);
}

.theme-dark .cluster-map-surface-tools .btn:hover,
.theme-dark .cluster-map-surface-tools .btn:focus {
    background: rgba(245, 214, 122, 0.12);
    color: var(--hc-dark-gold-strong);
}

.theme-dark .cluster-status-cell {
    background: #0b1c3a;
    border-color: rgba(159, 180, 224, 0.24);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.theme-dark .cluster-status-cell:hover,
.theme-dark .cluster-status-cell:focus-visible {
    border-color: rgba(129, 140, 248, 0.58);
    box-shadow: 0 0.45rem 0.9rem rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.theme-dark .cluster-status-cell.has-system {
    background: linear-gradient(135deg, #12335f, #0b1c3a 78%);
}

.theme-dark .cluster-status-cell.has-named-system {
    background: linear-gradient(135deg, #263d7a, #10264a 78%);
    border-color: rgba(129, 140, 248, 0.38);
}

.theme-dark .cluster-status-cell.has-members.has-system {
    background: linear-gradient(135deg, #12335f, #08162f 78%);
}

.theme-dark .cluster-status-cell.has-members.has-named-system {
    background: linear-gradient(135deg, #263d7a, #08162f 78%);
}

.theme-dark .cluster-status-cell.is-selected {
    border-color: rgba(245, 214, 122, 0.88);
    box-shadow: 0 0 0 3px rgba(245, 214, 122, 0.22), 0 0.55rem 1rem rgba(0, 0, 0, 0.34);
}

.theme-dark .cluster-member-pin::before,
.theme-dark .cluster-member-pin::after {
    background: rgba(8, 22, 47, 0.96);
    border-color: rgba(159, 180, 224, 0.28);
}

.theme-dark .cluster-status-garrison-marker {
    background: rgba(190, 18, 60, 0.22);
    border-color: rgba(248, 113, 113, 0.34);
    color: #fecdd3;
    box-shadow: 0 0 0 2px rgba(190, 18, 60, 0.08);
}

.theme-dark .cluster-status-scan-marker {
    background: rgba(45, 212, 191, 0.22);
    border-color: rgba(45, 212, 191, 0.34);
}

.theme-dark .cluster-hover-card {
    background: rgba(8, 22, 47, 0.98);
    border-color: var(--cluster-line);
    color: var(--cluster-text-soft);
}

.theme-dark .cluster-hover-card > div:not(.cluster-hover-title):not(.cluster-hover-members) {
    border-top-color: rgba(159, 180, 224, 0.16);
}

.theme-dark .cluster-hover-card strong {
    color: var(--cluster-text);
}

.theme-dark .cluster-hover-members span {
    background: rgba(159, 180, 224, 0.12);
    border-color: var(--cluster-line);
    color: var(--cluster-text-soft);
}

.theme-dark .cluster-details-dock {
    background: linear-gradient(180deg, rgba(16, 38, 74, 0.98), rgba(7, 20, 39, 0.98));
}

.theme-dark .cluster-side-tabs button.active {
    background: rgba(245, 214, 122, 0.12);
    color: #ffffff;
}

.theme-dark .cluster-panel-note,
.theme-dark .cluster-mini-stat,
.theme-dark .cluster-member-row,
.theme-dark .cluster-garrison-row,
.theme-dark .cluster-scan-table {
    background: rgba(7, 20, 39, 0.5);
    border-color: var(--cluster-line);
}

.theme-dark .cluster-member-row,
.theme-dark .cluster-garrison-row {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.theme-dark .cluster-member-row > img {
    border-color: rgba(244, 247, 255, 0.88);
    box-shadow: 0 0 0 1px rgba(159, 180, 224, 0.16);
}

.theme-dark .cluster-scan-table .table > :not(caption) > * > * {
    background-color: transparent;
}

.theme-dark .cluster-status-cell.activity-level-1::before {
    background: rgba(59, 130, 246, 0.18);
}

.theme-dark .cluster-status-cell.activity-level-2::before {
    background: rgba(20, 184, 166, 0.2);
}

.theme-dark .cluster-status-cell.activity-level-3::before {
    background: rgba(245, 214, 122, 0.18);
}

.theme-dark .cluster-status-cell.activity-level-4::before {
    background: rgba(225, 29, 72, 0.22);
}

.theme-dark .cluster-status-cell.mode-defense.has-garrison {
    border-color: rgba(248, 113, 113, 0.46);
}

.theme-dark .cluster-status-cell.mode-production.has-production {
    border-color: rgba(96, 165, 250, 0.48);
}

.theme-dark .cluster-status-cell.mode-assets.has-assets {
    border-color: rgba(129, 140, 248, 0.5);
}

.theme-dark .cluster-status-cell.mode-mining.has-mining {
    border-color: rgba(45, 212, 191, 0.48);
}

.theme-dark .cluster-operation-marker {
    border-color: rgba(244, 247, 255, 0.72);
    box-shadow: 0 0.08rem 0.18rem rgba(0, 0, 0, 0.3);
}

.theme-dark .cluster-ops-summary > div,
.theme-dark .cluster-summary-list > div {
    background: rgba(7, 20, 39, 0.5);
    border-color: var(--cluster-line);
}

.theme-dark .cluster-ops-summary span,
.theme-dark .cluster-summary-list span,
.theme-dark .cluster-summary-list small {
    color: var(--cluster-text-soft);
}

.theme-dark .cluster-ops-summary strong,
.theme-dark .cluster-summary-list strong {
    color: #ffffff;
}

.theme-dark .cluster-status-cell.has-system {
    border-color: rgba(96, 165, 250, 0.42);
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.16), inset 0 -0.2rem 0 rgba(96, 165, 250, 0.1);
}

.theme-dark .cluster-status-cell.has-named-system {
    border-color: rgba(129, 140, 248, 0.58);
    box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.22), inset 0 -0.24rem 0 rgba(129, 140, 248, 0.14);
}

.theme-dark .cluster-status-cell.is-selected {
    border-color: rgba(245, 214, 122, 0.88);
    box-shadow: 0 0 0 3px rgba(245, 214, 122, 0.22), 0 0.55rem 1rem rgba(0, 0, 0, 0.34);
}

.theme-dark .cluster-status-grid .cluster-status-cell.mode-members,
.theme-dark .cluster-status-grid .cluster-status-cell.mode-defense,
.theme-dark .cluster-status-grid .cluster-status-cell.mode-production,
.theme-dark .cluster-status-grid .cluster-status-cell.mode-assets,
.theme-dark .cluster-status-grid .cluster-status-cell.mode-mining {
    background: #0b1c3a;
}

.theme-dark .cluster-status-cell.mode-members.activity-level-1::before {
    background: rgba(245, 214, 122, 0.1);
}

.theme-dark .cluster-status-cell.mode-members.activity-level-2::before {
    background: rgba(245, 214, 122, 0.18);
}

.theme-dark .cluster-status-cell.mode-members.activity-level-3::before {
    background: rgba(245, 214, 122, 0.28);
}

.theme-dark .cluster-status-cell.mode-members.activity-level-4::before {
    background: rgba(245, 214, 122, 0.4);
}

.theme-dark .cluster-status-cell.mode-defense.activity-level-1::before {
    background: rgba(248, 113, 113, 0.1);
}

.theme-dark .cluster-status-cell.mode-defense.activity-level-2::before {
    background: rgba(248, 113, 113, 0.18);
}

.theme-dark .cluster-status-cell.mode-defense.activity-level-3::before {
    background: rgba(248, 113, 113, 0.28);
}

.theme-dark .cluster-status-cell.mode-defense.activity-level-4::before {
    background: rgba(248, 113, 113, 0.4);
}

.theme-dark .cluster-status-cell.mode-production.activity-level-1::before {
    background: rgba(96, 165, 250, 0.1);
}

.theme-dark .cluster-status-cell.mode-production.activity-level-2::before {
    background: rgba(96, 165, 250, 0.18);
}

.theme-dark .cluster-status-cell.mode-production.activity-level-3::before {
    background: rgba(96, 165, 250, 0.28);
}

.theme-dark .cluster-status-cell.mode-production.activity-level-4::before {
    background: rgba(96, 165, 250, 0.4);
}

.theme-dark .cluster-status-cell.mode-assets.activity-level-1::before {
    background: rgba(129, 140, 248, 0.07);
}

.theme-dark .cluster-status-cell.mode-assets.activity-level-2::before {
    background: rgba(129, 140, 248, 0.18);
}

.theme-dark .cluster-status-cell.mode-assets.activity-level-3::before {
    background: rgba(129, 140, 248, 0.42);
}

.theme-dark .cluster-status-cell.mode-assets.activity-level-4::before {
    background: rgba(129, 140, 248, 0.72);
    inset: 0.1rem;
}

.theme-dark .cluster-status-cell.mode-assets.activity-level-4 {
    border-color: rgba(165, 180, 252, 0.92);
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.26), 0 0.42rem 0.85rem rgba(0, 0, 0, 0.34);
}

.theme-dark .cluster-status-cell.mode-assets.activity-level-3 {
    border-color: rgba(129, 140, 248, 0.78);
}

.theme-dark .cluster-status-cell.mode-mining.activity-level-1::before {
    background: rgba(45, 212, 191, 0.1);
}

.theme-dark .cluster-status-cell.mode-mining.activity-level-2::before {
    background: rgba(45, 212, 191, 0.18);
}

.theme-dark .cluster-status-cell.mode-mining.activity-level-3::before {
    background: rgba(45, 212, 191, 0.28);
}

.theme-dark .cluster-status-cell.mode-mining.activity-level-4::before {
    background: rgba(45, 212, 191, 0.4);
}

/* --- Holopages --- */
.theme-dark .holopage-card .card-header {
    background: var(--hc-dark-panel);
}

.theme-dark .holopage-scope-toolbar {
    background: var(--hc-dark-panel);
    border-color: var(--hc-dark-border);
}

.theme-dark .holopage-scope-meta {
    color: var(--hc-dark-muted);
}

.theme-dark .holopage-scope-chip {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--hc-dark-border);
    color: var(--hc-dark-text);
}

.theme-dark .holopage-scope-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--hc-dark-gold);
}

.theme-dark .holopage-scope-chip.active {
    background: var(--hc-dark-gold);
    border-color: var(--hc-dark-gold);
    color: #07111f;
}

.theme-dark .holopage-scope-chip.active:hover,
.theme-dark .holopage-scope-chip.active:focus {
    background: var(--hc-dark-gold-strong);
    border-color: var(--hc-dark-gold-strong);
    color: #07111f;
}

.theme-dark .holopage-scope-chip.muted {
    background: transparent;
    border-color: transparent;
    color: var(--hc-dark-muted);
}

.theme-dark .holopage-preview {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--hc-dark-border);
}

.theme-dark .holopage-rendered .holopage-toc {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--hc-dark-border);
}

.theme-dark .holopage-rendered .holopage-toc-title {
    color: var(--hc-dark-gold);
}

.theme-dark .holopage-rendered .holopage-internal-link-missing {
    color: #fbbf24;
}

.theme-dark .holopage-rendered .holopage-internal-link-missing-text {
    color: var(--hc-dark-muted);
}

.theme-dark .holopage-rendered blockquote {
    background: rgba(255, 255, 255, 0.04);
    border-left-color: var(--hc-dark-gold);
    color: var(--hc-dark-text);
}

.theme-dark .holopage-rendered code {
    background: rgba(255, 255, 255, 0.08);
    color: var(--hc-dark-gold);
}

.theme-dark .holopage-rendered pre {
    background: #050b14;
    border: 1px solid var(--hc-dark-border);
}

.theme-dark .holopage-rendered pre code {
    background: transparent;
    color: #f8fafc;
}

.theme-dark .holopage-rendered .holopage-image {
    border: 1px solid var(--hc-dark-border);
}

/* --- Member banking command surface --- */
.theme-dark .banking-hero,
.theme-dark .banking-setup-panel,
.theme-dark .banking-auth-callout,
.theme-dark .banking-summary,
.theme-dark .banking-account-drawer,
.theme-dark .banking-action-card,
.theme-dark .banking-control-card,
.theme-dark .banking-section-card,
.theme-dark .banking-account-card {
    background: var(--app-color-surface);
    border-color: var(--app-color-border);
    color: var(--app-color-text);
    box-shadow: var(--app-shadow-rest);
}

.theme-dark .banking-hero {
    background:
        linear-gradient(90deg, rgba(158, 197, 254, 0.12), rgba(245, 214, 122, 0.1)),
        var(--app-color-surface);
}

.theme-dark .banking-card-header,
.theme-dark .banking-account-card .card-header,
.theme-dark .banking-action-pane,
.theme-dark .banking-action-tabs,
.theme-dark .banking-attention-strip,
.theme-dark .banking-attention-chip,
.theme-dark .banking-amount-chip,
.theme-dark .banking-confirm-summary,
.theme-dark .banking-balance-chip,
.theme-dark .banking-command-accountbar,
.theme-dark .banking-wage-drawer,
.theme-dark .banking-accountbar-stats span,
.theme-dark .banking-account-drawer-summary,
.theme-dark .banking-account-row,
.theme-dark .banking-account-row-meta span:not(.badge),
.theme-dark .banking-account-row .banking-account-details div,
.theme-dark .banking-empty-state,
.theme-dark .banking-loan-spotlight,
.theme-dark .banking-loan-card,
.theme-dark .banking-loan-meta span,
.theme-dark .banking-loan-stats div,
.theme-dark .banking-bill-card,
.theme-dark .banking-bill-details span,
.theme-dark .banking-ledger-body,
.theme-dark .banking-ledger-details span,
.theme-dark .banking-choice-card,
.theme-dark .banking-mode-switch,
.theme-dark .banking-status-pill,
.theme-dark .banking-summary-item,
.theme-dark .banking-account-details {
    background: var(--app-color-surface-muted);
    border-color: var(--app-color-border);
    color: var(--app-color-text-soft);
}

.theme-dark .banking-hero-meta span {
    background: rgba(7, 20, 39, 0.48);
    border-color: var(--app-color-border);
    color: var(--app-color-text-soft);
}

.theme-dark .banking-hero h1,
.theme-dark .banking-choice-card h2,
.theme-dark .banking-auth-callout h1,
.theme-dark .banking-action-pane h3,
.theme-dark .banking-account-card .display-6,
.theme-dark .banking-summary-item .metric-value {
    color: var(--app-color-text);
}

.theme-dark .banking-choice-card p,
.theme-dark .banking-auth-callout p,
.theme-dark .banking-hero-meta,
.theme-dark .banking-action-pane .form-label {
    color: var(--app-color-text-muted);
}

.theme-dark .banking-choice-card.is-primary,
.theme-dark .banking-choice-icon,
.theme-dark .banking-callout-icon {
    background: rgba(158, 197, 254, 0.12);
    border-color: rgba(158, 197, 254, 0.28);
    color: var(--app-color-primary);
}

.theme-dark .banking-status-pill.is-on {
    background: rgba(117, 183, 152, 0.14);
    border-color: rgba(117, 183, 152, 0.32);
    color: var(--app-color-success);
}

.theme-dark .banking-balance-chip.is-active {
    background: rgba(158, 197, 254, 0.12);
    border-color: rgba(158, 197, 254, 0.34);
}

.theme-dark .banking-hero-attention,
.theme-dark .banking-account-row .banking-account-details,
.theme-dark .banking-tag-row {
    border-color: var(--app-color-border);
}

.theme-dark .banking-account-card.is-active {
    border-color: rgba(245, 214, 122, 0.52) !important;
    box-shadow: 0 0.75rem 1.5rem rgba(245, 214, 122, 0.08) !important;
}

.theme-dark .banking-account-row.is-active {
    background: rgba(245, 214, 122, 0.08);
    border-color: rgba(245, 214, 122, 0.38);
}

.theme-dark .banking-recent-tags {
    border-top-color: var(--app-color-border);
}

.theme-dark .banking-action-tabs .nav-link {
    color: var(--app-color-text-soft);
}

.theme-dark .banking-action-tabs .nav-link.active {
    background: var(--hc-dark-gold);
    color: #07111f;
}

.theme-dark .banking-form-note {
    color: var(--app-color-text-muted);
}

.theme-dark .banking-account-drawer .offcanvas-header,
.theme-dark .banking-account-drawer .offcanvas-body {
    background: var(--app-color-surface);
    border-color: var(--app-color-border);
}

.theme-dark .banking-account-drawer .btn-close {
    filter: invert(1) grayscale(100%);
}

.theme-dark .banking-attention-title,
.theme-dark .banking-accountbar-title,
.theme-dark .banking-account-row-balance,
.theme-dark .banking-account-drawer-summary strong,
.theme-dark .banking-balance-chip strong,
.theme-dark .banking-worklist-kpi strong,
.theme-dark .banking-account-row .banking-account-details strong,
.theme-dark .banking-loan-title,
.theme-dark .banking-loan-stats strong,
.theme-dark .banking-ledger-title {
    color: var(--app-color-text);
}

.theme-dark .banking-attention-chip.is-warning {
    background: rgba(255, 218, 106, 0.12);
    border-color: rgba(255, 218, 106, 0.3);
    color: var(--app-color-warning);
}

.theme-dark .banking-attention-chip.is-success {
    background: rgba(117, 183, 152, 0.14);
    border-color: rgba(117, 183, 152, 0.32);
    color: var(--app-color-success);
}

.theme-dark .banking-ledger-amount {
    color: var(--app-color-danger);
}

.theme-dark .banking-ledger-entry.is-credit .banking-ledger-amount {
    color: var(--app-color-success);
}

.theme-dark .login-outage-copy {
    background: rgba(245, 214, 122, 0.12);
    border-color: rgba(245, 214, 122, 0.42);
    color: var(--hc-dark-gold-strong);
}

.theme-dark .discord-login-button {
    background: #5865f2;
    border-color: #7f88ff;
    color: #ffffff;
}

.theme-dark .discord-login-button:hover,
.theme-dark .discord-login-button:focus {
    background: #6d78ff;
    border-color: #9aa2ff;
    color: #ffffff;
}

.theme-dark .login-discord-helper {
    color: var(--hc-dark-muted);
}

.theme-dark #layoutAuthentication .btn-warning-subtle {
    background: rgba(245, 214, 122, 0.1);
    border-color: rgba(245, 214, 122, 0.24);
    color: var(--hc-dark-gold-strong);
}

.theme-dark #layoutAuthentication .btn-warning-subtle:hover,
.theme-dark #layoutAuthentication .btn-warning-subtle:focus {
    background: rgba(245, 214, 122, 0.16);
    color: #ffffff;
}

.theme-dark .guest-hub-shell {
    --guest-navy: #f1f6fb;
    --guest-muted: #b8c5d4;
}

.theme-dark .guest-hub-nav,
.theme-dark .guest-hub-intro,
.theme-dark .guest-hub-action,
.theme-dark .guest-hub-dispatches,
.theme-dark .guest-hub-visit-card,
.theme-dark .guest-route-hero,
.theme-dark .guest-route-panel {
    background: rgba(15, 24, 40, 0.82);
    border-color: rgba(245, 214, 122, 0.2);
    color: #f1f6fb;
}

.theme-dark .guest-hub-brand h1,
.theme-dark .guest-hub-intro h2,
.theme-dark .guest-hub-action,
.theme-dark .guest-hub-action:hover,
.theme-dark .guest-hub-action:focus,
.theme-dark .guest-hub-section-heading h3,
.theme-dark .guest-hub-visit-card h3,
.theme-dark .guest-hub-dispatch,
.theme-dark .guest-hub-dispatch:hover,
.theme-dark .guest-hub-dispatch:focus,
.theme-dark .guest-route-page,
.theme-dark .guest-route-hero h1,
.theme-dark .guest-route-panel h2,
.theme-dark .guest-route-list a,
.theme-dark .guest-route-list a:hover,
.theme-dark .guest-route-list a:focus {
    color: #f1f6fb;
}

.theme-dark .guest-hub-brand p,
.theme-dark .guest-hub-intro p,
.theme-dark .guest-hub-action-detail,
.theme-dark .guest-hub-dispatch-preview,
.theme-dark .guest-hub-empty,
.theme-dark .guest-hub-visit-card p,
.theme-dark .guest-route-hero p,
.theme-dark .guest-route-panel p,
.theme-dark .guest-route-list small {
    color: #b8c5d4;
}

.theme-dark .guest-hub-icon-button {
    background: rgba(21, 33, 52, 0.9);
    border-color: rgba(245, 214, 122, 0.18);
    color: #f1f6fb;
}

.theme-dark .guest-hub-dispatch,
.theme-dark .guest-route-list a {
    border-color: rgba(245, 214, 122, 0.14);
}
