/* Brand tokens from edtechassurance.co.uk (Website/assets/style.css). */
:root {
  --navy: #0F2942; --navy-deep: #081826; --teal: #0D7377; --teal-light: #14A3A8;
  --surface: #FFFFFF; --surface-alt: #F5F8F9; --card: #FFFFFF;
  --text: #1C2B3A; --text-muted: #55677A; --heading: #0F2942; --line: #E2E8EF;
  --hot: #B4531A; --hot-bg: #FFF2E8; --danger: #B42318; --ok: #1E7A45; --warn: #9A6700;
  --shadow: 0 1px 2px rgba(15,41,66,.06), 0 8px 24px -12px rgba(15,41,66,.18);
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #0A1622; --surface-alt: #0E1E2C; --card: #0F2130;
    --text: #D9E2EA; --text-muted: #90A2B4; --heading: #F3F7F9; --line: rgba(255,255,255,.12);
    --hot: #F0A36B; --hot-bg: rgba(240,163,107,.12); --danger: #F97066; --ok: #6CE9A6; --warn: #FEC84B;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 var(--font); background: var(--surface-alt); color: var(--text); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--teal); }
.small { font-size: 12px; }
.muted { color: var(--text-muted); }

.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 16px; background: var(--navy); color: #fff; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; }
.mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--teal);
  font-weight: 700; letter-spacing: .5px; }
.brand-title { font-weight: 700; font-size: 16px; }
.brand-sub { font-size: 12px; opacity: .75; }
.topbar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.topbar .muted { color: rgba(255,255,255,.72); }
.who { display: flex; align-items: center; gap: 6px; }
.who select { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25); border-radius: 6px; padding: 4px 8px; color: #fff; }
.who select option { color: #000; }
.banner { padding: 8px 16px; background: #FFF6DB; color: #5A4300; border-bottom: 1px solid #F1DE9B; font-size: 13px; }

.btn { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.btn:hover { border-color: var(--teal); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--teal-light); }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.layout { display: grid; grid-template-columns: minmax(340px, 1fr) minmax(0, 1.35fr); gap: 16px; padding: 16px;
  max-width: 1500px; margin: 0 auto; }
.list-pane { min-width: 0; }
.counts { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 12px; }
.count { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; }
.count b { display: block; font-size: 20px; color: var(--heading); font-variant-numeric: tabular-nums; }
.count span { font-size: 12px; color: var(--text-muted); }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tab { flex: 0 0 auto; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 13px; color: var(--text); }
.tab span { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 5px; border-radius: 999px; background: var(--surface-alt); font-size: 11px; font-weight: 700; text-align: center; }
.tab.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.tab.on span { background: rgba(255,255,255,.2); color: #fff; }
.tab.zero { opacity: .55; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.filters input[type=search] { flex: 1 1 220px; }
.filters input[type=search], .filters select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.chk { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-muted); }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
  cursor: pointer; box-shadow: var(--shadow); }
.card:hover, .card:focus-visible { border-color: var(--teal); outline: none; }
.card.active { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal) inset; }
.card-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.card h3 { margin: 0; font-size: 15px; color: var(--heading); }
.card .title { margin: 4px 0 6px; color: var(--text); }
.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--text-muted); }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--surface-alt); border: 1px solid var(--line); font-size: 12px; }
.chip.hot { background: var(--hot-bg); color: var(--hot); border-color: transparent; font-weight: 600; }
.chip.svc { color: var(--teal); }
.status { font-weight: 600; text-transform: capitalize; }
.need { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--navy); background: var(--surface-alt); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; margin-right: 8px; }
@media (prefers-color-scheme: dark) { .need { color: var(--heading); } }
.status.sent, .status.replied, .status.meeting, .status.won { color: var(--ok); }
.status.lost, .status.not_suitable, .status.suppressed { color: var(--text-muted); }
.status.on_hold { color: var(--warn); }
.due { font-weight: 600; }
.due.soon { color: var(--danger); }
.empty { color: var(--text-muted); text-align: center; padding: 40px 0; }

.detail-pane { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 20px; position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow: auto; }
.detail-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.detail-head h2 { margin: 0; color: var(--heading); font-size: 20px; }
.back { display: none; }
.sec { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.sec h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 4px 12px; font-size: 13px; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; word-break: break-word; }
.signal { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.signal h5 { margin: 0 0 6px; font-size: 14px; }
details summary { cursor: pointer; color: var(--teal); font-size: 12px; }
pre.evidence { white-space: pre-wrap; font-size: 11px; background: var(--surface-alt); padding: 8px; border-radius: 6px; max-height: 280px; overflow: auto; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.field { display: grid; gap: 4px; margin-bottom: 8px; }
.field label { font-size: 12px; color: var(--text-muted); }
.field input, .field textarea, .field select { width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.field textarea { min-height: 260px; resize: vertical; }
.checks { list-style: none; padding: 0; margin: 6px 0; font-size: 13px; }
.checks li::before { content: "✓ "; color: var(--ok); font-weight: 700; }
.checks li.fail::before { content: "✗ "; color: var(--danger); }
.checks li.fail { color: var(--danger); }
.timeline { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.timeline li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.timeline time { color: var(--text-muted); font-variant-numeric: tabular-nums; margin-right: 8px; }
.versions { font-size: 12px; color: var(--text-muted); }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff;
  padding: 8px 14px; border-radius: 8px; box-shadow: var(--shadow); z-index: 20; }
.toast.err { background: var(--danger); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; padding: 12px 16px; }
  .counts { grid-template-columns: repeat(3, 1fr); }
  .detail-pane { position: fixed; inset: 0; top: 0; max-height: none; border-radius: 0; z-index: 10; }
  .back { display: inline-block; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { margin-top: 6px; }
}

.card.alert { cursor: default; }
.card.alert h3 a { color: var(--heading); text-decoration: none; }
.card.alert h3 a:hover { color: var(--teal); text-decoration: underline; }

.signin { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: var(--surface-alt); padding: 16px; }
.signin[hidden] { display: none; }
.signin-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 28px; max-width: 380px; text-align: center; }
.signin-card .mark { margin: 0 auto 10px; color: #fff; }
.signin-card h1 { margin: 0 0 6px; font-size: 22px; color: var(--heading); }
.signin-card .err { color: var(--danger); min-height: 1.2em; font-size: 13px; }
.signin-form { display: grid; gap: 8px; margin: 16px 0 6px; text-align: left; }
.signin-form label { font-size: 13px; font-weight: 600; color: var(--heading); }
.signin-form input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--card); color: inherit; }
.signin-form .btn { padding: 10px 12px; }
.signin-card .sent { background: var(--surface-alt); border-radius: 8px; padding: 10px 12px; font-size: 14px; text-align: left; }
.signin-card .or { margin: 10px 0 6px; font-size: 12px; color: var(--text-muted); }
