/* FlyLat DataCenter — ops console (tinted neutrals, minimal charts) */

:root {
    --font-sans: "DM Sans", system-ui, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, monospace;

    --bg-deep: oklch(0.14 0.025 250);
    --bg: oklch(0.17 0.022 250);
    --bg-raised: oklch(0.2 0.02 248);
    --bg-hover: oklch(0.23 0.022 248);

    --fg: oklch(0.93 0.012 250);
    --fg-muted: oklch(0.68 0.02 250);
    --fg-faint: oklch(0.52 0.02 250);

    --line: oklch(0.32 0.02 250 / 0.55);
    --line-strong: oklch(0.42 0.025 250 / 0.7);

    --signal: oklch(0.72 0.1 205);
    --human: oklch(0.78 0.1 75);
    --ai: oklch(0.72 0.06 295);
    --danger: oklch(0.62 0.14 25);

    --radius: 6px;
    --radius-lg: 10px;
    --shadow: 0 1px 0 oklch(1 0 0 / 0.04), 0 12px 40px oklch(0 0 0 / 0.35);
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    background: var(--bg-deep);
    color: var(--fg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 50% at 10% -10%, oklch(0.35 0.08 205 / 0.12), transparent 55%),
        radial-gradient(ellipse 60% 40% at 100% 0%, oklch(0.3 0.06 295 / 0.08), transparent 50%);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.wrap {
    position: relative;
    z-index: 1;
    max-width: 1240px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3.5rem;
}

/* Header */
.site-header {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
}

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

.header-end {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 1.25rem;
}

.brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--radius-lg);
    background: var(--bg-raised);
    border: 1px solid var(--line-strong);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--signal);
    box-shadow: var(--shadow);
}

.brand h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.brand .tagline {
    margin: 0.2rem 0 0;
    font-size: 0.8125rem;
    color: var(--fg-muted);
    max-width: 26rem;
    line-height: 1.45;
}

.header-badges {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.5rem;
}

.badge-beta:focus-visible {
    outline: 2px solid oklch(0.72 0.1 85 / 0.55);
    outline-offset: 2px;
}

.badge-beta-dot {
    flex-shrink: 0;
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 2px oklch(0.72 0.1 85 / 0.25);
    animation: beta-pulse 2.2s ease-in-out infinite;
}

@keyframes beta-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.badge-beta-tooltip {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 50;
    width: max-content;
    max-width: min(18.5rem, calc(100vw - 2rem));
    padding: 0.65rem 0.85rem;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: normal;
    text-transform: none;
    color: var(--fg);
    background: var(--bg-raised);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.badge-beta:hover .badge-beta-tooltip,
.badge-beta:focus .badge-beta-tooltip,
.badge-beta:focus-within .badge-beta-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Tabs */
.tabs-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem;
    padding: 0.2rem;
    margin-bottom: 1.75rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--bg);
    width: 100%;
    overflow-x: auto;
}

.tabs-trigger {
    flex: 0 0 auto;
    padding: 0.5rem 0.9rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--fg-muted);
    background: transparent;
    border: none;
    border-radius: calc(var(--radius-lg) - 2px);
    cursor: pointer;
    transition: color 0.18s ease-out, background 0.18s ease-out;
}

.tabs-trigger:hover {
    color: var(--fg);
    background: var(--bg-hover);
}

.tabs-trigger:focus-visible {
    outline: 2px solid var(--signal);
    outline-offset: 1px;
}

.tabs-trigger.active {
    color: var(--fg);
    background: var(--bg-raised);
    box-shadow: 0 1px 0 oklch(1 0 0 / 0.06);
}

.panel { display: none; }
.panel.active {
    display: block;
    animation: panel-in 0.22s ease-out;
}

@keyframes panel-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-title {
    margin: 0 0 0.65rem;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--fg-faint);
}

.card-description {
    margin: 0.3rem 0 0;
    font-size: 0.8125rem;
    color: var(--fg-muted);
    line-height: 1.45;
}

/* Cards */
.card {
    margin-bottom: 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--bg);
    box-shadow: var(--shadow);
}

.card-header {
    padding: 1.15rem 1.25rem 0;
}

.card-title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.card-content { padding: 1.15rem 1.25rem 1.25rem; }
.card-content.pt-0 { padding-top: 0; }

/* KPIs — no side-stripe borders */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
    gap: 0.65rem;
    margin-bottom: 1.1rem;
}

.kpi-grid.hero {
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
    gap: 0.75rem;
}

.kpi {
    padding: 0.95rem 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--bg);
}

.kpi.hero {
    background: var(--bg-raised);
    padding: 1.1rem 1.15rem;
}

.kpi[data-tone="signal"] { border-color: oklch(0.72 0.1 205 / 0.35); }
.kpi[data-tone="human"] { border-color: oklch(0.78 0.1 75 / 0.3); }
.kpi[data-tone="ai"] { border-color: oklch(0.72 0.06 295 / 0.3); }

.kpi label {
    display: block;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--fg-faint);
}

.kpi-value {
    display: block;
    margin-top: 0.4rem;
    font-family: var(--font-mono);
    font-size: 1.35rem;
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.kpi.hero .kpi-value { font-size: 1.5rem; }

.kpi-sub {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: var(--fg-muted);
    line-height: 1.35;
}

.strip {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 2.25rem;
    padding: 0.9rem 1.1rem;
    margin-bottom: 1.1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--bg);
}

.strip .item label {
    display: block;
    font-size: 0.625rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg-faint);
}

.strip .item strong {
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.text-human { color: var(--human); }
.text-ai { color: var(--ai); }
.text-muted { color: var(--fg-muted); }

/* Controls */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2rem;
    padding: 0 0.8rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--bg-raised);
    color: var(--fg);
    cursor: pointer;
    transition: background 0.18s ease-out, border-color 0.18s ease-out;
}

.btn:hover {
    background: var(--bg-hover);
    border-color: var(--line-strong);
}

.btn.active {
    background: var(--signal);
    border-color: transparent;
    color: oklch(0.16 0.03 250);
}

.input, .select {
    height: 2rem;
    padding: 0 0.65rem;
    font-size: 0.8125rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--bg-deep);
    color: var(--fg);
}

.input { min-width: 11rem; }
.input:focus, .select:focus {
    outline: 2px solid oklch(0.72 0.1 205 / 0.45);
    outline-offset: 0;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.85rem;
}

.toolbar.btn-group,
#rank-toolbar,
#pilot-sort-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
    margin: 0 -0.15rem;
    border-radius: var(--radius);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0.55rem 0.5rem;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: left;
    color: var(--fg-faint);
    background: var(--bg);
    border-bottom: 1px solid var(--line-strong);
}

.table td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--line);
}

.table tbody tr:hover td {
    background: oklch(1 0 0 / 0.02);
}

.table td.num,
.table th.num {
    text-align: right;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.table .col-primary {
    color: var(--signal);
    font-weight: 500;
}

.airline-cell {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.45rem;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    border-radius: 4px;
    border: 1px solid var(--line);
    background: var(--bg-deep);
    color: var(--fg-muted);
}

.site-header .badge {
    gap: 0.4rem;
    min-height: 1.75rem;
    padding: 0.35rem 0.7rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: var(--radius);
    line-height: 1;
}

.site-header .badge-year,
.site-header .badge-home {
    border-color: var(--line);
    background: var(--bg-raised);
    color: var(--fg-muted);
}

.site-header .badge-home {
    flex-shrink: 0;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.18s ease-out, border-color 0.18s ease-out, color 0.18s ease-out;
}

.site-header .badge-home:hover {
    background: var(--bg-hover);
    border-color: var(--line-strong);
    color: var(--fg);
}

.site-header .badge-home:focus-visible {
    outline: 2px solid var(--signal);
    outline-offset: 2px;
}

.site-header .badge-beta {
    position: relative;
    cursor: help;
    border-color: oklch(0.72 0.1 85 / 0.4);
    background: oklch(0.72 0.1 85 / 0.1);
    color: oklch(0.84 0.08 85);
}

.badge-full {
    border-color: oklch(0.78 0.1 75 / 0.35);
    color: var(--human);
}

.badge-activity {
    border-color: oklch(0.75 0.12 65 / 0.4);
    color: oklch(0.8 0.1 65);
}

.badge-ai-heavy {
    border-color: oklch(0.72 0.06 295 / 0.4);
    color: var(--ai);
}

/* Charts — ApexCharts mounts */
.charts-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

@media (max-width: 820px) {
    .charts-2 { grid-template-columns: 1fr; }
}

.chart-box {
    position: relative;
    min-height: 240px;
    height: 260px;
}

.chart-box.tall {
    min-height: 280px;
    height: 300px;
}

.chart-box > div,
.chart-mount {
    width: 100%;
    height: 100%;
    min-height: inherit;
}

.chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 0.8125rem;
    color: var(--fg-muted);
}

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

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

.route-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.route-list li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.8125rem;
}

.route-list li span:last-child {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--fg-muted);
    font-variant-numeric: tabular-nums;
}

.legend-inline {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 0.65rem;
    font-size: 0.7rem;
    color: var(--fg-muted);
}

.legend-inline span::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 2px;
    margin-right: 0.4rem;
    vertical-align: middle;
    border-radius: 1px;
}

.legend-inline .h::before { background: var(--human); }
.legend-inline .a::before { background: var(--ai); }

/* Alerts */
.alert {
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.8125rem;
    border: 1px solid var(--line);
}

.alert-destructive {
    border-color: oklch(0.62 0.14 25 / 0.5);
    background: oklch(0.62 0.14 25 / 0.12);
    color: oklch(0.85 0.08 25);
}

/* Skeleton */
.skeleton,
#app-skeleton .skeleton {
    border-radius: var(--radius-lg);
    background: linear-gradient(
        90deg,
        var(--bg) 0%,
        var(--bg-raised) 50%,
        var(--bg) 100%
    );
    background-size: 200% 100%;
    animation: skeleton 1.4s ease-in-out infinite;
}

@keyframes skeleton {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.skeleton-kpi { height: 5.5rem; }
.skeleton-card { height: 14rem; margin-bottom: 1rem; }
.skeleton-chart { min-height: 240px; width: 100%; }
.skeleton-table-cell { height: 1.25rem; width: 100%; border-radius: var(--radius-sm); }
.skeleton-list-item { height: 1.5rem; width: 100%; border-radius: var(--radius-sm); }

#app-main { display: none; }
#app-main.ready { display: block; }
#app-skeleton.hidden { display: none; }

.empty-state {
    padding: 2rem 1rem;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--fg-muted);
}

.status-panel {
    display: grid;
    gap: 0.35rem 1rem;
    grid-template-columns: auto 1fr;
    font-size: 0.8125rem;
}

.status-panel dt {
    margin: 0;
    color: var(--fg-faint);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.status-panel dd {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}
