/* TL console. Dark, dense, readable across a monitoring desk. Deliberately plain CSS —
   no framework, no build step (see hub/app/console.py for the reasoning). */

:root {
  --bg: #0b0f14; --panel: #121821; --line: #232c38; --ink: #e6eef8; --dim: #8b9bb0;
  --ok: #2ec27e; --warn: #f5a623; --crit: #e4452f; --idle: #5b6675;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}
body.centred { display: grid; place-items: center; min-height: 100vh; }
h2 { font-size: 15px; margin: 22px 0 8px; font-weight: 600; }
h2 .meta { font-weight: 400; font-size: 12px; color: var(--dim); margin-left: 8px; }
.muted, .meta { color: var(--dim); }
.mono { font-family: ui-monospace, "Cascadia Code", monospace; font-size: 12px; color: var(--dim); }
.grow { flex: 1; }
.hidden { display: none !important; }
.note {
  font-size: 12.5px; color: #cbd5e1; background: #161d26; border-left: 3px solid var(--warn);
  padding: 8px 12px; margin: 0 0 10px; border-radius: 4px;
}

/* ---- chrome ---- */
.topbar {
  display: flex; align-items: center; gap: 18px; padding: 10px 18px;
  background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.brand { font-weight: 700; letter-spacing: .01em; }
.brand span { font-weight: 400; color: var(--dim); }
.brand.big { font-size: 20px; }
.tabs { display: flex; gap: 4px; }
.tabs a {
  color: var(--dim); text-decoration: none; padding: 6px 11px; border-radius: 6px;
  font-size: 13px; display: flex; align-items: center; gap: 6px;
}
.tabs a:hover { background: #1a222c; color: var(--ink); }
.tabs a.on { background: #1d2938; color: var(--ink); }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px;
       font-size: 12px; color: var(--dim); }
.clock { font-family: ui-monospace, monospace; }
.inline { display: inline; }
main { padding: 14px 18px 40px; }

button, .small {
  background: #223044; color: var(--ink); border: 1px solid #2f3f56; border-radius: 6px;
  padding: 6px 11px; font: inherit; font-size: 12.5px; cursor: pointer;
}
button:hover { background: #2c3d55; }
button:disabled { opacity: .5; cursor: default; }
input, select {
  background: #0d1219; color: var(--ink); border: 1px solid #2a3543; border-radius: 6px;
  padding: 7px 9px; font: inherit; font-size: 13px;
}

/* ---- login ---- */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px;
}
.card.login { width: min(360px, 92vw); display: flex; flex-direction: column; gap: 10px; }
.card.login .sub { color: var(--dim); font-size: 13px; margin-bottom: 4px; }
.card.login label { display: flex; flex-direction: column; gap: 4px; font-size: 12px;
                    color: var(--dim); }
.err { color: #ff8f7a; font-size: 12.5px; }

/* ---- rows & strips ---- */
.rows { display: flex; flex-direction: column; gap: 4px; }
.row {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px; font-size: 13px;
}
.row.warn { border-color: #6b5320; background: #1e1a11; }
.row.crit { border-color: #7a2a1e; background: #22120f; }

/* Another team's work. Dimmed and set back rather than hidden: a team leader can act on it,
   and doing so is recorded, so it should read as somebody else's without being unreadable
   (D-016). Never applied to an alert strip entry — an unacknowledged FALL is nobody's
   background. */
.row.notmine, .card.notmine {
  opacity: .62; border-style: dashed;
}
.row.notmine:hover, .card.notmine:hover { opacity: 1; }
.strip { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }

.pill {
  font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 9px;
  background: #2a3340; color: var(--dim); text-transform: uppercase; letter-spacing: .03em;
  white-space: nowrap;
}
.pill.ok, .pill.online, .pill.new { background: #14301f; color: #6ee7a8; }
.pill.warn, .pill.stale, .pill.needs_info { background: #3a3320; color: #f0c674; }
.pill.crit, .pill.bad, .pill.offline, .pill.revoked { background: #3a1a15; color: #ff9b86; }
.pill.idle, .pill.never, .pill.closed, .pill.ack { background: #232c38; color: #9fb0c4; }

/* ---- station cards ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.card.station { padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.card.station.offline { border-color: #7a2a1e; }
.card.station.stale { border-color: #6b5320; }
.station-head { display: flex; align-items: center; gap: 8px; }
.station-head b { flex: 1; }
.station-sub { font-size: 11.5px; color: var(--dim); display: flex; align-items: center;
               gap: 6px; flex-wrap: wrap; }
.cams { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.cam {
  display: flex; justify-content: space-between; gap: 8px; font-size: 12px;
  padding: 5px 8px; border-radius: 5px; background: #0f151d; border-left: 3px solid var(--idle);
}
.cam .camstate { color: var(--dim); font-size: 11px; }
.cam.ok { border-left-color: var(--ok); }
.cam.warn { border-left-color: var(--warn); }
.cam.crit { border-left-color: var(--crit); background: #1d1211; }
.cam.bad { border-left-color: #7a4a3e; }
.cam.idle { border-left-color: var(--idle); }

/* ---- reports ---- */
.card.report { margin-bottom: 8px; display: flex; flex-direction: column; gap: 7px; }
.card.report.help { border-color: #7a2a1e; background: #1b1210; }
.report-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.report-body { font-size: 13px; line-height: 1.6; }
.tl-note { font-size: 12.5px; background: #16202b; border-radius: 5px; padding: 6px 9px; }
.report-actions { display: flex; gap: 6px; align-items: center; }
.report-actions .note { flex: 1; }

/* ---- stations tab ---- */
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.code-out { width: 100%; margin-top: 8px; }
.code {
  font-family: ui-monospace, monospace; font-size: 26px; letter-spacing: .12em;
  color: #6ee7a8; background: #0d1219; border: 1px dashed #2f5f45; border-radius: 8px;
  padding: 12px; text-align: center; user-select: all;
}
.badge {
  background: var(--crit); color: #fff; font-size: 10.5px; font-weight: 700;
  border-radius: 9px; padding: 1px 6px; min-width: 17px; text-align: center;
}

/* ---- agents / credential caches ---- */
.chips { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px;
  background: #1a222c; border: 1px solid var(--line); border-radius: 12px;
  padding: 3px 9px; cursor: pointer; white-space: nowrap;
}
.chip:hover { background: #223044; }
.chip input { margin: 0; accent-color: var(--ok); }
.ag-edit { display: flex; align-items: center; gap: 8px; }
.report-actions .reply { flex: 1; }

/* ---- metrics tiles ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tile {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px;
}
.tile.ok   { border-left: 3px solid var(--ok); }
.tile.warn { border-left: 3px solid var(--warn); }
.tile.crit { border-left: 3px solid var(--crit); }
.tile-v { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile-l { font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: .03em; }
.tile-s { font-size: 11px; color: var(--dim); margin-top: 2px; }
.policy {
  flex: 1 1 100%; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-top: 6px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12px;
}
.policy label { display: inline-flex; align-items: center; gap: 5px; color: var(--dim); }
