/* ==========================================================================
   Knox Technologies — Caller Portal
   Styled to match knoxaifoundry.com: warm charcoal, sage-teal accent,
   cream type, condensed uppercase headlines, monospace labels, square edges.
   --------------------------------------------------------------------------
   BRAND TOKENS: every color and font lives in this first block.
   The five theme swatches (bottom of the sidebar, like the main site) only
   override the tokens below.
   ========================================================================== */
:root {
  /* Surfaces */
  --bg: #221d1a;            /* main canvas */
  --bg-side: #1c1815;       /* sidebar */
  --bg-strip: #2d2520;      /* top status strip */
  --surface: #28221e;       /* cards / panels */
  --surface-2: #2f2823;     /* raised / hover */
  --surface-3: #3a322c;     /* active nav item */
  --line: #3a332d;
  --line-strong: #4d443c;

  /* Type */
  --text: #efe6da;          /* cream */
  --text-2: #b8ac9f;
  --text-3: #8b8076;

  /* Accent (site default: sage teal) */
  --accent: #7fa9a3;
  --accent-hover: #93bab4;
  --accent-soft: rgba(127, 169, 163, .14);
  --on-accent: #1c1815;

  /* Status */
  --ok: #86bb95;
  --ok-soft: rgba(134, 187, 149, .14);
  --warn: #d5ae62;
  --warn-soft: rgba(213, 174, 98, .14);
  --bad: #d97a80;
  --bad-soft: rgba(217, 122, 128, .14);
  --bad-solid: #8e2b36;
  --info: #8fb4d6;
  --info-soft: rgba(143, 180, 214, .14);

  /* Pipeline stages */
  --stage-open: #8b8076;
  --stage-1: #7fa9a3;
  --stage-2: #a993c9;
  --stage-3: #d5ae62;
  --stage-won: #86bb95;

  /* Fonts */
  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --scrim: rgba(12, 10, 8, .62);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

/* Theme swatches (match the five on knoxaifoundry.com) */
:root[data-theme="gold"]  { --accent: #c9a45c; --accent-hover: #d8b571; --accent-soft: rgba(201, 164, 92, .15); }
:root[data-theme="green"] { --accent: #6fae94; --accent-hover: #84bfa6; --accent-soft: rgba(111, 174, 148, .15); }
:root[data-theme="cream"] { --accent: #e9dfcf; --accent-hover: #f6eee2; --accent-soft: rgba(233, 223, 207, .12); }
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3ede4; --bg-side: #ebe3d7; --bg-strip: #e3d9cb;
  --surface: #fbf8f3; --surface-2: #f3ede4; --surface-3: #e2d8ca;
  --line: #ddd2c3; --line-strong: #c7b9a7;
  --text: #211d1a; --text-2: #5a4f46; --text-3: #7d7166;
  --accent: #8e2b36; --accent-hover: #a33441; --accent-soft: rgba(142, 43, 54, .1); --on-accent: #fbf8f3;
  --ok: #2f7a4a; --ok-soft: rgba(47, 122, 74, .12);
  --warn: #93661b; --warn-soft: rgba(147, 102, 27, .12);
  --bad: #a3303c; --bad-soft: rgba(163, 48, 60, .1);
  --info: #2d5f8a; --info-soft: rgba(45, 95, 138, .1);
  --stage-open: #7d7166; --stage-1: #4f8079; --stage-2: #6d55a0; --stage-3: #a8762a; --stage-won: #2f7a4a;
  --scrim: rgba(33, 29, 26, .45);
  --shadow-lg: 0 18px 50px rgba(33, 29, 26, .25);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 500 16px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: .005em; line-height: 1; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.mono, .label, .eyebrow {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .16em;
}
.eyebrow { color: var(--text-3); }

/* ---------- Brand lockup ---------- */
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.logo-mark { width: 26px; height: 26px; flex: none; color: var(--text); }
.brand-name { font-family: var(--font-mono); font-weight: 800; font-size: 15px; letter-spacing: .12em; text-transform: uppercase; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: 0;
  border: 1px solid var(--line-strong); background: transparent; color: var(--text);
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-3); }
.btn:focus-visible, .tab:focus-visible, .work-row:focus-visible, .kcard:focus-visible, .swatch:focus-visible,
tr.clickable:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-go { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-go:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-decline { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.btn-decline:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn-danger { background: var(--bad-solid); border-color: var(--bad-solid); color: #f6eee2; }
.btn-danger:hover { background: #a33441; border-color: #a33441; }
.btn-ghost { border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 11.5px; letter-spacing: .12em; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); }
.field .hint { font-size: 13.5px; color: var(--text-3); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border-radius: 0;
  border: 1px solid var(--line-strong); background: var(--bg); color: var(--text);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); outline: none; }
.input[readonly] { color: var(--text-2); background: var(--surface); }
input[type="date"] { color-scheme: inherit; }
.req { color: var(--bad); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-error { color: var(--bad); font-size: 14px; font-weight: 600; min-height: 1em; }
.form-error:empty { display: none; }

/* ---------- Mosaic (the site's square grid motif) ---------- */
.mosaic { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.mosaic i { aspect-ratio: 1; background: var(--surface-2); }
.mosaic i.a1 { background: color-mix(in srgb, var(--accent) 45%, var(--bg)); }
.mosaic i.a2 { background: color-mix(in srgb, var(--accent) 75%, var(--bg)); }
.mosaic i.a3 { background: var(--accent); }

/* ---------- Spec list (key / value rows like the site's right panel) ---------- */
.spec { list-style: none; margin: 0; padding: 0; }
.spec li {
  display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase;
}
.spec li span:first-child { color: var(--text-3); }

/* ==========================================================================
   LOGIN
   ========================================================================== */
.login-body { min-height: 100vh; display: flex; flex-direction: column; }
.statusbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--bg-strip); padding: 12px 18px; min-height: 44px;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--text);
}
.statusbar .mid, .statusbar .right { color: var(--text-2); }
.statusbar .right b { color: var(--accent); font-weight: 600; }
.login-grid { flex: 1; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, .9fr); }
.login-hero { padding: 56px 40px 40px; display: flex; flex-direction: column; gap: 34px; border-right: 1px solid var(--line); }
.login-hero h1 { font-size: clamp(48px, 6vw, 84px); line-height: .92; }
.login-hero h1 span { color: var(--accent); }
.login-hero p { font-size: 20px; color: var(--text); max-width: 34ch; margin: 0; line-height: 1.5; }
.login-hero .spec { max-width: 460px; }
.login-panel { display: flex; flex-direction: column; justify-content: center; padding: 40px; gap: 28px; }
.login-card form { display: flex; flex-direction: column; gap: 18px; }
.login-card h2 { font-size: 34px; margin: 10px 0 6px; }
.login-card .sub { color: var(--text-2); margin: 0 0 22px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 76px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.login-help { font-size: 15px; color: var(--text-2); border-top: 1px solid var(--line); padding-top: 18px; margin: 0; }
.login-help b { color: var(--text); }
.login-foot {
  display: flex; gap: 22px; flex-wrap: wrap; align-items: center; padding: 18px 40px; border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3);
}
.login-foot b { color: var(--text); font-weight: 800; }

/* ==========================================================================
   APP SHELL (sidebar INDEX + status strip, like the main site)
   ========================================================================== */
.app {
  display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 100vh;
  background: linear-gradient(to right, var(--bg-side) 299px, var(--line) 299px 300px, var(--bg) 300px);
}
.sidebar {
  background: var(--bg-side); border-right: 1px solid var(--line); min-width: 0;
  display: flex; flex-direction: column; padding: 22px 18px 18px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { padding: 0 0 34px; }
.side-label { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .2em; color: var(--text-2); margin-bottom: 12px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.tab {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; background: transparent;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-2); cursor: pointer; text-align: left;
}
.tab::before { content: ""; width: 6px; height: 6px; background: var(--line-strong); flex: none; }
.tab .num { color: var(--text-3); }
.tab .count { margin-left: auto; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tab:hover { color: var(--text); background: var(--surface); }
.tab[aria-current="page"] { background: var(--surface-3); color: var(--text); }
.tab[aria-current="page"]::before { background: var(--accent); }
.tab[aria-current="page"] .num, .tab[aria-current="page"] .count { color: var(--text); }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 18px; display: flex; flex-direction: column; gap: 14px; }
.side-status { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--text-2); }
.side-status::before { content: ""; width: 7px; height: 7px; background: var(--accent); }
.user-card { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 38px; height: 38px; display: grid; place-items: center; flex: none;
  background: var(--surface-3); color: var(--text); font-family: var(--font-mono); font-weight: 700; font-size: 12.5px; letter-spacing: .06em;
}
.avatar.is-admin { background: var(--accent); color: var(--on-accent); }
.user-card .n { font-weight: 600; line-height: 1.2; }
.user-card .r { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.swatch {
  height: 24px; border: 1px solid transparent; padding: 0; cursor: pointer; position: relative;
  background: linear-gradient(to bottom, var(--sw-top) 0 62%, var(--sw-bar) 62% 100%);
}
.swatch[aria-pressed="true"] { border-color: var(--text); }

.main { display: flex; flex-direction: column; min-width: 0; }
.main .statusbar { position: sticky; top: 0; z-index: 20; }
.page { width: 100%; max-width: 1340px; padding: 40px 28px 64px; flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 30px; }
.page-head h1 { font-size: clamp(44px, 5vw, 72px); line-height: .92; margin-top: 10px; }
.page-head .greet { font-size: 19px; color: var(--text); margin-top: 14px; max-width: 60ch; }
.page-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.app-foot {
  display: flex; gap: 22px; flex-wrap: wrap; padding: 22px 28px; border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3);
}
.app-foot b { color: var(--text); font-weight: 800; }

/* KPI row — spec-style cells */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); margin-bottom: 30px; }
.kpi { padding: 18px 20px; border-right: 1px solid var(--line); position: relative; }
.kpi:last-child { border-right: 0; }
.kpi::before { content: ""; position: absolute; left: 20px; top: 0; width: 28px; height: 3px; background: var(--kpi-c, var(--line-strong)); }
.kpi .k-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }
.kpi .k-val { font-family: var(--font-display); font-size: 48px; font-weight: 700; line-height: 1; margin: 10px 0 6px; font-variant-numeric: tabular-nums; }
.kpi .k-note { font-size: 14px; color: var(--text-2); }

/* Section heading row */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: 30px; }

/* Toolbar */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .search { flex: 1 1 280px; position: relative; }
.toolbar .search .input { padding-left: 40px; }
.toolbar .search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.toolbar .select { width: auto; min-width: 170px; }

/* ---------- Open Work list ---------- */
.work-list { border-top: 1px solid var(--line); }
.work-row {
  display: grid; grid-template-columns: 4px minmax(0, 2.2fr) minmax(0, 1.3fr) minmax(0, 1.3fr) minmax(0, 1fr) auto;
  align-items: center; gap: 20px; padding: 18px 16px 18px 0; border-bottom: 1px solid var(--line);
  cursor: pointer; transition: background .15s;
}
.work-row:hover { background: var(--surface); }
.prio-bar { align-self: stretch; background: var(--line-strong); margin: -18px 0; }
.prio-High .prio-bar { background: var(--bad); }
.prio-Medium .prio-bar { background: var(--warn); }
.prio-Low .prio-bar { background: var(--text-3); }
.wr-id { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.wr-main .co { font-family: var(--font-display); font-weight: 700; font-size: 25px; text-transform: uppercase; line-height: 1.05; margin: 4px 0 2px; }
.wr-main .ct { color: var(--text-2); }
.wr-cell .lbl { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); margin-bottom: 4px; }
.wr-cell .val { font-size: 15.5px; }
.wr-actions { display: flex; gap: 8px; }
.wr-tel { color: var(--text); text-decoration: none; font-family: var(--font-mono); font-size: 14px; }
.wr-tel:hover { color: var(--accent); text-decoration: underline; }
.show-sm { display: none; }

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border: 1px solid var(--line-strong);
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-2); white-space: nowrap; line-height: 1.4;
}
.chip-bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: var(--bad-soft); }
.chip-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-soft); }
.chip-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: var(--ok-soft); }
.chip-info { color: var(--info); border-color: color-mix(in srgb, var(--info) 45%, transparent); background: var(--info-soft); }
.chip-dot::before { content: ""; width: 6px; height: 6px; background: currentColor; }
.stage-chip { color: var(--stage-c); border-color: color-mix(in srgb, var(--stage-c) 50%, transparent); background: color-mix(in srgb, var(--stage-c) 12%, transparent); }
.stage-chip::before { content: ""; width: 6px; height: 6px; background: currentColor; }

/* ---------- Pipeline board ---------- */
.board { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 16px; align-items: start; }
.col { border: 1px solid var(--line); background: var(--bg-side); min-height: 160px; }
.col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 14px 12px; border-bottom: 1px solid var(--line); border-top: 3px solid var(--stage-c); }
.col-head h3 { font-size: 22px; display: flex; align-items: center; gap: 10px; }
.col-head .sum { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; color: var(--text-2); }
.col-cards { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--stage-c); padding: 14px; cursor: pointer; transition: background .15s, border-color .15s; }
.kcard:hover { background: var(--surface-2); border-color: var(--line-strong); border-left-color: var(--stage-c); }
.kcard .co { font-family: var(--font-display); font-weight: 700; font-size: 21px; text-transform: uppercase; line-height: 1.05; margin-top: 4px; }
.kcard .meta { font-size: 14.5px; color: var(--text-2); margin-top: 4px; }
.kcard .foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.kcard .val { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-2); }
.col-empty { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); text-align: center; padding: 26px 8px; }

/* ---------- Tables ---------- */
.table-wrap { border: 1px solid var(--line); overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 15.5px; }
table.data th {
  text-align: left; font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-3); background: var(--bg-side); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.clickable:hover td { background: var(--surface); }
.td-strong { font-weight: 600; }
.td-sub { font-size: 13.5px; color: var(--text-3); }
.td-mono { font-family: var(--font-mono); font-size: 13px; letter-spacing: .06em; }
.td-actions { white-space: nowrap; display: flex; gap: 6px; }
.td-actions.stack { flex-direction: column; align-items: stretch; width: max-content; }

.empty { border: 1px dashed var(--line-strong); padding: 48px 20px; text-align: center; color: var(--text-2); }
.empty h3 { font-size: 28px; color: var(--text); margin-bottom: 8px; }

/* ==========================================================================
   DRAWER (work detail)
   ========================================================================== */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 40; animation: fade .15s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(660px, 100vw); background: var(--bg);
  border-left: 1px solid var(--line); z-index: 50; display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
  animation: slide .2s ease-out;
}
@keyframes slide { from { transform: translateX(28px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }
.drawer-strip { justify-content: space-between; }
.drawer-head { padding: 26px 24px 20px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.drawer-head h2 { font-size: 42px; line-height: .95; margin: 8px 0 8px; }
.drawer-head .sub { color: var(--text-2); font-size: 17px; }
.drawer-head .btn-ghost { margin-left: auto; }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px 24px 28px; display: flex; flex-direction: column; gap: 26px; }
.drawer-foot {
  padding: 14px 24px; background: var(--bg-side); border-top: 1px solid var(--line);
  display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
}
.panel h3 {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; letter-spacing: .2em; color: var(--text-3);
  padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 14px;
}
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
.kv .k { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); margin-bottom: 4px; }
.kv .v { font-size: 16px; word-break: break-word; }
.notes { white-space: pre-wrap; background: var(--surface); padding: 14px 16px; border-left: 3px solid var(--accent); }
.kv .span-2 { grid-column: 1 / -1; }
/* Lead brief: the pitch angle is the caller's opener, so it leads the panel */
.pitch { background: var(--surface); padding: 14px 16px; border-left: 3px solid var(--accent); margin-bottom: 16px; font-size: 18.5px; line-height: 1.45; }
.pitch .k { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }

/* Stepper */
.stepper { display: flex; gap: 4px; }
.step { flex: 1; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.step .bar { height: 6px; background: var(--surface-2); margin-bottom: 8px; }
.step.done .bar { background: var(--stage-c); }
.step.current { color: var(--text); }

.closed-banner { padding: 14px 16px; border-left: 3px solid; }
.closed-banner.won { background: var(--ok-soft); border-color: var(--ok); }
.closed-banner.declined { background: var(--bad-soft); border-color: var(--bad); }

/* Comment thread */
.thread { display: flex; flex-direction: column; gap: 16px; margin-bottom: 18px; }
.cmt { display: flex; gap: 12px; }
.cmt .avatar { width: 32px; height: 32px; font-size: 11px; }
.cmt-body { flex: 1; min-width: 0; }
.cmt-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cmt-head b { font-weight: 700; }
.cmt-head time { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; color: var(--text-3); }
.cmt-text { white-space: pre-wrap; margin-top: 3px; word-break: break-word; }
.cmt.sys .cmt-text { color: var(--text-3); font-style: italic; }
.cmt-tag { padding: 1px 7px; font-size: 10px; }
.composer { display: flex; flex-direction: column; gap: 10px; }
.composer-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.composer-row .hint { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; color: var(--text-3); }

/* ==========================================================================
   MODAL
   ========================================================================== */
.modal-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: var(--scrim); animation: fade .15s; }
.modal {
  width: min(580px, 100%); max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--bg); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg);
}
.modal.wide { width: min(780px, 100%); }
.modal-head { padding: 24px 24px 8px; }
.modal-head h2 { font-size: 36px; }
.modal-head p { color: var(--text-2); margin: 10px 0 0; }
.modal-body { padding: 16px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { padding: 14px 24px 22px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.move-path { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-family: var(--font-mono); color: var(--text-3); }
.callout { padding: 12px 14px; background: var(--surface); border-left: 3px solid var(--line-strong); color: var(--text-2); }
.callout.ok { border-color: var(--ok); background: var(--ok-soft); color: var(--text); }
.callout.bad { border-color: var(--bad); background: var(--bad-soft); color: var(--text); }
.temp-pw { font-family: var(--font-mono); font-size: 24px; letter-spacing: .1em; padding: 16px; text-align: center; border: 1px dashed var(--accent); color: var(--accent); }

/* Toast */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(460px, calc(100vw - 32px)); }
.toast {
  width: 100%; background: var(--bg-strip); color: var(--text); padding: 12px 16px; border-left: 3px solid var(--accent);
  box-shadow: var(--shadow-lg); font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .06em; animation: fade .2s;
}
.toast.ok { border-left-color: var(--ok); }
.toast.bad { border-left-color: var(--bad); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-right: 0; }
  .kpi:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .work-row { grid-template-columns: 4px minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1.1fr) auto; }
  .work-row .wr-svc { display: none; }
  .statusbar .mid { display: none; }
}
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); background: var(--bg); }
  .sidebar { position: static; height: auto; padding: 14px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand { padding: 0 0 12px; }
  .side-label { display: none; }
  .side-nav { flex-direction: row; overflow-x: auto; gap: 4px; scrollbar-width: thin; }
  .tab { width: auto; white-space: nowrap; padding: 10px 12px; }
  .tab .count { margin-left: 6px; }
  .side-foot { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 12px; }
  .side-status { display: none; }
  .swatches { width: 170px; }
  .main .statusbar { position: static; }
  .board { grid-template-columns: 1fr; }
  .login-grid { grid-template-columns: 1fr; }
  .login-hero { border-right: 0; border-bottom: 1px solid var(--line); padding: 36px 16px 28px; gap: 22px; }
  .login-hero .spec, .login-hero .mosaic { display: none; }
  .login-panel { padding: 28px 16px 36px; }
  .login-foot { padding: 16px; }
}
@media (max-width: 720px) {
  .page { padding: 26px 16px 48px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { border-right: 1px solid var(--line) !important; border-bottom: 1px solid var(--line); }
  .kpi:nth-child(2n) { border-right: 0 !important; }
  .kpi:last-child { border-bottom: 0; grid-column: span 2; }
  .kpi .k-val { font-size: 38px; }
  .work-row { grid-template-columns: 4px minmax(0, 1fr); gap: 12px; padding-right: 0; }
  .work-row .wr-hide-sm { display: none; }
  .work-row .wr-actions { grid-column: 2; }
  .show-sm { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .kv { grid-template-columns: 1fr; }
  .toolbar .select { flex: 1 1 140px; min-width: 0; }
  .statusbar { padding: 10px 16px; font-size: 10.5px; letter-spacing: .14em; }
  .drawer-head h2 { font-size: 34px; }
  .drawer-head, .drawer-body { padding-left: 16px; padding-right: 16px; }
  .drawer-foot { padding: 12px 16px; }
  .drawer-foot .btn { flex: 1; }
  .app-foot { padding: 18px 16px; }
}
