/* TSA Clean — Hiring & Dispatch Hub
   Deep-navy ops-room tiles (per Al's reference boards), industrial condensed
   display type, mono data numerals. One accent per meaning:
   green = go/hired · amber = trial/warning · red = stop · blue = comms */

:root {
  --bg: #12152b;
  --panel: #1c2044;
  --panel-2: #242a58;
  --line: #2e3567;
  --ink: #eef0ff;
  --muted: #8f96c6;
  --dim: #626a9e;
  --green: #35d49f;
  --amber: #ffb54d;
  --red: #ff6272;
  --blue: #5aa7ff;
  --violet: #a78bfa;
  --radius: 12px;
  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.45;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea {
  font-family: inherit; font-size: 13px;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; width: 100%;
}
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 1px;
}
::placeholder { color: var(--dim); }

/* ---------- login ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(900px 500px at 20% -10%, #232a5e 0%, transparent 60%),
    radial-gradient(700px 500px at 100% 110%, #1a2a4e 0%, transparent 55%),
    var(--bg);
}
.login-card {
  width: min(380px, 92vw); background: var(--panel);
  border: 1px solid var(--line); border-radius: 16px; padding: 34px 30px;
}
.login-card h1 {
  font-family: var(--font-display); font-weight: 700; font-size: 34px;
  letter-spacing: .5px; text-transform: uppercase; line-height: 1.05;
}
.login-card h1 em { color: var(--green); font-style: normal; }
.login-sub { color: var(--muted); font-size: 12px; margin: 6px 0 24px; }
.login-card label { display: block; font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em; margin: 14px 0 5px; }
.login-err { color: var(--red); font-size: 12px; margin-top: 10px; min-height: 16px; }

/* ---------- shell ---------- */
.shell { display: none; min-height: 100vh; flex-direction: column; }
header.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 12px 22px; background: #0e1124;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.brand {
  font-family: var(--font-display); font-size: 22px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
.brand em { color: var(--green); font-style: normal; }
.brand small {
  display: block; font-family: var(--font-body); font-size: 10px;
  color: var(--muted); letter-spacing: .18em; font-weight: 500;
}
/* live heartbeat light */
.livedot { display: flex; align-items: center; gap: 7px; font-size: 11px;
  color: var(--muted); white-space: nowrap; }
.livedot .dot { width: 11px; height: 11px; border-radius: 50%;
  background: var(--green); position: relative; }
.livedot .dot::after { content: ""; position: absolute; inset: -4px;
  border-radius: 50%; border: 2px solid var(--green);
  animation: livepulse 1.6s ease-out infinite; }
.livedot.down .dot { background: var(--red); }
.livedot.down .dot::after { border-color: var(--red); animation: none;
  opacity: .4; }
@keyframes livepulse {
  0% { transform: scale(.6); opacity: .9; }
  100% { transform: scale(1.6); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .livedot .dot::after { animation: none; opacity: .5; }
}

/* guide tab */
.guide { max-width: 880px; font-size: 13.5px; line-height: 1.6; }
.guide h2 { font-family: var(--font-display); font-size: 24px; font-weight: 700;
  letter-spacing: .03em; margin: 22px 0 8px; color: var(--ink); }
.guide h2:first-child { margin-top: 0; }
.guide ul { margin: 6px 0 14px 22px; }
.guide li { margin-bottom: 5px; }
.guide li b { color: var(--green); }
.guide .wip { background: #3a3050; border: 1px solid var(--amber);
  border-radius: 10px; padding: 12px 16px; color: var(--amber);
  font-size: 13px; margin-bottom: 18px; }
.guide .tip { color: var(--muted); font-size: 12.5px; }

.demo-pill {
  font-size: 11px; color: var(--amber); border: 1px solid #6b5325;
  background: #2e2748; padding: 3px 10px; border-radius: 20px; white-space: nowrap;
}
.topbar .spacer { flex: 1; }
.userchip { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.userchip .avatar {
  width: 30px; height: 30px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-weight: 700;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--green);
  font-family: var(--font-display); font-size: 15px;
}
.linkbtn { background: none; border: none; color: var(--muted); font-size: 12px;
  text-decoration: underline; }
.linkbtn:hover { color: var(--ink); }

/* ---------- KPI strip ---------- */
.kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px; padding: 14px 22px 0;
}
.kpi {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px 10px; cursor: pointer;
  transition: border-color .15s;
}
.kpi:hover { border-color: var(--dim); }
.kpi .n {
  font-family: var(--font-display); font-size: 34px; font-weight: 700;
  line-height: 1; letter-spacing: .02em;
}
.kpi .l { font-size: 10.5px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .09em; margin-top: 4px; }
.kpi.k-green .n { color: var(--green); }
.kpi.k-amber .n { color: var(--amber); }
.kpi.k-blue .n { color: var(--blue); }
.kpi.k-red .n { color: var(--red); }
.kpi.k-violet .n { color: var(--violet); }

/* ---------- tabs ---------- */
nav.tabs {
  display: flex; gap: 4px; padding: 12px 22px 0; flex-wrap: wrap;
  align-items: center;
}
.tab {
  background: none; border: 1px solid transparent; color: var(--muted);
  font-family: var(--font-display); font-size: 16.5px; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase;
  padding: 7px 16px; border-radius: 9px 9px 0 0;
}
.tab:hover { color: var(--ink); }
.tab.active {
  color: var(--ink); background: var(--panel);
  border-color: var(--line); border-bottom-color: var(--panel);
}
.tab .cnt { color: var(--green); font-family: var(--font-mono); font-size: 12px;
  margin-left: 5px; }
.tab.warn .cnt { color: var(--amber); }
.tabs .push { flex: 1; }
.btn {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
  border-radius: 9px; padding: 8px 15px; font-size: 12.5px; font-weight: 600;
}
.btn:hover { border-color: var(--dim); }
.btn.primary { background: var(--green); border-color: var(--green); color: #0a2018; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #06213f; }
.btn.danger { background: transparent; border-color: #7c3a44; color: var(--red); }
.btn.sm { padding: 5px 10px; font-size: 11.5px; }
.btn:disabled { opacity: .45; cursor: default; }

/* ---------- main ---------- */
main {
  flex: 1; margin: 0 22px 22px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 0 var(--radius) var(--radius) var(--radius);
  padding: 18px; min-height: 420px;
}

/* announcement strip (Teresa's trial slots) */
.trials-strip { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.trial-chip {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, #2c2a55, #24304f);
  border: 1px solid #3d4479; border-radius: 10px; padding: 8px 13px;
  font-size: 12.5px;
}
.trial-chip b { color: var(--amber); font-family: var(--font-display);
  font-size: 16px; letter-spacing: .04em; }
.trial-chip .x { background: none; border: none; color: var(--dim); font-size: 14px; }
.trial-chip .x:hover { color: var(--red); }

/* filter row */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input, .filters select { width: auto; min-width: 130px; }
.filters input[type="search"] { min-width: 210px; }

/* ---------- candidate cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px; }
.card {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px 14px; cursor: pointer;
  transition: border-color .15s, transform .1s;
  display: flex; flex-direction: column; gap: 8px;
}
.card:hover { border-color: var(--dim); transform: translateY(-1px); }
.card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card h3 { font-family: var(--font-display); font-size: 19px; font-weight: 600;
  letter-spacing: .03em; line-height: 1.1; }
.card .loc { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.light { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.light.green { background: var(--green); box-shadow: 0 0 8px #35d49f88; }
.light.yellow { background: var(--amber); box-shadow: 0 0 8px #ffb54d88; }
.light.red { background: var(--red); box-shadow: 0 0 8px #ff627288; }
.badges { display: flex; gap: 5px; flex-wrap: wrap; }
.badge {
  font-size: 9.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  padding: 2.5px 7px; border-radius: 5px; border: 1px solid transparent;
}
.b-src-facebook_ad { color: #7cb2ff; background: #1c2b52; }
.b-src-tiktok_callrail { color: #ff9bd2; background: #3a2044; }
.b-src-indeed { color: #7fe0ff; background: #14344a; }
.b-src-referral { color: #c9b8ff; background: #2c2559; }
.b-src-manual { color: var(--muted); background: #262b57; }
.b-status { color: var(--ink); background: #303764; }
.b-status.s-offer_sent { color: var(--amber); background: #3a3050; }
.b-status.s-hired { color: var(--green); background: #14372f; }
.b-status.s-terminated, .b-status.s-rejected { color: var(--red); background: #3c2333; }
.b-stale { color: var(--red); background: #3c2333; }
.b-optout { color: var(--red); background: #3c2333; }
.b-norehire { color: #ff8a96; background: #46202b; border-color: #7c3a44; }
.card .meta { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.card .own { font-size: 11px; color: var(--dim); }
.card .own b { color: var(--violet); }

/* ---------- pipeline board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(215px, 1fr);
  gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.col { background: #181c3a; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px; min-height: 300px; }
.col h4 {
  font-family: var(--font-display); font-size: 14.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .09em; color: var(--muted);
  display: flex; justify-content: space-between; margin: 2px 2px 10px;
}
.col h4 .cnt { color: var(--green); font-family: var(--font-mono); }
.col .card { margin-bottom: 8px; }

/* ---------- map ---------- */
.map-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px;
  overflow: hidden; }
.seg button { background: none; border: none; color: var(--muted);
  padding: 7px 14px; font-size: 12px; font-weight: 600; }
.seg button.on { background: var(--panel-2); color: var(--ink); }
.tilemap { display: grid; grid-template-columns: repeat(12, minmax(44px, 1fr));
  gap: 5px; max-width: 980px; }
.tile {
  aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--line);
  background: #181c3a; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px; cursor: pointer;
  transition: transform .1s;
}
.tile:hover { transform: scale(1.06); z-index: 2; }
.tile .ab { font-family: var(--font-display); font-weight: 600; font-size: 13px;
  letter-spacing: .05em; color: var(--muted); }
.tile .v { font-family: var(--font-mono); font-size: 12px; color: var(--ink); }
.tile.h1 { background: #1d3550; } .tile.h1 .ab { color: #9fc4e8; }
.tile.h2 { background: #1c4a62; } .tile.h2 .ab { color: #bfe0f5; }
.tile.h3 { background: #17636c; } .tile.h3 .ab { color: #d2f3f0; }
.tile.h4 { background: #128a71; } .tile.h4 .ab { color: #e2fff5; }
.tile.h5 { background: #35d49f; } .tile.h5 .ab, .tile.h5 .v { color: #0a2018; }
.tile.excluded { background: repeating-linear-gradient(45deg, #181c3a, #181c3a 4px,
  #22183a 4px, #22183a 8px); cursor: default; }
.tile.excluded .ab { color: #5c4b6e; }
.map-legend { display: flex; gap: 14px; margin-top: 14px; font-size: 11.5px;
  color: var(--muted); flex-wrap: wrap; }
.map-legend .sw { display: inline-block; width: 12px; height: 12px;
  border-radius: 3px; margin-right: 5px; vertical-align: -2px; }

/* ---------- tables (archive, log) ---------- */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th { text-align: left; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .09em; color: var(--muted); padding: 8px 10px;
  border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid #23284e; vertical-align: top; }
tr.rowlink { cursor: pointer; }
tr.rowlink:hover td { background: #20254c; }
.logline { font-family: var(--font-mono); font-size: 11.5px; }
.logline .who { color: var(--violet); }
.logline .what { color: var(--blue); }
.logline time { color: var(--dim); }

/* ---------- drawer ---------- */
.overlay { position: fixed; inset: 0; background: #05071adb; z-index: 90;
  display: none; }
.overlay.open { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 96vw);
  background: var(--panel); border-left: 1px solid var(--line); z-index: 100;
  transform: translateX(102%); transition: transform .22s ease;
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer-head { padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-family: var(--font-display); font-size: 27px;
  font-weight: 700; letter-spacing: .03em; line-height: 1.05; }
.drawer-head .sub { color: var(--muted); font-family: var(--font-mono);
  font-size: 11.5px; margin-top: 3px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px 30px; }
.drawer .close { position: absolute; top: 14px; right: 16px; background: none;
  border: none; color: var(--muted); font-size: 22px; }
.drawer .close:hover { color: var(--ink); }
.sec { margin-bottom: 18px; }
.sec > h5 { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); margin-bottom: 8px; }
.statusgrid { display: flex; flex-wrap: wrap; gap: 6px; }
.statusgrid .btn.on { background: var(--green); border-color: var(--green);
  color: #0a2018; }
.hl-row { display: flex; gap: 8px; }
.hl { flex: 1; border-radius: 9px; border: 1px solid var(--line); padding: 8px 4px;
  background: var(--panel-2); color: var(--muted); font-size: 12px; font-weight: 700; }
.hl.on-green { background: #14372f; border-color: var(--green); color: var(--green); }
.hl.on-yellow { background: #3a3050; border-color: var(--amber); color: var(--amber); }
.hl.on-red { background: #3c2333; border-color: var(--red); color: var(--red); }
.feed { display: flex; flex-direction: column; gap: 9px; max-height: 300px;
  overflow-y: auto; padding-right: 4px; }
.feed .item { border-left: 2px solid var(--line); padding: 2px 0 2px 11px; }
.feed .item .hd { font-size: 11px; color: var(--dim);
  font-family: var(--font-mono); }
.feed .item .hd b { color: var(--violet); }
.feed .item p { font-size: 12.5px; margin-top: 2px; }
.feed .item.t-sms_sent { border-color: var(--blue); }
.feed .item.t-sms_received { border-color: var(--green); }
.feed .item.t-status_change { border-color: var(--amber); }
.feed .item.t-health_change { border-color: var(--red); }
.chat { display: flex; flex-direction: column; gap: 6px; max-height: 220px;
  overflow-y: auto; padding: 4px; }
.bubble { max-width: 82%; padding: 7px 11px; border-radius: 12px; font-size: 12.5px; }
.bubble.out { align-self: flex-end; background: #1e3a5f; border: 1px solid #2d4f7c; }
.bubble.in { align-self: flex-start; background: #1c3b32; border: 1px solid #2b5a4b; }
.bubble time { display: block; font-size: 9.5px; color: var(--dim); margin-top: 2px;
  font-family: var(--font-mono); }
.inline-form { display: flex; gap: 7px; margin-top: 8px; }
.inline-form input { flex: 1; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px;
  font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { font-family: var(--font-mono); font-size: 12px; }
.docs { display: flex; flex-direction: column; gap: 5px; }
.doc { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.doc .st { font-size: 9.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 5px; }
.doc .st.signed { color: var(--green); background: #14372f; }
.doc .st.sent { color: var(--amber); background: #3a3050; }
.doc .st.missing { color: var(--dim); background: #262b57; }

/* ---------- modals ---------- */
.modal { position: fixed; inset: 0; z-index: 110; display: none;
  align-items: center; justify-content: center; background: #05071adb; padding: 18px; }
.modal.open { display: flex; }
.modal-card { width: min(520px, 96vw); max-height: 92vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px; }
.modal-card h3 { font-family: var(--font-display); font-size: 24px;
  font-weight: 700; letter-spacing: .03em; margin-bottom: 14px; }
.modal-card label { display: block; font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em; margin: 12px 0 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.packet { background: #181c3a; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; margin-top: 14px; font-size: 12.5px; }
.packet h6 { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--amber); margin-bottom: 7px; }
.packet li { margin-left: 16px; margin-bottom: 3px; color: #c9cdf2; }
.hint { font-size: 11.5px; color: var(--dim); margin-top: 6px; }
.err { color: var(--red); font-size: 12px; margin-top: 8px; min-height: 15px; }
.ok-flash { color: var(--green); font-size: 12px; margin-top: 8px; }

/* toast */
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: #0e1124; border: 1px solid var(--green); color: var(--ink);
  border-radius: 10px; padding: 10px 18px; font-size: 13px; z-index: 200;
  display: none; }
#toast.err { border-color: var(--red); }

.empty { color: var(--dim); text-align: center; padding: 46px 10px;
  font-size: 13px; }

@media (max-width: 760px) {
  main { margin: 0 8px 8px; padding: 12px; }
  .kpis, nav.tabs { padding-left: 8px; padding-right: 8px; }
  header.topbar { padding: 10px 12px; flex-wrap: wrap; }
  .tilemap { grid-template-columns: repeat(12, minmax(24px, 1fr)); }
  .tile .v { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
