/* PKB Civils — Lead Intelligence Engine
   Dark industrial "operations room". Navy base, white ink, orange reserved for
   action. Public Sans throughout. 45° diagonal cuts + orange rules as motifs. */

:root {
  --navy:      #020c28;  /* base background (brand navy) */
  --navy-2:    #06143a;  /* lifted panel */
  --navy-3:    #0a1c4d;  /* row / card surface */
  --navy-line: #14264f;  /* structural borders on dark */
  --ink:       #f3f5f8;  /* near-white body text */
  --slate:     #727D84;  /* secondary / muted text + UI */
  --slate-2:   #9aa3aa;  /* slightly brighter muted */
  --pearl:     #E8E7E7;  /* subtle dividers / light accents */
  --orange:    #ea5326;  /* ACTION + key accents only */
  --orange-dk: #c8431b;
  --good:      #4ea88a;  /* qualified status semantic only */

  --r: 6px;              /* base radius — industrial, not pill-soft */
  --gap: 24px;
  --maxw: 1320px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(234,83,38,.06), transparent 60%),
    var(--navy);
  color: var(--ink);
  font-family: "Public Sans", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---------- Header ---------- */
.masthead {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(180deg, #03102f, #020c28);
  border-bottom: 2px solid var(--orange);
}
.masthead__inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; gap: 28px;
  padding: 14px 28px;
}
/* Logo is already white/reversed art (white wordmark + orange mark) — it sits
   directly on the dark masthead; a light panel would hide the white wordmark. */
.brand { display: flex; align-items: center; gap: 14px; }
.brand img { height: 30px; display: block; }
.brand__sep { width: 1px; height: 26px; background: var(--navy-line); }
.brand__title {
  font-weight: 700; letter-spacing: .02em; font-size: 15px; color: var(--ink);
}
.brand__title small { display: block; color: var(--slate); font-weight: 400; font-size: 11px;
  letter-spacing: .14em; text-transform: uppercase; }

.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a {
  padding: 8px 14px; color: var(--slate-2); font-weight: 600; font-size: 14px;
  border-radius: var(--r); position: relative;
}
.nav a:hover { color: var(--ink); background: rgba(255,255,255,.03); }
.nav a.is-active { color: var(--ink); }
.nav a.is-active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 1px; height: 2px;
  background: var(--orange);
}
.masthead__spacer { flex: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit; font-weight: 700; font-size: 14px; cursor: pointer;
  padding: 9px 16px; border-radius: var(--r); border: 1px solid transparent;
  transition: transform .06s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
/* Orange = action. Used sparingly so it carries weight. */
.btn--action {
  background: var(--orange); color: #fff;
  box-shadow: 0 6px 16px rgba(234,83,38,.28);
}
.btn--action:hover { background: var(--orange-dk); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--navy-line); }
.btn--ghost:hover { border-color: var(--slate); }

/* ---------- Layout ---------- */
.page { max-width: var(--maxw); margin: 0 auto; padding: 32px 28px 64px; }

.page-head { display: flex; align-items: flex-end; gap: 20px; margin-bottom: 22px; }
.page-head h1 { font-size: 30px; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.page-head .context { color: var(--slate); font-size: 13px; margin-top: 6px; }
.page-head__spacer { flex: 1; }

/* Orange rule + diagonal cut motif under section heads */
.rule {
  height: 2px; border: 0; margin: 0 0 22px;
  background: linear-gradient(90deg, var(--orange) 0 64px, var(--navy-line) 64px);
}

/* ---------- Queue toggle (segmented) ---------- */
.segmented { display: inline-flex; background: var(--navy-2); border: 1px solid var(--navy-line);
  border-radius: var(--r); padding: 4px; gap: 4px; }
.segmented a {
  padding: 8px 16px; border-radius: 4px; font-weight: 700; font-size: 13px; color: var(--slate-2);
  display: inline-flex; align-items: center; gap: 9px;
}
.segmented a .count {
  font-size: 12px; font-weight: 700; color: var(--slate); background: rgba(255,255,255,.05);
  padding: 1px 8px; border-radius: 20px;
}
.segmented a.is-active { background: var(--navy-3); color: var(--ink); box-shadow: inset 0 0 0 1px var(--navy-line); }
.segmented a.is-active .count { color: #fff; background: var(--orange); }

/* ---------- Filter bar ---------- */
.filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  background: var(--navy-2); border: 1px solid var(--navy-line); border-radius: var(--r);
  padding: 14px 18px; margin: 18px 0 20px;
  /* 45° diagonal hatch accent on the leading edge */
  background-image: repeating-linear-gradient(45deg, rgba(234,83,38,.05) 0 2px, transparent 2px 9px);
  background-size: 64px 100%; background-repeat: no-repeat;
}
.filters .field { display: flex; flex-direction: column; gap: 5px; }
.filters label { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--slate); font-weight: 700; }
.filters select {
  appearance: none; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--ink);
  background: var(--navy-3); border: 1px solid var(--navy-line); border-radius: var(--r);
  padding: 8px 32px 8px 12px; min-width: 150px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--slate) 50%), linear-gradient(135deg, var(--slate) 50%, transparent 50%);
  background-position: right 14px center, right 9px center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.filters select:focus { outline: none; border-color: var(--orange); }
.filters__spacer { flex: 1; }
.filters .reset { color: var(--slate); font-size: 13px; font-weight: 600; align-self: flex-end; padding-bottom: 8px; }
.filters .reset:hover { color: var(--orange); }

/* ---------- Lead table ---------- */
.table-wrap { position: relative; border: 1px solid var(--navy-line); border-radius: var(--r); overflow: hidden; background: var(--navy-2); }
table.leads { width: 100%; border-collapse: collapse; }
table.leads thead th {
  text-align: left; font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--slate); font-weight: 700; padding: 14px 18px; background: #050f30;
  border-bottom: 1px solid var(--navy-line); white-space: nowrap; user-select: none;
}
table.leads thead th a { color: var(--slate); display: inline-flex; gap: 6px; align-items: center; }
table.leads thead th a:hover { color: var(--ink); }
table.leads thead th .arrow { color: var(--orange); font-size: 10px; }
table.leads tbody td { padding: 16px 18px; border-bottom: 1px solid var(--navy-line); vertical-align: middle; }
table.leads tbody tr { transition: background .12s ease; cursor: pointer; }
table.leads tbody tr:hover { background: var(--navy-3); }
table.leads tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--orange); }
table.leads tbody tr:last-child td { border-bottom: 0; }
/* Open-tender rows: a permanent orange left-bar — a biddable opportunity with a
   deadline, not a salience signal — reusing the row-hover accent idiom. */
table.leads tbody tr.is-tender td:first-child { box-shadow: inset 3px 0 0 var(--orange); }
.company { font-weight: 700; font-size: 15px; }
.company .loc { display: block; color: var(--slate); font-weight: 400; font-size: 12px; margin-top: 2px; }
.muted { color: var(--slate); }
.cell-sub { color: var(--slate); font-size: 12px; }

/* Re-run state badges (NEW / UPDATED) — click to mark seen */
.badge {
  display: inline-block; vertical-align: middle; margin-left: 8px;
  font-size: 10px; font-weight: 700; letter-spacing: .05em; line-height: 1;
  padding: 3px 6px; border-radius: 4px; border: 1px solid transparent;
  cursor: pointer; font-family: inherit;
}
.badge:hover { filter: brightness(1.12); }
.badge--new {
  color: #0a3a2c; background: var(--good); border-color: var(--good);
}
.badge--updated {
  color: #fff; background: var(--orange); border-color: var(--orange);
}
/* Pushed disposition — an actioned state, not a clickable "mark seen" badge */
.badge--pushed {
  color: var(--good); background: rgba(78,168,138,.16); border-color: rgba(78,168,138,.4);
  cursor: default;
}
.badge--pushed:hover { filter: none; }

/* Sector tag */
.tag {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  color: var(--slate-2); background: rgba(255,255,255,.04); border: 1px solid var(--navy-line);
  padding: 3px 9px; border-radius: 4px; text-transform: capitalize;
}

/* Tender bid-deadline chip (Inbox row) — the actionable "closes in N days". */
.deadline-chip {
  display: inline-block; vertical-align: middle; margin-left: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .03em; line-height: 1;
  color: var(--orange); background: rgba(234,83,38,.08);
  border: 1px solid rgba(234,83,38,.35); padding: 3px 8px; border-radius: 4px;
}
.deadline-chip--overdue {
  color: var(--slate-2); background: rgba(255,255,255,.04); border-color: var(--navy-line);
}

/* Signal-type label + multi-signal count */
.sig { font-weight: 600; }
.sig .count { margin-left: 8px; color: var(--slate); font-size: 12px; font-weight: 700; }

/* Score pill */
.score { display: inline-flex; align-items: baseline; gap: 4px; font-weight: 700; font-variant-numeric: tabular-nums; }
.score b { font-size: 17px; }
.score .of { color: var(--slate); font-size: 11px; font-weight: 600; }
.score.is-provisional { color: var(--slate-2); }
.score.is-provisional b { color: var(--ink); }

/* Status badge */
.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.status--qualified .dot { background: var(--good); box-shadow: 0 0 0 3px rgba(78,168,138,.18); }
.status--degraded  .dot { background: var(--slate); }
.status--rejected  .dot { background: #a8584a; box-shadow: 0 0 0 3px rgba(168,88,74,.18); }
.status .reason { color: var(--slate); font-weight: 600; font-size: 12px; }

/* ---------- Suitability card (lead detail) ---------- */
.suit { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; }
.suit .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.suit--suitable     .dot { background: var(--good); }
.suit--unsuitable   .dot { background: #a8584a; }
.suit--outside_gb   .dot { background: #a8584a; }
.suit--intermediary .dot { background: var(--orange); }
.card .suit-reason { color: var(--slate-2); font-size: 13px; line-height: 1.5; margin-top: 10px; }

/* ---------- Open-tender card (lead detail) ---------- */
/* Orange left-accent matches the Inbox row highlight — one consistent tender cue. */
.card--tender { border-left: 3px solid var(--orange); }
.card--tender .tender-runway {
  font-size: 20px; font-weight: 800; color: var(--orange); letter-spacing: .01em;
  margin: 2px 0 14px; font-variant-numeric: tabular-nums;
}
.card--tender .tender-runway--overdue { color: var(--slate-2); }
.card--tender .tender-note { color: var(--slate-2); font-size: 12.5px; line-height: 1.5; margin: 12px 0 0; }

/* ---------- Empty state (PKB voice) ---------- */
.empty {
  text-align: center; padding: 72px 24px; color: var(--slate-2);
  border: 1px dashed var(--navy-line); border-radius: var(--r); background: var(--navy-2);
}
.empty .mark { width: 46px; height: 46px; margin: 0 auto 18px; border-radius: 8px;
  background: repeating-linear-gradient(45deg, rgba(234,83,38,.5) 0 4px, transparent 4px 10px);
  border: 1px solid var(--navy-line); }
.empty h2 { color: var(--ink); font-size: 19px; margin: 0 0 8px; font-weight: 700; }
.empty p { margin: 0 auto; max-width: 440px; font-size: 14px; line-height: 1.6; }

/* table meta footer */
.table-foot { display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; color: var(--slate); font-size: 12px; }

/* HTMX loading indicator */
.htmx-indicator { opacity: 0; transition: opacity .15s ease; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
#load-bar { position: fixed; top: 0; left: 0; height: 3px; width: 100%; background: var(--orange);
  transform: scaleX(0); transform-origin: left; }
.htmx-request #load-bar { animation: load 1s ease-in-out infinite; }
@keyframes load { 0% { transform: scaleX(0); } 50% { transform: scaleX(.7); } 100% { transform: scaleX(1); opacity: 0; } }

.site-foot { max-width: var(--maxw); margin: 0 auto; padding: 24px 28px 40px; color: var(--slate);
  font-size: 12px; border-top: 1px solid var(--navy-line); display: flex; gap: 18px; }
.site-foot .diag { flex: 1; height: 1px; align-self: center;
  background: repeating-linear-gradient(45deg, var(--navy-line) 0 6px, transparent 6px 12px); }

/* ---------- Lead detail ---------- */
.back-link { color: var(--slate); font-weight: 600; font-size: 13px; display: inline-flex; gap: 7px; }
.back-link:hover { color: var(--orange); }

.detail-head { display: flex; align-items: flex-start; gap: 18px; margin: 14px 0 4px; }
.detail-head h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.01em; }
.detail-head .badges { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.detail-head__spacer { flex: 1; }

/* Action bar + state chips */
#lead-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; min-width: 320px; }
.actionbar { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.btn--sm { padding: 8px 13px; font-size: 13px; }
.chip { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 12px;
  padding: 5px 12px; border-radius: 20px; border: 1px solid var(--navy-line); }
.chip--pushed { color: #fff; background: rgba(78,168,138,.16); border-color: rgba(78,168,138,.4); }
.chip--dismissed { color: var(--slate-2); background: rgba(255,255,255,.04); }
.chip--snoozed { color: #f0c074; background: rgba(240,192,116,.1); border-color: rgba(240,192,116,.35); }
.chip--error { color: #f3a3a3; background: rgba(214,86,86,.12); border-color: rgba(214,86,86,.4); }
.chip--link { color: #fff; background: rgba(78,168,138,.16); border-color: rgba(78,168,138,.4); text-decoration: none; }
.chip--link:hover { background: rgba(78,168,138,.28); }
.note-form { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.note-form textarea { font-family: inherit; font-size: 13px; color: var(--ink); background: var(--navy-3);
  border: 1px solid var(--navy-line); border-radius: var(--r); padding: 10px 12px; resize: vertical; min-height: 64px; }
.note-form textarea:focus { outline: none; border-color: var(--orange); }
.note-saved { width: 100%; background: var(--navy-3); border: 1px solid var(--navy-line); border-left: 3px solid var(--orange);
  border-radius: var(--r); padding: 12px 14px; font-size: 13px; }
.note-saved .lbl { display: block; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--slate); margin-bottom: 5px; font-weight: 700; }

.detail-grid { display: grid; grid-template-columns: 1fr 360px; gap: 26px; align-items: start; }
@media (max-width: 980px) { .detail-grid { grid-template-columns: 1fr; } }

.section-h { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.section-h h2 { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--slate); margin: 0; font-weight: 700; }
.section-h .line { flex: 1; height: 2px; background: linear-gradient(90deg, var(--orange) 0 40px, var(--navy-line) 40px); }

/* Signal cards */
.sigcard { background: var(--navy-2); border: 1px solid var(--navy-line); border-radius: var(--r);
  padding: 18px 20px; margin-bottom: 14px; position: relative; overflow: hidden; }
.sigcard::before { content: ""; position: absolute; top: 0; left: 0; width: 46px; height: 100%;
  background: repeating-linear-gradient(45deg, rgba(234,83,38,.07) 0 2px, transparent 2px 10px); }
.sigcard__top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.sigcard__type { font-weight: 700; font-size: 15px; }
.sigcard__meta { color: var(--slate); font-size: 12px; margin-bottom: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.sigcard__meta b { color: var(--slate-2); font-weight: 600; }
.sigcard__summary { font-size: 14px; line-height: 1.6; color: var(--ink); }
.sigcard__summary.is-empty { color: var(--slate); font-style: italic; }
.extlink { color: var(--orange); font-weight: 700; font-size: 13px; }
.extlink:hover { text-decoration: underline; }

/* Sidebar cards */
.card { background: var(--navy-2); border: 1px solid var(--navy-line); border-radius: var(--r); padding: 18px 20px; margin-bottom: 18px; }
.card > h3 { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--slate); margin: 0 0 14px; font-weight: 700; }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 9px 14px; font-size: 13px; }
.kv dt { color: var(--slate); }
.kv dd { margin: 0; color: var(--ink); }
.kv dd a { color: var(--orange); }

.contact-empty { color: var(--slate); font-size: 13px; line-height: 1.6; }
.contact-empty .mark { width: 34px; height: 34px; border-radius: 7px; margin-bottom: 12px;
  background: repeating-linear-gradient(45deg, rgba(114,125,132,.4) 0 4px, transparent 4px 9px); border: 1px solid var(--navy-line); }

/* Score breakdown bars */
.scorebar { margin-bottom: 14px; }
.scorebar__top { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.scorebar__top .l { color: var(--slate-2); font-weight: 600; }
.scorebar__top .v { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.track { height: 8px; background: var(--navy-3); border-radius: 20px; overflow: hidden; border: 1px solid var(--navy-line); }
.track .fill { height: 100%; background: var(--orange); border-radius: 20px; }
.track .fill--muted { background: var(--slate); }
.score-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--navy-line); }
.score-total .big { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.score-note { color: var(--slate); font-size: 12px; line-height: 1.5; margin-top: 12px; }

/* ---------- Run history ---------- */
.run { background: var(--navy-2); border: 1px solid var(--navy-line); border-radius: var(--r); margin-bottom: 16px; overflow: hidden; }
.run.has-warn { border-left: 3px solid #f0c074; }
.run__head { display: flex; align-items: center; gap: 18px; padding: 16px 20px; flex-wrap: wrap; }
.run__when { font-weight: 700; font-size: 15px; }
.run__when .time { color: var(--slate); font-weight: 400; }
.trigger { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; padding: 3px 10px; border-radius: 4px; }
.trigger--scheduled { color: var(--slate-2); background: rgba(255,255,255,.05); border: 1px solid var(--navy-line); }
.trigger--manual { color: var(--orange); background: rgba(234,83,38,.1); border: 1px solid rgba(234,83,38,.35); }
.run__head .spacer { flex: 1; }
.metrics { display: flex; gap: 22px; }
.metric { text-align: right; }
.metric .n { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.metric .n.good { color: var(--good); }
.metric .l { display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--slate); }

/* Warning callouts (amber) — operational health, always visible */
.warnings { padding: 0 20px 14px; display: flex; flex-direction: column; gap: 8px; }
.callout { display: flex; gap: 11px; align-items: flex-start; font-size: 13px; line-height: 1.45;
  background: rgba(240,192,116,.07); border: 1px solid rgba(240,192,116,.28); border-radius: var(--r); padding: 10px 13px; }
.callout .ic { color: #f0c074; font-weight: 700; flex: none; }
.callout.is-error { background: rgba(234,83,38,.08); border-color: rgba(234,83,38,.35); }
.callout.is-error .ic { color: var(--orange); }

/* Expandable detail */
.run details { border-top: 1px solid var(--navy-line); }
.run summary { cursor: pointer; padding: 12px 20px; font-size: 12px; font-weight: 700; color: var(--slate);
  letter-spacing: .06em; text-transform: uppercase; list-style: none; user-select: none; }
.run summary:hover { color: var(--ink); }
.run summary::-webkit-details-marker { display: none; }
.run summary::before { content: "▸ "; color: var(--orange); }
.run details[open] summary::before { content: "▾ "; }
.run__detail { padding: 4px 20px 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 720px) { .run__detail { grid-template-columns: 1fr; } }
.run__detail h4 { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--slate); margin: 0 0 10px; }
.srctable { width: 100%; border-collapse: collapse; font-size: 13px; }
.srctable td { padding: 5px 0; border-bottom: 1px solid var(--navy-line); }
.srctable td:last-child { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.srctable tr.zero td { color: var(--slate); }
.run__detail .kv { grid-template-columns: 1fr auto; }
.run__detail .kv dd { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Run now (manual trigger) ---------- */
.small { font-size: 12px; }
.link { color: var(--orange); font-weight: 700; font-size: 13px; text-decoration: none; }
.link:hover { text-decoration: underline; }
.run-now { max-width: 760px; display: flex; flex-direction: column; gap: 18px; }

/* Spend warning — louder than the neutral callout */
.callout--spend { background: rgba(234,83,38,.09); border-color: rgba(234,83,38,.4); }
.callout--spend .ic { color: var(--orange); font-size: 16px; }
.callout--spend strong { color: var(--ink); }
.callout--spend em { font-style: normal; color: var(--orange); font-weight: 700; }

.panel { background: var(--navy-2); border: 1px solid var(--navy-line); border-radius: 8px; padding: 16px 18px; }
.panel h4 { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--slate); margin: 0 0 12px; }

.caps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.caps li { display: flex; align-items: baseline; gap: 10px; font-size: 14px; }
.caps__l { flex: 1; }
.caps__v { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--slate-2); }

.run-trigger { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ack { display: flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; }
.ack input { width: 16px; height: 16px; accent-color: var(--orange); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* Status region */
.run-status:empty { display: none; }
.run-status { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px;
  border: 1px solid var(--navy-line); border-radius: 8px; background: var(--navy-3); font-size: 14px; }
.run-status--running { border-color: rgba(234,83,38,.35); }
.run-status--done { border-color: rgba(78,168,138,.4); background: rgba(78,168,138,.07); }
.run-status--error { border-color: rgba(234,83,38,.45); background: rgba(234,83,38,.08); }
.run-status .ic { font-weight: 700; flex: none; font-size: 16px; }
.run-status .ic.ok { color: var(--good); }
.run-status .ic.bad { color: var(--orange); }
.run-status__log { color: var(--slate-2); font-size: 12px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.run-status__summary { color: var(--slate-2); font-size: 13px; margin-top: 4px; }
.run-status__summary b { color: var(--good); }
.run-status__links { display: flex; gap: 18px; margin-top: 8px; }

.spinner { width: 16px; height: 16px; flex: none; margin-top: 2px; border-radius: 50%;
  border: 2px solid var(--navy-line); border-top-color: var(--orange); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.last-run__line { display: flex; align-items: center; gap: 12px; font-size: 14px; flex-wrap: wrap; }
.last-run__line .spacer { flex: 1; }
.last-run .link { margin-top: 10px; display: inline-block; }

/* --- Suggested message (AI outreach draft) --- */
.card--draft { border-left: 3px solid var(--orange); }
.card--draft > .draft-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.card--draft .draft-head h3 { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--slate); margin: 0; font-weight: 700; }
.pill { display: inline-flex; align-items: center; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: var(--r); }
.pill--draft { color: var(--orange); background: rgba(234,83,38,.12); border: 1px solid rgba(234,83,38,.4); }
.draft-note { font-size: 13px; line-height: 1.55; color: var(--slate-2); margin: 0 0 14px; }
.draft-muted { font-size: 13px; line-height: 1.55; color: var(--slate); margin: 0; }
.draft-error { font-size: 13px; line-height: 1.5; color: #f0a074; background: rgba(234,83,38,.08);
  border: 1px solid rgba(234,83,38,.3); border-radius: var(--r); padding: 10px 12px; margin: 0 0 12px; }
.draft-text { width: 100%; font-family: inherit; font-size: 14px; line-height: 1.6; color: var(--ink);
  background: var(--navy-3); border: 1px solid var(--navy-line); border-radius: var(--r); padding: 14px 16px; resize: vertical; }
.draft-text:focus { outline: none; border-color: var(--orange); }
.draft-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.draft-working { color: var(--slate-2); font-size: 12px; }
.draft-meta { color: var(--slate); font-size: 12px; font-variant-numeric: tabular-nums; margin-left: auto; }

/* ---------- Login (standalone — no masthead) ---------- */
.login-body {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
}
.login { width: 100%; max-width: 400px; display: flex; flex-direction: column; align-items: center; }
.login__card {
  width: 100%;
  background: var(--navy-2);
  border: 1px solid var(--navy-line);
  border-top: 2px solid var(--orange);   /* same orange rule motif as the masthead */
  border-radius: 8px;
  padding: 34px 32px 30px;
  box-shadow: var(--shadow);
}
.login__brand { margin-bottom: 22px; }
.login__brand img { height: 30px; display: block; }
.login__title { font-size: 20px; font-weight: 700; letter-spacing: .01em; margin: 0; color: var(--ink); }
.login__sub {
  margin: 4px 0 24px; color: var(--slate); font-size: 11px;
  letter-spacing: .14em; text-transform: uppercase; font-weight: 600;
}
.login__error {
  font-size: 13px; line-height: 1.5; color: #f3a3a3;
  background: rgba(214,86,86,.12); border: 1px solid rgba(214,86,86,.4);
  border-radius: var(--r); padding: 10px 12px; margin: 0 0 18px;
}
.login__form { display: flex; flex-direction: column; gap: 16px; }
.login__field { display: flex; flex-direction: column; gap: 6px; }
.login__field span {
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--slate); font-weight: 700;
}
.login__field input {
  font-family: inherit; font-size: 15px; color: var(--ink);
  background: var(--navy-3); border: 1px solid var(--navy-line);
  border-radius: var(--r); padding: 11px 13px;
}
.login__field input:focus { outline: none; border-color: var(--orange); }
.login__submit { justify-content: center; margin-top: 6px; padding: 11px 16px; }
.login__foot { margin-top: 20px; color: var(--slate); font-size: 12px; }

/* ---------- Masthead account / logout ---------- */
.account { display: flex; align-items: center; gap: 12px; margin-left: 6px; }
.account__email { color: var(--slate-2); font-size: 13px; font-weight: 600; max-width: 200px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account__logout { margin: 0; }
.account__logout .btn { padding: 8px 13px; font-size: 13px; }
