/* ─────────────────────────────────────────────────────────────────────────────
 * Shared styles for Marketing Attribution mockups.
 * Design tokens so mockups feel like the real product when stakeholders click through.
 * ───────────────────────────────────────────────────────────────────────────── */

:root {
  --bg:      #f9fafb;
  --surface: #ffffff;
  --border:  #e5e7eb;
  --muted:   #6b7280;
  --text:    #111827;
  --accent:  #6366f1;   /* indigo */
  --accent-hover: #4f46e5;
  --green:   #16a34a;
  --amber:   #d97706;
  --red:     #dc2626;
  --blue:    #2563eb;
  --pink:    #ec4899;
  --orange:  #f97316;

  --radius:  12px;
  --radius-sm: 8px;
  --radius-pill: 20px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

/* Ensure anchored/focused elements clear the sticky nav */
html {
  scroll-padding-top: 60px;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

button { font-family: inherit; cursor: pointer; }

/* ── Page layout ───────────────────────────────────────────────────────────── */

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px 60px;
}

/* Keep page-header actions accessible below the sticky 52px nav */
.page-header {
  scroll-margin-top: 60px;
}

/* ── Persistent top nav (every mockup) ────────────────────────────────────── */

.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  padding: 0 28px;
  font-size: 13px;
  height: 52px;
  box-shadow: 0 1px 0 rgba(15,23,42,0.02);
}
.top-nav .left,
.top-nav .right {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}
.top-nav .tabs {
  display: flex;
  align-items: stretch;
  flex: 1;
  margin: 0 24px;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;
}
.top-nav .tabs::-webkit-scrollbar { display: none; } /* Chrome/Safari */

/* Logo */
.top-nav .logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
}
.top-nav .logo:hover { opacity: 0.85; }

/* Tabs */
.top-nav .tab {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  height: 100%;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px; /* overlap the nav border so the active underline aligns */
  transition: color 0.12s ease, border-color 0.12s ease;
}
.top-nav .tab:hover {
  color: var(--text);
}
/* Back-action button rendered as a tab — reset button defaults */
.top-nav .tab--back {
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  cursor: pointer;
}
.top-nav .tab.active {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

/* Right side: sitemap link + file-id badge + user pill */
.top-nav .sitemap-link {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}
.top-nav .sitemap-link:hover { color: var(--accent); }

.top-nav .file-id {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 3px 8px;
  white-space: nowrap;
}

.top-nav .user-pill {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

/* ── Page header ──────────────────────────────────────────────────────────── */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px 0 20px;
  gap: 20px;
}
.page-header h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
}
.page-header .subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.page-header .actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ── Cards ────────────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.card-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.card-header .meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 14px;
}

/* ── Stat cards ───────────────────────────────────────────────────────────── */

.stat-strip {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  flex: 1 1 180px;
  min-width: 160px;
  box-shadow: var(--shadow-sm);
}
.stat .label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.stat .value {
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.stat .value.accent { color: var(--accent); }
.stat .value.green  { color: var(--green); }
.stat .value.amber  { color: var(--amber); }
.stat .value.blue   { color: var(--blue); }
.stat .value.red    { color: var(--red); }
.stat .sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.stat .delta {
  font-size: 11px;
  margin-top: 4px;
  font-weight: 500;
}
.stat .delta.up   { color: var(--green); }
.stat .delta.down { color: var(--red); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: all 0.15s ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn-ghost:hover { color: var(--accent); }

.btn-sm {
  padding: 5px 11px;
  font-size: 12px;
}

/* ── Pills / badges ───────────────────────────────────────────────────────── */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 500;
  border: 1px solid;
  white-space: nowrap;
}
.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.pill.hot      { color: var(--green); background: rgba(22,163,74,0.10); border-color: rgba(22,163,74,0.35); }
.pill.warm     { color: var(--amber); background: rgba(217,119,6,0.10); border-color: rgba(217,119,6,0.35); }
.pill.pipeline { color: var(--blue);  background: rgba(37,99,235,0.10); border-color: rgba(37,99,235,0.35); }
.pill.cold     { color: var(--muted); background: rgba(107,114,128,0.10); border-color: rgba(107,114,128,0.35); }
.pill.indigo   { color: var(--accent); background: rgba(99,102,241,0.10); border-color: rgba(99,102,241,0.35); }
.pill.green    { color: var(--green); background: rgba(22,163,74,0.10); border-color: rgba(22,163,74,0.35); }
.pill.amber    { color: var(--amber); background: rgba(217,119,6,0.10); border-color: rgba(217,119,6,0.35); }
.pill.blue     { color: var(--blue);  background: rgba(37,99,235,0.10); border-color: rgba(37,99,235,0.35); }
.pill.red      { color: var(--red);   background: rgba(220,38,38,0.10); border-color: rgba(220,38,38,0.35); }
.pill.muted    { color: var(--muted); background: rgba(107,114,128,0.08); border-color: rgba(107,114,128,0.25); }
.pill.pink     { color: var(--pink);  background: rgba(236,72,153,0.10); border-color: rgba(236,72,153,0.35); }
.pill.orange   { color: var(--orange); background: rgba(249,115,22,0.10); border-color: rgba(249,115,22,0.35); }

/* ── Tables ───────────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data thead th {
  text-align: left;
  padding: 8px 12px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
table.data tbody tr {
  border-bottom: 1px solid var(--border);
}
table.data tbody tr:hover {
  background: rgba(99,102,241,0.04);
  cursor: pointer;
}
table.data tbody tr.row-hot  { background: rgba(22,163,74,0.05); }
table.data tbody tr.row-warm { background: rgba(217,119,6,0.05); }
table.data td {
  padding: 10px 12px;
  color: var(--text);
}
table.data td.muted { color: var(--muted); font-size: 12px; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Forms ────────────────────────────────────────────────────────────────── */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 20px;
}
.form-grid.full { grid-template-columns: 1fr; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.form-field label .req { color: var(--red); }
.form-field .hint {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}
.form-field input,
.form-field select,
.form-field textarea {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  outline: none;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
  background: rgba(249,250,251,0.5);
}
.fieldset legend {
  font-size: 13px;
  font-weight: 600;
  padding: 0 6px;
}

/* ── Tabs ─────────────────────────────────────────────────────────────────── */

.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tab {
  padding: 9px 16px;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
}
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.tab:hover { color: var(--text); }

/* ── Chip filter ─────────────────────────────────────────────────────────── */

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.chip {
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  text-transform: capitalize;
  text-decoration: none;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active {
  border-color: var(--accent);
  background: rgba(99,102,241,0.1);
  color: var(--accent);
}

/* ── Module tiles (home page) ────────────────────────────────────────────── */

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  display: block;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.tile:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.tile .icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 14px;
}
.tile h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.tile p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.tile .stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.tile .stats strong { color: var(--text); font-weight: 600; }

/* ── Two-column grids ─────────────────────────────────────────────────────── */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 0; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; margin-bottom: 0; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 0; }

/* ── Bar chart (CSS only) ─────────────────────────────────────────────────── */

.bar-chart { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-row .label {
  width: 180px;
  min-width: 180px;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}
.bar-row .track {
  flex: 1;
  height: 20px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}
.bar-row .fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.bar-row .num { width: 36px; font-size: 12px; text-align: right; }

/* ── Empty state ─────────────────────────────────────────────────────────── */

.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty .emoji { font-size: 48px; margin-bottom: 12px; }
.empty .title { font-size: 16px; font-weight: 500; color: var(--text); margin-bottom: 8px; }
.empty .body { font-size: 13px; }

/* ── Timeline (lead journey) ─────────────────────────────────────────────── */

.timeline {
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  padding-bottom: 24px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -23px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--accent);
}
.timeline-item.first::before  { background: var(--green); box-shadow: 0 0 0 2px var(--green); }
.timeline-item.event::before  { background: var(--amber); box-shadow: 0 0 0 2px var(--amber); }
.timeline-item.social::before { background: var(--pink); box-shadow: 0 0 0 2px var(--pink); }
.timeline-item.meeting::before { background: var(--blue); box-shadow: 0 0 0 2px var(--blue); }
.timeline-item .when {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.timeline-item .what {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 2px;
}
.timeline-item .what a { color: var(--accent); }
.timeline-item .detail {
  font-size: 12px;
  color: var(--muted);
}

/* ── Slider (for scenario sliders) ──────────────────────────────────────── */

.slider-row {
  display: grid;
  grid-template-columns: 180px 1fr 60px;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
}
.slider-row label {
  font-size: 12px;
  color: var(--muted);
}
.slider-row input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}
.slider-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
}
.slider-row .out {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── Notice / call-out ───────────────────────────────────────────────────── */

.notice {
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  border-left: 3px solid;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.notice.info  { background: rgba(37,99,235,0.06); border-color: var(--blue);  color: var(--text); }
.notice.warn  { background: rgba(217,119,6,0.06); border-color: var(--amber); color: var(--text); }
.notice.green { background: rgba(22,163,74,0.06); border-color: var(--green); color: var(--text); }
.notice .icon { font-size: 14px; flex-shrink: 0; }

/* ── Inline editable fields ───────────────────────────────────────────────
 * Use anywhere a stat / planned value should be adjustable on the fly.
 * Visually indistinguishable from text at rest; subtle dashed underline on
 * hover signals editability; bordered + tinted on focus.
 */
.inline-edit {
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  padding: 0 2px;
  outline: none;
  cursor: text;
  border-bottom: 1px dashed transparent;
  transition: all 0.15s ease;
  width: auto;
  min-width: 2ch;
  font-variant-numeric: tabular-nums;
}
.inline-edit:hover  { border-bottom-color: var(--accent); }
.inline-edit:focus  { border-bottom-color: var(--accent); background: rgba(99,102,241,0.06); }

.inline-edit.large {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
}
.inline-edit.medium {
  font-size: 18px;
  font-weight: 600;
}

/* Inline-editable <select> ── visually similar to .inline-edit, but works
 * for dropdowns. Native arrow is replaced with a subtle chevron that only
 * shows on hover/focus to keep the row visually quiet. */
.inline-edit-select {
  border: 1px solid transparent;
  background: transparent;
  font: inherit;
  color: inherit;
  padding: 2px 18px 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5' fill='none'><path d='M1 1l3 3 3-3' stroke='%239ca3af' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 4px center;
  background-size: 8px 5px;
  transition: all 0.15s ease;
  font-size: inherit;
}
.inline-edit-select:hover {
  border-color: var(--border);
  background-color: rgba(99,102,241,0.04);
}
.inline-edit-select:focus {
  border-color: var(--accent);
  background-color: rgba(99,102,241,0.06);
}

/* Pill-styled inline-editable select. Pair with one of .pill-*  modifier
 * classes to color it: e.g. <select class="pill-select pill-green"> */
.pill-select {
  border: 1px solid transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 18px 2px 8px;
  border-radius: 12px;
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5' fill='none'><path d='M1 1l3 3 3-3' stroke='%239ca3af' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 8px 5px;
  transition: all 0.15s ease;
}
.pill-select:hover  { filter: brightness(0.97); }
.pill-select:focus  { box-shadow: 0 0 0 2px rgba(99,102,241,0.20); }
.pill-select.pill-green { background-color: rgba(22,163,74,0.10);  color: var(--green);  border-color: rgba(22,163,74,0.30); }
.pill-select.pill-amber { background-color: rgba(217,119,6,0.10);  color: var(--amber);  border-color: rgba(217,119,6,0.30); }
.pill-select.pill-blue  { background-color: rgba(37,99,235,0.10);  color: var(--blue);   border-color: rgba(37,99,235,0.30); }
.pill-select.pill-pink  { background-color: rgba(236,72,153,0.10); color: var(--pink);   border-color: rgba(236,72,153,0.30); }
.pill-select.pill-red   { background-color: rgba(220,38,38,0.10);  color: var(--red);    border-color: rgba(220,38,38,0.30); }
.pill-select.pill-muted { background-color: rgba(107,114,128,0.10); color: var(--muted); border-color: rgba(107,114,128,0.25); }
.pill-select.pill-indigo { background-color: rgba(99,102,241,0.10); color: var(--accent); border-color: rgba(99,102,241,0.30); }
.pill-select.pill-hot   { background-color: rgba(22,163,74,0.10);  color: var(--green);  border-color: rgba(22,163,74,0.30); }
.pill-select.pill-warm  { background-color: rgba(217,119,6,0.10);  color: var(--amber);  border-color: rgba(217,119,6,0.30); }
.pill-select.pill-cold  { background-color: rgba(107,114,128,0.10); color: var(--muted); border-color: rgba(107,114,128,0.25); }
.pill-select.pill-pipeline { background-color: rgba(37,99,235,0.10); color: var(--blue); border-color: rgba(37,99,235,0.30); }

/* Wrapper that adds a subtle pencil hint on hover, useful for stat values. */
.editable-stat { position: relative; display: inline-flex; align-items: center; }
.editable-stat::after {
  content: '\270E';
  margin-left: 6px;
  font-size: 12px;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.editable-stat:hover::after { opacity: 0.75; }

/* "Saved" toast triggered when any .inline-edit is changed (handled in _nav.js). */
.save-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--surface);
  border: 1px solid var(--green);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 12px;
  color: var(--green);
  font-weight: 500;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 1100;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.2s ease;
  pointer-events: none;
}
.save-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ── Probability cards (P(0) / P(1) / P(>1)) ──────────────────────────── */
.prob-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 8px;
}
.prob-card {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  text-align: center;
  border: 1px solid var(--border);
}
.prob-card .label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  font-weight: 500;
}
.prob-card .value {
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.prob-card .value.red   { color: var(--red); }
.prob-card .value.amber { color: var(--amber); }
.prob-card .value.green { color: var(--green); }
.prob-card .sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}

/* Inline probability mini-strip — used on create forms as a preview. */
.prob-strip {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: rgba(99,102,241,0.04);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 12px;
}
.prob-strip .item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.prob-strip .item .l { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.prob-strip .item .v { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ── Helper text utilities ───────────────────────────────────────────────── */

.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny  { font-size: 11px; }
.bold  { font-weight: 600; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; }
.gap-sm { gap: 6px; }
.gap-md { gap: 12px; }
.gap-lg { gap: 20px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }

/* ── Kanban board ──────────────────────────────────────────────────────────── */

.kanban {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 20px;
  align-items: flex-start;
}
.kanban-col {
  flex: 0 0 172px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kanban-col-head {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  border-left: 3px solid var(--stage-color, var(--accent));
  background: rgba(255,255,255,0.7);
}
.kanban-col-head .stage-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.kanban-col-head .stage-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* ── Deal card (kanban) ────────────────────────────────────────────────────── */

.deal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--stage-color, var(--accent));
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  cursor: grab;
  transition: box-shadow 0.15s, transform 0.1s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.deal-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.deal-card.dragging { opacity: 0.5; }
.deal-card.stale { border-left-color: var(--amber); }
.deal-card.won   { border-left-color: var(--green); }
.deal-card .dc-company { font-size: 14px; font-weight: 600; color: var(--text); }
.deal-card .dc-arr { font-size: 13px; font-weight: 700; color: var(--accent); margin-top: 6px; }
.deal-card .dc-meta { font-size: 11px; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.deal-card .dc-badges { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.deal-card .dc-campaign { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.deal-card .stale-flag { color: var(--amber); display: flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; }

/* ── Responsive nav — squeeze tabs to fit at narrower viewports ─────────── */
@media (max-width: 1200px) {
  .top-nav .tab { padding: 0 10px; }
}
@media (max-width: 1024px) {
  .top-nav { padding: 0 16px; }
  .top-nav .left, .top-nav .right { gap: 10px; }
  .top-nav .tab { padding: 0 8px; font-size: 12px; }
  .top-nav .tabs { margin: 0 12px; }
  .page { padding: 0 16px 60px; }
}

/* ── M365-inspired sales design system (Jun 2026) ─────────────────────────
 * Reusable primitives for the sales app. Layered on existing tokens —
 * keeps Cofactor colors, adds M365 interaction patterns.
 * ─────────────────────────────────────────────────────────────────────────*/

/* Command bar — compact horizontal action row above tab bodies */
.command-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 0 10px;
}
.command-bar .cb-left  { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.command-bar .cb-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.command-bar .cb-title { font-size: 13px; font-weight: 600; color: var(--text); }
.command-bar .cb-count {
  font-size: 12px; color: var(--muted);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px; padding: 1px 9px; white-space: nowrap;
}

/* M365-style rounded pill search field */
.search-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 7px 14px;
  transition: border-color .15s, box-shadow .15s;
  min-width: 220px;
}
.search-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.10);
  color: var(--text);
}
.search-field input {
  border: none; outline: none; background: transparent;
  color: var(--text); font: inherit; font-size: 13px;
  flex: 1; min-width: 0;
}
.search-field input::placeholder { color: var(--muted); }

/* Fluent card — card that lifts on hover with indigo tint */
.fluent-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, border-color .2s ease, transform .15s ease;
}
.fluent-card:hover {
  box-shadow: 0 4px 18px rgba(99,102,241,0.10);
  border-color: rgba(99,102,241,0.22);
  transform: translateY(-1px);
}

/* Reveal row — stable-height row; actions emerge on hover */
.reveal-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: background .12s;
  position: relative;
}
.reveal-row:hover { background: rgba(99,102,241,0.04); }
.reveal-row .row-label { flex: 1; font-size: 13px; color: var(--text); }
.reveal-row .row-value { font-size: 13px; font-weight: 600; color: var(--text); }
.reveal-row .row-actions {
  display: flex; align-items: center; gap: 4px;
  opacity: 0; transition: opacity .12s; margin-left: 8px;
}
.reveal-row:hover .row-actions,
.reveal-row:focus-within .row-actions { opacity: 1; }

/* Quiet empty state — lower visual weight than .empty */
.empty-quiet {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 32px 20px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.empty-quiet .eq-icon  { font-size: 28px; opacity: .45; color: var(--muted); line-height: 1; }
.empty-quiet .eq-title { font-size: 14px; font-weight: 600; color: var(--text); }
.empty-quiet .eq-body  { font-size: 12px; color: var(--muted); max-width: 300px; line-height: 1.55; }
.empty-quiet .eq-action { margin-top: 4px; }

/* Pill action button — compact, hover-visible action pill */
.pill-action {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface); color: var(--muted);
  cursor: pointer; transition: all .12s; font-family: inherit;
}
.pill-action:hover { border-color: var(--accent); color: var(--accent); background: rgba(99,102,241,0.06); }
.pill-action.active { border-color: var(--accent); background: rgba(99,102,241,0.10); color: var(--accent); }

/* Section label — caps label inside cards */
.section-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); padding: 0 0 8px; margin: 0;
}

/* Focus ring — keyboard nav */
*:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* Dividers */
.divider    { height: 1px; background: var(--border); margin: 12px 0; }
.divider-sm { height: 1px; background: var(--border); margin:  6px 0; }

/* KPI row — tight inline stats block */
.kpi-row {
  display: flex; gap: 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.kpi-row .kpi {
  flex: 1; padding: 14px 18px;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px;
}
.kpi-row .kpi:last-child { border-right: none; }
.kpi-row .kpi .k-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi-row .kpi .k-value {
  font-size: 22px; font-weight: 700; color: var(--text);
  line-height: 1; font-variant-numeric: tabular-nums;
}
.kpi-row .kpi .k-value.accent { color: var(--accent); }
.kpi-row .kpi .k-value.green  { color: var(--green); }
.kpi-row .kpi .k-value.amber  { color: var(--amber); }
.kpi-row .kpi .k-value.blue   { color: var(--blue); }

/* Fluent table — subtle row hover and cleaner borders */
table.fluent-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.fluent-table thead th {
  padding: 8px 14px; text-align: left;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted);
  border-bottom: 1px solid var(--border); background: var(--bg);
  white-space: nowrap;
}
table.fluent-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .10s;
}
table.fluent-table tbody tr:last-child { border-bottom: none; }
table.fluent-table tbody tr:hover { background: rgba(99,102,241,0.04); cursor: pointer; }
table.fluent-table td { padding: 10px 14px; color: var(--text); }
table.fluent-table td.muted { color: var(--muted); font-size: 12px; }
table.fluent-table td.num  { text-align: right; font-variant-numeric: tabular-nums; }

/* Inline tag — compact read-only label */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 600;
  background: var(--bg); color: var(--muted); border: 1px solid var(--border);
}

/* ── End M365 sales design system ─────────────────────────────────────────*/
