/* Redstitch — CRM (session 2)
 * Visual tokens mirror dashboard.css so each page stays self-contained while
 * sharing the same brand palette. Stage colors are deliberately muted —
 * one tint per stage, used only on the pill and the stage-card backdrop.
 */

:root {
  --bg-app: #faf9f5;
  --bg-surface: #ffffff;
  --bg-muted: #f5f4ef;
  --bg-row-hover: #faf8f3;
  --bg-row-checked: #fdf4f5;

  --text-primary: #1a1a1a;
  --text-secondary: #6b6b6b;
  --text-tertiary: #999999;

  --border-faint: rgba(0, 0, 0, 0.08);
  --border-muted: rgba(0, 0, 0, 0.14);
  --border-strong: rgba(0, 0, 0, 0.24);

  --brand: #c8102e;
  --brand-deep: #a30d26;
  --brand-tint: #fdebee;
  --brand-tint-strong: #f9d4da;

  /* Stage palette — backgrounds + text */
  --stage-selected-bg:           #f5f4ef;
  --stage-selected-text:         #6b6b6b;
  --stage-intro-sent-bg:         #eef4fa;
  --stage-intro-sent-text:       #3a5a7a;
  --stage-engaged-bg:            #f1f5ec;
  --stage-engaged-text:          #3d5527;
  --stage-tryout-scheduled-bg:   #faf2e6;
  --stage-tryout-scheduled-text: #7a5520;
  --stage-tryout-complete-bg:    #f6ecdc;
  --stage-tryout-complete-text:  #704a18;
  --stage-offer-extended-bg:     #fdebee;
  --stage-offer-extended-text:   #a30d26;
  --stage-joined-bg:             #eaf3de;
  --stage-joined-text:           #173404;
  --stage-not-interested-bg:     #ecebe5;
  --stage-not-interested-text:   #6b6b6b;

  /* Outcome chips for activity log */
  --outcome-positive-bg:   #eaf3de;
  --outcome-positive-text: #173404;
  --outcome-neutral-bg:    #f5f4ef;
  --outcome-neutral-text:  #6b6b6b;
  --outcome-negative-bg:   #fdebee;
  --outcome-negative-text: #a30d26;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-drawer: -8px 0 32px rgba(0, 0, 0, 0.12);
  --shadow-modal: 0 8px 32px rgba(0, 0, 0, 0.18);
  --shadow-action-bar: 0 -2px 16px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--text-primary);
  background: var(--bg-app);
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 96px;
}
button { font-family: inherit; }

/* ─── App header ─────────────────────────────────────────────── */

.app-header {
  background: var(--bg-surface);
  border-bottom: 0.5px solid var(--border-faint);
}
.app-header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}
.wordmark-logo {
  height: 32px;
  width: auto;
  display: block;
}
.wordmark-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.back-link {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
}
.back-link:hover { color: var(--text-primary); }

/* ─── Page shell ─────────────────────────────────────────────── */

.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 24px;
}
.page-title { margin-bottom: 20px; }
.page-title h1 {
  font-size: 22px;
  font-weight: 500;
  margin: 0 0 4px;
}
.page-title .subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}
.page-title .dot { margin: 0 6px; color: var(--text-tertiary); }
.subtitle-stale { color: var(--brand-deep); font-weight: 500; }

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

.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 0.5px solid var(--border-faint);
  margin-bottom: 20px;
}
.tab {
  background: transparent;
  border: none;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 10px 16px 12px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 100ms;
}
.tab:hover { color: var(--text-primary); }
.tab.is-active {
  color: var(--brand-deep);
  border-bottom-color: var(--brand);
}
.tab-count {
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-muted);
  color: var(--text-secondary);
  padding: 2px 7px;
  border-radius: 999px;
}
.tab.is-active .tab-count {
  background: var(--brand-tint);
  color: var(--brand-deep);
}

/* ─── Pipeline summary strip ──────────────────────────────────── */

.pipeline-strip {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.stage-card {
  border: 0.5px solid var(--border-faint);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: transform 80ms, border-color 80ms, box-shadow 80ms;
  min-width: 0;
}
.stage-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.stage-card.is-active {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}
.stage-card-count {
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.stage-card-name {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Stage card backgrounds (the muted palette per stage) */
.stage-card--selected           { background: var(--stage-selected-bg);           color: var(--stage-selected-text); }
.stage-card--intro-sent         { background: var(--stage-intro-sent-bg);         color: var(--stage-intro-sent-text); }
.stage-card--engaged            { background: var(--stage-engaged-bg);            color: var(--stage-engaged-text); }
.stage-card--tryout-scheduled   { background: var(--stage-tryout-scheduled-bg);   color: var(--stage-tryout-scheduled-text); }
.stage-card--tryout-complete    { background: var(--stage-tryout-complete-bg);    color: var(--stage-tryout-complete-text); }
.stage-card--offer-extended     { background: var(--stage-offer-extended-bg);     color: var(--stage-offer-extended-text); }
.stage-card--joined             { background: var(--stage-joined-bg);             color: var(--stage-joined-text); }
.stage-card--not-interested     { background: var(--stage-not-interested-bg);     color: var(--stage-not-interested-text); }

/* "Showing: Tryout Scheduled · clear" filter indicator */
.active-filter {
  background: var(--brand-tint);
  color: var(--brand-deep);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.active-clear {
  background: transparent;
  border: none;
  color: var(--brand-deep);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  text-decoration: underline;
  padding: 0;
}
.active-clear:hover { color: var(--brand); }

/* ─── Filter bar ──────────────────────────────────────────────── */

.filter-bar {
  background: var(--bg-surface);
  border: 0.5px solid var(--border-faint);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: flex-end;
}
.filter-group { min-width: 0; }
.filter-group-search { flex: 1 1 200px; max-width: 320px; }
.filter-label {
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.chip-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.chip {
  background: var(--bg-muted);
  color: var(--text-primary);
  border: 0.5px solid transparent;
  font: inherit;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.chip:hover { background: #ebe8df; }
.chip.is-active {
  background: var(--brand-tint);
  color: var(--brand-deep);
  border-color: var(--brand-tint-strong);
}
.filter-search,
.filter-select,
.date-input,
.sort-select select {
  font: inherit;
  font-size: 12px;
  padding: 5px 9px;
  border: 0.5px solid var(--border-muted);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
}
.filter-search { width: 100%; }
.filter-search:focus,
.filter-select:focus,
.date-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-tint);
}
.date-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.date-dash { color: var(--text-tertiary); font-size: 12px; }
.filter-reset { margin-left: auto; align-self: flex-end; }
.reset-btn {
  font: inherit;
  font-size: 12px;
  color: var(--text-secondary);
  background: transparent;
  border: 0.5px solid var(--border-muted);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.reset-btn:hover { color: var(--brand-deep); border-color: var(--brand); }

/* ─── Table card ──────────────────────────────────────────────── */

.table-card {
  background: var(--bg-surface);
  border: 0.5px solid var(--border-faint);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: var(--bg-muted);
  border-bottom: 0.5px solid var(--border-faint);
}
.table-card-title {
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.table-card-count {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
}
.sort-select {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.sort-select select { cursor: pointer; }

.table-scroll { overflow-x: auto; }

.prospect-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}
.prospect-table thead th {
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 0.5px solid var(--border-faint);
  white-space: nowrap;
  vertical-align: middle;
}

/* Clickable header text (sort) + small filter icon (popover) — same
 * pattern as the dashboard, so the two screens feel consistent. */
.th-sort {
  cursor: pointer;
  user-select: none;
  display: inline-block;
  padding: 2px 2px 2px 0;
  color: inherit;
}
.th-sort:hover { color: var(--text-primary); }
.th-sort::after {
  content: " ↕";
  color: var(--text-tertiary);
  font-size: 9px;
  opacity: 0.5;
  margin-left: 2px;
}
.th-sort.is-sorted-desc::after { content: " ↓"; color: var(--brand); opacity: 1; }
.th-sort.is-sorted-asc::after  { content: " ↑"; color: var(--brand); opacity: 1; }
.th-filter {
  background: transparent;
  border: none;
  padding: 3px 4px;
  margin-left: 2px;
  cursor: pointer;
  color: var(--text-tertiary);
  border-radius: 4px;
  vertical-align: middle;
  position: relative;
  line-height: 0;
}
.th-filter:hover { background: var(--bg-muted); color: var(--text-primary); }
.th-filter svg { width: 11px; height: 11px; display: block; }
.th-filter.is-active { color: var(--brand); }
.th-filter.is-active::after {
  content: "";
  position: absolute;
  top: 1px;
  right: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
  border: 1px solid var(--bg-surface);
}

/* Filter popover (shared across all column filters) */
.filter-popover {
  position: absolute;
  z-index: 80;
  background: var(--bg-surface);
  border: 0.5px solid var(--border-muted);
  border-radius: var(--radius-md);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  padding: 12px 14px 10px;
  min-width: 210px;
  font-size: 13px;
}
.filter-popover-title {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
  margin-bottom: 8px;
}
.filter-popover-body { margin-bottom: 10px; }
.popover-input {
  font: inherit;
  font-size: 13px;
  width: 100%;
  padding: 6px 9px;
  border: 0.5px solid var(--border-muted);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
}
.popover-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-tint);
}
select.popover-input { cursor: pointer; }
.popover-help {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 4px;
}
.filter-popover-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-top: 6px;
  border-top: 0.5px solid var(--border-faint);
}
.popover-clear, .popover-done {
  font: inherit;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 0.5px solid var(--border-muted);
}
.popover-clear { background: var(--bg-surface); color: var(--text-secondary); }
.popover-clear:hover { color: var(--text-primary); }
.popover-done {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  font-weight: 500;
}
.popover-done:hover { background: var(--brand-deep); }
.prospect-table td {
  padding: 11px 12px;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.col-check   { width: 36px; text-align: center; }
.col-stage   { width: 140px; }
.col-owner   { width: 88px; }
.col-pri     { width: 50px; }
.col-name    { width: 170px; }
.col-player  { width: auto; }
.col-contact { width: 130px; }
.col-touch   { width: 70px; }
.col-next    { width: 180px; }
.col-days    { width: 70px; }
.col-actions { width: 90px; }

.prospect-table tbody tr {
  border-bottom: 0.5px solid var(--border-faint);
  transition: background 80ms;
}
.prospect-table tbody tr:last-child { border-bottom: none; }
.prospect-table tbody tr:hover { background: var(--bg-row-hover); }
.prospect-table tbody tr.is-checked { background: var(--bg-row-checked); }
.prospect-table td.cell-check {
  text-align: center;
}
.prospect-table td.cell-check input[type="checkbox"] {
  accent-color: var(--brand);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* Stage pill (table + drawer header) */
.stage-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.stage-pill--selected         { background: var(--stage-selected-bg);         color: var(--stage-selected-text); }
.stage-pill--intro-sent       { background: var(--stage-intro-sent-bg);       color: var(--stage-intro-sent-text); }
.stage-pill--engaged          { background: var(--stage-engaged-bg);          color: var(--stage-engaged-text); }
.stage-pill--tryout-scheduled { background: var(--stage-tryout-scheduled-bg); color: var(--stage-tryout-scheduled-text); }
.stage-pill--tryout-complete  { background: var(--stage-tryout-complete-bg);  color: var(--stage-tryout-complete-text); }
.stage-pill--offer-extended   { background: var(--stage-offer-extended-bg);   color: var(--stage-offer-extended-text); }
.stage-pill--joined           { background: var(--stage-joined-bg);           color: var(--stage-joined-text); }
.stage-pill--not-interested   { background: var(--stage-not-interested-bg);   color: var(--stage-not-interested-text); }

/* Owner avatar */
.owner-avatar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.owner-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.owner-name {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Priority badge */
.pri-badge {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  line-height: 22px;
}
.pri-badge--a { background: var(--brand-tint); color: var(--brand-deep); }
.pri-badge--b { background: #faf2e6; color: #7a5520; }
.pri-badge--c { background: var(--bg-muted); color: var(--text-secondary); }

.cell-name { font-weight: 500; cursor: pointer; }
.cell-name:hover { color: var(--brand-deep); text-decoration: underline; }
.cell-player {
  color: var(--text-secondary);
  font-size: 12px;
}
.cell-contact { font-size: 12px; }
.cell-contact .relative { color: var(--text-tertiary); font-size: 11px; margin-left: 4px; }
.cell-next {
  font-size: 12px;
}
.cell-next .next-date { color: var(--text-tertiary); font-size: 11px; margin-left: 4px; }
.cell-days {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 500;
}
.cell-days.is-stale { color: var(--brand); }
.cell-days .em { color: var(--text-tertiary); }

.log-touch-btn {
  font: inherit;
  font-size: 11px;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--border-muted);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
}
.log-touch-btn:hover { color: var(--brand-deep); border-color: var(--brand); }

.table-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
}

/* ─── Activity feed ───────────────────────────────────────────── */

.activity-feed {
  display: flex;
  flex-direction: column;
}
.activity-row {
  display: grid;
  grid-template-columns: 110px 24px 1fr 100px 90px 90px;
  gap: 14px;
  padding: 12px 16px;
  align-items: center;
  border-bottom: 0.5px solid var(--border-faint);
  font-size: 13px;
}
.activity-row:last-child { border-bottom: none; }
.activity-row:hover { background: var(--bg-row-hover); }
.act-date {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}
.act-date .relative { color: var(--text-tertiary); font-size: 11px; }
.act-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}
.act-name {
  font-weight: 500;
  cursor: pointer;
}
.act-name:hover { color: var(--brand-deep); text-decoration: underline; }
.act-name .meta {
  color: var(--text-tertiary);
  font-weight: 400;
  font-size: 11px;
  margin-left: 6px;
}
.act-channel,
.act-who { font-size: 12px; color: var(--text-secondary); }
.act-outcome {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.act-outcome--positive { background: var(--outcome-positive-bg); color: var(--outcome-positive-text); }
.act-outcome--neutral  { background: var(--outcome-neutral-bg);  color: var(--outcome-neutral-text); }
.act-outcome--negative { background: var(--outcome-negative-bg); color: var(--outcome-negative-text); }

.activity-row .act-note-row {
  grid-column: 3 / -1;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.show-more-row { padding: 12px 16px; text-align: center; }
.show-more-btn {
  font: inherit;
  font-size: 12px;
  background: transparent;
  border: 0.5px solid var(--border-muted);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.show-more-btn:hover { color: var(--brand-deep); border-color: var(--brand); }

/* ─── Sticky bulk-action bar ──────────────────────────────────── */

.action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-surface);
  border-top: 0.5px solid var(--border-faint);
  box-shadow: var(--shadow-action-bar);
  z-index: 50;
}
.action-bar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.action-count {
  font-size: 14px;
  color: var(--text-secondary);
}
#action-count { color: var(--text-primary); font-weight: 500; }
.action-bar-buttons { display: flex; gap: 8px; }
.action-btn,
.action-btn-secondary {
  font: inherit;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 500;
}
.action-btn {
  background: var(--brand);
  color: #fff;
  border: 1px solid var(--brand);
}
.action-btn:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.action-btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 0.5px solid var(--border-muted);
}
.action-btn-secondary:hover { background: var(--bg-muted); border-color: var(--border-strong); }

/* ─── Drawer ──────────────────────────────────────────────────── */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.18);
  z-index: 90;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(560px, 94vw);
  height: 100vh;
  background: var(--bg-surface);
  box-shadow: var(--shadow-drawer);
  z-index: 100;
  overflow-y: auto;
  animation: slideIn 200ms ease-out;
}
@keyframes slideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.drawer-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: transparent;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 4px 8px;
}
.drawer-close:hover { color: var(--text-primary); }
.drawer-content { padding: 32px 32px 48px; }

.drawer-header { margin-bottom: 20px; padding-right: 32px; }
.drawer-name {
  font-size: 22px;
  font-weight: 500;
  margin: 0 0 6px;
}
.drawer-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 12px;
}
.drawer-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.drawer-owner-line {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.drawer-link {
  display: inline-block;
  font-size: 12px;
  color: var(--brand-deep);
  text-decoration: none;
  margin-top: 6px;
}
.drawer-link:hover { text-decoration: underline; }

.drawer-section { margin-bottom: 22px; }
.drawer-section-title {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.drawer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 18px;
  font-size: 13px;
}
.drawer-grid .k { color: var(--text-secondary); }
.drawer-grid .v { color: var(--text-primary); text-align: right; font-variant-numeric: tabular-nums; }

.breakdown-row {
  display: grid;
  grid-template-columns: 100px 1fr 60px;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}
.breakdown-row .b-label { color: var(--text-secondary); }
.breakdown-row .b-bar {
  height: 6px;
  background: var(--bg-muted);
  border-radius: 999px;
  overflow: hidden;
}
.breakdown-row .b-bar-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
}
.breakdown-row .b-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  font-weight: 500;
}

.notes-box {
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.55;
  white-space: pre-wrap;
}

/* Activity timeline (inside drawer) */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.timeline-entry {
  display: grid;
  grid-template-columns: 80px 24px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 0.5px solid var(--border-faint);
  font-size: 12px;
}
.timeline-entry:last-child { border-bottom: none; }
.timeline-date {
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}
.timeline-body { min-width: 0; }
.timeline-headline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  font-size: 12px;
  color: var(--text-primary);
}
.timeline-meta {
  color: var(--text-tertiary);
  font-size: 11px;
  margin-top: 2px;
}
.timeline-note {
  color: var(--text-secondary);
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.45;
}
.timeline-empty {
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
  padding: 12px 0;
}

/* Drawer footer */
.drawer-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  border-top: 0.5px solid var(--border-faint);
}
.drawer-footer-spacer { flex: 1; }
.drawer-btn-primary,
.drawer-btn-secondary,
.drawer-btn-quiet {
  font: inherit;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 500;
}
.drawer-btn-primary {
  background: var(--brand);
  color: #fff;
  border: 1px solid var(--brand);
}
.drawer-btn-primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.drawer-btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 0.5px solid var(--border-muted);
}
.drawer-btn-secondary:hover { background: var(--bg-muted); }
.drawer-btn-quiet {
  background: transparent;
  color: var(--text-tertiary);
  border: 0.5px solid transparent;
}
.drawer-btn-quiet:hover { color: var(--brand-deep); border-color: var(--border-faint); }

/* ─── Modal ──────────────────────────────────────────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 24px 26px 20px;
  box-shadow: var(--shadow-modal);
  max-width: 460px;
  width: calc(100% - 32px);
}
.modal h2 { margin: 0 0 8px; font-size: 17px; font-weight: 500; }
.modal p  { margin: 0 0 18px; font-size: 13px; color: var(--text-secondary); }
.modal-sub { font-size: 12px; color: var(--text-tertiary); margin: 0 0 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.btn-secondary, .btn-primary {
  font: inherit;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 0.5px solid var(--border-muted);
}
.btn-secondary { background: var(--bg-surface); color: var(--text-primary); }
.btn-secondary:hover { background: var(--bg-muted); }
.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  font-weight: 500;
}
.btn-primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); }

/* Log-a-touch form modal */
.modal-form { max-width: 520px; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  margin-bottom: 18px;
}
.form-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.form-label-full { grid-column: 1 / -1; }
.form-input {
  font: inherit;
  font-size: 13px;
  padding: 7px 10px;
  border: 0.5px solid var(--border-muted);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
.form-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-tint);
}
.form-textarea { resize: vertical; min-height: 70px; }

/* ─── Toast ──────────────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 108px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text-primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms, transform 180ms;
  z-index: 300;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Responsive ─────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .pipeline-strip { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 820px) {
  .activity-row {
    grid-template-columns: 90px 24px 1fr;
    grid-template-rows: auto auto;
    row-gap: 2px;
  }
  .act-channel, .act-who, .act-outcome {
    grid-column: 3 / -1;
    text-align: left;
  }
  .pipeline-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .page { padding: 18px 12px; }
  .col-player, .col-pri, .col-touch, .col-days { display: none; }
}
