/* ==========================================================================
   Archively GTM Ops — brand console
   White, deep navy, disciplined gold. Sibling of archively.ai.

   Contents
   1. Fonts             2. Tokens                3. Base & typography
   4. Layout & rail     5. Page furniture        6. Buttons & links
   7. Forms             8. Tables                9. Chips, dots, tiers
   10. Cards & lists    11. Today                12. Pipeline board
   13. Metrics          14. Timeline             15. Warnings & messages
   16. Settings         17. Login                18. Small screens
   ========================================================================== */

/* 1. Fonts — Geist Sans + Geist Mono, vendored from the marketing site ---- */

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("geist-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("geist-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+1D00-1DBF, U+1E00-1EFF, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("geist-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("geist-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+1D00-1DBF, U+1E00-1EFF, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

/* 2. Tokens — lifted from archively.ai globals.css ------------------------ */

:root {
  /* Surfaces */
  --bg: #ffffff;
  --subtle: #f4f6f8;
  --border: #e5e7eb;
  --border-strong: #d7dde3;

  /* Ink */
  --ink: #0b1220;
  --muted: #475569;
  --faint: #8b95a3;

  /* Brand */
  --brand: #0f2742;
  --brand-hover: #16375f;
  --accent: #b8862b;
  --accent-deep: #8a6117;      /* gold that passes contrast on light tints */
  --accent-soft: #f6edd7;
  --champagne: #d8c28a;        /* the brand's gold-on-dark, for the navy rail */
  --on-brand: #ffffff;

  /* Semantic */
  --ok: #15803d;
  --warn: #b45309;
  --danger: #b91c1c;
  --info: #0f2742;
  --ok-wash: rgba(21, 128, 61, 0.09);
  --warn-wash: rgba(180, 83, 9, 0.09);
  --danger-wash: rgba(185, 28, 28, 0.08);
  --info-wash: rgba(15, 39, 66, 0.07);

  /* Type */
  --sans: "Geist", Inter, -apple-system, "Segoe UI", system-ui, sans-serif;
  --mono: "Geist Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  /* Shape */
  --r-card: 8px;
  --r-ctl: 6px;
  --shadow-card: 0 1px 2px rgba(11, 18, 32, 0.04), 0 1px 3px rgba(11, 18, 32, 0.03);
  --shadow-raise: 0 2px 6px rgba(11, 18, 32, 0.07), 0 8px 20px -12px rgba(11, 18, 32, 0.12);
  --shadow-menu: 0 4px 10px rgba(11, 18, 32, 0.08), 0 12px 32px -8px rgba(11, 18, 32, 0.18);
}

/* 3. Base & typography ---------------------------------------------------- */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); text-decoration: underline; text-underline-offset: 2px; }

h1, h2, h3 {
  font-family: var(--sans);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.015em;
  margin: 0;
}
h1 { font-size: 21px; line-height: 1.25; }
h2 { font-size: 15px; line-height: 1.35; }
h3 { font-size: 13.5px; line-height: 1.35; margin: 14px 0 4px; }

p { margin: 0 0 8px; }
p:last-child { margin-bottom: 0; }

code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--subtle);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}

.muted { color: var(--muted); }
.small { font-size: 13px; }
.prewrap { white-space: pre-wrap; }
.nowrap { white-space: nowrap; }

/* Eyebrow — the app's labelling voice */
.section-label {
  display: block;
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.section-label a { color: var(--muted); }
.section-label a:hover { color: var(--brand); }

/* Empty states: warm words, quiet clothes */
.empty {
  font-size: 13.5px;
  color: var(--muted);
  padding: 14px 0;
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: rgba(184, 134, 43, 0.22); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* 4. Layout & the navy rail ------------------------------------------------ */

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px;
  flex: 0 0 232px;
  background: var(--brand);
  color: #e9eef5;
  padding: 22px 0 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 4px 20px 18px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.brand-name {
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: #ffffff;
}
.brand-dot { color: var(--champagne); font-weight: 600; }
.brand-sub {
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(233, 238, 245, 0.62);
}

.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--r-ctl);
  font-size: 13px;
  font-weight: 500;
  color: rgba(233, 238, 245, 0.72);
  transition: color 120ms ease, background-color 120ms ease;
}
.nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}
.nav-item.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.09);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--champagne);
}

/* Warnings count beside “Today” — champagne, calm */
.badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--champagne);
  background: rgba(216, 194, 138, 0.14);
  border-radius: 999px;
  padding: 1px 7px;
  line-height: 16px;
}

.signout {
  margin-top: auto;
  padding: 14px 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
}
.signout .who { display: block; color: rgba(233, 238, 245, 0.55); margin-bottom: 6px; }
.signout button {
  background: none;
  border: none;
  padding: 0;
  font: 500 12.5px var(--sans);
  color: rgba(233, 238, 245, 0.85);
  cursor: pointer;
}
.signout button:hover { color: #ffffff; text-decoration: underline; text-underline-offset: 2px; }

.content {
  flex: 1;
  min-width: 0;
  max-width: 1180px;
  padding: 36px 44px 72px;
}

/* 5. Page furniture -------------------------------------------------------- */

.page-head { margin-bottom: 24px; }
.page-head h1 { margin-bottom: 4px; }
.page-head p { color: var(--muted); font-size: 13.5px; }
.page-head.with-action {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.section-head h2 { flex: none; }
.section-head .count,
.count {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  background: var(--subtle);
  border-radius: 999px;
  padding: 1px 8px;
}
.section-head .muted { font-size: 12.5px; }

/* 6. Buttons & links -------------------------------------------------------- */

.btn {
  display: inline-block;
  font: 550 13px/1 var(--sans);
  letter-spacing: 0.005em;
  padding: 8px 14px;
  border-radius: var(--r-ctl);
  border: 1px solid var(--brand);
  background: var(--brand);
  color: var(--on-brand);
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease,
    color 120ms ease, box-shadow 120ms ease;
}
.btn:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  color: var(--on-brand);
  box-shadow: inset 0 0 0 1px rgba(216, 194, 138, 0.45);
  text-decoration: none;
}

.btn-secondary {
  background: var(--bg);
  border-color: var(--border-strong);
  color: var(--ink);
  box-shadow: none;
}
.btn-secondary:hover {
  background: var(--subtle);
  border-color: #c3ccd5;
  color: var(--ink);
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  box-shadow: none;
}
.btn-ghost:hover {
  background: var(--subtle);
  border-color: transparent;
  color: var(--ink);
  box-shadow: none;
}

.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: default; }

/* Quiet destructive: red text, no shouting */
.link-danger, .btn-quiet {
  display: inline-block;
  background: none;
  border: none;
  padding: 8px 6px;
  font: 500 13px/1 var(--sans);
  color: var(--danger);
  cursor: pointer;
}
.link-danger:hover, .btn-quiet:hover { text-decoration: underline; text-underline-offset: 2px; }

/* Text-sized action inside tables */
.btn-link {
  background: none;
  border: none;
  padding: 0;
  font: 500 13px/1.4 var(--sans);
  color: var(--brand);
  cursor: pointer;
}
.btn-link:hover { color: var(--brand-hover); text-decoration: underline; }

.inline, .inline-form { display: inline; margin: 0; }

/* 7. Forms ------------------------------------------------------------------ */

.input,
input[type="text"], input[type="search"], input[type="password"],
input[type="email"], input[type="number"], input[type="date"], input[type="file"],
select, textarea {
  font: 400 13.5px/1.4 var(--sans);
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-ctl);
  padding: 8px 10px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
textarea { resize: vertical; }

.input:focus,
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 39, 66, 0.1);
}
::placeholder { color: var(--faint); opacity: 1; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
}
.filter-bar input[type="search"] { flex: 1 1 220px; max-width: 340px; }
.inline-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.stack { display: flex; flex-direction: column; gap: 10px; }
.stack .btn { align-self: flex-start; }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
}
.field input[type="text"], .field input[type="number"],
.field select, .field textarea { width: 100%; max-width: 640px; }
.field-row { display: flex; gap: 20px; flex-wrap: wrap; }
.field-row .field { flex: 1 1 200px; }
.field-hint { font-size: 12.5px; margin-top: 5px; }
.field-error { color: var(--danger); font-size: 12.5px; margin-top: 5px; }
.checkbox-field { display: flex; align-items: center; gap: 8px; }
.checkbox-field label { margin: 0; font-weight: 400; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); }
.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.form-card { max-width: 720px; }

/* 8. Tables ------------------------------------------------------------------ */

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.data th {
  text-align: left;
  font-size: 12px;
  font-weight: 550;
  color: var(--muted);
  padding: 0 12px 9px 0;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data td {
  text-align: left;
  padding: 8px 12px 8px 0;
  height: 46px;
  border-bottom: 1px solid #eef1f4;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover td { background: #f8fafb; }
table.data th.num, table.data td.num { text-align: right; }
table.data td.num { font-family: var(--mono); font-size: 12.5px; }
table.data a { color: var(--ink); font-weight: 500; }
table.data a:hover { color: var(--brand-hover); }
table.data .empty { padding: 20px 0; }
.row-muted td { color: var(--muted); }
.row-errors { margin: 4px 0 0; padding-left: 16px; color: var(--danger); font-size: 12.5px; }

/* 9. Chips, dots, tiers -------------------------------------------------------- */

/* Status chip: soft tint, strong word. One system everywhere. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 18px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef1f5;
  color: var(--muted);
  white-space: nowrap;
}
.chip-ok { background: var(--ok-wash); color: var(--ok); }
.chip-warn { background: var(--warn-wash); color: var(--warn); }
.chip-bad, .chip-danger { background: var(--danger-wash); color: var(--danger); }
.chip-info { background: var(--info-wash); color: var(--info); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip strong { font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Pipeline-stage dot */
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 7px;
  background: #cbd5e1;
  vertical-align: 1px;
}
.dot-target { background: #94a3b8; }
.dot-approved { background: #4a7ab5; }
.dot-contacted { background: var(--brand); }
.dot-replied { background: var(--accent); }
.dot-discovery { background: #0e7490; }
.dot-opportunity { background: var(--warn); }
.dot-proposal { background: #815407; }
.dot-won { background: var(--ok); }
.dot-lost { background: var(--danger); }
.dot-nurture { background: #64748b; }
.dot-do_not_contact { background: var(--danger); }

/* Tier badge — the gold is reserved for Tier A */
.tier {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  background: #eef1f5;
  vertical-align: -3px;
  margin-right: 4px;
}
.tier-A {
  color: var(--accent-deep);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(184, 134, 43, 0.25);
}
.tier-B { color: var(--muted); }

/* 10. Cards & lists -------------------------------------------------------------- */

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
  margin: 0 0 16px;
  overflow-x: auto;
}
.card > .section-label:first-child { margin-bottom: 10px; }
.card > h2 { margin-bottom: 8px; }

.mini-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid #eef1f4;
  font-size: 13.5px;
}
.mini-row:first-of-type { border-top: none; }
.mini-row > span:first-child { flex: 1; min-width: 0; }
.mini-row > .muted, .mini-row > .chip { white-space: nowrap; }
.mini-row > .muted { font-family: var(--mono); font-size: 12px; }

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}
.detail-side .card { padding: 16px 18px; }

.fieldefs { margin: 0; }
.fieldefs > div {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  padding: 7px 0;
  border-top: 1px solid #eef1f4;
}
.fieldefs > div:first-child { border-top: none; }
.fieldefs dt { color: var(--muted); font-size: 13px; }
.fieldefs dd { margin: 0; font-size: 13.5px; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

/* 11. Today — the morning briefing ------------------------------------------------ */

.today-hero { padding: 4px 0 24px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.hero-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}
.hero-eyebrow .ip { color: var(--accent); }
.hero-lede {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  max-width: 24em;
  margin: 0 0 10px;
}
.hero-lede strong {
  font-family: var(--mono);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--brand);
}
.hero-lede strong.num-key { color: var(--accent); }
.today-hero .muted { font-size: 13.5px; }

/* Today sections are cards: a premium ops console, not a broadsheet */
.today-section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 18px 22px;
  margin: 0 0 16px;
}
.today-section .section-head { margin-bottom: 0; }
.today-section > .empty { padding-top: 12px; padding-bottom: 4px; }

.reply-card, .draft-card {
  padding: 15px 0;
  border-bottom: 1px solid #eef1f4;
}
.reply-card:last-of-type, .draft-card:last-of-type { border-bottom: none; padding-bottom: 4px; }

.reply-meta, .draft-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 13px;
}
.reply-meta a, .draft-head a { color: var(--ink); font-weight: 600; }
.reply-meta a:hover, .draft-head a:hover { color: var(--brand-hover); }
.reply-meta .when {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.reply-subject, .draft-subject {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin-top: 5px;
}
.reply-excerpt, .draft-preview {
  margin: 4px 0 0;
  font-size: 13.5px;
  max-width: 62em;
}
.reply-actions, .draft-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

/* Follow-up ledger rows */
.followup-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(200px, 1.4fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 46px;
  padding: 10px 0;
  border-bottom: 1px solid #eef1f4;
  font-size: 13.5px;
}
.followup-row:last-of-type { border-bottom: none; }
.followup-who a { color: var(--ink); font-weight: 600; }
.followup-who a:hover { color: var(--brand-hover); }
.followup-mid { display: flex; flex-direction: column; gap: 1px; }
.followup-mid .muted { font-size: 12.5px; }
.task-title { font-weight: 500; }
.followup-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-self: end;
  white-space: nowrap;
}

/* 12. Pipeline board --------------------------------------------------------------- */

.board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 16px;
  align-items: flex-start;
}
.board-col {
  flex: 0 0 224px;
  background: var(--subtle);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 10px;
  min-height: 120px;
}
.board-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 4px 10px;
}
.board-col-title {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.board-col .empty { padding: 6px 4px 8px; font-size: 13px; }

.pipe-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-ctl);
  box-shadow: var(--shadow-card);
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 13px;
  transition: box-shadow 120ms ease, border-color 120ms ease;
}
.pipe-card:hover { box-shadow: var(--shadow-raise); border-color: #d7dde3; }
.pipe-card:last-child { margin-bottom: 0; }
.pipe-card-top { display: flex; align-items: center; gap: 4px; }
.pipe-card-top a { color: var(--ink); font-weight: 600; }
.pipe-card-top a:hover { color: var(--brand-hover); }
.pipe-card-meta { font-size: 12px; margin-top: 3px; }

.stage-menu { margin-top: 8px; position: relative; }
.stage-menu summary {
  list-style: none;
  cursor: pointer;
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  padding: 2px 0;
}
.stage-menu summary::-webkit-details-marker { display: none; }
.stage-menu summary::after { content: " ▾"; font-size: 10px; }
.stage-menu summary:hover { color: var(--brand); }
.stage-menu[open] summary { color: var(--brand); }
.stage-menu .stack {
  position: absolute;
  z-index: 10;
  top: calc(100% + 6px);
  left: 0;
  width: 200px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-menu);
  padding: 10px;
  gap: 8px;
}

/* 13. Metrics ------------------------------------------------------------------------ */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin: 0 0 16px;
}
.kpi { padding: 18px 20px 16px; border-left: 1px solid #eef1f4; }
.kpi:nth-child(4n + 1) { border-left: none; }
.kpi:nth-child(n + 5) { border-top: 1px solid #eef1f4; }
.kpi-num {
  display: block;
  font-family: var(--mono);
  font-size: 27px;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--brand);
  margin-bottom: 4px;
}
.kpi-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.kpi-label .muted { color: var(--faint); font-weight: 400; }

.bar-cell { width: 26%; min-width: 120px; }
.bar { display: block; width: 100%; height: 10px; }
.bar-fill { fill: var(--brand); opacity: 0.3; rx: 2px; }
tr:hover .bar-fill { opacity: 0.55; }

/* 14. Timeline ------------------------------------------------------------------------- */

.timeline { list-style: none; margin: 6px 0 0; padding: 0; }
.timeline-item {
  position: relative;
  padding: 12px 0 12px 22px;
  border-bottom: 1px solid #eef1f4;
}
.timeline-item:last-child { border-bottom: none; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 19px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
}
.timeline-outbound::before { background: var(--brand); }
.timeline-inbound::before { background: var(--accent); }
.tl-type {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 2px;
}
.tl-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 13.5px;
}
.tl-body .muted { font-size: 13px; }
.tl-body .when {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

/* 15. Warnings & messages ------------------------------------------------------------------ */

.warn-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  margin-bottom: 8px;
  border: 1px solid rgba(180, 83, 9, 0.18);
  border-left: 3px solid var(--warn);
  border-radius: var(--r-card);
  background: var(--warn-wash);
}
.warn-copy { display: flex; flex-direction: column; gap: 1px; font-size: 13.5px; }
.warn-copy .muted { font-size: 13px; }
.warn-band .btn { flex: none; }
.warn-info { border-color: rgba(15, 39, 66, 0.15); border-left-color: var(--info); background: var(--info-wash); }
.warn-danger { border-color: rgba(185, 28, 28, 0.18); border-left-color: var(--danger); background: var(--danger-wash); }

/* Warnings section on /today keeps card chrome off — bands only */
.today-section.warnings {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.messages { list-style: none; padding: 0; margin: 0 0 20px; }
.message {
  padding: 10px 14px;
  margin-bottom: 6px;
  font-size: 13.5px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--info);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}
.message.success { border-left-color: var(--ok); }
.message.warning { border-left-color: var(--warn); }
.message.danger, .message.error { border-left-color: var(--danger); }

/* 16. Settings & imports --------------------------------------------------------------------- */

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid #eef1f4;
}
.settings-row:first-of-type { border-top: none; }
.settings-row-actions form { margin: 0; }

.settings-form label { display: block; font-size: 13px; font-weight: 600; margin: 18px 0 3px; }
.settings-form p.muted { margin: 0 0 6px; font-size: 12.5px; }
.settings-form textarea,
.settings-form input[type="text"],
.settings-form input[type="number"] { width: 100%; max-width: 520px; }

.status { font-size: 13px; font-weight: 600; margin: 2px 0; }
.status-ok { color: var(--ok); }
.status-warn { color: var(--danger); }
.status-muted { color: var(--muted); font-weight: 500; }

.imports-form label { display: block; font-size: 13px; font-weight: 600; margin: 16px 0 4px; }
.imports-form input[type="text"], .imports-form select, .imports-form textarea { width: 100%; }
.imports-form .small { margin: 12px 0 0; }

/* 17. Login — flawless, centered, unmistakably Archively ------------------------------------------ */

.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  position: relative;
}
/* The marketing site's grid-paper backdrop, fading from the top */
.auth-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(11, 18, 32, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(11, 18, 32, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, black 30%, transparent 75%);
  mask-image: radial-gradient(ellipse at 50% 0%, black 30%, transparent 75%);
}
.auth-card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-raise);
  padding: 36px 36px 32px;
  width: 360px;
}
.auth-brand { text-align: center; margin-bottom: 24px; }
.auth-logo { display: block; width: 178px; height: auto; margin: 0 auto 12px; }
.auth-brand .brand-sub {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 2px 10px;
}
.auth-card label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 14px 0 5px;
}
.auth-card input[type="text"], .auth-card input[type="password"] { width: 100%; }
.auth-card .btn { margin-top: 22px; width: 100%; text-align: center; padding: 10px 14px; }
.auth-card .message { margin-top: 14px; }

/* 18. Small screens ---------------------------------------------------------------------------------- */

@media (max-width: 960px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: auto;
    flex: none;
    position: static;
    height: auto;
    padding: 14px 0 0;
  }
  .brand { border-bottom: none; padding-bottom: 8px; margin-bottom: 0; }
  .nav { flex-direction: row; flex-wrap: wrap; padding: 0 12px 10px; gap: 2px; }
  .nav-item.active::before { content: none; }
  .nav-item.active {
    background:
      linear-gradient(var(--champagne), var(--champagne)) bottom center / calc(100% - 20px) 2px no-repeat,
      rgba(255, 255, 255, 0.09);
  }
  .signout { display: none; }
  .content { padding: 24px 20px 48px; }
  .detail-grid, .two-col { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi:nth-child(4n + 1) { border-left: 1px solid #eef1f4; }
  .kpi:nth-child(2n + 1) { border-left: none; }
  .kpi:nth-child(n + 3) { border-top: 1px solid #eef1f4; }
  .followup-row { grid-template-columns: 1fr; gap: 6px; }
  .followup-actions { justify-self: start; flex-wrap: wrap; white-space: normal; }
  .hero-lede { font-size: 23px; }
}
