head {
    /* position: relative; */
}

body {
    /* position: relative; */
}

.map {
    position: relative;
    width: 1000px;
    height: 1000px;
}

.map-dot-red {
    position: absolute;
    height: 8px;
    width: 8px;
    border-radius: 25px;
    display: inline-block;
    background: #f5280a;
    border: 2px solid #500000;
    box-shadow: 0 0 6px 2px #a50505;
}

.map-dot-blue {
    position: absolute;
    height: 8px;
    width: 8px;
    border-radius: 25px;
    display: inline-block;
    background: #46dcff;
    border: 2px solid #043f71;
    box-shadow: 0 0 6px 2px #0f78a0;
}

.map-dot-green {
    position: absolute;
    height: 8px;
    width: 8px;
    border-radius: 25px;
    display: inline-block;
    background: #28f50a;
    border: 2px solid #005000;
    box-shadow: 0 0 6px 2px #05a505;
}

.map-dot-yellow {
    position: absolute;
    height: 8px;
    width: 8px;
    border-radius: 25px;
    display: inline-block;
    background: #f5f50a;
    border: 2px solid #505000;
    box-shadow: 0 0 6px 2px #a5a505;
}

.map-dot-orange {
    position: absolute;
    height: 8px;
    width: 8px;
    border-radius: 25px;
    display: inline-block;
    background: #f5a50a;
    border: 2px solid #502d00;
    box-shadow: 0 0 6px 2px #a57d05;
}

/* --- Topbar enhancements --- */
.topbar-logo {
    height: 40px;
    width: 40px;
    object-fit: contain;
}

.topbar-breadcrumb .breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.65);
}

.topbar-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.35);
}

.topbar-breadcrumb .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
}

.topbar-breadcrumb .breadcrumb-item a:hover {
    color: #fff;
    text-decoration: underline;
}

.topbar-breadcrumb .breadcrumb-item.active {
    color: #fff;
}

.topbar-user-nav .dropdown-menu {
    min-width: 14rem;
}

.topbar-user-nav .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: clamp(9rem, 24vw, 16rem);
    white-space: normal;
    word-break: break-word;
    line-height: 1.1;
    text-align: right;
    font-size: 0.95rem;
}

.topbar-user-nav .nav-link .fa-user {
    flex-shrink: 0;
}

@media (max-width: 767.98px) {
    .topbar-logo {
        height: 32px;
        width: 32px;
    }

    .topbar-user-nav .nav-link {
        max-width: 60vw;
        font-size: 0.9rem;
    }
}

@media (max-width: 575.98px) {
    .sb-topnav .navbar-brand {
        max-width: calc(100vw - 8.75rem);
        min-width: 0;
    }

    .sb-topnav .navbar-brand span {
        display: block;
        font-size: 1.05rem;
        line-height: 1.1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar-user-nav {
        margin-right: 0.25rem !important;
    }

    .topbar-user-nav .nav-link {
        font-size: 0;
        gap: 0;
        justify-content: center;
        max-width: 2.6rem;
        min-height: 2.4rem;
        min-width: 2.4rem;
        padding-left: 0.35rem;
        padding-right: 0.35rem;
        white-space: nowrap;
    }

    .topbar-user-nav .nav-link svg,
    .topbar-user-nav .nav-link .svg-inline--fa {
        font-size: 1rem;
    }

    .topbar-user-nav .dropdown-toggle::after {
        display: none;
    }
}

/* --- Dashboard layout helpers --- */
.dashboard-card {
    border: none;
    border-radius: 0.75rem;
}

.dashboard-card .card-header {
    background: transparent;
}

.officer-tool-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0.9rem;
}

.hub-module-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.12), rgba(13, 110, 253, 0.04));
    color: #0d6efd;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.hub-access-chip {
    background: rgba(15, 23, 42, 0.05);
    color: #334155;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.defense-hub-nav .nav-link {
    border-radius: 999px;
    padding: 0.55rem 0.9rem;
}

.defense-hub-card {
    border-color: rgba(15, 23, 42, 0.1);
}

.defense-hub-card .hub-module-icon {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.12), rgba(13, 110, 253, 0.05));
    color: #b45309;
}

.production-hub-card .hub-module-icon {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(13, 110, 253, 0.05));
    color: #065f46;
}

.defense-hub-metrics {
    row-gap: 0.45rem;
}

.defense-hub-metrics dt,
.defense-hub-metrics dd {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.defense-hub-metrics dt {
    color: #64748b;
    font-weight: 600;
}

.defense-hub-metrics dd {
    color: #0f172a;
    font-weight: 600;
}

.defense-cluster-map-card {
    border-color: rgba(15, 23, 42, 0.08);
}

.defense-cluster-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: center;
    color: #475569;
    font-size: 0.86rem;
}

.cluster-legend-box {
    display: inline-block;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 0.25rem;
    margin-right: 0.35rem;
    vertical-align: -0.12rem;
    border: 1px solid rgba(15, 23, 42, 0.14);
}

.cluster-legend-system {
    background: #dbeafe;
}

.cluster-legend-station {
    background: #fee2e2;
    border-color: rgba(220, 38, 38, 0.5);
}

.cluster-legend-scan {
    background: #cffafe;
    border-color: rgba(8, 145, 178, 0.45);
}

.cluster-legend-selected {
    background: #fef3c7;
    border-color: rgba(180, 83, 9, 0.7);
}

.cluster-legend-line {
    display: inline-block;
    width: 1.25rem;
    height: 0.24rem;
    border-radius: 999px;
    background: #14532d;
    margin-right: 0.35rem;
    vertical-align: 0.08rem;
    box-shadow: 0 0 0 2px rgba(20, 83, 45, 0.12);
}

.defense-cluster-scroll {
    overflow-x: visible;
    padding-bottom: 0.4rem;
}

.defense-cluster-map-layer {
    --cluster-cols: 20;
    position: relative;
    width: 100%;
    min-width: 0;
    isolation: isolate;
}

.defense-cluster-boundary {
    position: absolute;
    inset: 0;
    z-index: 4;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.cluster-boundary-fill {
    fill: rgba(139, 255, 148, 0.11);
    stroke: none;
}

.cluster-boundary-stroke {
    fill: none;
    stroke: rgba(20, 83, 45, 0.9);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 0.12rem 0.18rem rgba(15, 23, 42, 0.18));
}

.defense-cluster-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(var(--cluster-cols), minmax(0, 1fr));
    gap: clamp(0.12rem, 0.35vw, 0.35rem);
}

.defense-cluster-cell {
    position: relative;
    aspect-ratio: 1 / 1;
    min-height: 0;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 0.55rem;
    background: #f8fafc;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    overflow: hidden;
    transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

@media (max-width: 1199.98px) {
    .cluster-coord-label {
        display: none;
    }
}

.defense-cluster-cell:hover {
    border-color: rgba(37, 99, 235, 0.55);
    box-shadow: 0 0.45rem 1rem rgba(15, 23, 42, 0.12);
    transform: translateY(-1px);
    color: #1d4ed8;
}

.defense-cluster-cell.has-system {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
}

.defense-cluster-cell.outside-sector {
    background: #f8fafc;
    border-color: rgba(203, 213, 225, 0.45);
    opacity: 0.42;
}

.defense-cluster-cell.outside-sector .cluster-coord-label {
    color: rgba(100, 116, 139, 0.42);
}

.defense-cluster-cell.has-station {
    border-color: rgba(220, 38, 38, 0.55);
    box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.12);
}

.defense-cluster-cell.has-scan {
    background-image: linear-gradient(135deg, rgba(14, 165, 233, 0.14), rgba(255, 255, 255, 0));
}

.defense-cluster-cell.is-selected {
    border-color: rgba(180, 83, 9, 0.8);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.24);
    background: #fffbeb;
}

.cluster-coord-label {
    position: absolute;
    bottom: 0.12rem;
    left: 0.22rem;
    font-size: 0.55rem;
    line-height: 1;
    color: rgba(15, 23, 42, 0.46);
}

.cluster-system-pip {
    width: 0.62rem;
    height: 0.62rem;
    border-radius: 999px;
    background: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.cluster-station-pip {
    position: absolute;
    top: 0.18rem;
    right: 0.18rem;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.18rem;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.58rem;
    font-weight: 700;
    line-height: 1rem;
    text-align: center;
}

.cluster-scan-pip {
    position: absolute;
    bottom: 0.24rem;
    right: 0.24rem;
    width: 0.48rem;
    height: 0.48rem;
    border-radius: 999px;
    background: #0891b2;
    box-shadow: 0 0 0 2px rgba(8, 145, 178, 0.16);
}

.defense-cluster-detail-card {
    border-color: rgba(15, 23, 42, 0.08);
}

.defense-cluster-station {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0.75rem;
    padding: 0.85rem;
    background: #fff;
}

.defense-cluster-entity-table {
    max-height: 28rem;
    overflow: auto;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0.75rem;
}

/* --- Cluster status map --- */
.cluster-status-container {
    padding-bottom: 1.5rem;
}

.cluster-status-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin: 1rem 0 0.85rem;
}

.cluster-status-title {
    margin: 0;
    font-size: clamp(1.35rem, 2vw, 1.8rem);
    font-weight: 700;
    letter-spacing: 0;
    color: #162033;
}

.cluster-status-subtitle {
    margin-top: 0.15rem;
    color: #64748b;
    font-size: 0.88rem;
}

.cluster-status-header-actions,
.cluster-status-toolbar,
.cluster-status-filters,
.cluster-status-metrics {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.cluster-status-toolbar {
    justify-content: space-between;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0.5rem;
    background: #fff;
}

.cluster-status-metrics {
    color: #475569;
    font-size: 0.82rem;
}

.cluster-status-metrics span {
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
    white-space: nowrap;
}

.cluster-status-metrics strong {
    color: #0f172a;
    font-size: 0.95rem;
}

.cluster-status-filters .form-control,
.cluster-status-filters .form-select {
    width: min(14rem, 42vw);
}

.cluster-pin-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 1.95rem;
    padding: 0.18rem 0.55rem 0.18rem 2.35rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    font-size: 0.78rem;
    white-space: nowrap;
}

.cluster-pin-toggle .form-check-input {
    margin-top: 0;
}

.cluster-status-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 410px);
    gap: 0.75rem;
    min-height: min(34rem, var(--cluster-shell-height, 34rem));
    height: var(--cluster-shell-height, calc(100vh - 17rem));
}

.cluster-map-surface,
.cluster-side-panel {
    min-height: 0;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 0.6rem;
    background: #f8fafc;
}

.cluster-map-surface {
    position: relative;
    overflow: hidden;
}

.cluster-map-surface-tools {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 12;
    box-shadow: 0 0.45rem 1rem rgba(15, 23, 42, 0.12);
}

.cluster-map-surface-tools .btn {
    border-color: rgba(15, 23, 42, 0.08);
}

.cluster-map-loading {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    background: rgba(248, 250, 252, 0.78);
    color: #475569;
    font-weight: 600;
}

.cluster-map-loading[hidden] {
    display: none;
}

.cluster-status-map-scroll {
    width: 100%;
    height: 100%;
    overflow: auto;
    padding: 3.1rem 1rem 1rem;
}

.cluster-status-map-layer {
    --cluster-cols: 20;
    --cluster-cell-size: 30px;
    --cluster-gap: 2px;
    position: relative;
    display: inline-block;
    min-width: max-content;
    isolation: isolate;
}

.cluster-status-boundary {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.cluster-status-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(var(--cluster-cols), var(--cluster-cell-size));
    gap: var(--cluster-gap);
}

.cluster-status-cell {
    position: relative;
    width: var(--cluster-cell-size);
    height: var(--cluster-cell-size);
    padding: 0;
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 0.38rem;
    background: #eef2f7;
    color: #1f2937;
    overflow: visible;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.cluster-status-cell:hover,
.cluster-status-cell:focus-visible {
    z-index: 5;
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, 0.72);
    box-shadow: 0 0.5rem 1rem rgba(15, 23, 42, 0.18);
    outline: none;
}

.cluster-status-cell.outside-sector {
    opacity: 0.22;
    background: #f8fafc;
}

.cluster-status-cell.has-system {
    background: #e0f2fe;
}

.cluster-status-cell.has-named-system {
    background: #c7d2fe;
    border-color: rgba(79, 70, 229, 0.34);
    box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.1);
}

.cluster-status-cell.has-garrison {
    border-color: rgba(148, 163, 184, 0.38);
    box-shadow: inset 0 0 0 1px rgba(190, 18, 60, 0.06);
}

.cluster-status-cell.has-scan {
    background-image: linear-gradient(135deg, rgba(20, 184, 166, 0.12), transparent 58%);
}

.cluster-status-cell.has-members {
    background-color: #f8fafc;
}

.cluster-status-cell.has-visible-members {
    z-index: 3;
}

.cluster-status-cell.has-members.has-system {
    background: linear-gradient(135deg, #dbeafe, #f8fafc);
}

.cluster-status-cell.has-members.has-named-system {
    background: linear-gradient(135deg, #c7d2fe, #f8fafc);
}

.cluster-status-cell.is-selected {
    z-index: 6;
    border-color: rgba(245, 158, 11, 0.95);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.28), 0 0.5rem 1rem rgba(15, 23, 42, 0.18);
}

.cluster-status-cell.is-filter-muted {
    opacity: 0.2;
}

.cluster-status-cell.outside-sector.is-filter-muted {
    opacity: 0.12;
}

.cluster-status-cell.mode-members:not(.has-members),
.cluster-status-cell.mode-garrisons:not(.has-garrison),
.cluster-status-cell.mode-scans:not(.has-scan) {
    opacity: 0.24;
}

.cluster-status-cell.mode-garrisons.has-garrison {
    border-color: rgba(190, 18, 60, 0.38);
    box-shadow: inset 0 0 0 1px rgba(190, 18, 60, 0.14);
}

.cluster-status-cell.mode-scans.has-scan {
    background-image: linear-gradient(135deg, rgba(20, 184, 166, 0.22), transparent 58%);
}

.cluster-member-pin {
    position: absolute;
    left: 50%;
    top: calc(50% - 0.18rem);
    z-index: 12;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -100%);
    pointer-events: none;
}

.cluster-member-pin::before {
    content: '';
    position: absolute;
    inset: -0.12rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(37, 99, 235, 0.18);
    box-shadow: 0 0.18rem 0.45rem rgba(15, 23, 42, 0.24);
}

.cluster-member-pin::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -0.42rem;
    z-index: 1;
    width: 0.62rem;
    height: 0.62rem;
    border-radius: 0 0 0.18rem 0;
    background: rgba(255, 255, 255, 0.92);
    border-right: 1px solid rgba(37, 99, 235, 0.18);
    border-bottom: 1px solid rgba(37, 99, 235, 0.18);
    box-shadow: 0.13rem 0.13rem 0.2rem rgba(15, 23, 42, 0.14);
    transform: translateX(-50%) rotate(45deg);
}

.cluster-member-stack {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
}

.cluster-member-stack img {
    width: 1.18rem;
    height: 1.18rem;
    object-fit: cover;
    border-radius: 999px;
    border: 2px solid #fff;
    background: #fff;
    box-shadow: 0 0.08rem 0.18rem rgba(15, 23, 42, 0.22);
}

.cluster-member-pin.member-count-1 .cluster-member-stack img {
    width: 1.5rem;
    height: 1.5rem;
}

.cluster-member-stack img + img {
    margin-left: -0.45rem;
}

.cluster-member-count {
    min-width: 1.18rem;
    height: 1.18rem;
    margin-left: -0.34rem;
    padding: 0 0.2rem;
    border-radius: 999px;
    border: 2px solid #fff;
    background: #111827;
    color: #fff;
    font-size: 0.56rem;
    line-height: 0.91rem;
    font-weight: 700;
    box-shadow: 0 0.08rem 0.18rem rgba(15, 23, 42, 0.22);
}

.cluster-status-indicators {
    position: absolute;
    top: 0.18rem;
    right: 0.18rem;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
    pointer-events: none;
}

.cluster-status-garrison-marker {
    display: grid;
    place-items: center;
    align-items: center;
    width: 1.05rem;
    height: 1.05rem;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(190, 18, 60, 0.26);
    background: rgba(255, 241, 242, 0.92);
    color: #be123c;
    font-size: 0.66rem;
    line-height: 1;
    box-shadow: none;
    opacity: 0.9;
}

.cluster-status-cell.mode-garrisons .cluster-status-garrison-marker,
.cluster-status-cell:hover .cluster-status-garrison-marker,
.cluster-status-cell.is-selected .cluster-status-garrison-marker {
    background: #be123c;
    color: #fff;
    opacity: 1;
}

.cluster-status-garrison-marker svg {
    width: 0.64rem;
    height: 0.64rem;
}

.cluster-status-scan-marker {
    display: block;
    width: 0.42rem;
    height: 0.42rem;
    margin-right: 0.31rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 118, 110, 0.38);
    background: rgba(240, 253, 250, 0.92);
    box-shadow: none;
}

.cluster-status-cell.mode-scans .cluster-status-scan-marker,
.cluster-status-cell:hover .cluster-status-scan-marker,
.cluster-status-cell.is-selected .cluster-status-scan-marker {
    background: #0f766e;
    box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.14);
}

.cluster-status-cell.has-low-health .cluster-member-stack img:first-child {
    border-color: #f97316;
}

.cluster-status-coord {
    position: absolute;
    left: 0.18rem;
    top: 0.12rem;
    color: rgba(15, 23, 42, 0.44);
    font-size: 0.48rem;
    line-height: 1;
    opacity: 0;
}

.cluster-status-cell:hover .cluster-status-coord,
.cluster-status-cell.is-selected .cluster-status-coord {
    opacity: 1;
}

.cluster-hover-card {
    position: fixed;
    z-index: 3000;
    width: min(19rem, calc(100vw - 1.5rem));
    padding: 0.75rem;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 0.55rem;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 0.85rem 2rem rgba(15, 23, 42, 0.22);
    color: #334155;
    font-size: 0.78rem;
    pointer-events: none;
}

.cluster-hover-title {
    margin-bottom: 0.35rem;
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 700;
}

.cluster-hover-members {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.cluster-hover-members span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    max-width: 100%;
    padding: 0.18rem 0.4rem 0.18rem 0.22rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
}

.cluster-hover-members img {
    width: 1rem;
    height: 1rem;
    border-radius: 999px;
    object-fit: cover;
}

.cluster-side-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
}

.cluster-side-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 0.95rem 0.65rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.cluster-side-kicker {
    color: #64748b;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cluster-side-header h2 {
    margin: 0.1rem 0 0;
    color: #0f172a;
    font-size: 1.05rem;
    line-height: 1.2;
}

.cluster-side-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.cluster-side-tabs button {
    min-width: 0;
    padding: 0.55rem 0.25rem;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
}

.cluster-side-tabs button.active {
    color: #1d4ed8;
    border-bottom-color: #2563eb;
    background: #eff6ff;
}

.cluster-side-content {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 0.9rem;
}

.cluster-panel-section + .cluster-panel-section {
    margin-top: 1rem;
}

.cluster-panel-section h3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0 0 0.55rem;
    color: #1f2937;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cluster-panel-section h3 span {
    color: #64748b;
    font-weight: 600;
}

.cluster-panel-note {
    padding: 0.75rem;
    border-radius: 0.5rem;
    background: #f8fafc;
    color: #475569;
    font-size: 0.84rem;
}

.cluster-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.cluster-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 0.25rem 0.5rem;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
}

.cluster-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.cluster-mini-stat {
    min-width: 0;
    padding: 0.55rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0.45rem;
    background: #f8fafc;
}

.cluster-mini-stat span {
    display: block;
    margin-bottom: 0.15rem;
    color: #64748b;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cluster-mini-stat strong {
    display: block;
    color: #0f172a;
    font-size: 0.92rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.cluster-row-list {
    display: grid;
    gap: 0.55rem;
}

.cluster-member-row,
.cluster-garrison-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.65rem;
    align-items: center;
    padding: 0.62rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0.5rem;
    background: #fff;
}

.cluster-garrison-row {
    grid-template-columns: minmax(0, 1fr) auto;
}

.cluster-member-row > img {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    object-fit: cover;
}

.cluster-row-main {
    min-width: 0;
}

.cluster-row-title {
    color: #0f172a;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.cluster-row-subtitle,
.cluster-row-meta,
.cluster-garrison-types {
    margin-top: 0.12rem;
    color: #64748b;
    font-size: 0.74rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.cluster-row-meta {
    color: #475569;
}

.cluster-health {
    position: relative;
    width: 3.8rem;
    padding-bottom: 0.46rem;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 700;
    text-align: right;
}

.cluster-health::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 0.24rem;
    border-radius: 999px;
    background: #e2e8f0;
}

.cluster-health i {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 1;
    display: block;
    height: 0.24rem;
    border-radius: 999px;
    background: #16a34a;
}

.cluster-health.warn i {
    background: #f59e0b;
}

.cluster-health.danger i {
    background: #dc2626;
}

.cluster-health.unknown i {
    background: transparent;
}

.cluster-garrison-stats {
    display: grid;
    justify-items: end;
    gap: 0.1rem;
    color: #64748b;
    font-size: 0.68rem;
}

.cluster-garrison-stats strong {
    color: #be123c;
    font-size: 1rem;
    line-height: 1;
}

.cluster-garrison-stats a {
    margin-top: 0.2rem;
    color: #1d4ed8;
    font-weight: 700;
    text-decoration: none;
}

.cluster-scan-table {
    max-height: 20rem;
    overflow: auto;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0.5rem;
}

.cluster-scan-table th,
.cluster-scan-table td {
    font-size: 0.74rem;
}

.cluster-map-key {
    display: grid;
    gap: 0.7rem;
    color: #334155;
}

.cluster-map-key > div {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.key-dot,
.key-avatar,
.key-shield,
.key-system-square,
.key-outline {
    flex: 0 0 auto;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 999px;
}

.key-system {
    background: #2563eb;
}

.key-system-square {
    border-radius: 0.28rem;
    background: #c7d2fe;
    border: 1px solid rgba(79, 70, 229, 0.34);
}

.key-scan {
    background: #0f766e;
}

.key-avatar {
    background: url('../images/logo/logo_70.png') center / cover;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.14);
}

.key-shield {
    display: grid;
    place-items: center;
    background: #be123c;
    color: #fff;
    font-size: 0.65rem;
}

.key-outline {
    border: 3px solid #f59e0b;
    border-radius: 0.28rem;
}

.cluster-empty-state {
    padding: 1rem;
    color: #64748b;
}

@media (max-width: 1199.98px) {
    .cluster-status-shell {
        grid-template-columns: 1fr;
        height: auto;
    }

    .cluster-map-surface {
        min-height: 32rem;
    }

    .cluster-side-panel {
        min-height: 28rem;
    }
}

@media (max-width: 767.98px) {
    .cluster-status-header {
        align-items: stretch;
        flex-direction: column;
    }

    .cluster-status-header-actions,
    .cluster-status-toolbar,
    .cluster-status-filters {
        align-items: stretch;
        flex-direction: column;
    }

    .cluster-status-filters .form-control,
    .cluster-status-filters .form-select {
        width: 100%;
    }

    .cluster-mode-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cluster-map-surface {
        min-height: 28rem;
    }

    .cluster-status-map-scroll {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .cluster-mini-grid {
        grid-template-columns: 1fr;
    }
}

.metric-block {
    padding: 0.75rem 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.metric-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.metric-value.location-value {
    font-size: 0.95rem;
    font-weight: 500;
}

.metric-note {
    margin-top: 0.35rem;
}

.metric-progress-shell {
    margin-top: 0.35rem;
    padding: 0.18rem;
    display: flex;
    align-items: center;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.07);
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.35);
}

.metric-progress-fill {
    display: block;
    height: 0.5rem;
    border-radius: 999px;
    background: linear-gradient(90deg, #8e44ad, #3498db);
    transition: width 0.6s ease;
}

.metric-grid {
    display: grid;
    gap: 0.75rem;
}

@media (min-width: 576px) {
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .metric-grid {
        grid-template-columns: 1fr;
    }
}

.metric-cell {
    padding: 0.45rem 0.6rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 0.5rem;
}

.metric-cell .metric-value {
    font-size: 1rem;
}

.metric-cell .metric-note {
    margin-top: 0.3rem;
}

/* --- Banking overview --- */
.banking-summary {
    border-radius: 0.9rem;
    background: linear-gradient(135deg, #f7f8fb, #ffffff);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.banking-summary-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    align-items: center;
}

.banking-summary-item {
    padding: 0.5rem 0.75rem;
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 0.6rem;
}

.banking-account-card {
    border-radius: 0.9rem;
}

.banking-account-card.is-active {
    border: 1px solid rgba(13, 110, 253, 0.4);
    box-shadow: 0 6px 18px rgba(13, 110, 253, 0.08);
}

.banking-balance-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.banking-account-metrics {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.banking-account-details {
    background: rgba(15, 23, 42, 0.02);
    border-radius: 0.6rem;
    padding: 0.75rem;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.banking-wage {
    border-left: 4px solid rgba(13, 110, 253, 0.6);
}

.dashboard-list li:last-child {
    margin-bottom: 0 !important;
}

.dashboard-notification .notification-body {
    flex: 1 1 auto;
}

.notification-dot {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
}

.notification-dot.dot-info {
    background: rgba(13, 110, 253, 0.12);
    color: #0d6efd;
}

.notification-dot.dot-success {
    background: rgba(25, 135, 84, 0.15);
    color: #198754;
}

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

.notification-dot.dot-alert {
    background: rgba(253, 126, 20, 0.18);
    color: #fd7e14;
}

.notification-dot.dot-danger {
    background: rgba(220, 53, 69, 0.18);
    color: #dc3545;
}

.notification-dot.dot-notice {
    background: rgba(108, 117, 125, 0.12);
    color: #6c757d;
}

.command-panel {
    background: rgba(13, 110, 253, 0.05);
    border-color: rgba(13, 110, 253, 0.1);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.command-panel:hover {
    border-color: rgba(13, 110, 253, 0.35);
    box-shadow: 0 0.75rem 1.5rem rgba(13, 110, 253, 0.12);
}

.command-icon {
    width: 2.6rem;
    height: 2.6rem;
    font-size: 1.1rem;
}

.dashboard-definition dt {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.dashboard-definition dd {
    font-size: 0.85rem;
}

.extra-small {
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

@media (prefers-color-scheme: light) {
    .metric-block {
        border-color: rgba(0, 0, 0, 0.05);
        background: rgba(0, 0, 0, 0.015);
    }
    .metric-progress-shell {
        background: rgba(255, 255, 255, 0.8);
        border-color: rgba(15, 23, 42, 0.12);
        box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
    }
    .metric-cell {
        background: rgba(0, 0, 0, 0.02);
        border-color: rgba(0, 0, 0, 0.05);
    }
}

/* --- Sidebar enhancements --- */
.sidebar-profile {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
}

.sidebar-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.35);
}

.sidebar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-profile-actions .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    text-transform: uppercase;
}

.profile-assignment-list .list-group-item {
    background: transparent;
    border: none;
    padding-left: 0;
    padding-right: 0;
}

.profile-assignment-list .list-group-item + .list-group-item {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* --- Neshig hub map --- */
.neshig-map-wrapper {
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.5rem;
    background: #000;
    padding: 0.15rem 0.2rem;
    overflow: auto;
    max-height: 520px;
}

.neshig-map-table {
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: fixed;
    width: max-content;
    min-width: 100%;
    color: inherit;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.neshig-map-table th,
.neshig-map-table td {
    position: relative;
    width: 18px;
    height: 18px;
    padding: 0;
    text-align: center;
    font-size: 0.55rem;
    border: 0;
}

.neshig-map-table th.neshig-axis,
.neshig-map-table td.neshig-cell:not(.state-void)::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.8);
    pointer-events: none;
}

.neshig-map-table th.neshig-axis {
    background: rgba(0, 0, 0, 0.85);
}

.neshig-map-table .neshig-axis {
    position: sticky;
    top: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    color: #f5f5f5;
    font-weight: 600;
    z-index: 2;
}

.neshig-map-table .neshig-axis-y {
    left: 0;
    position: sticky;
    top: auto;
    z-index: 3;
}

.neshig-map-table .neshig-axis-corner {
    z-index: 4;
}

.neshig-cell {
    cursor: default;
    background: #404040;
}

.neshig-cell.state-void {
    background: transparent;
    border-color: transparent;
}

.neshig-cell.state-border,
.neshig-cell.state-open {
    background: #4a4a4a;
    border-color: #ffffff;
    cursor: pointer;
}

.neshig-cell.state-open.selectable:hover {
    box-shadow: inset 0 0 0 2px #ffffff;
}

.neshig-cell.state-claimed-pending {
    background: linear-gradient(135deg, #f7d564, #e2b735);
    color: #2e2105;
    border-color: #f0c75f;
}

.neshig-cell.state-claimed-approved {
    background: linear-gradient(135deg, #46c58f, #1f8d60);
    color: #0c2f1c;
    border-color: #29a876;
}

.neshig-cell.state-restricted {
    background: #000000;
    border-color: #ffffff;
    cursor: not-allowed;
}

.neshig-cell.state-owned {
    box-shadow: inset 0 0 0 2px #6ea8fe;
}

.neshig-cell.selected {
    outline: 2px solid #ffffff;
    outline-offset: -2px;
}

.neshig-legend-pill {
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.92);
}

.neshig-legend-open { background: #d0d0d0; }
.neshig-legend-pending { background: #f7d67a; }
.neshig-legend-approved { background: #b0eecf; }
.neshig-legend-restricted { background: #000000; color: #ffffff; }
.neshig-legend-owned { background: #cfe1ff; }

@media (prefers-color-scheme: light) {
    .neshig-map-wrapper {
        border-color: rgba(0, 0, 0, 0.1);
        background: #f8fafc;
    }
    .neshig-map-table th,
    .neshig-map-table td {
        border-color: rgba(0, 0, 0, 0.12);
    }
    .neshig-map-table .neshig-axis {
        background: #eef2f8;
        color: #2f3a4c;
    }
    .neshig-cell.state-border {
        background: #d7e1f4;
        border-color: #c3cfe8;
    }
    .neshig-cell.state-open {
        background: linear-gradient(135deg, #dbe8ff, #c9dafc);
        border-color: #b4c7f0;
    }
}

@media (prefers-color-scheme: light) {
    .profile-assignment-list .list-group-item + .list-group-item {
        border-top-color: rgba(0, 0, 0, 0.08);
    }
}

/* --- App design system foundation --- */
:root {
    --app-color-page: #f5f7fb;
    --app-color-surface: #ffffff;
    --app-color-surface-raised: #ffffff;
    --app-color-surface-muted: #f8fafc;
    --app-color-text: #0f172a;
    --app-color-text-soft: #334155;
    --app-color-text-muted: #64748b;
    --app-color-border: rgba(15, 23, 42, 0.1);
    --app-color-border-strong: rgba(15, 23, 42, 0.16);
    --app-color-primary: #1d4ed8;
    --app-color-primary-soft: #dbeafe;
    --app-color-accent: #b58110;
    --app-color-success: #198754;
    --app-color-warning: #b58110;
    --app-color-danger: #dc3545;
    --app-color-info: #0d6efd;
    --app-radius-xs: 0.28rem;
    --app-radius-sm: 0.42rem;
    --app-radius: 0.58rem;
    --app-radius-lg: 0.72rem;
    --app-shadow-rest: 0 0.4rem 1rem rgba(15, 23, 42, 0.06);
    --app-shadow-lift: 0 0.75rem 1.5rem rgba(15, 23, 42, 0.1);
    --app-shadow-float: 0 1rem 2rem rgba(15, 23, 42, 0.16);
    --app-space-1: 0.25rem;
    --app-space-2: 0.5rem;
    --app-space-3: 0.75rem;
    --app-space-4: 1rem;
    --app-space-5: 1.25rem;
}

.app-page-header,
.app-section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--app-space-3);
    margin: var(--app-space-4) 0 var(--app-space-3);
}

.app-page-title,
.app-section-title {
    margin: 0;
    color: var(--app-color-text);
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.2;
}

.app-page-title {
    font-size: clamp(1.35rem, 2vw, 1.85rem);
}

.app-section-title {
    font-size: 1rem;
}

.app-eyebrow,
.app-section-kicker {
    margin-bottom: 0.18rem;
    color: var(--app-color-text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.app-page-subtitle,
.app-section-subtitle {
    margin: 0.22rem 0 0;
    color: var(--app-color-text-muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.app-card,
.dashboard-card,
.officer-tool-card,
.defense-hub-card,
.production-hub-card,
.defense-cluster-map-card,
.defense-cluster-detail-card,
.banking-account-card {
    border: 1px solid var(--app-color-border);
    border-radius: var(--app-radius);
    background: var(--app-color-surface);
    color: var(--app-color-text-soft);
    box-shadow: var(--app-shadow-rest);
}

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

.app-card-header,
.app-toolbar,
.app-filter-bar,
.app-section-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--app-space-2);
    padding: 0.62rem 0.75rem;
    border: 1px solid var(--app-color-border);
    border-radius: var(--app-radius);
    background: var(--app-color-surface-muted);
}

.app-card-header {
    border-width: 0 0 1px;
    border-radius: var(--app-radius) var(--app-radius) 0 0;
}

.app-card-body {
    padding: var(--app-space-4);
}

.app-toolbar,
.app-filter-bar {
    flex-wrap: wrap;
}

.app-toolbar-group,
.app-actions,
.app-filter-group {
    display: inline-flex;
    align-items: center;
    gap: var(--app-space-2);
    flex-wrap: wrap;
}

.app-filter-bar .form-control,
.app-filter-bar .form-select,
.app-toolbar .form-control,
.app-toolbar .form-select {
    width: auto;
    min-width: 10rem;
}

.app-stat-grid,
.metric-grid {
    display: grid;
    gap: 0.65rem;
}

.app-stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.app-stat,
.metric-cell,
.metric-block,
.banking-summary-item,
.cluster-mini-stat {
    min-width: 0;
    padding: 0.58rem 0.7rem;
    border: 1px solid var(--app-color-border);
    border-radius: var(--app-radius-sm);
    background: var(--app-color-surface-muted);
    color: var(--app-color-text-soft);
}

.app-stat-label,
.metric-label {
    margin-bottom: 0.18rem;
    color: var(--app-color-text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.055em;
    line-height: 1.2;
    text-transform: uppercase;
}

.app-stat-value,
.metric-value {
    color: var(--app-color-text);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
}

.app-stat-note,
.metric-note {
    margin-top: 0.24rem;
    color: var(--app-color-text-muted);
    font-size: 0.8rem;
    line-height: 1.35;
}

.app-chip,
.hub-access-chip,
.cluster-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    min-height: 1.5rem;
    padding: 0.22rem 0.52rem;
    border: 1px solid var(--app-color-border);
    border-radius: 999px;
    background: var(--app-color-surface-muted);
    color: var(--app-color-text-soft);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.15;
    text-decoration: none;
}

.app-chip:hover,
a.app-chip:hover,
a.cluster-chip:hover {
    border-color: var(--app-color-border-strong);
    color: var(--app-color-primary);
    text-decoration: none;
}

.app-status-dot {
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
    background: var(--app-color-text-muted);
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.14);
    vertical-align: 0.02rem;
}

.app-status-dot.status-success { background: var(--app-color-success); box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.15); }
.app-status-dot.status-warning { background: var(--app-color-warning); box-shadow: 0 0 0 3px rgba(181, 129, 16, 0.16); }
.app-status-dot.status-danger { background: var(--app-color-danger); box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.14); }
.app-status-dot.status-info { background: var(--app-color-info); box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.14); }

.app-empty-state,
.cluster-empty-state {
    padding: var(--app-space-4);
    border: 1px dashed var(--app-color-border-strong);
    border-radius: var(--app-radius);
    background: var(--app-color-surface-muted);
    color: var(--app-color-text-muted);
    text-align: center;
}

.app-table-shell {
    overflow: auto;
    border: 1px solid var(--app-color-border);
    border-radius: var(--app-radius);
    background: var(--app-color-surface);
}

.app-data-table,
.table-responsive > .table:not(.neshig-map-table) {
    margin-bottom: 0;
    color: var(--app-color-text-soft);
    vertical-align: middle;
}

.app-data-table > :not(caption) > * > *,
.table-responsive > .table:not(.neshig-map-table) > :not(caption) > * > * {
    padding: 0.56rem 0.68rem;
    border-color: var(--app-color-border);
    vertical-align: middle;
}

.app-data-table.table-sm > :not(caption) > * > *,
.table-responsive > .table-sm:not(.neshig-map-table) > :not(caption) > * > * {
    padding: 0.4rem 0.52rem;
}

.app-data-table thead th,
.app-data-table thead td,
.table-responsive > .table:not(.neshig-map-table) thead th,
.table-responsive > .table:not(.neshig-map-table) thead td {
    color: var(--app-color-text-muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.035em;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-data-table tbody tr,
.table-responsive > .table:not(.neshig-map-table) tbody tr {
    transition: background-color 0.12s ease;
}

.app-data-table.table-hover > tbody > tr:hover > *,
.table-responsive > .table-hover:not(.neshig-map-table) > tbody > tr:hover > * {
    background-color: rgba(13, 110, 253, 0.06);
}

.app-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.app-field {
    min-width: 0;
}

.app-field-label {
    display: block;
    margin-bottom: 0.28rem;
    color: var(--app-color-text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.app-help {
    margin-top: 0.28rem;
    color: var(--app-color-text-muted);
    font-size: 0.8rem;
    line-height: 1.35;
}

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

.form-control-sm,
.form-select-sm,
.input-group-sm > .form-control,
.input-group-sm > .form-select,
.input-group-sm > .input-group-text {
    min-height: 1.86rem;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(13, 110, 253, 0.42);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.12);
}

.btn {
    border-radius: var(--app-radius-sm);
    font-weight: 600;
}

.badge {
    border-radius: 0.36rem;
}

/* --- Member banking command surface --- */
.banking-dashboard {
    padding-bottom: 1.5rem;
}

.banking-dashboard .card {
    border-color: var(--app-color-border);
    border-radius: var(--app-radius-lg);
    box-shadow: 0 0.35rem 1rem rgba(15, 23, 42, 0.055);
}

.banking-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) auto;
    gap: 0.75rem 1rem;
    align-items: start;
    padding: 0.95rem;
    border: 1px solid var(--app-color-border);
    border-radius: var(--app-radius-lg);
    background:
        linear-gradient(90deg, rgba(29, 78, 216, 0.08), rgba(181, 129, 16, 0.08)),
        var(--app-color-surface);
    box-shadow: 0 0.45rem 1.15rem rgba(15, 23, 42, 0.06);
}

.banking-hero h1 {
    margin: 0;
    color: var(--app-color-text);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.1;
}

.banking-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.45rem;
    color: var(--app-color-text-muted);
    font-size: 0.84rem;
}

.banking-hero-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 1.5rem;
    padding: 0.18rem 0.48rem;
    border: 1px solid var(--app-color-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.68);
}

.banking-hero-actions,
.banking-mode-switch,
.banking-control-actions,
.banking-inline-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.banking-hero > .banking-summary-grid {
    grid-column: 1 / -1;
}

.banking-balance-strip {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
    gap: 0.45rem;
}

.banking-balance-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    min-width: 0;
    min-height: 2.15rem;
    padding: 0.38rem 0.55rem;
    border: 1px solid var(--app-color-border);
    border-radius: var(--app-radius-sm);
    background: rgba(255, 255, 255, 0.62);
}

.banking-balance-chip.is-active {
    border-color: rgba(29, 78, 216, 0.36);
    background: rgba(29, 78, 216, 0.08);
}

.banking-balance-chip span {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    color: var(--app-color-text-muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.banking-balance-chip strong {
    flex: 0 1 auto;
    min-width: 0;
    color: var(--app-color-text);
    font-size: 0.84rem;
    font-weight: 900;
    line-height: 1.15;
    overflow-wrap: anywhere;
    text-align: right;
}

.banking-hero-attention {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 0.72rem;
    border-top: 1px solid var(--app-color-border);
}

.banking-attention-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.72rem 0.85rem;
    border: 1px solid var(--app-color-border);
    border-radius: var(--app-radius-lg);
    background: var(--app-color-surface);
    box-shadow: var(--app-shadow-rest);
}

.banking-attention-title,
.banking-attention-items,
.banking-attention-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.banking-attention-title {
    color: var(--app-color-text);
    font-weight: 800;
}

.banking-attention-items {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.banking-attention-chip {
    min-height: 1.9rem;
    padding: 0.28rem 0.62rem;
    border: 1px solid var(--app-color-border);
    border-radius: 999px;
    background: var(--app-color-surface-muted);
    color: var(--app-color-text-soft);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.1;
    text-decoration: none;
}

button.banking-attention-chip {
    cursor: pointer;
}

.banking-attention-chip:hover,
a.banking-attention-chip:hover,
button.banking-attention-chip:hover {
    border-color: var(--app-color-border-strong);
    color: var(--app-color-primary);
    text-decoration: none;
}

.banking-attention-chip.is-warning {
    border-color: rgba(181, 129, 16, 0.28);
    background: rgba(181, 129, 16, 0.1);
    color: #8a610c;
}

.banking-attention-chip.is-success {
    border-color: rgba(25, 135, 84, 0.24);
    background: rgba(25, 135, 84, 0.1);
    color: var(--app-color-success);
}

.banking-attention-chip.is-muted {
    color: var(--app-color-text-muted);
}

.banking-active-strip,
.banking-control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.banking-active-balance {
    min-width: min(100%, 18rem);
}

.banking-focus-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(20rem, 0.72fr);
    gap: 1rem;
    align-items: stretch;
}

.banking-focus-card,
.banking-control-card {
    height: 100%;
}

.banking-account-drawer {
    --bs-offcanvas-width: min(36rem, 100vw);
    color: var(--app-color-text-soft);
}

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

.banking-account-drawer .offcanvas-header {
    border-bottom: 1px solid var(--app-color-border);
}

.banking-account-drawer .banking-account-grid .col-12 {
    width: 100%;
}

.banking-account-drawer-summary,
.banking-account-tools,
.banking-command-accountbar,
.banking-accountbar-main,
.banking-accountbar-stats,
.banking-accountbar-actions,
.banking-account-row-main,
.banking-account-row-meta,
.banking-account-row-actions,
.banking-worklist-header,
.banking-worklist-kpi,
.banking-tag-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.banking-account-drawer-summary {
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--app-color-border);
    border-radius: var(--app-radius);
    background: var(--app-color-surface-muted);
}

.banking-account-drawer-summary div {
    display: grid;
    gap: 0.08rem;
}

.banking-account-drawer-summary span,
.banking-worklist-kpi span {
    color: var(--app-color-text-muted);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.banking-account-drawer-summary strong,
.banking-worklist-kpi strong {
    color: var(--app-color-text);
    font-size: 0.9rem;
}

.banking-account-tools {
    margin-bottom: 0.75rem;
}

.banking-account-tools .form-select {
    max-width: 8.5rem;
}

.banking-account-list {
    display: grid;
    gap: 0.55rem;
}

.banking-account-row {
    padding: 0.72rem;
    border: 1px solid var(--app-color-border);
    border-radius: var(--app-radius);
    background: var(--app-color-surface-muted);
}

.banking-account-row.is-active {
    border-color: rgba(29, 78, 216, 0.4);
    background: rgba(29, 78, 216, 0.045);
}

.banking-account-row-main {
    justify-content: space-between;
    gap: 1rem;
}

.banking-account-row-name {
    min-width: 0;
}

.banking-account-row-balance {
    color: var(--app-color-text);
    font-weight: 900;
    white-space: nowrap;
}

.banking-account-row-meta {
    flex-wrap: wrap;
    margin-top: 0.45rem;
    color: var(--app-color-text-muted);
    font-size: 0.76rem;
}

.banking-account-row-meta span:not(.badge) {
    padding: 0.14rem 0.42rem;
    border: 1px solid var(--app-color-border);
    border-radius: 999px;
    background: var(--app-color-surface);
}

.banking-account-row-actions {
    flex-wrap: wrap;
    margin-top: 0.55rem;
}

.banking-account-row .banking-account-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--app-color-border);
}

.banking-account-row .banking-account-details div {
    padding: 0.48rem 0.55rem;
    border: 1px solid var(--app-color-border);
    border-radius: var(--app-radius-sm);
    background: var(--app-color-surface);
}

.banking-account-row .banking-account-details span {
    display: block;
    color: var(--app-color-text-muted);
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
}

.banking-account-row .banking-account-details strong {
    display: block;
    margin-top: 0.1rem;
    color: var(--app-color-text);
    font-size: 0.82rem;
}

.banking-summary .card-body,
.banking-section-card .card-body,
.banking-action-card .card-body,
.banking-control-card .card-body {
    padding: 1rem;
}

.banking-dashboard .banking-summary {
    background: var(--app-color-surface);
}

.banking-summary-grid {
    width: 100%;
}

.banking-summary-item .metric-value {
    overflow-wrap: anywhere;
}

.banking-card-header {
    border-color: var(--app-color-border);
    background: var(--app-color-surface-muted);
}

.banking-account-grid .col-12 {
    display: flex;
}

.banking-account-card {
    width: 100%;
    overflow: hidden;
    transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.banking-account-card:hover {
    transform: translateY(-1px);
}

.banking-account-card .card-header {
    border-color: var(--app-color-border);
    background: var(--app-color-surface-muted);
}

.banking-account-card .display-6 {
    color: var(--app-color-text);
    font-size: 1.75rem;
    line-height: 1.05;
}

.banking-account-card.is-active {
    border-color: rgba(29, 78, 216, 0.48);
    box-shadow: 0 0.75rem 1.5rem rgba(29, 78, 216, 0.1);
}

.banking-account-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.banking-account-details {
    border-top: 1px solid var(--app-color-border) !important;
}

.banking-control-card {
    border-left: 0;
}

.banking-control-card .banking-control-row {
    align-items: stretch;
    flex-direction: column;
}

.banking-control-card .banking-control-actions,
.banking-control-card .banking-inline-form,
.banking-control-card .banking-inline-form .form-select,
.banking-control-card .banking-control-actions .btn {
    width: 100%;
}

.banking-control-copy {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.banking-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: 5.8rem;
    min-height: 1.8rem;
    padding: 0.25rem 0.56rem;
    border: 1px solid var(--app-color-border);
    border-radius: 999px;
    background: var(--app-color-surface-muted);
    color: var(--app-color-text-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.banking-status-pill.is-on {
    border-color: rgba(25, 135, 84, 0.24);
    background: rgba(25, 135, 84, 0.1);
    color: var(--app-color-success);
}

.banking-inline-form .form-select {
    min-width: 16rem;
}

.banking-mode-switch {
    padding: 0.18rem;
    border: 1px solid var(--app-color-border);
    border-radius: var(--app-radius);
    background: var(--app-color-surface);
}

.banking-mode-switch .btn {
    min-width: 5.8rem;
}

.banking-action-card {
    overflow: hidden;
}

.banking-command-card {
    margin-bottom: 1rem !important;
}

.banking-command-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.banking-command-accountbar {
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding: 0.72rem;
    border: 1px solid var(--app-color-border);
    border-radius: var(--app-radius);
    background: var(--app-color-surface-muted);
}

.banking-accountbar-main {
    min-width: 0;
    flex-wrap: wrap;
}

.banking-accountbar-title {
    color: var(--app-color-text);
    font-weight: 900;
}

.banking-accountbar-stats {
    flex-wrap: wrap;
}

.banking-accountbar-stats span {
    padding: 0.18rem 0.48rem;
    border: 1px solid var(--app-color-border);
    border-radius: 999px;
    background: var(--app-color-surface);
    color: var(--app-color-text-muted);
    font-size: 0.76rem;
    font-weight: 800;
}

.banking-accountbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.banking-wage-drawer {
    margin-bottom: 0.75rem;
    padding: 0.72rem;
    border: 1px solid var(--app-color-border);
    border-radius: var(--app-radius);
    background: var(--app-color-surface-muted);
}

.banking-action-tabs {
    gap: 0.4rem;
    margin-bottom: 0.85rem;
    padding: 0.22rem;
    border: 1px solid var(--app-color-border);
    border-radius: var(--app-radius);
    background: var(--app-color-surface-muted);
}

.banking-action-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 2rem;
    border-radius: var(--app-radius-sm);
    color: var(--app-color-text-soft);
    font-weight: 700;
}

.banking-action-tabs .nav-link.active {
    background: var(--app-color-primary);
    color: #fff;
}

.banking-action-tab-content > .banking-action-pane {
    padding: 0.9rem;
}

.banking-compact-form {
    display: grid;
    grid-template-columns: minmax(11rem, 0.6fr) minmax(14rem, 1fr) auto;
    gap: 0.75rem;
    align-items: end;
}

.banking-compact-form textarea {
    min-height: 2.4rem;
}

.banking-compact-form .btn {
    min-width: 8.5rem;
}

.banking-amount-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.4rem;
}

.banking-amount-chip {
    min-height: 1.35rem;
    padding: 0.1rem 0.42rem;
    border: 1px solid var(--app-color-border);
    border-radius: 999px;
    background: var(--app-color-surface);
    color: var(--app-color-text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
}

.banking-amount-chip:hover {
    border-color: var(--app-color-primary);
    color: var(--app-color-primary);
}

.banking-form-note {
    align-self: center;
    color: var(--app-color-text-muted);
    font-size: 0.82rem;
}

.banking-confirm-summary {
    margin-top: 0.7rem;
    padding: 0.58rem 0.68rem;
    border: 1px solid var(--app-color-border);
    border-radius: var(--app-radius-sm);
    background: var(--app-color-surface);
    color: var(--app-color-text-soft);
    font-size: 0.84rem;
    font-weight: 700;
}

.banking-forms-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.banking-action-pane {
    min-width: 0;
    padding: 0.85rem;
    border: 1px solid var(--app-color-border);
    border-radius: var(--app-radius);
    background: var(--app-color-surface-muted);
}

.banking-action-pane h3 {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.75rem;
    color: var(--app-color-text);
    font-size: 0.92rem;
    font-weight: 700;
}

.banking-action-pane .form-label {
    color: var(--app-color-text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.banking-inline-alert {
    border-radius: var(--app-radius);
}

.banking-recent-tags {
    margin-bottom: 0.85rem;
}

.banking-tag-row {
    justify-content: space-between;
    padding: 0.45rem 0;
    border-top: 1px solid var(--app-color-border);
}

.banking-setup-panel,
.banking-auth-callout {
    border: 1px solid var(--app-color-border);
    border-radius: var(--app-radius-lg);
    background: var(--app-color-surface);
    box-shadow: var(--app-shadow-rest);
}

.banking-setup-panel {
    padding: 1rem;
}

.banking-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.banking-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.banking-choice-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.85rem;
    border: 1px solid var(--app-color-border);
    border-radius: var(--app-radius);
    background: var(--app-color-surface-muted);
}

.banking-choice-card.is-primary {
    border-color: rgba(29, 78, 216, 0.22);
    background: rgba(29, 78, 216, 0.05);
}

.banking-choice-card h2,
.banking-auth-callout h1 {
    margin: 0;
    color: var(--app-color-text);
    font-size: 0.98rem;
    font-weight: 700;
}

.banking-choice-card p,
.banking-auth-callout p {
    margin: 0.16rem 0 0;
    color: var(--app-color-text-muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.banking-choice-icon,
.banking-callout-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: var(--app-radius-sm);
    background: rgba(29, 78, 216, 0.1);
    color: var(--app-color-primary);
}

.banking-auth-callout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
}

.banking-auth-copy {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.banking-section-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.banking-worklist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 23rem), 1fr));
    gap: 0.85rem;
    align-items: start;
}

.banking-worklist-card {
    min-width: 0;
    margin-bottom: 0 !important;
}

.banking-worklist-card .card-body {
    max-height: 34rem;
    overflow: auto;
}

.banking-worklist-header {
    justify-content: space-between;
    gap: 0.75rem;
}

.banking-worklist-kpi {
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    margin-left: auto;
}

.banking-section-card .card-body.collapse:not(.show) {
    display: none;
}

.banking-subsection-head,
.banking-loan-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.banking-subsection-head {
    margin-bottom: 0.65rem;
}

.banking-loan-spotlight,
.banking-loan-card,
.banking-empty-state {
    border: 1px solid var(--app-color-border);
    border-radius: var(--app-radius);
    background: var(--app-color-surface-muted);
}

.banking-loan-spotlight,
.banking-loan-card {
    padding: 0.75rem;
}

.banking-loan-list {
    display: grid;
    gap: 0.65rem;
}

.banking-loan-list.is-compact {
    gap: 0.5rem;
}

.banking-loan-title {
    color: var(--app-color-text);
    font-weight: 800;
}

.banking-loan-meta,
.banking-loan-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.65rem;
}

.banking-loan-meta span {
    padding: 0.18rem 0.45rem;
    border: 1px solid var(--app-color-border);
    border-radius: 999px;
    background: var(--app-color-surface);
    color: var(--app-color-text-muted);
    font-size: 0.78rem;
}

.banking-loan-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.banking-loan-stats div {
    min-width: 0;
    padding: 0.55rem 0.62rem;
    border: 1px solid var(--app-color-border);
    border-radius: var(--app-radius-sm);
    background: var(--app-color-surface);
}

.banking-loan-stats span {
    display: block;
    color: var(--app-color-text-muted);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.banking-loan-stats strong {
    display: block;
    margin-top: 0.12rem;
    color: var(--app-color-text);
    font-size: 0.86rem;
}

.banking-loan-note,
.banking-empty-state {
    color: var(--app-color-text-muted);
    font-size: 0.82rem;
}

.banking-loan-note {
    margin-top: 0.65rem;
    font-weight: 700;
}

.banking-empty-state {
    padding: 0.72rem 0.75rem;
}

.banking-bill-list,
.banking-ledger-list {
    display: grid;
    gap: 0.65rem;
}

.banking-bill-card {
    padding: 0.75rem;
    border: 1px solid var(--app-color-border);
    border-radius: var(--app-radius);
    background: var(--app-color-surface-muted);
}

.banking-bill-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
}

.banking-bill-title {
    min-width: 0;
    overflow-wrap: break-word;
    word-break: normal;
}

.banking-bill-amount {
    text-align: right;
}

.banking-bill-actions,
.banking-bill-pay-form {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.banking-bill-actions {
    grid-column: 1 / -1;
}

.banking-bill-pay-form .form-select {
    min-width: 11rem;
}

.banking-bill-details,
.banking-ledger-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--app-color-border);
    color: var(--app-color-text-muted);
    font-size: 0.78rem;
}

.banking-bill-details span,
.banking-ledger-details span {
    max-width: 100%;
    padding: 0.18rem 0.45rem;
    border: 1px solid var(--app-color-border);
    border-radius: 999px;
    background: var(--app-color-surface);
    overflow-wrap: break-word;
    word-break: normal;
}

.banking-ledger-entry {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.7rem;
}

.banking-ledger-marker {
    width: 0.74rem;
    height: 0.74rem;
    margin-top: 0.38rem;
    border-radius: 999px;
    background: var(--app-color-danger);
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.1);
}

.banking-ledger-entry.is-credit .banking-ledger-marker {
    background: var(--app-color-success);
    box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.12);
}

.banking-ledger-body {
    min-width: 0;
    padding: 0.7rem;
    border: 1px solid var(--app-color-border);
    border-radius: var(--app-radius);
    background: var(--app-color-surface-muted);
}

.banking-ledger-main,
.banking-ledger-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.banking-ledger-title {
    color: var(--app-color-text);
    font-weight: 800;
    text-transform: capitalize;
}

.banking-ledger-amount {
    color: var(--app-color-danger);
    font-weight: 900;
    white-space: nowrap;
}

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

.banking-ledger-meta {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: 0.42rem;
    color: var(--app-color-text-muted);
    font-size: 0.8rem;
}

@media (max-width: 991.98px) {
    .banking-hero,
    .banking-focus-grid,
    .banking-choice-grid,
    .banking-forms-grid,
    .banking-worklist-grid,
    .banking-compact-form {
        grid-template-columns: 1fr;
    }

    .banking-command-head,
    .banking-hero-actions {
        justify-content: flex-start;
    }

    .banking-active-strip,
    .banking-control-row,
    .banking-attention-strip,
    .banking-hero-attention,
    .banking-command-accountbar,
    .banking-auth-callout {
        align-items: stretch;
        flex-direction: column;
    }

    .banking-attention-items,
    .banking-accountbar-actions,
    .banking-worklist-header {
        justify-content: flex-start;
    }

    .banking-bill-main,
    .banking-loan-stats,
    .banking-account-row .banking-account-details {
        grid-template-columns: 1fr;
    }

    .banking-ledger-main,
    .banking-loan-main,
    .banking-subsection-head,
    .banking-account-row-main {
        align-items: flex-start;
        flex-direction: column;
    }

    .banking-worklist-kpi {
        align-items: flex-start;
        margin-left: 0;
    }

    .banking-bill-amount,
    .banking-bill-actions,
    .banking-bill-pay-form,
    .banking-ledger-amount,
    .banking-account-row-balance {
        justify-content: flex-start;
        text-align: left;
    }

    .banking-control-actions,
    .banking-inline-form,
    .banking-inline-form .form-select,
    .banking-control-actions .btn,
    .banking-account-tools .form-select,
    .banking-compact-form .btn,
    .banking-bill-pay-form,
    .banking-bill-pay-form .form-select,
    .banking-auth-callout .btn {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .banking-hero h1 {
        font-size: 1.65rem;
    }

    .banking-account-metrics {
        grid-template-columns: 1fr;
    }

    .banking-choice-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .banking-choice-card .btn {
        grid-column: 1 / -1;
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .app-page-header,
    .app-section-header {
        align-items: stretch;
        flex-direction: column;
    }

    .app-toolbar,
    .app-filter-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .app-toolbar-group,
    .app-actions,
    .app-filter-group,
    .app-filter-bar .form-control,
    .app-filter-bar .form-select,
    .app-toolbar .form-control,
    .app-toolbar .form-select {
        width: 100%;
    }
}

/* --- Cluster map command surface polish --- */
.cluster-status-container {
    --cluster-surface: var(--app-color-surface);
    --cluster-surface-muted: var(--app-color-surface-muted);
    --cluster-line: var(--app-color-border);
    --cluster-line-strong: var(--app-color-border-strong);
    --cluster-text: var(--app-color-text);
    --cluster-text-soft: var(--app-color-text-soft);
    --cluster-text-muted: var(--app-color-text-muted);
    padding-bottom: 1.25rem;
}

.cluster-status-header {
    margin: 0.95rem 0 0.75rem;
}

.cluster-status-title {
    color: var(--cluster-text);
}

.cluster-status-subtitle {
    color: var(--cluster-text-muted);
}

.cluster-status-header-actions {
    align-items: center;
}

.cluster-mode-switch {
    padding: 0.18rem;
    border: 1px solid var(--cluster-line);
    border-radius: var(--app-radius);
    background: var(--cluster-surface-muted);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.cluster-mode-switch .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    border-radius: var(--app-radius-sm) !important;
    border-color: transparent;
    white-space: nowrap;
}

.cluster-command-bar {
    align-items: center;
    padding: 0.58rem;
    margin-bottom: 0.75rem;
    border-radius: var(--app-radius);
}

.cluster-status-metrics {
    display: flex;
    align-items: center;
    gap: 0.42rem;
}

.cluster-status-metrics span {
    min-height: 1.95rem;
    padding: 0.24rem 0.55rem;
    border: 1px solid var(--cluster-line);
    border-radius: 999px;
    background: var(--cluster-surface-muted);
    color: var(--cluster-text-muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.cluster-status-metrics strong {
    color: var(--cluster-text);
    font-size: 0.92rem;
}

.cluster-status-filters {
    justify-content: flex-end;
}

.cluster-status-filters .form-control,
.cluster-status-filters .form-select {
    width: clamp(10rem, 16vw, 13rem);
}

.cluster-pin-toggle {
    min-height: 2rem;
    padding-right: 0.62rem;
    border-color: var(--cluster-line);
    background: var(--cluster-surface-muted);
    color: var(--cluster-text-soft);
    font-weight: 700;
}

.cluster-status-shell {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
    gap: 0.75rem;
    min-height: 35rem;
    height: clamp(36rem, calc(100vh - 15.25rem), 58rem);
}

.cluster-map-surface,
.cluster-side-panel {
    border-color: var(--cluster-line);
    border-radius: var(--app-radius-lg);
    box-shadow: var(--app-shadow-rest);
}

.cluster-map-workspace {
    background:
        linear-gradient(180deg, rgba(248, 250, 252, 0.86), rgba(241, 245, 249, 0.98)),
        radial-gradient(circle at 18px 18px, rgba(37, 99, 235, 0.1) 1px, transparent 1px);
    background-size: auto, 36px 36px;
}

.cluster-map-surface-tools {
    top: 0.62rem;
    left: 0.62rem;
    padding: 0.18rem;
    border: 1px solid var(--cluster-line);
    border-radius: var(--app-radius);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--app-shadow-rest);
    backdrop-filter: blur(10px);
}

.cluster-map-surface-tools .btn {
    min-width: 2rem;
    border-color: transparent;
    background: transparent;
    color: var(--cluster-text-soft);
}

.cluster-map-surface-tools .btn:hover,
.cluster-map-surface-tools .btn:focus {
    background: var(--app-color-primary-soft);
    color: var(--app-color-primary);
}

.cluster-status-map-scroll {
    padding: 3.35rem 1.05rem 1.05rem;
}

.cluster-status-map-layer {
    --cluster-gap: 3px;
}

.cluster-status-cell {
    border-color: rgba(100, 116, 139, 0.22);
    border-radius: 0.34rem;
    background: #eef2f7;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.cluster-status-cell:hover,
.cluster-status-cell:focus-visible {
    border-color: rgba(37, 99, 235, 0.68);
    box-shadow: 0 0.45rem 0.9rem rgba(15, 23, 42, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.cluster-status-cell.has-system {
    background: linear-gradient(135deg, #e0f2fe, #dbeafe);
}

.cluster-status-cell.has-named-system {
    background: linear-gradient(135deg, #c7d2fe, #dbeafe);
    border-color: rgba(79, 70, 229, 0.42);
}

.cluster-status-cell.has-members.has-system {
    background: linear-gradient(135deg, #dbeafe, #f8fafc 72%);
}

.cluster-status-cell.has-members.has-named-system {
    background: linear-gradient(135deg, #c7d2fe, #f8fafc 72%);
}

.cluster-status-cell.is-selected {
    border-color: rgba(245, 158, 11, 0.95);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25), 0 0.55rem 1rem rgba(15, 23, 42, 0.18);
}

.cluster-member-pin {
    top: calc(50% - 0.08rem);
    filter: drop-shadow(0 0.22rem 0.24rem rgba(15, 23, 42, 0.2));
}

.cluster-member-pin::before {
    inset: -0.14rem;
    border-color: rgba(37, 99, 235, 0.22);
}

.cluster-member-pin::after {
    bottom: -0.4rem;
}

.cluster-member-stack img {
    border-width: 2px;
}

.cluster-status-indicators {
    top: 0.14rem;
    right: 0.14rem;
}

.cluster-status-garrison-marker {
    width: 1.1rem;
    height: 1.1rem;
    background: rgba(255, 241, 242, 0.96);
    box-shadow: 0 0 0 2px rgba(190, 18, 60, 0.08);
}

.cluster-status-scan-marker {
    width: 0.44rem;
    height: 0.44rem;
    margin-right: 0.33rem;
}

.cluster-hover-card {
    width: min(20rem, calc(100vw - 1.5rem));
    padding: 0.7rem 0.78rem;
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow-float);
    line-height: 1.35;
}

.cluster-hover-card > div:not(.cluster-hover-title):not(.cluster-hover-members) {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.18rem 0;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.cluster-hover-card > div:not(.cluster-hover-title):not(.cluster-hover-members):first-of-type {
    border-top: 0;
}

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

.cluster-hover-title {
    margin-bottom: 0.45rem;
    font-size: 0.92rem;
}

.cluster-hover-members span {
    min-height: 1.35rem;
    font-weight: 700;
}

.cluster-details-dock {
    background: var(--cluster-surface);
}

.cluster-side-header {
    align-items: center;
    min-height: 4.1rem;
    padding: 0.78rem 0.85rem;
    background: var(--cluster-surface-muted);
}

.cluster-side-header h2 {
    font-size: 1rem;
}

.cluster-side-tabs {
    padding: 0.22rem;
    gap: 0.18rem;
    border-bottom-color: var(--cluster-line);
    background: var(--cluster-surface-muted);
}

.cluster-side-tabs button {
    min-height: 2rem;
    border-radius: var(--app-radius-sm);
    border-bottom: 0;
}

.cluster-side-tabs button.active {
    color: var(--app-color-primary);
    background: var(--app-color-primary-soft);
}

.cluster-side-content {
    padding: 0.78rem;
}

.cluster-panel-section + .cluster-panel-section {
    margin-top: 0.85rem;
}

.cluster-panel-section h3 {
    margin-bottom: 0.48rem;
    font-size: 0.76rem;
    letter-spacing: 0.055em;
}

.cluster-panel-note,
.cluster-mini-stat,
.cluster-member-row,
.cluster-garrison-row,
.cluster-scan-table {
    border-color: var(--cluster-line);
    border-radius: var(--app-radius-sm);
}

.cluster-mini-grid {
    gap: 0.48rem;
}

.cluster-mini-stat {
    padding: 0.5rem 0.58rem;
}

.cluster-row-list {
    gap: 0.48rem;
}

.cluster-member-row,
.cluster-garrison-row {
    gap: 0.56rem;
    padding: 0.56rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

.cluster-member-row > img {
    width: 2.1rem;
    height: 2.1rem;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.1);
}

.cluster-row-title {
    font-size: 0.86rem;
}

.cluster-row-subtitle,
.cluster-row-meta,
.cluster-garrison-types {
    font-size: 0.72rem;
}

.cluster-health {
    width: 3.35rem;
}

.cluster-garrison-stats strong {
    font-size: 1.05rem;
}

.cluster-scan-table {
    background: var(--cluster-surface);
}

@media (max-width: 1399.98px) {
    .cluster-status-shell {
        grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    }
}

@media (max-width: 1199.98px) {
    .cluster-status-shell {
        grid-template-columns: 1fr;
        height: auto;
    }

    .cluster-map-surface {
        min-height: min(38rem, 68vh);
    }

    .cluster-side-panel {
        min-height: 24rem;
    }
}

@media (max-width: 767.98px) {
    .cluster-status-header-actions {
        align-items: stretch;
    }

    .cluster-mode-switch {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .cluster-mode-switch .btn {
        min-width: 0;
    }

    .cluster-command-bar {
        align-items: stretch;
    }

    .cluster-status-metrics {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .cluster-status-metrics span {
        justify-content: center;
    }

    .cluster-status-filters {
        width: 100%;
    }

    .cluster-pin-toggle {
        justify-content: center;
        width: 100%;
    }

    .cluster-map-surface {
        min-height: 30rem;
    }

    .cluster-status-map-scroll {
        padding: 3.15rem 0.72rem 0.72rem;
    }

    .cluster-side-tabs button {
        font-size: 0.72rem;
    }
}

.cluster-status-cell::before {
    content: '';
    position: absolute;
    inset: 0.16rem;
    z-index: 0;
    border-radius: 0.24rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s ease, background-color 0.12s ease;
}

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

.cluster-status-cell.activity-level-2::before {
    background: rgba(20, 184, 166, 0.22);
    opacity: 1;
}

.cluster-status-cell.activity-level-3::before {
    background: rgba(245, 158, 11, 0.25);
    opacity: 1;
}

.cluster-status-cell.activity-level-4::before {
    background: rgba(225, 29, 72, 0.26);
    opacity: 1;
}

.cluster-status-cell.is-layer-muted,
.cluster-status-cell.mode-members:not(.has-members),
.cluster-status-cell.mode-defense:not(.has-garrison),
.cluster-status-cell.mode-production:not(.has-production),
.cluster-status-cell.mode-assets:not(.has-assets),
.cluster-status-cell.mode-mining:not(.has-mining) {
    opacity: 0.24;
}

.cluster-status-cell.mode-defense.has-garrison,
.cluster-status-cell.mode-production.has-production,
.cluster-status-cell.mode-assets.has-assets,
.cluster-status-cell.mode-mining.has-mining {
    opacity: 1;
}

.cluster-status-cell.mode-defense.has-garrison {
    border-color: rgba(190, 18, 60, 0.42);
}

.cluster-status-cell.mode-production.has-production {
    border-color: rgba(37, 99, 235, 0.46);
}

.cluster-status-cell.mode-assets.has-assets {
    border-color: rgba(79, 70, 229, 0.46);
}

.cluster-status-cell.mode-mining.has-mining {
    border-color: rgba(15, 118, 110, 0.48);
}

.cluster-operation-markers {
    position: absolute;
    left: 0.16rem;
    bottom: 0.14rem;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 0.1rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s ease;
}

.cluster-status-coord {
    z-index: 6;
}

.cluster-operation-marker {
    display: grid;
    place-items: center;
    width: 0.66rem;
    height: 0.66rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    color: #ffffff;
    font-size: 0.42rem;
    line-height: 1;
    opacity: 0.82;
    box-shadow: 0 0.08rem 0.18rem rgba(15, 23, 42, 0.18);
    transform: scale(0.92);
    transition: transform 0.12s ease, opacity 0.12s ease;
}

.cluster-operation-marker i {
    line-height: 1;
}

.marker-production,
.key-production {
    background: #2563eb;
}

.marker-assets,
.key-assets {
    background: #4f46e5;
}

.marker-mining,
.key-mining {
    background: #0f766e;
}

.cluster-status-cell.mode-production .marker-production,
.cluster-status-cell.mode-assets .marker-assets,
.cluster-status-cell.mode-mining .marker-mining,
.cluster-status-cell:hover .cluster-operation-markers,
.cluster-status-cell.is-selected .cluster-operation-markers,
.cluster-status-cell.mode-production .cluster-operation-markers,
.cluster-status-cell.mode-assets .cluster-operation-markers,
.cluster-status-cell.mode-mining .cluster-operation-markers,
.cluster-status-cell:hover .cluster-operation-marker,
.cluster-status-cell.is-selected .cluster-operation-marker {
    opacity: 1;
}

.cluster-status-cell.mode-production .marker-production,
.cluster-status-cell.mode-assets .marker-assets,
.cluster-status-cell.mode-mining .marker-mining,
.cluster-status-cell:hover .cluster-operation-marker,
.cluster-status-cell.is-selected .cluster-operation-marker {
    transform: scale(1.08);
}

.cluster-status-cell.mode-production .marker-assets,
.cluster-status-cell.mode-production .marker-mining,
.cluster-status-cell.mode-assets .marker-production,
.cluster-status-cell.mode-assets .marker-mining,
.cluster-status-cell.mode-mining .marker-production,
.cluster-status-cell.mode-mining .marker-assets {
    display: none;
}

.cluster-status-cell.mode-defense .cluster-status-garrison-marker {
    background: #be123c;
    color: #ffffff;
    opacity: 1;
}

.cluster-status-scan-marker {
    opacity: 0;
}

.cluster-status-cell.mode-defense .cluster-status-scan-marker,
.cluster-status-cell:hover .cluster-status-scan-marker,
.cluster-status-cell.is-selected .cluster-status-scan-marker {
    opacity: 1;
}

.cluster-ops-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.48rem;
}

.cluster-ops-summary > div,
.cluster-summary-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    min-width: 0;
    padding: 0.55rem 0.62rem;
    border: 1px solid var(--cluster-line, rgba(148, 163, 184, 0.22));
    border-radius: var(--app-radius-sm, 0.45rem);
    background: var(--cluster-surface, #ffffff);
}

.cluster-ops-summary i {
    flex: 0 0 auto;
    color: var(--app-color-primary, #2563eb);
}

.cluster-ops-summary span,
.cluster-summary-list span {
    min-width: 0;
    color: var(--cluster-text-soft, #64748b);
    font-size: 0.74rem;
    font-weight: 700;
}

.cluster-ops-summary strong,
.cluster-summary-list strong {
    color: var(--cluster-text, #0f172a);
    font-size: 0.9rem;
    font-weight: 800;
    white-space: nowrap;
}

.cluster-summary-list {
    display: grid;
    gap: 0.42rem;
}

.cluster-summary-list small {
    display: block;
    margin-top: 0.08rem;
    color: var(--cluster-text-muted, #94a3b8);
    font-size: 0.65rem;
    font-weight: 600;
}

.cluster-mode-switch {
    flex-wrap: wrap;
}

.cluster-side-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cluster-status-cell.has-system {
    border-color: rgba(37, 99, 235, 0.48);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.16), inset 0 -0.2rem 0 rgba(37, 99, 235, 0.12);
}

.cluster-status-cell.has-named-system {
    border-color: rgba(79, 70, 229, 0.62);
    box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.22), inset 0 -0.24rem 0 rgba(79, 70, 229, 0.16);
}

.cluster-status-cell.is-selected {
    border-color: rgba(245, 158, 11, 0.95);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25), 0 0.55rem 1rem rgba(15, 23, 42, 0.18);
}

.cluster-status-grid .cluster-status-cell.mode-members,
.cluster-status-grid .cluster-status-cell.mode-defense,
.cluster-status-grid .cluster-status-cell.mode-production,
.cluster-status-grid .cluster-status-cell.mode-assets,
.cluster-status-grid .cluster-status-cell.mode-mining {
    background: #eef2f7;
}

.cluster-status-cell.mode-members.activity-level-1::before {
    background: rgba(245, 158, 11, 0.14);
}

.cluster-status-cell.mode-members.activity-level-2::before {
    background: rgba(245, 158, 11, 0.22);
}

.cluster-status-cell.mode-members.activity-level-3::before {
    background: rgba(245, 158, 11, 0.32);
}

.cluster-status-cell.mode-members.activity-level-4::before {
    background: rgba(245, 158, 11, 0.44);
}

.cluster-status-cell.mode-defense.activity-level-1::before {
    background: rgba(225, 29, 72, 0.12);
}

.cluster-status-cell.mode-defense.activity-level-2::before {
    background: rgba(225, 29, 72, 0.2);
}

.cluster-status-cell.mode-defense.activity-level-3::before {
    background: rgba(225, 29, 72, 0.3);
}

.cluster-status-cell.mode-defense.activity-level-4::before {
    background: rgba(225, 29, 72, 0.42);
}

.cluster-status-cell.mode-production.activity-level-1::before {
    background: rgba(37, 99, 235, 0.12);
}

.cluster-status-cell.mode-production.activity-level-2::before {
    background: rgba(37, 99, 235, 0.2);
}

.cluster-status-cell.mode-production.activity-level-3::before {
    background: rgba(37, 99, 235, 0.3);
}

.cluster-status-cell.mode-production.activity-level-4::before {
    background: rgba(37, 99, 235, 0.42);
}

.cluster-status-cell.mode-assets.activity-level-1::before {
    background: rgba(79, 70, 229, 0.06);
}

.cluster-status-cell.mode-assets.activity-level-2::before {
    background: rgba(79, 70, 229, 0.18);
}

.cluster-status-cell.mode-assets.activity-level-3::before {
    background: rgba(79, 70, 229, 0.42);
}

.cluster-status-cell.mode-assets.activity-level-4::before {
    background: rgba(67, 56, 202, 0.78);
    inset: 0.1rem;
}

.cluster-status-cell.mode-assets.activity-level-4 {
    border-color: rgba(67, 56, 202, 0.95);
    box-shadow: 0 0 0 2px rgba(67, 56, 202, 0.24), 0 0.42rem 0.85rem rgba(67, 56, 202, 0.24);
}

.cluster-status-cell.mode-assets.activity-level-3 {
    border-color: rgba(79, 70, 229, 0.72);
}

.cluster-status-cell.mode-mining.activity-level-1::before {
    background: rgba(15, 118, 110, 0.12);
}

.cluster-status-cell.mode-mining.activity-level-2::before {
    background: rgba(15, 118, 110, 0.2);
}

.cluster-status-cell.mode-mining.activity-level-3::before {
    background: rgba(15, 118, 110, 0.31);
}

.cluster-status-cell.mode-mining.activity-level-4::before {
    background: rgba(15, 118, 110, 0.44);
}

@media (max-width: 767.98px) {
    .cluster-side-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* --- Holopages --- */
.holopage-card .card-header {
    background: #ffffff;
}

.holopage-scope-toolbar {
    background: #ffffff;
    border: 1px solid #d6dce5;
    border-radius: 6px;
    padding: 0.75rem 1rem;
}

.holopage-scope-meta {
    color: #667085;
    font-size: 0.875rem;
}

.holopage-scope-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.holopage-scope-chip {
    align-items: center;
    background: #f6f8fb;
    border: 1px solid #d6dce5;
    border-radius: 999px;
    color: #344054;
    display: inline-flex;
    font-size: 0.8125rem;
    line-height: 1.2;
    max-width: 220px;
    min-height: 1.8rem;
    overflow: hidden;
    padding: 0.3rem 0.65rem;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.holopage-scope-chip:hover {
    background: #eef2f7;
    color: #1f2937;
    text-decoration: none;
}

.holopage-scope-chip.active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #ffffff;
}

.holopage-scope-chip.muted {
    background: transparent;
    border-color: transparent;
    color: #667085;
}

.holopage-page-link-picker {
    max-width: 220px;
}

.holopage-tabs {
    gap: 0.25rem;
}

.holopage-tabs .nav-link {
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.holopage-textarea {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    min-height: 420px;
}

.holopage-toolbar .btn {
    min-width: 2.25rem;
}

.holopage-preview {
    border: 1px solid #d6dce5;
    border-radius: 6px;
    padding: 1rem;
    background: #fbfcfe;
}

.holopage-preview-output .holopage-rendered {
    max-width: none;
}

.holopage-rendered {
    max-width: 920px;
    line-height: 1.65;
}

.holopage-rendered .holopage-toc {
    background: #f8fafc;
    border: 1px solid #d6dce5;
    border-radius: 6px;
    margin: 0 0 1.25rem;
    padding: 0.85rem 1rem;
}

.holopage-rendered .holopage-toc-title {
    color: #344054;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 0.45rem;
    text-transform: uppercase;
}

.holopage-rendered .holopage-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.holopage-rendered .holopage-toc li {
    margin: 0.2rem 0;
}

.holopage-rendered .holopage-toc-level-3 {
    padding-left: 1rem;
}

.holopage-rendered .holopage-toc-level-4,
.holopage-rendered .holopage-toc-level-5 {
    padding-left: 2rem;
}

.holopage-rendered .holopage-internal-link {
    font-weight: 600;
}

.holopage-rendered .holopage-internal-link-missing {
    border-bottom: 1px dashed currentColor;
    color: #b45309;
}

.holopage-rendered .holopage-internal-link-missing-text {
    color: #667085;
    font-style: italic;
}

.holopage-rendered h2,
.holopage-rendered h3,
.holopage-rendered h4,
.holopage-rendered h5 {
    margin: 1.35rem 0 0.65rem;
}

.holopage-rendered h2:first-child,
.holopage-rendered h3:first-child,
.holopage-rendered h4:first-child,
.holopage-rendered h5:first-child {
    margin-top: 0;
}

.holopage-rendered p,
.holopage-rendered ul,
.holopage-rendered ol,
.holopage-rendered blockquote,
.holopage-rendered pre {
    margin-bottom: 1rem;
}

.holopage-rendered blockquote {
    border-left: 4px solid #c8d0dc;
    padding: 0.75rem 1rem;
    background: #f6f8fb;
    color: #344054;
}

.holopage-rendered pre {
    background: #111827;
    border-radius: 6px;
    color: #f9fafb;
    overflow-x: auto;
    padding: 1rem;
}

.holopage-rendered code {
    background: #eef2f7;
    border-radius: 4px;
    color: #27364a;
    padding: 0.1rem 0.3rem;
}

.holopage-rendered pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.holopage-rendered .holopage-image {
    border-radius: 6px;
    display: block;
    height: auto;
    margin: 1rem 0;
    max-width: 100%;
}

.login-outage-copy {
    background: #fff7d6;
    border: 1px solid #b7791f;
    border-radius: 0.375rem;
    color: #5f370e;
    line-height: 1.4;
    padding: 0.55rem 0.75rem;
}

.discord-login-button {
    background: #5865f2;
    border-color: #5865f2;
    color: #ffffff;
    font-weight: 600;
}

.discord-login-button:hover,
.discord-login-button:focus {
    background: #4752c4;
    border-color: #4752c4;
    color: #ffffff;
}

.discord-login-button:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(88, 101, 242, 0.32);
}

.login-discord-helper {
    color: #475569;
    line-height: 1.35;
}

body.tactical-home-mode {
    background: #030817;
}

body.tactical-home-mode #layoutSidenav_content main {
    min-height: calc(100vh - 56px);
    background:
        radial-gradient(circle at 50% 16%, rgba(45, 102, 188, 0.2), transparent 33rem),
        radial-gradient(circle at 78% 78%, rgba(211, 160, 65, 0.1), transparent 28rem),
        linear-gradient(135deg, #020715 0%, #07132b 55%, #0d0a07 100%);
}

body.tactical-home-mode #layoutSidenav #layoutSidenav_nav {
    display: none;
}

body.tactical-home-mode #layoutSidenav #layoutSidenav_content {
    margin-left: 0;
    padding-left: 0;
}

body.tactical-home-mode.sb-sidenav-toggled #layoutSidenav #layoutSidenav_content:before {
    display: none;
}

body.tactical-home-mode #sidebarToggle {
    display: none;
}

body.tactical-home-mode #layoutSidenav_content .container-fluid {
    max-width: none;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

body.tactical-home-mode #layoutSidenav_content .container-fluid > .alert {
    margin: 16px;
}

.tactical-home {
    color: #e8f2ff;
    min-height: 0;
    overflow: hidden;
    padding: 12px;
}

.tactical-home-shell {
    align-items: start;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 350px);
    min-height: 0;
}

.tactical-home-map-panel,
.tactical-home-card {
    background: rgba(4, 11, 30, 0.88);
    border: 1px solid rgba(99, 151, 225, 0.28);
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34), inset 0 0 24px rgba(88, 151, 255, 0.045);
    position: relative;
}

.tactical-home-kicker {
    color: #f2c15f;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.tactical-home h1,
.tactical-home h2 {
    color: #f7fbff;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.05;
    margin: 0;
}

.tactical-home h1 {
    font-size: clamp(1.35rem, 2vw, 1.9rem);
}

.tactical-home h2 {
    font-size: clamp(1.2rem, 1.8vw, 1.65rem);
}

.tactical-home-map-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    width: 100%;
}

.tactical-home-map-head {
    align-items: center;
    border-bottom: 1px solid rgba(104, 164, 255, 0.18);
    display: flex;
    justify-content: space-between;
    min-height: 76px;
    padding: 18px 22px;
}

.tactical-home-member-chip {
    align-items: center;
    background: rgba(93, 144, 221, 0.12);
    border: 1px solid rgba(242, 193, 95, 0.34);
    border-radius: 999px;
    color: #d9e8ff;
    display: inline-flex;
    font-size: 0.9rem;
    gap: 8px;
    max-width: 240px;
    min-height: 34px;
    padding: 0 12px;
}

.tactical-home-member-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tactical-home-map-stage {
    align-items: start;
    display: grid;
    flex: 1;
    isolation: isolate;
    justify-items: center;
    min-height: clamp(320px, 39vh, 460px);
    overflow: hidden;
    padding: clamp(6px, 0.8vw, 12px) clamp(16px, 2vw, 26px) clamp(26px, 2.6vw, 38px);
    perspective: 1600px;
    position: relative;
}

.tactical-home-map-stage::before {
    background:
        radial-gradient(ellipse at 50% 72%, rgba(57, 101, 168, 0.18), transparent 42%),
        radial-gradient(ellipse at 50% 88%, rgba(242, 193, 95, 0.08), transparent 34%),
        linear-gradient(90deg, rgba(93, 144, 221, 0.028), transparent 28%, transparent 72%, rgba(242, 193, 95, 0.022));
    content: "";
    inset: 0;
    pointer-events: none;
    position: absolute;
    z-index: 0;
}

.tactical-home-map-stage::after {
    background:
        linear-gradient(180deg, transparent 0 76%, rgba(5, 12, 29, 0.44) 88%, rgba(5, 12, 29, 0.7) 100%),
        linear-gradient(90deg, transparent 0 12%, rgba(237, 248, 255, 0.014) 12.1%, transparent 12.35% 87%, rgba(237, 248, 255, 0.012) 87.15%, transparent 87.35%);
    content: "";
    inset: 0;
    opacity: 0.7;
    pointer-events: none;
    position: absolute;
    z-index: 0;
}

.tactical-home-comms-ticker {
    align-items: center;
    background: linear-gradient(90deg, rgba(5, 13, 30, 0.62), rgba(5, 12, 28, 0.28));
    border: 1px solid rgba(96, 188, 255, 0.18);
    border-top-color: rgba(242, 193, 95, 0.24);
    border-radius: 5px;
    box-shadow: inset 0 1px 0 rgba(242, 193, 95, 0.12), 0 0 20px rgba(70, 169, 255, 0.05);
    display: grid;
    gap: 10px;
    grid-template-columns: 18px minmax(0, 1fr);
    left: clamp(18px, 3vw, 44px);
    min-height: 38px;
    overflow: hidden;
    padding: 0 12px;
    position: absolute;
    right: clamp(18px, 3vw, 44px);
    top: clamp(12px, 1.4vw, 18px);
    z-index: 4;
}

.tactical-home-comms-ticker > i {
    color: #f2c15f;
    font-size: 0.9rem;
}

.tactical-home-comms-window {
    min-width: 0;
    overflow: hidden;
}

.tactical-home-comms-track {
    align-items: center;
    animation: tacticalHomeCommsScroll 36s linear infinite;
    display: flex;
    gap: 28px;
    width: max-content;
}

.tactical-home-comms-ticker:hover .tactical-home-comms-track {
    animation-play-state: paused;
}

.tactical-home-comms-item {
    align-items: baseline;
    color: #d9e8ff;
    display: inline-flex;
    font-size: 0.82rem;
    gap: 8px;
    min-width: max-content;
    white-space: nowrap;
}

.tactical-home-comms-item strong {
    color: #f2c15f;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.tactical-home-comms-item span {
    color: #eaf4ff;
}

.tactical-home-command-readout {
    align-items: flex-start;
    background: linear-gradient(180deg, rgba(5, 13, 30, 0.52), rgba(5, 12, 28, 0.24));
    border: 1px solid rgba(96, 188, 255, 0.18);
    border-top-color: rgba(242, 193, 95, 0.24);
    border-radius: 5px;
    box-shadow: inset 0 1px 0 rgba(242, 193, 95, 0.12), 0 0 18px rgba(70, 169, 255, 0.04);
    color: #eef5ff;
    display: flex;
    gap: 10px;
    max-width: 250px;
    min-width: 190px;
    padding: 9px 11px;
    position: absolute;
    z-index: 4;
}

.tactical-home-command-readout i {
    color: #f2c15f;
    flex: 0 0 auto;
    font-size: 1rem;
    margin-top: 3px;
}

.tactical-home-command-readout span {
    color: #f2c15f;
    display: block;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.2;
    text-transform: uppercase;
}

.tactical-home-command-readout strong,
.tactical-home-command-readout em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tactical-home-command-readout strong {
    color: #f7fbff;
    font-size: 0.94rem;
    line-height: 1.25;
}

.tactical-home-command-readout em {
    color: #b9c9e6;
    font-size: 0.76rem;
    font-style: normal;
    line-height: 1.3;
    margin-top: 2px;
}

.tactical-home-command-readout-location {
    bottom: clamp(44px, 4vw, 58px);
    left: clamp(18px, 3vw, 44px);
}

.tactical-home-command-readout-vessel {
    bottom: clamp(44px, 4vw, 58px);
    max-width: 310px;
    min-width: 230px;
    right: clamp(18px, 3vw, 44px);
}

.tactical-home-command-nav {
    align-items: center;
    background: linear-gradient(180deg, rgba(5, 14, 33, 0.5), rgba(5, 12, 27, 0.24));
    border: 1px solid rgba(242, 193, 95, 0.22);
    border-radius: 999px;
    bottom: clamp(12px, 1.4vw, 18px);
    box-shadow: inset 0 1px 0 rgba(242, 193, 95, 0.14), 0 0 28px rgba(43, 158, 255, 0.08);
    display: flex;
    gap: 7px;
    justify-content: center;
    left: 50%;
    max-width: calc(100% - 32px);
    padding: 7px;
    position: absolute;
    transform: translateX(-50%);
    z-index: 5;
}

.tactical-home-command-primary {
    display: flex;
    gap: 7px;
}

.tactical-home-command-link,
.tactical-home-command-more summary {
    align-items: center;
    background: rgba(56, 135, 210, 0.075);
    border: 1px solid rgba(114, 196, 255, 0.16);
    border-radius: 999px;
    color: #eaf4ff;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    gap: 7px;
    justify-content: center;
    line-height: 1;
    min-height: 34px;
    min-width: 88px;
    padding: 0 12px;
    text-decoration: none;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.tactical-home-command-more {
    position: relative;
}

.tactical-home-command-more summary {
    cursor: pointer;
    list-style: none;
}

.tactical-home-command-more summary::-webkit-details-marker {
    display: none;
}

.tactical-home-command-nav::before {
    background: linear-gradient(90deg, transparent, rgba(65, 180, 255, 0.4), rgba(242, 193, 95, 0.22), rgba(65, 180, 255, 0.4), transparent);
    content: "";
    height: 1px;
    left: 14px;
    opacity: 0.74;
    pointer-events: none;
    position: absolute;
    right: 14px;
    top: -5px;
}

.tactical-home-command-link:focus,
.tactical-home-command-link:hover,
.tactical-home-command-more summary:focus,
.tactical-home-command-more summary:hover {
    background: rgba(242, 193, 95, 0.12);
    border-color: rgba(242, 193, 95, 0.42);
    color: #fff7dc;
}

.tactical-home-command-menu {
    background: rgba(4, 11, 30, 0.96);
    border: 1px solid rgba(242, 193, 95, 0.24);
    border-radius: 8px;
    bottom: calc(100% + 10px);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(242, 193, 95, 0.12);
    display: grid;
    gap: 10px;
    max-height: min(46vh, 340px);
    min-width: 280px;
    overflow-y: auto;
    padding: 10px;
    position: absolute;
    right: 0;
    width: min(72vw, 360px);
}

.tactical-home-command-group {
    display: grid;
    gap: 5px;
}

.tactical-home-command-group + .tactical-home-command-group {
    border-top: 1px solid rgba(104, 164, 255, 0.14);
    padding-top: 8px;
}

.tactical-home-command-group-label {
    color: #f2c15f;
    font-size: 0.64rem;
    font-weight: 800;
    padding: 0 4px 2px;
    text-transform: uppercase;
}

.tactical-home-command-menu-link {
    align-items: center;
    border: 1px solid rgba(104, 164, 255, 0.14);
    border-radius: 5px;
    color: #eaf4ff;
    display: grid;
    font-size: 0.78rem;
    font-weight: 800;
    gap: 8px;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    min-height: 36px;
    padding: 0 10px;
    text-decoration: none;
}

.tactical-home-command-menu-link:focus,
.tactical-home-command-menu-link:hover {
    background: rgba(242, 193, 95, 0.1);
    border-color: rgba(242, 193, 95, 0.3);
    color: #fff7dc;
}

.tactical-home-command-menu-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tactical-home-command-link b,
.tactical-home-command-menu-link b {
    align-items: center;
    background: rgba(220, 64, 76, 0.28);
    border: 1px solid rgba(255, 112, 125, 0.42);
    border-radius: 999px;
    color: #ffe8ec;
    display: inline-flex;
    font-size: 0.68rem;
    font-weight: 800;
    height: 20px;
    justify-content: center;
    min-width: 20px;
    padding: 0 6px;
}

.tactical-home-command-nav i {
    color: #f2c15f;
    font-size: 0.86rem;
}

.tactical-home-map-plane {
    align-self: start;
    aspect-ratio: 1.95;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    filter: drop-shadow(0 20px 32px rgba(0, 0, 0, 0.28)) drop-shadow(0 0 20px rgba(103, 158, 238, 0.15));
    height: auto;
    isolation: isolate;
    margin-top: clamp(6px, 1.8vh, 18px);
    max-width: 100%;
    overflow: visible;
    position: relative;
    transform: none;
    transform-origin: center center;
    transform-style: preserve-3d;
    width: min(100%, 1040px);
    z-index: 2;
}

.tactical-home-map-canvas {
    cursor: grab;
    display: block;
    height: 100%;
    inset: 0;
    position: absolute;
    touch-action: none;
    width: 100%;
    z-index: 3;
}

.tactical-home-map-plane.is-dragging .tactical-home-map-canvas {
    cursor: grabbing;
}

.tactical-home-map-plane::before {
    background: radial-gradient(ellipse at 50% 56%, rgba(104, 162, 244, 0.22), transparent 63%);
    content: "";
    inset: -8% -5%;
    pointer-events: none;
    position: absolute;
    z-index: 0;
}

.tactical-home-map-plane::after {
    display: none;
}

.tactical-home-holo-svg {
    display: block;
    bottom: 0;
    height: auto;
    left: 0;
    overflow: visible;
    pointer-events: none;
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
    z-index: 2;
}

.tactical-home-map-fallback {
    opacity: 0.55;
    transition: opacity 180ms ease;
}

.tactical-home-map-plane.is-rendered .tactical-home-map-fallback {
    opacity: 0;
}

.tactical-home-board-plate {
    opacity: 0.82;
    stroke: rgba(132, 190, 255, 0.26);
    stroke-width: 0.36px;
    vector-effect: non-scaling-stroke;
}

.tactical-home-board-rail {
    fill: none;
    opacity: 0.28;
    stroke: rgba(169, 213, 255, 0.3);
    stroke-linecap: square;
    stroke-width: 0.26px;
    vector-effect: non-scaling-stroke;
}

.tactical-home-board-corners {
    fill: none;
    opacity: 0.42;
    stroke: rgba(242, 193, 95, 0.42);
    stroke-linecap: square;
    stroke-width: 0.38px;
    vector-effect: non-scaling-stroke;
}

.tactical-home-board-register {
    fill: none;
    opacity: 0.16;
    stroke: rgba(168, 216, 255, 0.22);
    stroke-linecap: round;
    stroke-width: 0.34px;
    vector-effect: non-scaling-stroke;
}

.tactical-home-system-lanes path {
    fill: none;
    opacity: 0.26;
    stroke: rgba(178, 226, 255, 0.28);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 0.26px;
    vector-effect: non-scaling-stroke;
}

.tactical-home-system-lanes path.is-secondary {
    opacity: 0.2;
    stroke: rgba(242, 193, 95, 0.2);
    stroke-dasharray: 0.18 0.34;
}

.tactical-home-sector-haze {
    fill: rgba(71, 136, 222, 0.012);
}

.tactical-home-holo-svg pattern path {
    fill: none;
    stroke: rgba(139, 198, 255, 0.045);
    stroke-width: 0.014;
}

.tactical-home-wireframe-fill {
    opacity: 0.34;
}

.tactical-home-boundary-backlight,
.tactical-home-boundary-line,
.tactical-home-boundary-dash {
    fill: none;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.tactical-home-boundary-backlight {
    opacity: 0.18;
    stroke: rgba(91, 154, 255, 0.2);
    stroke-width: 1.1px;
}

.tactical-home-boundary-line {
    opacity: 0.74;
    stroke: rgba(129, 186, 246, 0.36);
    stroke-width: 0.42px;
}

.tactical-home-boundary-dash {
    opacity: 0.32;
    stroke: rgba(242, 193, 95, 0.24);
    stroke-dasharray: 0.45 0.55;
    stroke-width: 0.3px;
}

.tactical-home-svg-system .tactical-home-svg-star-glow {
    fill: rgba(126, 184, 255, 0.055);
    stroke: rgba(139, 198, 255, 0.08);
    stroke-width: 0.012;
}

.tactical-home-svg-system .tactical-home-svg-dot {
    fill: rgba(157, 201, 247, 0.58);
    filter: drop-shadow(0 0 0.04px rgba(118, 177, 242, 0.58));
    stroke: rgba(210, 234, 255, 0.3);
    stroke-width: 0.016;
}

.tactical-home-svg-system.has-assigned .tactical-home-svg-dot,
.tactical-home-svg-ship .tactical-home-svg-dot {
    fill: #91c8ff;
    filter: drop-shadow(0 0 0.1px rgba(172, 218, 255, 0.9)) drop-shadow(0 0 0.3px rgba(91, 154, 255, 0.72));
    stroke: rgba(211, 235, 255, 0.72);
    stroke-width: 0.026;
}

.tactical-home-svg-ship.is-active .tactical-home-svg-dot {
    fill: #f2c15f;
    filter: drop-shadow(0 0 0.08px rgba(255, 246, 211, 0.95)) drop-shadow(0 0 0.28px rgba(242, 193, 95, 0.86));
    stroke: #fff6d3;
}

.tactical-home-svg-pulse {
    animation: tacticalHomeSvgPulse 2.8s ease-out infinite;
    fill: none;
    stroke: rgba(108, 177, 255, 0.46);
    stroke-width: 0.026;
    transform-box: fill-box;
    transform-origin: center;
}

.tactical-home-svg-location-halo {
    fill: rgba(242, 193, 95, 0.1);
    filter: drop-shadow(0 0 0.52px rgba(242, 193, 95, 0.74));
    stroke: rgba(242, 193, 95, 0.48);
    stroke-width: 0.04;
}

.tactical-home-svg-location-core {
    fill: #f2c15f;
    stroke: #fff6d3;
    stroke-width: 0.04;
}

.tactical-home-svg-location-arrow {
    fill: #061024;
}

.tactical-home-empty-map {
    align-items: center;
    border: 1px solid rgba(104, 164, 255, 0.28);
    border-radius: 8px;
    color: #d9e8ff;
    display: inline-flex;
    gap: 10px;
    min-height: 84px;
    padding: 0 22px;
}

.tactical-home-status {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.tactical-home-card {
    display: grid;
    gap: 13px;
    min-width: 0;
    padding: 15px;
}

.tactical-home-member-head {
    display: grid;
    gap: 12px;
    grid-template-columns: 62px minmax(0, 1fr);
}

.tactical-home-member-head img {
    border: 1px solid rgba(226, 185, 92, 0.55);
    border-radius: 8px;
    height: 62px;
    object-fit: cover;
    width: 62px;
}

.tactical-home-muted {
    color: #b9c9e6;
    font-size: 0.82rem;
    line-height: 1.35;
}

.tactical-home-rank-progress {
    display: grid;
    gap: 2px;
}

.tactical-home-ranks {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
}

.tactical-home-rank-row {
    align-items: center;
    background: rgba(8, 20, 48, 0.62);
    border: 1px solid rgba(104, 164, 255, 0.18);
    border-radius: 6px;
    display: grid;
    gap: 8px;
    grid-template-columns: 44px minmax(0, 1fr);
    min-height: 48px;
    padding: 7px;
}

.tactical-home-rank-row img {
    display: block;
    max-height: 30px;
    max-width: 44px;
    object-fit: contain;
}

.tactical-home-rank-placeholder {
    align-items: center;
    color: #f2c15f;
    display: flex;
    height: 30px;
    justify-content: center;
    width: 44px;
}

.tactical-home-rank-name {
    color: #f7fbff;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.tactical-home-ship {
    display: grid;
    gap: 12px;
    grid-template-columns: 68px minmax(0, 1fr);
}

.tactical-home-ship-media {
    background: rgba(0, 0, 0, 0.34);
    border: 1px solid rgba(104, 164, 255, 0.22);
    border-radius: 6px;
    height: 68px;
    overflow: hidden;
    width: 68px;
}

.tactical-home-ship-media img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.tactical-home-ship-copy {
    min-width: 0;
}

.tactical-home-ship-copy h2,
.tactical-home-standby h2 {
    font-size: 1.25rem;
    overflow-wrap: anywhere;
}

.tactical-home-ship-type {
    color: #d9e8ff;
    font-size: 0.9rem;
    margin-top: 6px;
}

.tactical-home-location-readout {
    align-items: flex-start;
    background: rgba(8, 20, 48, 0.72);
    border: 1px solid rgba(104, 164, 255, 0.2);
    border-radius: 6px;
    color: #eef5ff;
    display: flex;
    gap: 10px;
    line-height: 1.35;
    padding: 12px;
}

.tactical-home-location-readout i {
    color: #f2c15f;
    margin-top: 2px;
}

.tactical-home-side-signal {
    padding: 10px 12px;
}

.tactical-home-stat-stack {
    display: grid;
    gap: 14px;
}

.tactical-home-stat-line {
    align-items: baseline;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.tactical-home-stat-line span {
    color: #f2c15f;
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.tactical-home-stat-line strong {
    color: #f7fbff;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: right;
}

.tactical-home-stat-bar {
    background: rgba(104, 164, 255, 0.14);
    border-radius: 999px;
    height: 7px;
    margin-top: 7px;
    overflow: hidden;
}

.tactical-home-stat-bar span {
    background: linear-gradient(90deg, #6aa8ff, #f2c15f);
    border-radius: inherit;
    display: block;
    height: 100%;
}

.tactical-home-standby {
    display: grid;
    gap: 16px;
}

@keyframes tacticalHomePulse {
    0% {
        opacity: 0.85;
        transform: scale(0.6);
    }
    100% {
        opacity: 0;
        transform: scale(1.45);
    }
}

@keyframes tacticalHomeSvgPulse {
    0% {
        opacity: 0.76;
        transform: scale(0.45);
    }
    100% {
        opacity: 0;
        transform: scale(1.75);
    }
}

@keyframes tacticalHomeCommsScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .tactical-home-comms-track {
        animation: none;
        width: auto;
    }
}

@media (max-width: 1180px) {
    .tactical-home-shell {
        grid-template-columns: 1fr;
    }

    .tactical-home-status {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .tactical-home {
        padding: 10px;
    }

    .tactical-home-shell {
        grid-template-columns: 1fr;
    }

    .tactical-home-status {
        grid-template-columns: 1fr;
    }

    .tactical-home-map-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .tactical-home-map-panel {
        min-height: 0;
    }

    .tactical-home-map-stage {
        align-items: stretch;
        display: flex;
        flex-direction: column;
        gap: 12px;
        min-height: 0;
        padding: 14px 18px 16px;
    }

    .tactical-home-command-readout {
        max-width: none;
        min-width: 0;
        position: relative;
        width: 100%;
    }

    .tactical-home-comms-ticker {
        left: auto;
        order: 2;
        position: relative;
        right: auto;
        top: auto;
        width: 100%;
    }

    .tactical-home-command-readout-location,
    .tactical-home-command-readout-vessel {
        bottom: auto;
        left: auto;
        right: auto;
        top: auto;
    }

    .tactical-home-map-plane {
        align-self: stretch;
        aspect-ratio: 1.72;
        height: auto;
        inset: auto;
        margin-top: 0;
        order: 1;
        width: 100%;
    }

    .tactical-home-command-readout-location {
        order: 3;
    }

    .tactical-home-command-readout-vessel {
        order: 4;
    }

    .tactical-home-command-nav {
        align-self: center;
        bottom: auto;
        flex-wrap: wrap;
        left: auto;
        max-width: 100%;
        order: 5;
        position: relative;
        transform: none;
    }

    .tactical-home-command-primary {
        flex-wrap: wrap;
        justify-content: center;
    }

    .tactical-home-command-menu {
        left: auto;
        max-height: min(56vh, 380px);
        right: 0;
        width: min(86vw, 360px);
    }
}

@media (max-width: 520px) {
    .tactical-home-command-nav {
        border-radius: 8px;
        display: grid;
        justify-items: stretch;
        width: 100%;
    }

    .tactical-home-command-primary {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .tactical-home-command-link,
    .tactical-home-command-more summary {
        min-width: 0;
    }

    .tactical-home-command-more,
    .tactical-home-command-more summary {
        width: 100%;
    }

    .tactical-home-command-menu {
        left: 0;
        min-width: 0;
        right: 0;
        width: 100%;
    }

    .tactical-home-comms-ticker {
        min-height: 40px;
    }

    .tactical-home-ship {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .tactical-home-ship-media {
        height: 64px;
        width: 64px;
    }
}

/* --- Guest hub --- */
.guest-hub-shell {
    --guest-navy: #12223e;
    --guest-teal: #0e6e68;
    --guest-gold: #b79245;
    --guest-cream: #f6f8f5;
    --guest-muted: #637083;
    color: var(--guest-navy);
    padding-bottom: 1.5rem;
}

.guest-hub-hero {
    background-image: var(--guest-hub-bg);
    background-position: center;
    background-size: cover;
    border: 1px solid rgba(183, 146, 69, 0.38);
    border-radius: 8px;
    box-shadow: 0 1.2rem 2.8rem rgba(15, 31, 56, 0.16);
    min-height: clamp(640px, calc(100vh - 8.5rem), 820px);
    overflow: hidden;
    padding: clamp(0.8rem, 1.8vw, 1.25rem);
    position: relative;
}

.guest-hub-nav {
    align-items: center;
    background: rgba(247, 250, 250, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 8px;
    box-shadow: 0 0.75rem 1.8rem rgba(15, 31, 56, 0.12);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.7rem 0.85rem;
}

@supports (backdrop-filter: blur(12px)) {
    .guest-hub-nav,
    .guest-hub-intro,
    .guest-hub-action,
    .guest-hub-dispatches,
    .guest-hub-visit-card,
    .guest-route-panel,
    .guest-route-hero {
        backdrop-filter: blur(16px);
    }
}

.guest-hub-brand {
    align-items: center;
    display: flex;
    gap: 0.85rem;
    min-width: 0;
}

.guest-hub-logo {
    align-items: center;
    background: radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.95), rgba(232, 244, 241, 0.82));
    border: 1px solid rgba(183, 146, 69, 0.55);
    border-radius: 50%;
    box-shadow: 0 0.45rem 1rem rgba(15, 31, 56, 0.16);
    display: inline-flex;
    flex: 0 0 auto;
    height: clamp(56px, 6vw, 74px);
    justify-content: center;
    overflow: hidden;
    width: clamp(56px, 6vw, 74px);
}

.guest-hub-logo img {
    height: 114%;
    object-fit: contain;
    width: 114%;
}

.guest-hub-brand h1,
.guest-hub-intro h2,
.guest-hub-section-heading h3,
.guest-hub-visit-card h3,
.guest-route-hero h1,
.guest-route-panel h2 {
    letter-spacing: 0;
}

.guest-hub-brand h1 {
    color: var(--guest-navy);
    font-size: clamp(1.25rem, 2vw, 1.8rem);
    font-weight: 760;
    line-height: 1.1;
    margin: 0;
}

.guest-hub-brand p {
    color: var(--guest-muted);
    font-size: 0.86rem;
    line-height: 1.35;
    margin: 0.18rem 0 0;
}

.guest-hub-nav-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 0.55rem;
}

.guest-hub-icon-button {
    align-items: center;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(18, 34, 62, 0.1);
    border-radius: 8px;
    color: var(--guest-navy);
    display: inline-flex;
    font-size: 1.05rem;
    height: 2.8rem;
    justify-content: center;
    text-decoration: none;
    transition: background 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
    width: 2.8rem;
}

.guest-hub-icon-button:hover,
.guest-hub-icon-button:focus {
    background: #ffffff;
    border-color: rgba(183, 146, 69, 0.58);
    color: var(--guest-teal);
    transform: translateY(-1px);
}

.guest-hub-content {
    align-items: end;
    display: grid;
    gap: clamp(1rem, 3vw, 2.5rem);
    grid-template-columns: minmax(16rem, 1fr) minmax(22rem, 32rem);
    min-height: calc(clamp(640px, calc(100vh - 8.5rem), 820px) - 7rem);
    padding: clamp(1rem, 2.5vw, 2.25rem) 0.15rem 0.15rem;
}

.guest-hub-intro {
    align-self: end;
    background: rgba(248, 251, 250, 0.74);
    border: 1px solid rgba(255, 255, 255, 0.64);
    border-radius: 8px;
    box-shadow: 0 0.9rem 2rem rgba(15, 31, 56, 0.14);
    max-width: 34rem;
    padding: clamp(1rem, 2vw, 1.45rem);
}

.guest-hub-intro h2 {
    color: var(--guest-navy);
    font-size: clamp(1.6rem, 3.4vw, 3rem);
    font-weight: 760;
    line-height: 1.05;
    margin: 0;
}

.guest-hub-intro p {
    color: #33445f;
    font-size: clamp(0.98rem, 1.25vw, 1.12rem);
    line-height: 1.6;
    margin: 0.85rem 0 0;
}

.guest-hub-actions {
    display: grid;
    gap: 0.7rem;
}

.guest-hub-action {
    align-items: center;
    background: rgba(248, 251, 250, 0.88);
    border: 1px solid rgba(183, 146, 69, 0.45);
    border-radius: 8px;
    box-shadow: 0 0.65rem 1.35rem rgba(15, 31, 56, 0.12);
    color: var(--guest-navy);
    display: grid;
    gap: 0.85rem;
    grid-template-columns: 3.4rem minmax(0, 1fr) 1.15rem;
    min-height: 5.1rem;
    padding: 0.72rem 0.9rem 0.72rem 0.72rem;
    text-decoration: none;
    transition: background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.guest-hub-action:hover,
.guest-hub-action:focus {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(183, 146, 69, 0.78);
    box-shadow: 0 0.9rem 1.7rem rgba(15, 31, 56, 0.18);
    color: var(--guest-navy);
    transform: translateY(-1px);
}

.guest-hub-action.is-disabled {
    background: rgba(235, 238, 239, 0.82);
    border-color: rgba(99, 112, 131, 0.24);
    box-shadow: none;
    cursor: not-allowed;
    filter: grayscale(0.45);
    opacity: 0.66;
}

.guest-hub-action.is-disabled:hover {
    transform: none;
}

.guest-hub-action.is-disabled .guest-hub-action-icon {
    background: #7d8794;
    box-shadow: none;
}

.guest-hub-action.is-disabled .guest-hub-action-arrow {
    color: var(--guest-muted);
}

.guest-hub-action-icon {
    align-items: center;
    background: linear-gradient(135deg, #0e746d, #2d8f86);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 0.4rem 0.8rem rgba(5, 65, 63, 0.2);
    color: #ffffff;
    display: inline-flex;
    font-size: 1.2rem;
    height: 3.4rem;
    justify-content: center;
    width: 3.4rem;
}

.guest-hub-action-copy {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
}

.guest-hub-action-label {
    display: block;
    font-size: clamp(1rem, 1.35vw, 1.28rem);
    font-weight: 740;
    line-height: 1.15;
}

.guest-hub-action-detail {
    color: var(--guest-muted);
    display: block;
    font-size: 0.82rem;
    line-height: 1.35;
}

.guest-hub-action-arrow {
    color: var(--guest-teal);
    font-size: 0.95rem;
    text-align: right;
}

.guest-hub-lower {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 25rem);
    margin-top: 1rem;
}

.guest-hub-dispatches,
.guest-hub-visit-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(18, 34, 62, 0.08);
    border-radius: 8px;
    box-shadow: 0 0.65rem 1.4rem rgba(15, 31, 56, 0.08);
    padding: 1rem;
}

.guest-hub-section-heading {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.guest-hub-section-heading h3,
.guest-hub-visit-card h3 {
    color: var(--guest-navy);
    font-size: 1rem;
    font-weight: 760;
    margin: 0;
}

.guest-hub-section-heading a,
.guest-hub-mini-actions a {
    color: var(--guest-teal);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
}

.guest-hub-section-heading a:hover,
.guest-hub-mini-actions a:hover {
    color: #0a4d49;
    text-decoration: underline;
}

.guest-hub-dispatch-list {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.guest-hub-dispatch {
    border: 1px solid rgba(18, 34, 62, 0.08);
    border-radius: 8px;
    color: var(--guest-navy);
    display: grid;
    gap: 0.26rem;
    min-height: 9rem;
    padding: 0.82rem;
    text-decoration: none;
    transition: border-color 0.14s ease, transform 0.14s ease;
}

.guest-hub-dispatch:hover,
.guest-hub-dispatch:focus {
    border-color: rgba(183, 146, 69, 0.52);
    color: var(--guest-navy);
    transform: translateY(-1px);
}

.guest-hub-dispatch-date {
    color: var(--guest-gold);
    font-size: 0.72rem;
    font-weight: 760;
    text-transform: uppercase;
}

.guest-hub-dispatch-title {
    font-size: 0.96rem;
    font-weight: 740;
    line-height: 1.25;
}

.guest-hub-dispatch-preview,
.guest-hub-empty,
.guest-hub-visit-card p {
    color: var(--guest-muted);
    font-size: 0.86rem;
    line-height: 1.5;
}

.guest-hub-empty {
    border: 1px dashed rgba(18, 34, 62, 0.16);
    border-radius: 8px;
    padding: 1rem;
}

.guest-hub-visit-card {
    display: flex;
    flex-direction: column;
}

.guest-hub-visit-card p {
    margin: 0.55rem 0 1rem;
}

.guest-hub-mini-actions {
    display: flex;
    gap: 1rem;
    margin-top: auto;
}

.guest-route-page {
    color: #12223e;
    padding-bottom: 1.5rem;
}

.guest-route-hero,
.guest-route-panel {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(18, 34, 62, 0.08);
    border-radius: 8px;
    box-shadow: 0 0.65rem 1.4rem rgba(15, 31, 56, 0.08);
}

.guest-route-hero {
    align-items: center;
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1.15rem;
}

.guest-route-icon {
    align-items: center;
    background: linear-gradient(135deg, #0e746d, #2d8f86);
    border-radius: 8px;
    color: #ffffff;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 1.35rem;
    height: 3.4rem;
    justify-content: center;
    width: 3.4rem;
}

.guest-route-hero h1,
.guest-route-panel h2 {
    color: #12223e;
    font-weight: 760;
    margin: 0;
}

.guest-route-hero h1 {
    font-size: clamp(1.45rem, 2.2vw, 2rem);
    line-height: 1.12;
}

.guest-route-hero p,
.guest-route-panel p {
    color: #637083;
    line-height: 1.55;
    margin: 0.35rem 0 0;
}

.guest-route-panel {
    padding: 1rem;
}

.guest-route-panel h2 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.guest-route-list {
    display: grid;
    gap: 0.65rem;
}

.guest-route-list a {
    align-items: center;
    border: 1px solid rgba(18, 34, 62, 0.08);
    border-radius: 8px;
    color: #12223e;
    display: grid;
    gap: 0.35rem 0.75rem;
    grid-template-columns: 2.4rem minmax(0, 1fr);
    padding: 0.75rem;
    text-decoration: none;
    transition: border-color 0.14s ease, transform 0.14s ease;
}

.guest-route-list a:hover,
.guest-route-list a:focus {
    border-color: rgba(183, 146, 69, 0.52);
    color: #12223e;
    transform: translateY(-1px);
}

.guest-route-list span {
    align-items: center;
    background: rgba(14, 110, 104, 0.1);
    border-radius: 8px;
    color: #0e6e68;
    display: inline-flex;
    grid-row: span 2;
    height: 2.4rem;
    justify-content: center;
    width: 2.4rem;
}

.guest-route-list strong {
    font-size: 0.96rem;
    line-height: 1.2;
}

.guest-route-list small {
    color: #637083;
    line-height: 1.35;
}

.guest-route-status {
    align-items: flex-start;
    background: rgba(14, 110, 104, 0.09);
    border: 1px solid rgba(14, 110, 104, 0.18);
    border-radius: 8px;
    color: #0e5b56;
    display: flex;
    gap: 0.55rem;
    line-height: 1.45;
    margin-top: 1rem;
    padding: 0.8rem;
}

.guest-route-status.is-warning {
    background: rgba(183, 146, 69, 0.12);
    border-color: rgba(183, 146, 69, 0.28);
    color: #7a5b1f;
}

@media (max-width: 1199.98px) {
    .guest-hub-content {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .guest-hub-intro {
        max-width: 42rem;
    }

    .guest-hub-actions {
        max-width: 42rem;
    }
}

@media (max-width: 991.98px) {
    .guest-hub-lower,
    .guest-hub-dispatch-list {
        grid-template-columns: 1fr;
    }

    .guest-hub-hero {
        min-height: 0;
    }

    .guest-hub-content {
        min-height: 0;
    }
}

@media (max-width: 575.98px) {
    .guest-hub-shell {
        margin-left: -0.35rem;
        margin-right: -0.35rem;
    }

    .guest-hub-nav,
    .guest-route-hero {
        align-items: flex-start;
    }

    .guest-hub-nav {
        flex-direction: column;
    }

    .guest-hub-nav-actions {
        width: 100%;
    }

    .guest-hub-icon-button {
        flex: 1 1 auto;
        width: auto;
    }

    .guest-hub-action {
        grid-template-columns: 2.9rem minmax(0, 1fr) 0.8rem;
        min-height: 4.6rem;
    }

    .guest-hub-action-icon {
        height: 2.9rem;
        width: 2.9rem;
    }

    .guest-hub-action-detail {
        display: none;
    }

    .guest-route-hero {
        flex-direction: column;
    }
}
