/* ═══════════════════════════════════════════════════════════════
   Tactical Board v2 — Redesigned Operations Dashboard
   flyExclusive Intelligence Platform
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. Design Tokens ── */
.bi-content {
    /* Backgrounds */
    --tb-bg: #080c14;
    --tb-surface: rgba(17, 24, 39, 0.85);
    --tb-surface-solid: #111827;
    --tb-surface-hover: #1a2233;
    --tb-elevated: #1e293b;

    /* Borders — 10% opacity minimum for LCD visibility */
    --tb-border: rgba(148, 163, 184, 0.10);
    --tb-border-hover: rgba(148, 163, 184, 0.18);

    /* Text hierarchy — all pass WCAG AA on #111827 */
    --tb-text: #f1f5f9;
    --tb-text-2: #cbd5e1;
    --tb-text-3: #94a3b8;        /* ~5.4:1 contrast on #111827 */
    --tb-text-4: #8b9bb5;        /* ~4.7:1 contrast — AA compliant */

    /* Status — green desaturated for dark mode luminance balance */
    --tb-green: #0d9668;
    --tb-green-bg: rgba(13, 150, 104, 0.08);
    --tb-green-glow: rgba(13, 150, 104, 0.2);
    --tb-red: #ef4444;
    --tb-red-bg: rgba(239, 68, 68, 0.08);
    --tb-amber: #f59e0b;
    --tb-amber-bg: rgba(245, 158, 11, 0.08);
    --tb-blue: #3b82f6;
    --tb-blue-bg: rgba(59, 130, 246, 0.08);
    --tb-purple: #8b5cf6;
    --tb-cyan: #06b6d4;
    --tb-muted: #6b7280;
    --tb-money: #34d399;          /* Distinct from status green */
    --tb-tail: #1a2744;           /* Tail number — dark navy on light tiles */

    /* Typography scale (minor third ~1.2x) */
    --tb-font-2xs: 0.5625rem;    /* 9px — smallest labels */
    --tb-font-xs: 0.625rem;      /* 10px — sub-labels, counts */
    --tb-font-sm: 0.6875rem;     /* 11px — table data, body */
    --tb-font-base: 0.8125rem;   /* 13px — fleet names, stats */
    --tb-font-lg: 1.1875rem;     /* 19px — panel hero values */
    --tb-font-xl: 1.5rem;        /* 24px — KPI values */
    --tb-font-2xl: 1.875rem;     /* 30px — primary KPI value */

    /* Spacing scale */
    --tb-sp-1: 4px;
    --tb-sp-2: 6px;
    --tb-sp-3: 8px;
    --tb-sp-4: 12px;
    --tb-sp-4a: 14px;
    --tb-sp-5: 16px;
    --tb-sp-6: 24px;

    /* Radius */
    --tb-r: 10px;
    --tb-r-sm: 6px;
    --tb-r-xs: 3px;

    /* Shadows */
    --tb-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    --tb-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.3);

    /* Motion */
    --tb-transition: 180ms ease;
}

/* ── 2. Layout Overrides ── */
.bi-mode .bi-content {
    background: var(--tb-bg);
}

.bi-mode .bi-top-row {
    background: transparent;
    padding: var(--tb-sp-4a) var(--tb-sp-5) var(--tb-sp-3);
}

.bi-mode .bi-grid-section {
    padding: 0 var(--tb-sp-5);
    scrollbar-width: thin;
    scrollbar-color: var(--tb-elevated) transparent;
}

.bi-grid-section::-webkit-scrollbar {
    width: 5px;
}

.bi-grid-section::-webkit-scrollbar-track {
    background: transparent;
}

.bi-grid-section::-webkit-scrollbar-thumb {
    background: var(--tb-elevated);
    border-radius: 3px;
}

.bi-grid-section::-webkit-scrollbar-thumb:hover {
    background: var(--tb-text-4);
}

.bi-mode .bi-right-column {
    padding: var(--tb-sp-4a) var(--tb-sp-5) var(--tb-sp-4a) 0;
    gap: var(--tb-sp-3);
}

.bi-mode .bi-bottom-row {
    padding: 0 var(--tb-sp-5) var(--tb-sp-4a);
    gap: var(--tb-sp-3);
    min-height: 220px;
    max-height: 300px;
}

/* Give bottom row more space in the grid */
.bi-mode .bi-content {
    grid-template-rows: auto 1fr minmax(220px, 0.45fr);
}

.bi-mode .bi-panel {
    background: var(--tb-surface-solid);
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-r);
    padding: var(--tb-sp-4);
}

/* Panel urgency accents */
.bi-panel--urgent {
    border-left: 3px solid var(--tb-red) !important;
}

/* ── 3. KPI Section ── */
.tb-kpi-row {
    display: flex;
    align-items: stretch;
    gap: var(--tb-sp-4a);
    padding: 0;
}

.tb-kpi {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--tb-surface-solid);
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-r);
    padding: var(--tb-sp-4a) var(--tb-sp-5) var(--tb-sp-3);
    min-width: 120px;
    cursor: pointer;
    transition: border-color var(--tb-transition), box-shadow var(--tb-transition);
}

.tb-kpi--animated {
    animation: tb-fade-up 300ms ease-out both;
}

.tb-kpi--animated:nth-child(2) { animation-delay: 60ms; }
.tb-kpi--animated:nth-child(3) { animation-delay: 120ms; }

.tb-kpi:hover {
    border-color: var(--tb-border-hover);
}

.tb-kpi--primary {
    min-width: 150px;
}

.tb-kpi--primary.tb-kpi--good {
    border-color: rgba(13, 150, 104, 0.20);
    background: linear-gradient(135deg, var(--tb-surface-solid) 0%, var(--tb-green-bg) 100%);
}

.tb-kpi--primary.tb-kpi--good:hover {
    box-shadow: 0 0 24px var(--tb-green-glow);
}

.tb-kpi--primary.tb-kpi--warn {
    border-color: rgba(245, 158, 11, 0.20);
    background: linear-gradient(135deg, var(--tb-surface-solid) 0%, var(--tb-amber-bg) 100%);
}

.tb-kpi--primary.tb-kpi--crit {
    border-color: rgba(239, 68, 68, 0.20);
    background: linear-gradient(135deg, var(--tb-surface-solid) 0%, var(--tb-red-bg) 100%);
}

/* Clickable KPI filter indicator */
.tb-kpi--active {
    box-shadow: 0 0 0 2px var(--tb-blue);
}

/* SVG Ring */
.tb-kpi-ring {
    width: 96px;
    height: 96px;
}

.tb-kpi--primary .tb-kpi-ring {
    width: 112px;
    height: 112px;
}

.tb-ring-bg {
    fill: none;
    stroke: var(--tb-elevated);
    stroke-width: 5;
}

.tb-ring-fill {
    fill: none;
    stroke-width: 5;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    transition: stroke-dashoffset 700ms cubic-bezier(0.4, 0, 0.2, 1), stroke 300ms ease;
}

.tb-ring-fill--animated {
    animation: tb-ring-in 900ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

.tb-kpi--good .tb-ring-fill { stroke: var(--tb-green); }
.tb-kpi--warn .tb-ring-fill { stroke: var(--tb-amber); }
.tb-kpi--crit .tb-ring-fill { stroke: var(--tb-red); }

/* Center text overlay */
.tb-kpi-inner {
    position: absolute;
    top: 14px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 96px;
    pointer-events: none;
}

.tb-kpi--primary .tb-kpi-inner {
    height: 112px;
}

.tb-kpi-value {
    font-size: var(--tb-font-xl);
    font-weight: 700;
    color: var(--tb-text);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.tb-kpi--primary .tb-kpi-value {
    font-size: var(--tb-font-2xl);
}

.tb-kpi-count {
    font-size: var(--tb-font-xs);
    color: var(--tb-text-4);
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

.tb-kpi-label {
    font-size: var(--tb-font-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--tb-text-3);
    margin-top: var(--tb-sp-3);
    text-align: center;
}

/* ── 4. MX Breakdown ── */
.tb-mx-breakdown {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--tb-sp-2);
    margin-left: var(--tb-sp-1);
    padding-left: var(--tb-sp-4a);
    border-left: 1px solid var(--tb-border);
}

.tb-mx-breakdown--animated {
    animation: tb-fade-up 300ms ease-out 180ms both;
}

.tb-mx-breakdown-label {
    font-size: var(--tb-font-2xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--tb-text-4);
    font-weight: 600;
    margin-bottom: 2px;
}

.tb-mx-pills {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tb-mx-pill {
    display: flex;
    align-items: center;
    gap: var(--tb-sp-3);
    padding: 3px var(--tb-sp-3);
    border-radius: var(--tb-r-sm);
    font-size: var(--tb-font-sm);
    cursor: default;
    transition: background var(--tb-transition);
}

.tb-mx-pill:hover {
    background: var(--tb-surface-hover);
}

.tb-mx-pill--sch { color: var(--tb-blue); }
.tb-mx-pill--aog { color: var(--tb-red); }
.tb-mx-pill--sme {
    color: var(--tb-amber);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: rgba(245, 158, 11, 0.3);
    text-underline-offset: 2px;
}
.tb-mx-pill--other { color: var(--tb-muted); }

.tb-mx-pill-label {
    font-weight: 700;
    width: 34px;
    font-size: var(--tb-font-xs);
    letter-spacing: 0.03em;
}

.tb-mx-pill-count {
    font-weight: 700;
    min-width: 16px;
    text-align: right;
}

.tb-mx-pill-pct {
    color: var(--tb-text-4);
    font-size: var(--tb-font-2xs);
    font-variant-numeric: tabular-nums;
}

/* ── 5. Status Bar Legend ── */
.tb-grid-legend {
    display: flex;
    align-items: center;
    gap: var(--tb-sp-4);
    padding: 0 0 var(--tb-sp-2);
    margin-bottom: var(--tb-sp-1);
    border-bottom: 1px solid var(--tb-border);
}

.tb-grid-legend-label {
    font-size: var(--tb-font-2xs);
    color: var(--tb-text-4);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.tb-grid-legend-item {
    display: flex;
    align-items: center;
    gap: var(--tb-sp-1);
    font-size: var(--tb-font-2xs);
    color: var(--tb-text-3);
}

.tb-grid-legend-swatch {
    width: 14px;
    height: 3px;
    background: var(--tb-text-3);
    border-radius: 1px;
}

/* Tail search input */
.tb-tail-search {
    margin-left: auto;
    width: 110px;
    padding: 2px 6px;
    font-size: var(--tb-font-2xs);
    font-family: inherit;
    color: var(--tb-text);
    background: var(--tb-elevated);
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-r-xs);
    outline: none;
    transition: border-color var(--tb-transition);
}

.tb-tail-search::placeholder {
    color: var(--tb-text-4);
}

.tb-tail-search:focus {
    border-color: var(--tb-blue);
}

/* Search match glow */
.tb-ac--search-match {
    border-color: var(--tb-cyan) !important;
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.35);
}

/* ── 6. Fleet Grid ── */
.tb-fleet-row {
    display: flex;
    align-items: stretch;
    gap: var(--tb-sp-3);
    padding: 3px 0;
}

.tb-fleet-card {
    flex-shrink: 0;
    width: 88px;
    background: var(--tb-surface-solid);
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-r-sm);
    padding: var(--tb-sp-3);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--tb-sp-1);
    transition: border-color var(--tb-transition);
}

.tb-fleet-card:hover {
    border-color: var(--tb-border-hover);
}

.tb-fleet-name {
    font-size: var(--tb-font-base);
    font-weight: 700;
    color: var(--tb-text);
    line-height: 1.1;
}

.tb-fleet-subtext {
    font-size: var(--tb-font-2xs);
    color: var(--tb-text-4);
    display: block;
    font-weight: 400;
}

.tb-fleet-bar {
    height: 3px;
    background: var(--tb-elevated);
    border-radius: 2px;
    overflow: hidden;
}

.tb-fleet-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

.tb-fleet-bar--good { background: var(--tb-green); }
.tb-fleet-bar--warn { background: var(--tb-amber); }
.tb-fleet-bar--crit { background: var(--tb-red); }

.tb-fleet-stats {
    display: flex;
    align-items: baseline;
    gap: var(--tb-sp-1);
}

.tb-fleet-stat {
    font-size: var(--tb-font-base);
    font-weight: 700;
    color: var(--tb-text-2);
    font-variant-numeric: tabular-nums;
}

.tb-fleet-stat-detail {
    font-size: var(--tb-font-2xs);
    color: var(--tb-text-4);
    font-variant-numeric: tabular-nums;
}

.tb-fleet-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: var(--tb-sp-1);
    align-content: flex-start;
    padding: 1px 0;
}

/* ── 7. Aircraft Tiles ── */
.tb-ac {
    position: relative;
    width: 70px;
    background: var(--tb-surface-solid);
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-r-sm);
    padding: 5px 3px 0;
    cursor: pointer;
    transition: border-color var(--tb-transition), transform var(--tb-transition), box-shadow var(--tb-transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

/* Reset old bi-aircraft-cell styles */
.tb-ac.bi-aircraft-cell {
    width: 70px;
    min-width: unset;
    max-width: unset;
    margin: 0;
}

.tb-ac:hover {
    border-color: var(--tb-border-hover);
    transform: translateY(-1px);
    box-shadow: var(--tb-shadow);
}

.tb-ac:focus-visible {
    outline: 2px solid var(--tb-blue);
    outline-offset: 1px;
}

/* AOG emergency treatment */
.tb-ac--aog {
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.2);
}

.tb-ac--aog::after {
    content: 'AOG';
    position: absolute;
    top: -1px;
    right: -1px;
    font-size: var(--tb-font-2xs);
    font-weight: 700;
    background: var(--tb-red);
    color: white;
    padding: 0 3px;
    border-radius: 0 5px 0 3px;
    letter-spacing: 0.04em;
    line-height: 1.5;
}

/* SME badge — top-right, amber */
.tb-ac--sme {
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.2);
}

.tb-ac--sme::after {
    content: 'SME';
    position: absolute;
    top: -1px;
    right: -1px;
    font-size: var(--tb-font-2xs);
    font-weight: 700;
    background: var(--tb-amber);
    color: white;
    padding: 0 3px;
    border-radius: 0 5px 0 3px;
    letter-spacing: 0.04em;
    line-height: 1.5;
}

/* SCH badge — top-right, blue */
.tb-ac--sch {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.2);
}

.tb-ac--sch::after {
    content: 'SCH';
    position: absolute;
    top: -1px;
    right: -1px;
    font-size: var(--tb-font-2xs);
    font-weight: 700;
    background: var(--tb-blue);
    color: white;
    padding: 0 3px;
    border-radius: 0 5px 0 3px;
    letter-spacing: 0.04em;
    line-height: 1.5;
}

/* Generic MX badge — top-right, muted */
.tb-ac--mx-other {
    border-color: rgba(107, 114, 128, 0.4);
    box-shadow: 0 0 6px rgba(107, 114, 128, 0.2);
}

.tb-ac--mx-other::after {
    content: 'MX';
    position: absolute;
    top: -1px;
    right: -1px;
    font-size: var(--tb-font-2xs);
    font-weight: 700;
    background: var(--tb-muted);
    color: white;
    padding: 0 3px;
    border-radius: 0 5px 0 3px;
    letter-spacing: 0.04em;
    line-height: 1.5;
}

/* Crew inbound badge — bottom-left */
.tb-ac-crew-inbound {
    position: absolute;
    bottom: 4px;
    left: 2px;
    font-size: var(--tb-font-2xs);
    font-weight: 700;
    background: var(--tb-cyan);
    color: white;
    padding: 0 3px;
    border-radius: 3px;
    line-height: 1.4;
}

.tb-ac-crew-inbound.planned {
    opacity: 0.7;
}

/* Days-until-MX countdown badge — bottom-right */
.tb-ac-mx-countdown {
    position: absolute;
    bottom: 4px;
    right: 2px;
    font-size: var(--tb-font-2xs);
    font-weight: 700;
    background: var(--tb-amber);
    color: white;
    padding: 0 3px;
    border-radius: 3px;
    line-height: 1.4;
}

.tb-ac-mx-countdown.urgent {
    background: var(--tb-red);
}

/* MEL restriction badge — top-left, amber */
.tb-ac--mel::before {
    content: 'MEL';
    position: absolute;
    top: -1px;
    left: -1px;
    font-size: var(--tb-font-2xs);
    font-weight: 700;
    background: var(--tb-amber);
    color: white;
    padding: 0 3px;
    border-radius: 5px 0 3px 0;
    letter-spacing: 0.04em;
    line-height: 1.5;
}

/* KPI filter dimming — 0.35 keeps tiles perceptible; no pointer-events:none so keyboard still works */
.tb-ac--dimmed {
    opacity: 0.35;
}

.tb-ac-tail {
    font-size: var(--tb-font-sm);
    font-weight: 600;
    color: var(--tb-tail);
    line-height: 1;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.tb-ac-loc {
    font-size: var(--tb-font-2xs);
    color: var(--tb-text-3);
    margin: 2px 0 var(--tb-sp-1);
    line-height: 1;
}

.tb-ac-loc .en-route-arrow {
    color: var(--tb-amber);
    font-weight: 700;
}

.tb-ac-status-bar {
    display: flex;
    width: calc(100% + 6px);
    height: 3px;
    gap: 1px;
    margin: 0 -3px;
}

.tb-ac-bar-crew,
.tb-ac-bar-mx {
    flex: 1;
}

.tb-ac-bar-crew {
    border-radius: 0 0 0 5px;
}

.tb-ac-bar-mx {
    border-radius: 0 0 5px 0;
}

/* ── 8. Panel Headers ── */
.bi-mode .bi-panel h3 {
    font-size: var(--tb-font-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--tb-text-3);
    margin: 0 0 var(--tb-sp-3);
    padding-bottom: var(--tb-sp-2);
    border-bottom: 1px solid var(--tb-border);
}

/* ── 9. Empty States ── */
.tb-empty-state {
    text-align: center;
    color: var(--tb-text-4);
    font-size: var(--tb-font-sm);
    padding: var(--tb-sp-5) var(--tb-sp-3);
    font-style: italic;
}

/* ── 10. Whitespace Panel ── */
.tb-ws-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--tb-sp-3);
    padding-bottom: var(--tb-sp-3);
    border-bottom: 1px solid var(--tb-border);
}

.tb-ws-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tb-ws-metric-value {
    font-size: var(--tb-font-lg);
    font-weight: 700;
    color: var(--tb-text);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.tb-ws-metric-value--revenue {
    color: var(--tb-money);
}

.tb-ws-metric-label {
    font-size: var(--tb-font-2xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--tb-text-4);
    margin-top: 2px;
    font-weight: 600;
}

/* ── 11. ISO Panel (compact horizontal strip) ── */
.tb-iso-strip {
    display: flex;
    gap: var(--tb-sp-2);
}

.tb-iso-chip {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--tb-elevated);
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-r-xs);
    padding: var(--tb-sp-1) var(--tb-sp-2);
    cursor: default;
    transition: border-color var(--tb-transition);
}

.tb-iso-chip:hover {
    border-color: var(--tb-border-hover);
}

.tb-iso-chip--total {
    background: linear-gradient(135deg, var(--tb-elevated) 0%, rgba(59, 130, 246, 0.06) 100%);
}

.tb-iso-chip-value {
    font-size: var(--tb-font-base);
    font-weight: 700;
    color: var(--tb-text);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.tb-iso-chip-label {
    font-size: var(--tb-font-2xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--tb-text-4);
    margin-top: 1px;
    font-weight: 600;
}

/* ── 12. Tables (shared) ── */
.tb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--tb-font-sm);
}

.tb-table th {
    text-align: left;
    font-weight: 600;
    color: var(--tb-text-4);
    font-size: var(--tb-font-2xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--tb-sp-1) var(--tb-sp-2);
    border-bottom: 1px solid var(--tb-border);
    white-space: nowrap;
}

.tb-table td {
    padding: 3px var(--tb-sp-2);
    color: var(--tb-text-2);
    border-bottom: 1px solid var(--tb-border);
}

.tb-table tbody tr {
    transition: background var(--tb-transition);
}

.tb-table tbody tr:hover {
    background: var(--tb-surface-hover);
}

/* Revenue uses distinct money color */
.tb-revenue {
    text-align: right;
    font-weight: 600;
    color: var(--tb-money) !important;
    font-variant-numeric: tabular-nums;
}

.tb-ws-fleet-header td {
    font-weight: 700;
    color: var(--tb-text-3) !important;
    font-size: var(--tb-font-2xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-top: var(--tb-sp-3) !important;
    border-bottom: none !important;
}

/* ── 13. Progress Bars (ERTS) ── */
.tb-progress-cell {
    display: flex;
    align-items: center;
    gap: var(--tb-sp-2);
}

.tb-progress {
    flex: 1;
    height: 4px;
    background: var(--tb-elevated);
    border-radius: 2px;
    overflow: hidden;
    min-width: 40px;
}

.tb-progress-fill {
    height: 100%;
    background: var(--tb-green);
    border-radius: 2px;
    transition: width 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

.tb-progress-text {
    font-size: var(--tb-font-2xs);
    color: var(--tb-text-3);
    min-width: 28px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ── 14. Fleet Badges (Crew Panel) ── */
.tb-fleet-badge {
    display: inline-block;
    padding: 1px 5px;
    border-radius: var(--tb-r-xs);
    font-size: var(--tb-font-2xs);
    font-weight: 700;
    background: var(--tb-elevated);
    color: var(--tb-text-3);
    letter-spacing: 0.03em;
    line-height: 1.4;
}

.tb-crew-table {
    width: 100%;
    border-collapse: collapse;
}

.tb-crew-table td {
    padding: 3px var(--tb-sp-1);
    font-size: var(--tb-font-sm);
    color: var(--tb-text-2);
    border-bottom: 1px solid var(--tb-border);
}

.tb-crew-table tr {
    transition: background var(--tb-transition);
}

.tb-crew-table tr:hover {
    background: var(--tb-surface-hover);
}

.tb-crew-name {
    font-weight: 500;
}

.tb-crew-position {
    color: var(--tb-text-4);
    font-size: var(--tb-font-2xs);
    font-weight: 600;
}

/* ── 15. Managed / International ── */
.tb-managed-container {
    display: flex;
    gap: var(--tb-sp-4a);
}

.tb-managed-section {
    flex: 1;
    min-width: 0;
}

.tb-managed-header {
    font-size: var(--tb-font-2xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--tb-text-4);
    margin-bottom: var(--tb-sp-2);
}

.tb-managed-empty {
    color: var(--tb-text-4);
    font-size: var(--tb-font-xs);
    font-style: italic;
}

/* ── 16. Low Hour Colors ── */
.tb-hrs-critical {
    color: var(--tb-red) !important;
    font-weight: 700;
}

.tb-hrs-warning {
    color: var(--tb-amber) !important;
    font-weight: 600;
}

.tb-hrs-ok {
    color: var(--tb-text-2);
}

/* ── 17. Animations ── */
@keyframes tb-ring-in {
    from { stroke-dashoffset: 301.59; }
}

@keyframes tb-fade-up {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── 18. Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
    .tb-kpi--animated,
    .tb-mx-breakdown--animated {
        animation: none !important;
    }

    .tb-ring-fill,
    .tb-ring-fill--animated {
        animation: none !important;
        transition: none !important;
    }

    .tb-ac {
        transition: none !important;
    }

    .tb-fleet-bar-fill,
    .tb-progress-fill {
        transition: none !important;
    }
}

/* ── 19. Fullscreen Adjustments ── */
.bi-fullscreen .tb-kpi-ring {
    width: 110px;
    height: 110px;
}

.bi-fullscreen .tb-kpi-inner {
    height: 110px;
}

.bi-fullscreen .tb-kpi--primary .tb-kpi-ring {
    width: 130px;
    height: 130px;
}

.bi-fullscreen .tb-kpi--primary .tb-kpi-inner {
    height: 130px;
}

.bi-fullscreen .tb-kpi-value {
    font-size: 1.7rem;
}

.bi-fullscreen .tb-kpi--primary .tb-kpi-value {
    font-size: 2.1rem;
}

.bi-fullscreen .tb-ac {
    width: 74px;
}

.bi-fullscreen .tb-ac.bi-aircraft-cell {
    width: 74px;
}

/* ── 20. Light Mode Overrides (class-based, not media query) ── */
.bi-content[data-theme="light"],
.bi-content.theme-light {
    --tb-bg: #f8fafc;
    --tb-surface: rgba(255, 255, 255, 0.9);
    --tb-surface-solid: #ffffff;
    --tb-surface-hover: #f1f5f9;
    --tb-elevated: #e2e8f0;
    --tb-border: rgba(15, 23, 42, 0.08);
    --tb-border-hover: rgba(15, 23, 42, 0.16);
    --tb-text: #0f172a;
    --tb-text-2: #334155;
    --tb-text-3: #475569;
    --tb-text-4: #64748b;
    --tb-green: #059669;
    --tb-red: #dc2626;
    --tb-amber: #d97706;
    --tb-blue: #2563eb;
    --tb-purple: #7c3aed;
    --tb-cyan: #0891b2;
    --tb-muted: #9ca3af;
    --tb-money: #059669;
    --tb-tail: #1a2744;
    --tb-green-bg: rgba(5, 150, 105, 0.06);
    --tb-green-glow: rgba(5, 150, 105, 0.15);
    --tb-red-bg: rgba(220, 38, 38, 0.06);
    --tb-amber-bg: rgba(217, 119, 6, 0.06);
    --tb-blue-bg: rgba(37, 99, 235, 0.06);
    --tb-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --tb-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* Fallback: also support prefers-color-scheme for auto-detection */
@media (prefers-color-scheme: light) {
    .bi-content:not([data-theme]) {
        --tb-bg: #f8fafc;
        --tb-surface: rgba(255, 255, 255, 0.9);
        --tb-surface-solid: #ffffff;
        --tb-surface-hover: #f1f5f9;
        --tb-elevated: #e2e8f0;
        --tb-border: rgba(15, 23, 42, 0.08);
        --tb-border-hover: rgba(15, 23, 42, 0.16);
        --tb-text: #0f172a;
        --tb-text-2: #334155;
        --tb-text-3: #475569;
        --tb-text-4: #64748b;
        --tb-green: #059669;
        --tb-red: #dc2626;
        --tb-amber: #d97706;
        --tb-blue: #2563eb;
        --tb-purple: #7c3aed;
        --tb-cyan: #0891b2;
        --tb-muted: #9ca3af;
        --tb-money: #059669;
        --tb-tail: #1a2744;
        --tb-green-bg: rgba(5, 150, 105, 0.06);
        --tb-green-glow: rgba(5, 150, 105, 0.15);
        --tb-red-bg: rgba(220, 38, 38, 0.06);
        --tb-amber-bg: rgba(217, 119, 6, 0.06);
        --tb-blue-bg: rgba(37, 99, 235, 0.06);
        --tb-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
        --tb-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.06);
    }
}
