/* HALO design system — clean flight-data-monitoring dashboard.
   Loaded after app.css; restyles the shared chrome + surfaces and adds the
   console/flight components. The admin datapoints page keeps its own classes. */

:root {
  /* Dark army-green theme. Orange = secondary, McLaren sky-blue = super-accent.
     Data panels (.gtrace/.panel) stay light "instrument screens"; emails are
     untouched (they share render.py and must render light in mail clients). */
  --bg: #20251a;            /* page — dark army green */
  --surface: #2a3022;       /* cards */
  --surface-2: #353d2b;     /* insets, hovers */
  --panel: #f4f6ee;         /* light instrument panels (g-trace, event minis) */
  --ink: #f4f6f0;           /* primary text (brighter for legibility) */
  --muted: #ccd1c3;         /* secondary text */
  --faint: #a6ad97;         /* hints */
  --line: #3b4329;          /* hairline borders */
  --line-2: #4b5639;        /* stronger borders */
  --brand: #181d0f;         /* topbar — deepest olive */
  --accent: #34bfe6;        /* super-accent — McLaren sky blue */
  --secondary: #f0812c;     /* secondary — orange */
  --green: #5fb172; --green-bg: #25341f; --green-ink: #93d69e;
  --amber: #e3a73f; --amber-bg: #38301a; --amber-ink: #f3c468;
  --red: #e36f5d; --red-bg: #3a221c; --red-ink: #f4a698;
  --radius: 11px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(0,0,0,.28), 0 6px 18px rgba(0,0,0,.24);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace; }

/* ---- top bar ---- */
.stripe { display: none; }
.topbar {
  display: flex; align-items: center; gap: 8px;
  background: var(--brand); color: #fff;
  padding: 0 20px; height: 56px;
}
.topbar__brand { color: var(--secondary); font-weight: 700; letter-spacing: .14em; font-size: 15px; margin-right: 18px; }
.topbar__brand:hover { text-decoration: none; }
.topbar__primary { display: flex; gap: 4px; flex: 1; }
.topbar__tab {
  color: #c4cedb; font-size: 13.5px; font-weight: 500; padding: 8px 14px; border-radius: 8px;
}
.topbar__tab:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.topbar__tab.active { color: #fff; background: rgba(255,255,255,.14); }
.topbar__right { display: flex; align-items: center; gap: 14px; }
.topbar__admin { color: #c4cedb; display: flex; align-items: center; gap: 6px; font-size: 13px; }
.topbar__admin:hover, .topbar__admin.active { color: #fff; text-decoration: none; }
.topbar__who { color: #93a1b0; font-size: 13px; }
.topbar__logout { color: #c4cedb; font-size: 13px; }

/* ---- page + cards ---- */
.page { max-width: 1080px; margin: 0 auto; padding: 28px 24px 64px; }
.card-stack { display: flex; flex-direction: column; gap: 20px; padding: 0; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 24px; max-width: none; width: auto;
}
.card--auth { max-width: 380px; margin: 56px auto; }
.card--pad0 { padding: 0; overflow: hidden; }

.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
h1.headline, .headline { font-family: inherit; color: var(--ink); font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 4px 0 0; }
h2.headline, .headline--sm { font-size: 19px; }
.lede { color: var(--muted); margin: 8px 0 0; }
.hint { color: var(--faint); font-size: 13px; }
.section-title { font-family: inherit; color: var(--ink); font-size: 15px; font-weight: 600; margin: 0 0 14px; }

/* ---- KPI metric cards ---- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.kpi__label { font-size: 12.5px; color: var(--muted); }
.kpi__value { font-size: 27px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; }
.kpi__value.is-danger { color: var(--red); }
.kpi__value .pill { font-size: 13px; padding: 3px 12px; vertical-align: 2px; }
.kpi__unit { font-size: 15px; font-weight: 500; color: var(--muted); }

/* ---- pills + tags ---- */
.pill { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .03em; padding: 2px 9px; border-radius: 20px; }
.pill--green { background: var(--green-bg); color: var(--green-ink); }
.pill--yellow { background: var(--amber-bg); color: var(--amber-ink); }
.pill--red { background: var(--red-bg); color: var(--red-ink); }
.tag { font-size: 11.5px; color: var(--red); }

/* ---- severity bar (green/yellow/red proportions) ---- */
.sev { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--surface-2); }
.sev > span { display: block; }
.sev .g { background: #6fae5a; } .sev .y { background: #e0a534; } .sev .r { background: #d6584a; }

/* ---- console pilot rows ---- */
.rows { }
.rowhead, .prow {
  display: grid; grid-template-columns: 1.5fr 2fr 70px 84px 28px; gap: 14px; align-items: center;
  padding: 13px 20px;
}
.rowhead { font-size: 12px; color: var(--faint); border-bottom: 1px solid var(--line); }
.prow { border-top: 1px solid var(--line); cursor: pointer; background: none; width: 100%; text-align: left; font: inherit; color: inherit; }
.prow:first-of-type { border-top: 0; }
.prow:hover { background: var(--surface-2); }
.prow.is-flagged { border-left: 3px solid var(--red); }
.prow__name { font-weight: 600; }
.prow__sub { font-size: 11.5px; color: var(--red); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.num--danger { color: var(--red); font-weight: 600; }
.num--zero { color: var(--faint); }
.chev { text-align: center; color: var(--faint); }

/* expansion panel */
.expand { padding: 4px 20px 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 26px; background: var(--surface-2); border-top: 1px solid var(--line); }
.expand h4 { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 14px 0 8px; }
.miniline { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.miniline:last-child { border-bottom: 0; }
.miniline .when { color: var(--muted); }
.dot { font-size: 9px; vertical-align: 2px; }
.dot--red { color: var(--red); } .dot--amber { color: var(--amber); }

/* ---- data table (flights list) ---- */
.dtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.dtable th { text-align: left; font-weight: 500; color: var(--faint); font-size: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.dtable td { padding: 11px 12px; border-bottom: 1px solid var(--line); }
.dtable tr:last-child td { border-bottom: 0; }
.dtable tbody tr:hover { background: var(--surface-2); }

/* ---- g-trace + event panels ---- */
.gtrace { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); padding: 6px; }
.gtrace svg { display: block; width: 100%; height: auto; }
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; background: var(--panel); color: #25303a; }
.panel .hint { color: #5b6770; }
.panel__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 13px; }
.panel svg { display: block; width: 100%; height: auto; }

/* ---- buttons + forms ---- */
.btn { display: inline-block; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 500; padding: 9px 16px; border-radius: 8px; cursor: pointer; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #06222b; }
.btn--primary:hover { background: #4fcdef; }
.field { display: block; width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; font: inherit; margin: 6px 0 16px; background: var(--surface-2); color: var(--ink); }
.field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(52,191,230,.22); }
.label { font-size: 13px; font-weight: 600; color: var(--muted); }

/* ---- flashes + footer ---- */
.flashes { max-width: 1080px; margin: 16px auto 0; padding: 0 24px; }
.flash { border-radius: 8px; padding: 10px 14px; font-size: 14px; margin-bottom: 8px; }
.flash--error { background: var(--red-bg); color: var(--red-ink); }
.flash--success { background: var(--green-bg); color: var(--green-ink); }
.flash--info { background: #e8eef6; color: #234; }
.footer { display: block; max-width: 1080px; margin: 40px auto 0; padding: 18px 24px; background: none; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; text-align: left; }
.footer .stamp { display: none; }
.impersonation-banner { background: var(--amber-bg); color: var(--amber-ink); padding: 8px 24px; font-size: 13px; display: flex; align-items: center; gap: 10px; }
.impersonation-banner__btn { margin-left: auto; }
