/* ============================================================
   CALL FLY — flight strip board
   Chrome is tower glass (dark slate). Content is a strip bay:
   every record is a paper strip with a status tab, the way a
   tower controller works a board of live flights.
   ============================================================ */

:root {
  --ink:        #151A21;   /* tower glass */
  --ink-2:      #1D242D;
  --ink-3:      #2A3441;
  --bay:        #DCD8CF;   /* the metal bay strips sit in */
  --strip:      #FBFAF6;   /* strip paper */
  --gold:       #B8860F;   /* Golden Era amber — primary accent */
  --gold-lit:   #E3A81C;
  --signal:     #2B6E8C;   /* radar blue — secondary */
  --rust:       #A33D22;   /* alerts */
  --go:         #3D7A4E;   /* cleared */
  --taxi:       #8A6A18;   /* moving */
  --text:       #171C22;
  --text-dim:   #5E6873;
  --line:       #C3BEB2;

  --rail-w: 236px;
  --strip-h: 46px;
  --r: 2px;

  --font-display: "Barlow Condensed", "Oswald", "Arial Narrow", sans-serif;
  --font-body: "Public Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-data: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bay);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--signal); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--gold-lit);
  outline-offset: 2px;
}

/* ---------- Left rail: tower glass ------------------------ */

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail-w);
  background: var(--ink);
  color: #C9D1DA;
  display: flex;
  flex-direction: column;
  z-index: 40;
  overflow-y: auto;
}

.mark {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--ink-3);
}
.mark-name {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1;
  display: block;
}
.mark-name em { font-style: normal; color: var(--gold-lit); }
.mark-sub {
  font-family: var(--font-data);
  font-size: 9.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #6B7784;
  margin-top: 6px;
  display: block;
}

.rail-group {
  padding: 14px 0 4px;
}
.rail-group > h3 {
  font-family: var(--font-data);
  font-size: 9.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #626E7C;
  margin: 0 0 6px;
  padding: 0 18px;
  font-weight: 500;
}

.rail a.nav {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 18px;
  color: #B7C0CA;
  font-size: 13.5px;
  border-left: 3px solid transparent;
  text-decoration: none;
}
.rail a.nav:hover { background: var(--ink-2); color: #fff; text-decoration: none; }
.rail a.nav.on {
  background: var(--ink-2);
  color: #fff;
  border-left-color: var(--gold);
}
.rail a.nav .k {
  font-family: var(--font-data);
  font-size: 10px;
  color: #5D6874;
  width: 26px;
  flex: 0 0 26px;
  letter-spacing: .04em;
}
.rail a.nav.on .k { color: var(--gold-lit); }

.rail-foot {
  margin-top: auto;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--ink-3);
  font-size: 12px;
  color: #6B7784;
}
.rail-foot strong { color: #C9D1DA; display: block; font-weight: 600; }
.rail-foot a { color: #8792A0; }

/* ---------- Top bar --------------------------------------- */

.shell { margin-left: var(--rail-w); min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bay);
  border-bottom: 1px solid var(--line);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.picker {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--strip);
  border: 1px solid var(--line);
  padding: 4px 8px;
}
.picker label {
  font-family: var(--font-data);
  font-size: 9.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.picker select {
  border: 0;
  background: transparent;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text);
  max-width: 210px;
}

/* Live counter: the one animated thing on the page */
.live {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-data);
  font-size: 12px;
  letter-spacing: .05em;
  color: var(--text-dim);
}
.live .dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--go);
  position: relative;
}
.live .dot::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid var(--go);
  animation: sweep 2.6s ease-out infinite;
}
@keyframes sweep {
  0%   { transform: scale(.4); opacity: .9; }
  100% { transform: scale(1.5); opacity: 0; }
}
.live b {
  font-size: 17px;
  color: var(--text);
  font-weight: 600;
}

.main { padding: 22px 24px 60px; flex: 1; }

/* ---------- Page head ------------------------------------- */

.head { margin-bottom: 18px; display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.head h1 {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin: 0;
  line-height: 1;
}
.head p { margin: 4px 0 0; color: var(--text-dim); font-size: 13.5px; max-width: 62ch; }
.head .head-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.eyebrow {
  font-family: var(--font-data);
  font-size: 9.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 5px;
}

/* ---------- Metric row ------------------------------------ */

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 22px;
}
.metric { background: var(--strip); padding: 13px 15px 11px; }
.metric .m-label {
  font-family: var(--font-data);
  font-size: 9.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.metric .m-value {
  font-family: var(--font-display);
  font-size: 33px;
  font-weight: 600;
  line-height: 1.05;
  margin-top: 3px;
  letter-spacing: .01em;
}
.metric .m-foot { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.m-delta { font-family: var(--font-data); font-size: 11px; }
.m-delta.up   { color: var(--go); }
.m-delta.down { color: var(--rust); }
.m-delta.flat { color: var(--text-dim); }

.spark { width: 74px; height: 22px; margin-left: auto; display: block; }
.spark-line { fill: none; stroke: var(--gold); stroke-width: 1.5; }
.spark-fill { fill: rgba(184,134,15,.13); stroke: none; }

/* ---------- Panels ---------------------------------------- */

.panel {
  background: var(--strip);
  border: 1px solid var(--line);
  margin-bottom: 20px;
}
.panel > header {
  padding: 10px 15px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(var(--strip), #F2F0EA);
}
.panel > header h2 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin: 0;
}
.panel > header .hint { font-size: 12px; color: var(--text-dim); }
.panel > header .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.panel .body { padding: 15px; }

.grid { display: grid; gap: 20px; }
.grid.two   { grid-template-columns: 1fr 1fr; }
.grid.wide  { grid-template-columns: 1.65fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }

/* ---------- THE FLIGHT STRIP (signature) ------------------ */

.bay { display: flex; flex-direction: column; }

.strip {
  display: grid;
  grid-template-columns: 6px 108px 1fr;
  align-items: stretch;
  min-height: var(--strip-h);
  background: var(--strip);
  border-bottom: 1px solid var(--line);
  position: relative;
}
.strip:last-child { border-bottom: 0; }
.strip:hover { background: #F6F4EE; }

.strip .tab { background: var(--text-dim); }
.strip .tab.go   { background: var(--go); }
.strip .tab.taxi { background: var(--taxi); }
.strip .tab.hold { background: var(--signal); }
.strip .tab.stop { background: var(--rust); }

.strip .callsign {
  font-family: var(--font-data);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .04em;
  padding: 11px 12px;
  border-right: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}
.strip .callsign small {
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 1px;
}

.strip .cells {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 6px 0;
  min-width: 0;
}
.cell {
  padding: 0 14px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}
.cell + .cell { border-left: 1px solid #EAE7DF; }
.cell.grow { flex: 1; }
.cell.tight { flex: 0 0 auto; }
.cell .c-label {
  font-family: var(--font-data);
  font-size: 9px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.cell .c-value {
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cell .c-value.data { font-family: var(--font-data); font-size: 12.5px; }
.cell .c-value.big { font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: .02em; }
.cell.end { margin-left: auto; text-align: right; }
.cell.end .c-label, .cell.end .c-value { text-align: right; }

.strip-actions { display: flex; align-items: center; gap: 6px; padding: 0 12px 0 14px; margin-left: auto; }

.bay-head {
  display: grid;
  grid-template-columns: 6px 108px 1fr;
  background: #EFEDE6;
  border-bottom: 1px solid var(--line);
}
.bay-head .callsign { border-right: 1px dashed var(--line); }
.bay-head span {
  font-family: var(--font-data);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 6px 12px;
}

/* ---------- Plain table ----------------------------------- */

table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  font-family: var(--font-data);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: #EFEDE6;
  white-space: nowrap;
}
table.data td { padding: 9px 12px; border-bottom: 1px solid #EAE7DF; vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #F6F4EE; }
table.data td.n, table.data th.n { text-align: right; font-family: var(--font-data); font-size: 12.5px; white-space: nowrap; }

/* Inline proportion bar behind a label */
.barcell { position: relative; }
.barcell .fill {
  position: absolute;
  inset: 3px auto 3px 0;
  background: rgba(43,110,140,.13);
  z-index: 0;
}
.barcell span { position: relative; z-index: 1; }

/* ---------- Chart ----------------------------------------- */

.chart-wrap { position: relative; height: 232px; }
.chart-wrap canvas { width: 100%; height: 100%; display: block; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-family: var(--font-data); font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--text-dim); }
.legend i { width: 10px; height: 3px; display: inline-block; margin-right: 5px; vertical-align: middle; }

/* ---------- Controls -------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-data);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 7px 13px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  border-radius: var(--r);
  text-decoration: none;
  line-height: 1;
}
.btn:hover { background: var(--ink-2); text-decoration: none; color: #fff; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: #EFEDE6; color: var(--text); }
.btn.gold { background: var(--gold); border-color: var(--gold); }
.btn.gold:hover { background: var(--gold-lit); border-color: var(--gold-lit); }
.btn.sm { padding: 5px 9px; font-size: 10px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.chip {
  display: inline-block;
  font-family: var(--font-data);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 3px 7px;
  border: 1px solid var(--line);
  color: var(--text-dim);
  background: #F2F0EA;
  border-radius: var(--r);
  white-space: nowrap;
}
.chip.go   { color: var(--go);     border-color: rgba(61,122,78,.4);  background: rgba(61,122,78,.09); }
.chip.taxi { color: var(--taxi);   border-color: rgba(138,106,24,.4); background: rgba(138,106,24,.09); }
.chip.hold { color: var(--signal); border-color: rgba(43,110,140,.4); background: rgba(43,110,140,.09); }
.chip.stop { color: var(--rust);   border-color: rgba(163,61,34,.4);  background: rgba(163,61,34,.09); }

.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a {
  font-family: var(--font-data);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 9px 15px;
  color: var(--text-dim);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--text); border-bottom-color: var(--gold); }

/* Forms */
.field { margin-bottom: 12px; }
.field > label {
  display: block;
  font-family: var(--font-data);
  font-size: 9.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=url], input[type=search], select, textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 13.5px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: var(--r);
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--signal); outline: none; box-shadow: 0 0 0 2px rgba(43,110,140,.16); }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.help { font-size: 11.5px; color: var(--text-dim); margin-top: 4px; }

.filterbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: var(--strip);
  border: 1px solid var(--line);
}
.filterbar input, .filterbar select { width: auto; min-width: 132px; }

/* Flash + empty states */
.note {
  padding: 10px 14px;
  border-left: 3px solid var(--signal);
  background: var(--strip);
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  font-size: 13.5px;
}
.note.ok   { border-left-color: var(--go); }
.note.warn { border-left-color: var(--taxi); }
.note.bad  { border-left-color: var(--rust); }

.empty { padding: 34px 20px; text-align: center; color: var(--text-dim); }
.empty h3 {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0 0 6px;
}
.empty p { margin: 0 auto 14px; max-width: 46ch; font-size: 13.5px; }

code.snippet {
  display: block;
  font-family: var(--font-data);
  font-size: 12px;
  background: var(--ink);
  color: #C7D2DC;
  padding: 13px 15px;
  overflow-x: auto;
  white-space: pre;
  border-radius: var(--r);
  line-height: 1.6;
}
code.snippet .t { color: var(--gold-lit); }

/* Heatmap plot */
.heat { position: relative; background: #EFEDE6; border: 1px solid var(--line); height: 300px; overflow: hidden; }
.heat i {
  position: absolute;
  width: 22px; height: 22px;
  margin: -11px 0 0 -11px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(163,61,34,.55) 0%, rgba(184,134,15,.25) 45%, transparent 72%);
}

/* Funnel */
.funnel { display: flex; flex-direction: column; gap: 3px; }
.funnel .step { position: relative; background: #EFEDE6; height: 40px; display: flex; align-items: center; }
.funnel .step .fill { position: absolute; inset: 0 auto 0 0; background: rgba(43,110,140,.2); border-right: 2px solid var(--signal); }
.funnel .step .lab { position: relative; padding: 0 12px; font-size: 13px; display: flex; width: 100%; gap: 12px; align-items: center; }
.funnel .step .lab b { font-family: var(--font-data); font-size: 12.5px; font-weight: 500; margin-left: auto; }
.funnel .drop { font-family: var(--font-data); font-size: 10.5px; color: var(--rust); padding-left: 12px; }

/* Login */
.gate { min-height: 100vh; display: grid; place-items: center; background: var(--ink); padding: 24px; }
.gate-card { width: 100%; max-width: 372px; background: var(--strip); border: 1px solid var(--line); padding: 30px 28px; }
.gate-card .mark-name { color: var(--text); font-size: 38px; }
.gate-card .mark-sub { color: var(--text-dim); margin-bottom: 22px; }

/* Print — reports go out as PDFs from the browser */
@media print {
  .rail, .topbar, .head-actions, .btn, .filterbar { display: none !important; }
  .shell { margin-left: 0; }
  body { background: #fff; }
  .panel, .metrics { break-inside: avoid; border-color: #999; }
}

/* Responsive */
@media (max-width: 1100px) {
  .grid.two, .grid.wide, .grid.three { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  :root { --rail-w: 0px; }
  .rail {
    position: static;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding-bottom: 6px;
  }
  .mark { border-bottom: 0; padding: 12px 16px; }
  .rail-group { padding: 0; display: flex; flex-wrap: wrap; }
  .rail-group > h3 { display: none; }
  .rail a.nav { border-left: 0; border-bottom: 2px solid transparent; padding: 7px 11px; }
  .rail a.nav.on { border-left: 0; border-bottom-color: var(--gold); }
  .rail a.nav .k { display: none; }
  .rail-foot { display: none; }
  .shell { margin-left: 0; }
  .main { padding: 16px 14px 48px; }
  .strip { grid-template-columns: 5px 88px 1fr; }
  .strip .cells { flex-wrap: wrap; }
  .cell + .cell { border-left: 0; }
  .cell.end { margin-left: 0; text-align: left; }
  .cell.end .c-label, .cell.end .c-value { text-align: left; }
  .bay-head { display: none; }
  .head h1 { font-size: 27px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
