/* Product Memory design system — tokens extracted from the approved dashboard mockup. */

:root {
  color-scheme: light;
  --bg: #F5F6F3;
  --surface: #FFFFFF;
  --ink: #1B211E;
  --muted: #64706A;
  --border: #E2E6E1;
  --accent: #2E6B58;
  --accent-soft: #E4EFEA;
  --hover: #EEF1ED;
  --danger: #A84B32;
  --danger-soft: #F4E6E1;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #131715;
    --surface: #1B201D;
    --ink: #E7ECE8;
    --muted: #93A099;
    --border: #2A312D;
    --accent: #63C4A4;
    --accent-soft: #22322C;
    --hover: #222824;
    --danger: #D98B72;
    --danger-soft: #3A2A24;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131715;
  --surface: #1B201D;
  --ink: #E7ECE8;
  --muted: #93A099;
  --border: #2A312D;
  --accent: #63C4A4;
  --accent-soft: #22322C;
  --hover: #222824;
  --danger: #D98B72;
  --danger-soft: #3A2A24;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 "Avenir Next", "Segoe UI", system-ui, sans-serif;
  display: flex;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Sidebar ---------- */
.sidebar {
  view-transition-name: sidebar; /* stays put while page content cross-fades */
  width: 260px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 4px 10px 18px; }
.brand-icon { flex: none; display: block; }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.04; }
.brand-dot { color: var(--accent); }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
}
.nav-item:hover { background: var(--hover); text-decoration: none; }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item svg { flex-shrink: 0; stroke: currentColor; }

.project-block { padding: 14px 10px 6px; }
.project-name { padding-top: 2px; font-size: 14px; font-weight: 600; }
.select-wrap { position: relative; display: block; }
.select-wrap::after {
  content: ""; position: absolute; right: 13px; top: 50%;
  width: 7px; height: 7px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.project-select { appearance: none; padding-right: 32px; font-weight: 600; }
select:focus-visible, input:focus-visible, textarea:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}
.project-select, select, input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="url"], input[type="search"], input[type="number"], textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}
textarea { resize: vertical; min-height: 90px; }
.nav-section { padding: 16px 10px 2px; }
.nav-section .field-label { margin-bottom: 0; }
.sidebar-bottom { margin-top: auto; }

/* ---------- Main ---------- */
.main { flex: 1; padding: 32px 40px; min-width: 0; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.page-title { font-size: 22px; font-weight: 600; margin: 0 0 4px; }
.page-sub { color: var(--muted); margin: 0 0 28px; }
.crumb { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.crumb a { color: var(--muted); }

/* ---------- Tiles ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  color: var(--ink);
  display: block;
}
a.tile:hover { background: var(--hover); text-decoration: none; }
.tile .label { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.tile .value { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 6px; }
.tile .delta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ---------- Cards & lists ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 24px;
}
.card > h2 {
  font-size: 14px; font-weight: 600; margin: 0;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.card-pad { padding: 16px 18px; }

.recent { list-style: none; margin: 0; padding: 6px 0; }
.recent li { padding: 0; }
.recent a, .recent .row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 18px;
  color: var(--ink);
}
.recent a:hover { background: var(--hover); text-decoration: none; }
.recent .when { margin-left: auto; color: var(--muted); font-size: 12.5px; white-space: nowrap; }

/* ---------- Pills ---------- */
.pill {
  font-size: 11px; font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--hover);
  color: var(--muted);
  white-space: nowrap;
}
.pill-accent { background: var(--accent-soft); color: var(--accent); }
.pill-outline { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.records { width: 100%; border-collapse: collapse; font-size: 14px; }
table.records th {
  text-align: left;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
  padding: 12px 18px 8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.records td { padding: 10px 18px; border-bottom: 1px solid var(--border); vertical-align: baseline; }
table.records tbody th {
  padding: 10px 18px; vertical-align: baseline;
  font-size: inherit; font-weight: inherit; letter-spacing: normal; text-transform: none;
}
table.records tr:last-child :is(th, td) { border-bottom: none; }
table.records tbody tr:hover { background: var(--hover); }
table.records td.num, .num { font-variant-numeric: tabular-nums; }
table.records td .title-link { color: var(--ink); font-weight: 500; }
table.records td.muted, .muted { color: var(--muted); }
table.records td.nowrap { white-space: nowrap; }
.display-id { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--muted); white-space: nowrap; }

/* ---------- Filters ---------- */
.filters { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.filters select, .filters input[type="text"] { width: auto; min-width: 130px; }
.filters input[type="text"] { min-width: 220px; }
.filters .spacer { flex: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--surface);
  font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { opacity: 0.92; text-decoration: none; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border); font-weight: 500; }
.btn-secondary:hover { background: var(--hover); opacity: 1; }
.btn-small { padding: 4px 10px; font-size: 13px; }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--border); font-weight: 500; }

/* ---------- Detail ---------- */
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
@media (max-width: 1100px) { .detail-layout { grid-template-columns: 1fr; } }
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px 20px;
  margin: 0;
}
/* The rail is metadata, not the document — flat sections, micro-headings, smaller text. */
.detail-rail { font-size: 13px; }
.detail-rail .card { background: none; border: none; border-radius: 0; margin-bottom: 26px; }
.detail-rail .card > h2 {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); padding: 0 0 8px;
}
.detail-rail .card-pad { padding: 4px 0 0; }
.detail-rail .meta-grid dd { font-size: 13px; }
.detail-rail .link-list, .detail-rail .history { padding: 0; }
.detail-rail .link-list li, .detail-rail .history li { padding-left: 0; padding-right: 0; }
.detail-rail .link-list li:hover { background: none; }
.meta-grid div { min-width: 0; }
.meta-grid dt { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.meta-grid dd { margin: 0; font-size: 14px; overflow-wrap: break-word; }
.prose { font-size: 14.5px; max-width: 68ch; }
.prose p { margin: 0 0 0.8em; }
.prose p:last-child { margin-bottom: 0; }

.link-list { list-style: none; margin: 0; padding: 6px 0; }
.link-list li { display: flex; gap: 10px; align-items: baseline; padding: 8px 18px; }
.link-list li:hover { background: var(--hover); }
.link-list .title-link { color: var(--ink); min-width: 0; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 10px 18px; }
.timeline li { position: relative; padding: 0 0 18px 22px; }
.timeline li::before {
  content: "";
  position: absolute; left: 4px; top: 7px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
}
.timeline li::after {
  content: "";
  position: absolute; left: 7px; top: 18px; bottom: 2px;
  width: 1px; background: var(--border);
}
.timeline li:last-child { padding-bottom: 4px; }
.timeline li:last-child::after { display: none; }
.timeline .when { color: var(--muted); font-size: 12.5px; }
.timeline .entry-title { font-weight: 500; }
.timeline .entry-body { color: var(--muted); font-size: 13.5px; max-width: 60ch; }

/* ---------- History ---------- */
.history { list-style: none; margin: 0; padding: 6px 0; font-size: 13px; }
.history li { display: flex; gap: 10px; align-items: baseline; padding: 7px 18px; }
.history .when { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; flex-shrink: 0; }
.history .actor { color: var(--muted); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 800px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: block; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; align-items: center; }
.contact-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* ---------- Flash & errors ---------- */
.flash {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 20px;
  font-size: 14px;
}
.flash.alert { background: var(--danger-soft); color: var(--danger); }
.token-reveal {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  background: var(--hover);
  padding: 2px 6px;
  border-radius: 6px;
  user-select: all;
}

/* ---------- Empty states ---------- */
.empty { padding: 44px 24px; text-align: center; color: var(--muted); }
.empty .glyph { font-size: 22px; margin-bottom: 8px; color: var(--accent); }
.empty .line { font-weight: 500; color: var(--ink); margin-bottom: 4px; }
.empty .hint-line { font-size: 13.5px; }

/* ---------- Attachment viewer ---------- */
.attachment-frame {
  width: 100%;
  min-height: 75vh;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #FFFFFF; /* untrusted document keeps its own ground */
}

/* ---------- Auth ---------- */
.auth-wrap {
  flex: 1; display: grid; place-items: center; padding: 48px 20px;
  background:
    radial-gradient(circle at 18% 14%, color-mix(in srgb, var(--accent) 12%, var(--accent-soft)), transparent 34%),
    radial-gradient(circle at 82% 86%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 38%),
    linear-gradient(145deg, var(--bg), var(--surface) 52%, var(--accent-soft));
}
.auth-card {
  width: calc(100vw - 40px); max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: clamp(28px, 8vw, 40px);
  box-shadow: 0 24px 64px rgba(19, 23, 21, 0.12);
}
.auth-card .brand { gap: 12px; padding: 0 0 28px; }
.auth-card .brand-icon { width: 42px; height: 42px; }
.auth-card .brand-name { font-size: 19px; }
.auth-card .field { margin-bottom: 18px; }
.auth-card .field-label { margin-bottom: 8px; }
.auth-card input[type="email"], .auth-card input[type="password"] {
  min-height: 50px; padding: 12px 14px; border-radius: 10px; font-size: 15px;
}
.auth-card .btn { width: 100%; min-height: 50px; border-radius: 10px; font-size: 15px; }

a:focus-visible, button:focus-visible, summary:focus-visible, select:focus-visible,
input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---- Backlog board ---- */
.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(190px, 1fr);
  gap: 10px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 8px;
}
.board-col {
  background: color-mix(in srgb, var(--surface) 55%, var(--bg));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.board-col-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 2px 6px 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.board-col-head .num { font-variant-numeric: tabular-nums; }
.board-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 12px;
  color: var(--ink);
}
.board-card:hover { border-color: var(--accent); }
.board-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 5px;
}
.board-card-top .display-id { font-size: 12px; }
.board-priority { font-size: 11px; color: var(--muted); }
.board-priority.is-critical { color: var(--danger); font-weight: 600; }
.board-card-title { font-size: 13.5px; font-weight: 500; line-height: 1.35; }
.board-card-meta { font-size: 11.5px; margin-top: 6px; }
.board-empty { text-align: center; color: var(--muted); padding: 10px 0 6px; font-size: 12px; }

/* ---- Nav counts ---- */
.nav-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---- Account pages: the Next strip and the one-line log form ---- */
.next-strip { background: var(--accent-soft); border-color: transparent; }
.next-strip .strip-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 4px;
}
.next-row { display: flex; gap: 10px; align-items: center; padding: 4px 0; }
.next-row .title-link { color: var(--ink); font-weight: 500; min-width: 0; }
.next-row .when { margin-left: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.next-row .when.overdue { color: var(--danger); font-weight: 600; }

.timeline-log { display: flex; gap: 8px; align-items: center; border-top: 1px solid var(--border); }
.timeline-log input[type="text"] { flex: 1; font-size: 13.5px; }
.timeline-log select { width: auto; font-size: 13px; }

.rail-contact { padding: 3px 0; }
.overdue { color: var(--danger); font-weight: 600; }

/* ---- Structured outreach action ---- */
.contact-line { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.primary-action { margin-top: 14px; }
.message-foot { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.verify-line { font-size: 12.5px; }
.raw-notes { margin-bottom: 24px; color: var(--muted); font-size: 13px; }
.raw-notes summary { cursor: pointer; }
.raw-notes .prose { margin-top: 8px; font-size: 13px; }
.h2-split { display: flex; align-items: center; justify-content: space-between; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0; flex: none;
  border: 1px solid var(--border); border-radius: 6px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { color: var(--ink); }
.copy-rows { margin-top: 12px; display: grid; gap: 6px; max-width: 560px; }
.copy-row { display: flex; gap: 10px; align-items: center; min-width: 0; }
.copy-row .copy-label {
  width: 56px; flex: none;
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--muted);
}
.copy-row .copy-value { min-width: 0; overflow-wrap: anywhere; }
.copy-row .icon-btn { margin-left: auto; }

/* ---- Customer pipeline & quick actions ---- */
.pipeline { display: flex; gap: 8px; flex-wrap: wrap; margin: -12px 0 16px; }
.pipeline-stage {
  display: inline-flex; gap: 6px; align-items: baseline;
  padding: 4px 12px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface);
  font-size: 12.5px; color: var(--ink);
}
.pipeline-stage:hover { border-color: var(--accent); text-decoration: none; }
.pipeline-stage.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.pipeline-stage .num { font-weight: 600; font-variant-numeric: tabular-nums; }
.pipeline-stage.is-zero { color: var(--muted); }
.pipeline-stage.is-zero .num { font-weight: 400; }

/* ---- Acquisition analytics ---- */
.analytics-filters input[type="date"] { width: auto; min-width: 142px; }
.analytics-tiles {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.analytics-tile { min-width: 0; }
.quality-stat .label, .response-time .label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}
.analytics-tile .value { overflow-wrap: anywhere; }
.analytics-tile .value.is-pending { color: var(--accent); font-size: 18px; padding: 5px 0 3px; }
.analytics-empty {
  margin: -8px 0 24px;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
}
.analytics-funnels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.analytics-funnel { min-width: 0; }
.funnel-flow { display: flex; align-items: stretch; overflow-x: auto; padding: 14px; }
.funnel-step {
  position: relative;
  flex: 1 0 92px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 18px 9px 10px;
  border: 1px solid var(--border);
  border-right: 0;
  color: var(--ink);
  background: var(--surface);
}
.funnel-step:first-child { border-radius: 8px 0 0 8px; }
.funnel-step:last-child { border-right: 1px solid var(--border); border-radius: 0 8px 8px 0; }
.funnel-step:hover { background: var(--hover); text-decoration: none; }
.funnel-step::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 50%;
  z-index: 1;
  width: 8px;
  height: 8px;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: inherit;
  transform: translateY(-50%) rotate(45deg);
}
.funnel-step:last-child::after { display: none; }
.funnel-label { color: var(--muted); font-size: 11px; }
.funnel-step strong { font-size: 18px; }
.analytics-channels td:not(:first-child) a { color: var(--ink); display: block; }
.quality-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; }
.quality-stat, .response-time {
  display: block;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
}
.quality-stat:hover, .response-time:hover { background: var(--hover); text-decoration: none; }
.quality-stat strong, .response-time strong { display: block; margin: 4px 0 1px; font-size: 21px; font-variant-numeric: tabular-nums; }
.quality-stat .muted { font-size: 12px; }
.quality-exclusions { margin: 0; padding: 0 18px 14px 36px; color: var(--muted); font-size: 13px; }
.analytics-warning { margin: 0; padding: 10px 18px; border-top: 1px solid var(--border); color: var(--danger); font-size: 13px; }
.response-times { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 1050px) {
  .analytics-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quality-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1500px) { .analytics-funnels { grid-template-columns: 1fr; } }
@media (max-width: 680px) {
  .analytics-tiles, .quality-grid, .response-times { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  body { display: block; }
  .sidebar {
    position: sticky;
    z-index: 10;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .sidebar .brand { flex: none; padding: 0 8px 0 0; }
  .project-block { flex: 0 0 190px; padding: 0; }
  .project-block .field-label, .nav-section { display: none; }
  .nav-item { flex: none; }
  .sidebar-bottom { display: flex; flex: none; margin: 0 0 0 auto; }
  .main { width: 100%; padding: 24px 20px; }
  .table-wrap { max-width: 100%; }
}

@media (max-width: 480px) {
  .sidebar .brand { display: none; }
  .main { padding: 20px 12px; }
  .analytics-filters > * { flex: 1 1 140px; }
  .analytics-filters .btn { flex: 0 0 auto; }
}

.filters .search { margin-left: auto; }
.filters .search input[type="search"] { width: auto; min-width: 220px; }

.stage-form { display: inline-block; }
.stage-form select { width: auto; padding: 3px 8px; font-size: 12.5px; border-radius: 999px; }

.next-action-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.next-action-form input[type="text"] { flex: 1; min-width: 200px; }
.next-action-form input[type="date"] { width: auto; }

/* ---- Today & opportunity extras ---- */
.count-badge {
  display: inline-block; margin-left: 6px;
  padding: 1px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.today-list { list-style: none; margin: 0; padding: 0; }
.today-list li { border-bottom: 1px solid var(--border); }
.today-list li:last-child { border-bottom: none; }
.today-row {
  display: flex; gap: 14px; align-items: baseline;
  padding: 11px 18px; color: inherit;
}
.today-row:hover { background: var(--accent-soft); text-decoration: none; }
.today-row .deal { display: flex; flex-direction: column; gap: 1px; min-width: 220px; }
.today-row .deal .title { font-weight: 600; }
.today-row .deal .muted { font-size: 12.5px; }
.today-row .action { flex: 1; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.today-row .next { font-size: 13.5px; }
.today-row .when { font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.today-row .when.overdue { color: var(--danger); font-weight: 600; }

.next-action-extras { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--border); }
.suggestion {
  flex: 1; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 8px 12px; border-radius: 8px;
  background: var(--accent-soft); font-size: 13.5px;
}

/* Value + currency side by side */
.value-row { display: flex; gap: 8px; }
.value-row input[type="number"] { flex: 1; }
.value-row input[type="text"] { width: 76px; text-transform: uppercase; }
