/* ======================================================================
   Fleet Ops — enterprise-grade trends/health dashboard at /ops.

   NOTE: global stylesheet (linked from _Host.cshtml). The scoped-CSS
   bundle (.razor.css) was failing to apply for this page in dev runs —
   the bundle compiled and was served, but the scope attribute wasn't
   reaching the rendered elements. Rather than keep chasing that, ship
   globally. Class names here are page-specific (.ops-*, .hero-*, .kpi-*,
   .lb-*, .spend-*) so cross-page bleed is minimal.

   Visual targets (think Stripe / Linear / Datadog, not generic Bootstrap).
   ====================================================================== */

.ops-shell {
    /* refined neutral palette overrides — used inside this page only */
    --ops-card-bg: var(--bs-body-bg);
    --ops-card-border: color-mix(in srgb, var(--bs-border-color) 75%, transparent);
    --ops-card-shadow: 0 1px 0 0 rgba(0,0,0,0.02), 0 4px 14px rgba(15,23,42,0.04);
    --ops-card-shadow-hover: 0 1px 0 0 rgba(0,0,0,0.02), 0 8px 24px rgba(15,23,42,0.08);

    --ops-success: #16a34a;
    --ops-success-bg: rgba(22, 163, 74, 0.10);
    --ops-warn: #d97706;
    --ops-warn-bg: rgba(217, 119, 6, 0.10);
    --ops-bad: #dc2626;
    --ops-bad-bg: rgba(220, 38, 38, 0.10);

    padding-bottom: 4rem;
}

/* ── Header ──────────────────────────────────────────────────────── */

.ops-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.4rem 0 1.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--ops-card-border);
    flex-wrap: wrap;
}
.ops-bar-title { display: flex; align-items: center; gap: 0.85rem; }
.ops-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 14px rgba(99, 102, 241, 0.30);
}
.ops-bar-title h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
}
.ops-subtitle {
    color: var(--bs-secondary-color);
    font-size: 0.78rem;
    font-weight: 500;
    display: inline-flex; gap: 0.35rem; align-items: center; flex-wrap: wrap;
}
.ops-sep { opacity: 0.4; }
.ops-clock {
    color: var(--ops-success);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.ops-bar-controls { display: flex; align-items: center; gap: 0.5rem; }
.ctrl-btn {
    background: var(--ops-card-bg);
    border: 1px solid var(--ops-card-border);
    color: var(--bs-body-color);
    border-radius: 999px;
    width: 36px; height: 36px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s ease;
    box-shadow: var(--ops-card-shadow);
}
.ctrl-btn:hover { border-color: var(--brand-primary, #0d6efd); color: var(--brand-primary, #0d6efd); transform: translateY(-1px); }
.ctrl-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.spin { animation: rot 1s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ── Time-range selector — chip group + custom popover ──────────── */

.ops-range {
    display: inline-flex;
    align-items: stretch;
    gap: 0;
    background: var(--ops-card-bg);
    border: 1px solid var(--ops-card-border);
    border-radius: 999px;
    padding: 3px;
    box-shadow: var(--ops-card-shadow);
}
.ops-range-chip {
    background: transparent;
    border: 0;
    color: var(--bs-secondary-color);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.32rem 0.85rem;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
    line-height: 1.2;
}
.ops-range-chip:hover { color: var(--bs-body-color); background: color-mix(in srgb, var(--brand-primary, #0d6efd) 8%, transparent); }
.ops-range-chip.active {
    background: var(--brand-primary, #0d6efd);
    color: #fff;
    box-shadow: 0 3px 10px color-mix(in srgb, var(--brand-primary, #0d6efd) 38%, transparent);
}
.ops-range-chip:disabled { opacity: 0.55; cursor: not-allowed; }

.ops-range-custom-wrap { position: relative; }
.ops-range-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 80;
    background: var(--bs-body-bg);
    border: 1px solid var(--ops-card-border);
    border-radius: 10px;
    box-shadow: 0 14px 32px rgba(0,0,0,0.18), 0 4px 10px rgba(0,0,0,0.10);
    padding: 0.85rem;
    min-width: 260px;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.ops-range-popover label {
    display: flex; flex-direction: column; gap: 0.2rem;
    font-size: 0.75rem; font-weight: 600;
    color: var(--bs-secondary-color);
}
.ops-range-popover label span { letter-spacing: 0.08em; text-transform: uppercase; }
.ops-range-popover input[type="date"] {
    background: var(--ops-card-bg);
    border: 1px solid var(--ops-card-border);
    border-radius: 6px;
    padding: 0.4rem 0.55rem;
    font-size: 0.85rem;
    color: var(--bs-body-color);
    font-variant-numeric: tabular-nums;
}
.ops-range-popover-actions {
    display: flex; justify-content: flex-end; gap: 0.4rem;
    border-top: 1px solid var(--ops-card-border);
    padding-top: 0.5rem;
}

/* ── Hero summary band ──────────────────────────────────────────── */

.hero-band {
    display: grid;
    grid-template-columns: 2fr auto repeat(3, 1fr);
    gap: 1.5rem;
    align-items: center;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    background:
        linear-gradient(135deg, rgba(99, 102, 241, 0.04), rgba(14, 165, 233, 0.04)),
        var(--ops-card-bg);
    border: 1px solid var(--ops-card-border);
    border-radius: 16px;
    box-shadow: var(--ops-card-shadow);
}
.hero-stat { min-width: 0; }
.hero-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bs-secondary-color);
    margin-bottom: 0.35rem;
    display: inline-flex;
    align-items: center;
}
.hero-label .bi-heart-pulse-fill { color: #ec4899; }
.hero-value {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}
.hero-unit { font-size: 1.4rem; font-weight: 600; color: var(--bs-secondary-color); margin-left: 0.1rem; }
.hero-bar {
    margin-top: 0.6rem;
    height: 8px;
    background: var(--bs-tertiary-bg);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
.hero-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.8s cubic-bezier(.4,0,.2,1);
}
.h-good { background: linear-gradient(90deg, #22c55e, #16a34a); }
.h-ok   { background: linear-gradient(90deg, #f59e0b, #d97706); }
.h-bad  { background: linear-gradient(90deg, #ef4444, #dc2626); }
.hero-meta {
    margin-top: 0.4rem;
    font-size: 0.78rem;
    color: var(--bs-secondary-color);
}

.hero-divider {
    width: 1px;
    height: 60px;
    background: var(--ops-card-border);
}

.hero-quickstat { min-width: 0; }
.hero-quick-num {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.hero-quick-of {
    font-size: 0.95rem;
    color: var(--bs-secondary-color);
    font-weight: 500;
    margin-left: 0.1rem;
}
.hero-quick-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bs-secondary-color);
    margin-top: 0.2rem;
    font-weight: 600;
}

/* ── KPI strip ───────────────────────────────────────────────────── */

.kpi-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.kpi-card {
    background: var(--ops-card-bg);
    border: 1px solid var(--ops-card-border);
    border-radius: 14px;
    padding: 1rem 1.1rem 0.85rem;
    display: flex;
    flex-direction: column;
    transition: all 0.18s ease;
    box-shadow: var(--ops-card-shadow);
    min-width: 0;
    position: relative;
    overflow: hidden;
}
.kpi-card:hover {
    border-color: color-mix(in srgb, var(--brand-primary, #0d6efd) 35%, var(--ops-card-border));
    box-shadow: var(--ops-card-shadow-hover);
    transform: translateY(-2px);
}

.kpi-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}
.kpi-icon {
    width: 28px; height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.kpi-icon-blue    { background: rgba(14,165,233,0.12); color: #0284c7; }
.kpi-icon-emerald { background: rgba(16,185,129,0.12); color: #059669; }
.kpi-icon-violet  { background: rgba(139,92,246,0.12); color: #7c3aed; }
.kpi-icon-amber   { background: rgba(245,158,11,0.12); color: #d97706; }
.kpi-icon-rose    { background: rgba(244,63,94,0.12);  color: #e11d48; }

.kpi-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bs-secondary-color);
    line-height: 1.2;
}

.kpi-num {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.025em;
    font-variant-numeric: tabular-nums;
    color: var(--bs-body-color);
}
.kpi-num-suf { font-size: 1.2rem; font-weight: 600; color: var(--bs-secondary-color); margin-left: 0.05rem; }
.kpi-num-of  { font-size: 1.15rem; color: var(--bs-secondary-color); font-weight: 500; margin-left: 0.1rem; }
.kpi-money .kpi-num { color: var(--brand-primary, #0d6efd); }

.kpi-delta {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 0.3rem;
    font-variant-numeric: tabular-nums;
}
.kpi-arrow { font-size: 0.7rem; }
.kpi-delta-num { font-weight: 700; }
.kpi-pct { color: var(--bs-secondary-color); font-weight: 500; }
.kpi-delta-flat {
    color: var(--bs-secondary-color);
    font-style: italic;
    font-weight: 500;
    font-size: 0.78rem;
}
.tone-good { color: var(--ops-success); }
.tone-bad  { color: var(--ops-bad); }
.tone-flat { color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .tone-good { color: #4ade80; }
[data-bs-theme="dark"] .tone-bad  { color: #fca5a5; }

.kpi-spark {
    margin-top: 0.6rem;
    height: 36px;
}

.kpi-foot {
    font-size: 0.66rem;
    color: var(--bs-secondary-color);
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}
.kpi-foot-no-spark { margin-top: 1rem; }

/* ── Cards (general) ─────────────────────────────────────────────── */

.ops-card {
    background: var(--ops-card-bg);
    border: 1px solid var(--ops-card-border);
    border-radius: 14px;
    margin-bottom: 1.25rem;
    overflow: hidden;
    box-shadow: var(--ops-card-shadow);
}
.ops-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid var(--ops-card-border);
    gap: 0.75rem;
    flex-wrap: wrap;
}
.ops-card-head-left { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.ops-card-head h6 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.ops-card-sub {
    color: var(--bs-secondary-color);
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
    padding-left: 0.5rem;
    border-left: 1px solid var(--ops-card-border);
}

.accent-bar {
    width: 4px;
    height: 22px;
    border-radius: 4px;
    flex-shrink: 0;
}
.accent-green  { background: linear-gradient(180deg, #22c55e, #16a34a); }
.accent-blue   { background: linear-gradient(180deg, #0ea5e9, #0284c7); }
.accent-violet { background: linear-gradient(180deg, #a855f7, #7e22ce); }
.accent-amber  { background: linear-gradient(180deg, #f59e0b, #d97706); }

.ops-card-body { padding: 1rem 1.15rem 1.15rem; }
.ops-card-body.p-0 { padding: 0; }

.card-legend {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
    font-weight: 500;
}
.legend-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 0.3rem;
    vertical-align: middle;
}
.dot-pass { background: #22c55e; }
.dot-fail { background: #ef4444; }

/* ── Timeline chart ─────────────────────────────────────────────── */

.chart-svg .bar { transition: opacity 0.2s ease; transform-origin: bottom center; animation: bar-grow 0.6s cubic-bezier(.4,0,.2,1) backwards; }
.chart-svg .bar:hover { opacity: 0.78; }
@keyframes bar-grow {
    from { transform: scaleY(0); }
    to   { transform: scaleY(1); }
}

/* ── Spend split ────────────────────────────────────────────────── */

.split-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}
.split-row .ops-card { margin-bottom: 0; }
.split-half { min-width: 0; }

.spend-bars {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.spend-bar {
    display: grid;
    grid-template-columns: 150px 1fr 96px;
    gap: 0.8rem;
    align-items: center;
    font-size: 0.85rem;
}
.spend-bar-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--bs-body-color);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}
.spend-bar-dot {
    width: 10px; height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}
.spend-bar-track {
    position: relative;
    background: var(--bs-tertiary-bg);
    border-radius: 999px;
    height: 18px;
    overflow: hidden;
}
.spend-bar-fill {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: 999px;
    transition: width 0.7s cubic-bezier(.4,0,.2,1);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15);
}
.spend-bar-share {
    position: absolute;
    right: 0.55rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--bs-body-color);
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 4px var(--ops-card-bg);
}
.spend-bar-num {
    text-align: right;
    color: var(--bs-body-color);
    font-variant-numeric: tabular-nums;
    font-size: 0.82rem;
    font-weight: 600;
}

/* ── Leaderboard ────────────────────────────────────────────────── */

.leaderboard-head { padding-right: 1rem; }
.sort-chips { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.sort-chip {
    background: var(--bs-tertiary-bg);
    border: 1px solid transparent;
    color: var(--bs-secondary-color);
    border-radius: 999px;
    padding: 0.28rem 0.7rem;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s ease;
    display: inline-flex;
    align-items: center;
}
.sort-chip:hover {
    background: var(--ops-card-bg);
    border-color: var(--ops-card-border);
    color: var(--bs-body-color);
}
.sort-chip.active {
    background: var(--brand-primary, #0d6efd);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 10px color-mix(in srgb, var(--brand-primary, #0d6efd) 35%, transparent);
}
.sort-chip-arrow {
    margin-left: 0.3rem;
    font-size: 0.7rem;
    opacity: 0.95;
}

.lb-wrap { overflow-x: auto; }

.leaderboard {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.leaderboard thead th {
    background: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
    text-align: left;
    padding: 0.55rem 0.95rem;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--ops-card-border);
    white-space: nowrap;
    user-select: none;
}
.leaderboard thead th.text-end { text-align: right; }
.leaderboard thead th.text-end .th-inner { justify-content: flex-end; }

/* Sortable column headers — clickable, with hover and active states.
   Inactive headers show a faded chevron only on hover so the header
   row stays clean at rest. Active header shows a solid caret in the
   current sort direction. */
.leaderboard thead th.sortable {
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
}
.leaderboard thead th.sortable:hover {
    background: color-mix(in srgb, var(--brand-primary, #0d6efd) 8%, var(--bs-tertiary-bg));
    color: var(--bs-body-color);
}
.leaderboard thead th.sortable.active {
    color: var(--brand-primary, #0d6efd);
    background: color-mix(in srgb, var(--brand-primary, #0d6efd) 6%, var(--bs-tertiary-bg));
}
.leaderboard thead th .th-inner {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.leaderboard thead th .sort-arrow {
    font-size: 0.7rem;
    line-height: 1;
}
.leaderboard thead th .sort-arrow-hint {
    opacity: 0;
    transition: opacity 0.12s ease;
}
.leaderboard thead th.sortable:hover .sort-arrow-hint {
    opacity: 0.5;
}
.leaderboard thead th.sortable.active .sort-arrow {
    opacity: 1;
}
.leaderboard tbody td {
    padding: 0.7rem 0.95rem;
    border-bottom: 1px solid var(--ops-card-border);
    vertical-align: middle;
}
.leaderboard tbody tr:last-child td { border-bottom: 0; }

.lb-row {
    cursor: pointer;
    transition: background-color 0.12s ease;
}
.lb-row:hover { background: color-mix(in srgb, var(--brand-primary, #0d6efd) 4%, transparent); }

.lb-rank { width: 36px; text-align: center; }
.lb-rank-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px; height: 22px;
    border-radius: 999px;
    background: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
    font-size: 0.72rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.lb-row:nth-child(1) .lb-rank-num { background: linear-gradient(135deg, #facc15, #ca8a04); color: #fff; }
.lb-row:nth-child(2) .lb-rank-num { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #fff; }
.lb-row:nth-child(3) .lb-rank-num { background: linear-gradient(135deg, #fb923c, #c2410c); color: #fff; }

.lb-name-cell {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.lb-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.18);
    letter-spacing: -0.02em;
}
.lb-name {
    font-weight: 600;
    color: var(--bs-body-color);
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.lb-crown { color: #f59e0b; font-size: 0.78rem; }
.lb-id {
    font-size: 0.66rem;
    color: var(--bs-secondary-color);
    font-variant-numeric: tabular-nums;
    margin-top: 1px;
}

.lb-type {
    font-size: 0.74rem;
    color: var(--bs-body-color);
    background: var(--bs-tertiary-bg);
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-weight: 500;
    white-space: nowrap;
}
.num { font-variant-numeric: tabular-nums; }
.lb-last-seen { color: var(--bs-secondary-color); font-size: 0.78rem; }

.lb-success-pill {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.74rem;
    font-variant-numeric: tabular-nums;
    min-width: 48px;
    text-align: center;
}
.lb-good { background: var(--ops-success-bg); color: var(--ops-success); }
.lb-ok   { background: var(--ops-warn-bg);    color: var(--ops-warn); }
.lb-bad  { background: var(--ops-bad-bg);     color: var(--ops-bad); }
[data-bs-theme="dark"] .lb-good { color: #4ade80; }
[data-bs-theme="dark"] .lb-ok   { color: #fcd34d; }
[data-bs-theme="dark"] .lb-bad  { color: #fca5a5; }
.lb-fail { color: var(--ops-bad); font-weight: 700; }
[data-bs-theme="dark"] .lb-fail { color: #fca5a5; }

/* ── Loading + empty ────────────────────────────────────────────── */

.ops-loading {
    display: flex; align-items: center; justify-content: center;
    min-height: 240px;
}
.ops-empty {
    text-align: center;
    padding: 4rem 1rem;
    background: var(--ops-card-bg);
    border: 1px dashed var(--ops-card-border);
    border-radius: 16px;
}
.ops-empty-icon {
    font-size: 3rem;
    color: var(--bs-secondary-color);
    opacity: 0.5;
    display: block;
    margin-bottom: 0.5rem;
}

/* ── Responsive ─────────────────────────────────────────────────── */

@media (max-width: 1280px) {
    .kpi-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1024px) {
    .hero-band { grid-template-columns: 1fr; gap: 1rem; }
    .hero-divider { display: none; }
    .split-row { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .kpi-row { grid-template-columns: repeat(2, 1fr); }
    .leaderboard { font-size: 0.78rem; }
    .leaderboard thead th, .leaderboard tbody td { padding: 0.5rem 0.55rem; }
    .lb-id { display: none; }
}

/* ── Dark mode ──────────────────────────────────────────────────── */

[data-bs-theme="dark"] .ops-shell {
    /* Card bg pushed slightly LIGHTER than body (#1a1d20 in site.css) so cards read
       as elevated surfaces instead of receding into the page. Previous #161b22 was
       darker than the body and made the lower cards visually disappear. */
    --ops-card-bg: #21262d;
    --ops-card-border: #3d444d;
    --ops-card-shadow: 0 1px 0 0 rgba(255,255,255,0.02), 0 4px 14px rgba(0,0,0,0.4);
    --ops-card-shadow-hover: 0 1px 0 0 rgba(255,255,255,0.03), 0 8px 24px rgba(0,0,0,0.55);
    --ops-success-bg: rgba(34, 197, 94, 0.16);
    --ops-warn-bg:    rgba(245, 158, 11, 0.16);
    --ops-bad-bg:     rgba(239, 68, 68, 0.16);
}
[data-bs-theme="dark"] .hero-band {
    background:
        linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(14, 165, 233, 0.08)),
        var(--ops-card-bg);
}

/* Explicit text-color overrides for the dim-on-dark issue. Bootstrap's
   --bs-body-color / --bs-secondary-color resolve correctly in dark mode but
   are too muted against our darker card background. Bumping to brighter
   neutrals so spend bars + leaderboard rows stay readable. */
[data-bs-theme="dark"] .spend-bar-label,
[data-bs-theme="dark"] .spend-bar-num,
[data-bs-theme="dark"] .lb-name,
[data-bs-theme="dark"] .leaderboard tbody td {
    color: #e6edf3;
}
[data-bs-theme="dark"] .spend-bar-share {
    color: #f0f6fc;
    text-shadow: 0 0 4px rgba(0,0,0,0.55);
}
[data-bs-theme="dark"] .lb-type {
    color: #e6edf3;
    background: #30363d;
}
[data-bs-theme="dark"] .lb-id,
[data-bs-theme="dark"] .lb-last-seen,
[data-bs-theme="dark"] .ops-card-sub,
[data-bs-theme="dark"] .card-legend {
    color: #9ba6b3;
}
[data-bs-theme="dark"] .leaderboard thead th {
    background: #2d333b;
    color: #9ba6b3;
}
[data-bs-theme="dark"] .lb-row:hover {
    background: rgba(56, 139, 253, 0.10);
}
