/* Metaform Openings Solutions — clean industrial theme */
:root {
  --mf-navy: #1F3A5F;
  --mf-steel: #4A6B8A;
  --mf-gold: #C8A35F;
  --mf-bg: #F5F5F0;
  --mf-bg2: #ffffff;
  --mf-text: #1a1a1a;
  --mf-muted: #6b7280;
  --mf-border: #d1d5db;
  --mf-success: #22c55e;
  --mf-warning: #f59e0b;
  --mf-danger: #ef4444;
  --mf-info: #3b82f6;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  background: var(--mf-bg);
  color: var(--mf-text);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--mf-navy); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ----- Header / Nav ----- */
header.topbar {
  background: var(--mf-navy);
  color: white;
  padding: 0;
  display: flex;
  align-items: center;
  border-bottom: 3px solid var(--mf-gold);
}
header.topbar .brand {
  font-weight: 700;
  letter-spacing: .04em;
  padding: 14px 18px;
  font-size: 15px;
  background: rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
}
header.topbar .brand .small { font-weight: 400; opacity: .8; margin-left: 8px; font-size: 12px; }
header.topbar nav { display: flex; flex: 1; }
header.topbar nav a {
  color: white;
  padding: 14px 16px;
  font-size: 13px;
  border-right: 1px solid rgba(255,255,255,0.08);
}
header.topbar nav a:hover { background: var(--mf-steel); text-decoration: none; }
header.topbar nav a.active { background: var(--mf-steel); }
.nav-badge {
  display: inline-block;
  background: var(--mf-gold);
  color: #1a1a1a;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 9px;
  margin-left: 4px;
  vertical-align: middle;
}
header.topbar .user-menu {
  margin-left: auto;
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-size: 13px;
  gap: 12px;
}
header.topbar .user-menu .role { opacity: .75; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }

.intake-health-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  padding: 4px;
}
.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  vertical-align: middle;
  border: 1px solid rgba(255,255,255,0.2);
}
.status-dot.status-green { background: #2eb86b; }
.status-dot.status-amber { background: #d8a02b; }
.status-dot.status-red   { background: #d6473f; }

main {
  padding: 24px 32px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ----- Cards / Sections ----- */
.card {
  background: var(--mf-bg2);
  border: 1px solid var(--mf-border);
  border-radius: 6px;
  padding: 18px 22px;
  margin-bottom: 18px;
}
.card h2, .card h3 { margin-top: 0; color: var(--mf-navy); }
.card .subtitle { color: var(--mf-muted); font-size: 13px; margin-top: -4px; margin-bottom: 14px; }

.section-title {
  font-size: 22px;
  color: var(--mf-navy);
  font-weight: 700;
  letter-spacing: .02em;
  margin: 0 0 6px 0;
}
.section-subtitle {
  color: var(--mf-muted);
  margin: 0 0 18px 0;
}

/* ----- KPI Tiles ----- */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.kpi {
  background: var(--mf-bg2);
  border: 1px solid var(--mf-border);
  border-left: 4px solid var(--mf-navy);
  border-radius: 4px;
  padding: 14px 18px;
}
.kpi .label { color: var(--mf-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.kpi .value { font-size: 26px; font-weight: 700; color: var(--mf-navy); margin-top: 4px; }
.kpi.gold { border-left-color: var(--mf-gold); }
.kpi.gold .value { color: var(--mf-gold); }

/* ----- Tables ----- */
table.data {
  width: 100%;
  border-collapse: collapse;
  background: var(--mf-bg2);
  font-size: 13px;
}
table.data th {
  background: var(--mf-navy);
  color: white;
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
table.data td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--mf-border);
}
table.data tr:hover td { background: rgba(31, 58, 95, 0.04); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .center { text-align: center; }

/* ----- Forms ----- */
form .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 12px;
}
form .row.full { grid-template-columns: 1fr; }
form .row.three { grid-template-columns: 1fr 1fr 1fr; }
form .row.four { grid-template-columns: 1fr 1fr 1fr 1fr; }
form label {
  display: block;
  font-size: 12px;
  color: var(--mf-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 4px;
  font-weight: 600;
}
form input[type=text], form input[type=number], form input[type=date], form input[type=email], form input[type=password], form select, form textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--mf-border);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  background: white;
}
form input:focus, form select:focus, form textarea:focus {
  outline: none;
  border-color: var(--mf-navy);
  box-shadow: 0 0 0 3px rgba(31, 58, 95, 0.12);
}
form textarea { min-height: 70px; resize: vertical; }
form .form-help { font-size: 12px; color: var(--mf-muted); margin-top: 4px; }
form .checkbox-row { display: flex; align-items: center; gap: 8px; }
form .checkbox-row label { margin: 0; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 14px; color: var(--mf-text); }

/* ----- Buttons ----- */
.btn {
  display: inline-block;
  padding: 8px 18px;
  background: var(--mf-navy);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  font-family: inherit;
}
.btn:hover { background: var(--mf-steel); text-decoration: none; color: white; }
.btn.secondary { background: white; color: var(--mf-navy); border: 1px solid var(--mf-navy); }
.btn.secondary:hover { background: var(--mf-bg); }
.btn.success { background: var(--mf-success); }
.btn.warning { background: var(--mf-warning); }
.btn.danger { background: var(--mf-danger); }
.btn.gold { background: var(--mf-gold); }
.btn.small { padding: 4px 10px; font-size: 11px; }
.btn.large { padding: 12px 24px; font-size: 14px; }
.btn:disabled { background: var(--mf-muted); cursor: not-allowed; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form { display: inline; }

/* ----- Status badges ----- */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge.draft { background: #e5e7eb; color: #374151; }
.badge.issued { background: #dbeafe; color: #1e40af; }
.badge.won, .badge.released, .badge.in_progress, .badge.code_a { background: #d1fae5; color: #065f46; }
.badge.lost, .badge.code_c, .badge.cancelled { background: #fee2e2; color: #991b1b; }
.badge.code_b_no_impact, .badge.code_b_impact { background: #fef3c7; color: #92400e; }
.badge.closed, .badge.completed, .badge.superseded { background: #ddd6fe; color: #5b21b6; }
.badge.expired, .badge.archived { background: #f3f4f6; color: #6b7280; }
.badge.in_estimation, .badge.quoted, .badge.in_submittal, .badge.in_production { background: #dbeafe; color: #1e40af; }
.badge.registered, .badge.open, .badge.schedule_frozen, .badge.released_to_production { background: #ede9fe; color: #5b21b6; }
.badge.lane-a { background: #dbeafe; color: #1e40af; }
.badge.lane-b { background: #fef3c7; color: #92400e; }
.badge.lane-c { background: #fee2e2; color: #991b1b; }
.badge.info { background: #dbeafe; color: #1e40af; }
.badge.needs_triage { background: #fef3c7; color: #92400e; }
.badge.pending_review { background: #fef3c7; color: #92400e; border: 1px dashed var(--mf-gold); }
tr.row-triage td { background: #fffbeb; }
tr.row-pending td { background: #fdfaf3; }

/* ----- Flash messages ----- */
.flash {
  padding: 10px 16px;
  margin-bottom: 14px;
  border-radius: 4px;
  border-left: 4px solid;
  font-size: 13px;
}
.flash.success { background: #ecfdf5; border-color: var(--mf-success); color: #064e3b; }
.flash.danger, .flash.error { background: #fef2f2; border-color: var(--mf-danger); color: #7f1d1d; }
.flash.warning { background: #fffbeb; border-color: var(--mf-warning); color: #78350f; }
.flash.info { background: #eff6ff; border-color: var(--mf-info); color: #1e3a8a; }

/* ----- Form-level error list (admin/working_calendar.html, issue #24) ----- */
.form-errors {
  list-style: none;
  margin: 0 0 14px;
  padding: 10px 16px;
  background: #fef2f2;
  border: 1px solid var(--mf-danger);
  border-left-width: 4px;
  border-radius: 4px;
  color: #7f1d1d;
  font-size: 13px;
}
.form-errors li { margin: 2px 0 2px 16px; list-style: disc; }
.form-errors li::marker { color: var(--mf-danger); }

/* ----- Weekday chip-checkboxes (admin/working_calendar.html, #24) ----- */
.weekday-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  margin: 0 6px 6px 0;
  background: var(--mf-bg2);
  border: 1px solid var(--mf-border);
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  user-select: none;
}
.weekday-checkbox:hover { background: var(--mf-bg); }
.weekday-checkbox input[type="checkbox"] { margin: 0; cursor: pointer; }
.weekday-checkbox:has(input[type="checkbox"]:checked) {
  background: var(--mf-navy);
  border-color: var(--mf-navy);
  color: white;
}

/* ----- Misc ----- */
.muted { color: var(--mf-muted); }
.right { text-align: right; }
.mono { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }
.flex { display: flex; gap: 12px; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.spacer { flex: 1; }
hr.thin { border: none; border-top: 1px solid var(--mf-border); margin: 18px 0; }

.detail-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 6px 18px;
  font-size: 13px;
}
.detail-grid .label {
  color: var(--mf-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  align-self: center;
}
.detail-grid .value { color: var(--mf-text); }

/* ----- Variance colors ----- */
.var-good { color: var(--mf-success); font-weight: 600; }
.var-bad { color: var(--mf-danger); font-weight: 600; }
.var-neutral { color: var(--mf-muted); }

/* ----- Pending-review suggestion card ----- */
.card.review-card { border-left: 4px solid var(--mf-gold); }
.review-classification { padding: 10px 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; }
table.review-table { font-size: 13px; margin-top: 10px; }
table.review-table th { background: var(--mf-bg); color: var(--mf-navy); }
table.review-table td:first-child { font-weight: 600; color: var(--mf-navy); width: 180px; }
table.review-table td:nth-child(2) { width: 220px; }

/* ----- Timeline (enquiry events) ----- */
.tl-tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--mf-steel); margin-bottom: 12px; }
.tl-tab {
  background: transparent; border: 0; cursor: pointer;
  padding: 8px 14px; font-size: 13px; color: var(--mf-muted);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.tl-tab:hover { color: #1a1a1a; }
.tl-tab.active { color: #1a1a1a; font-weight: 600; border-bottom-color: var(--mf-gold); }
.tl-panel[hidden] { display: none; }
.tl-panel .muted.small { margin: 0 0 10px; }
ul.timeline { list-style: none; padding: 0; margin: 0; }
ul.timeline .timeline-item {
  border-left: 3px solid var(--mf-border);
  padding: 10px 14px 14px 14px;
  margin-left: 6px;
  position: relative;
}
ul.timeline .timeline-item.dir-in { border-left-color: var(--mf-info); }
ul.timeline .timeline-item.dir-out { border-left-color: var(--mf-success); }
ul.timeline .timeline-item.dir-sys { border-left-color: var(--mf-muted); }
ul.timeline .timeline-item.timeline-llm { border-left-color: var(--mf-gold); background: rgba(200, 163, 95, 0.04); }
ul.timeline .timeline-item.timeline-llm pre { font-size: 11px; line-height: 1.4; max-height: 300px; overflow: auto; padding: 8px; background: white; }
ul.timeline .timeline-item.timeline-llm details summary { cursor: pointer; font-size: 11px; padding: 4px 0; }
ul.timeline .timeline-item + .timeline-item { margin-top: 4px; }
ul.timeline .timeline-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 11px;
  margin-bottom: 4px;
}
ul.timeline .timeline-head { font-size: 13px; margin-bottom: 6px; }
ul.timeline .timeline-body {
  font-size: 13px;
  background: var(--mf-bg);
  padding: 8px 10px;
  border-radius: 4px;
  white-space: pre-wrap;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--mf-border);
}
ul.timeline .timeline-html { white-space: normal; max-height: 400px; }
ul.timeline .timeline-html p { margin: 4px 0; }
ul.timeline .timeline-html a { color: var(--mf-navy); text-decoration: underline; }
ul.timeline .timeline-html table { border-collapse: collapse; margin: 6px 0; }
ul.timeline .timeline-html th, ul.timeline .timeline-html td { border: 1px solid var(--mf-border); padding: 3px 6px; }
ul.timeline details > summary { font-size: 11px; padding: 2px 0; cursor: pointer; }
ul.timeline .timeline-attach { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
ul.timeline .timeline-attach a.attach-link { text-decoration: none; cursor: pointer; }
ul.timeline .timeline-attach a.attach-link:hover { background: var(--mf-bg); }

/* ----- Per-Enquiry historical timeline (issue #20 markup, #22 styles) ----- */
ol.timeline {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}
.timeline-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  column-gap: 14px;
  row-gap: 4px;
  padding: 10px 14px;
  border-left: 3px solid var(--mf-border);
  margin: 4px 0 4px 6px;
  background: var(--mf-bg2);
}
.timeline-row + .timeline-row { margin-top: 4px; }
.timeline-row__when {
  grid-column: 1;
  font-size: 11px;
  color: var(--mf-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  align-self: start;
}
.timeline-row__title {
  grid-column: 2;
  font-size: 13px;
}
.timeline-row__title strong { font-weight: 600; }
.timeline-row__body {
  grid-column: 2;
  font-size: 13px;
  background: var(--mf-bg);
  padding: 8px 10px;
  border-radius: 4px;
  white-space: pre-wrap;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--mf-border);
}
.timeline-row__raw {
  grid-column: 2;
  font-size: 12px;
}
.timeline-row__raw > summary {
  cursor: pointer;
  padding: 4px 0;
  color: var(--mf-muted);
  font-size: 11px;
}
.timeline-row__raw pre.llm-output {
  font-size: 11px;
  line-height: 1.4;
  max-height: 300px;
  overflow: auto;
  background: var(--mf-bg);
  padding: 8px;
  border-radius: 4px;
  border: 1px solid var(--mf-border);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 4px 0 0;
}

/* Per-kind left accents */
.timeline-row--inbound_email  { border-left-color: var(--mf-info); }
.timeline-row--outbound_email { border-left-color: var(--mf-success); }
.timeline-row--note           { border-left-color: var(--mf-muted); }
.timeline-row--llm {
  border-left-color: var(--mf-gold);
  background: rgba(200, 163, 95, 0.04);
}

/* Per-note-kind tints (the row already has --note's neutral accent) */
.timeline-row--note-apply             { background: rgba(34, 197, 94, 0.05); }
.timeline-row--note-system            { background: var(--mf-bg2); }
.timeline-row--note-importance_change {
  background: rgba(245, 158, 11, 0.06);
  border-left-color: var(--mf-warning);
}
.timeline-row--note-dismiss           { opacity: 0.7; }

/* ----- Print ----- */
@media print {
  header.topbar, .actions { display: none !important; }
  body { background: white; }
  main { padding: 0; max-width: none; }
  .card { border: 1px solid #999; box-shadow: none; }
}

/* ============================================================
 * Inbox surface (issue #10)
 * Scoped repaletted tokens — applies only to .inbox-surface
 * wrappers on inbox.html and conversation_view.html. Other
 * pages stay on the existing Metaform navy/gold/steel until a
 * separate brand pass.
 * ============================================================ */
.inbox-surface {
  --is-bg: #f8fafc;
  --is-surface: #ffffff;
  --is-border: #e2e8f0;
  --is-text: #0f172a;
  --is-muted: #64748b;
  --is-primary: #4338ca;
  --is-primary-soft: rgba(67, 56, 202, 0.08);
  --is-accent: #0d9488;
  --is-danger: #ef4444;
  --is-warning: #f59e0b;
  --is-info: #3b82f6;
  --is-radius: 8px;
  --is-radius-sm: 6px;
  color: var(--is-text);
}
.inbox-surface .card { background: var(--is-surface); border: 1px solid var(--is-border); border-radius: var(--is-radius); }
.inbox-surface .muted { color: var(--is-muted); }
.inbox-surface a { color: var(--is-accent); }
.inbox-surface a:hover { color: var(--is-primary); }

.inbox-surface .inbox-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
.inbox-surface .inbox-header .section-title { color: var(--is-text); }
.inbox-surface .inbox-header .section-subtitle { color: var(--is-muted); }

.inbox-surface .inbox-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.inbox-surface .segmented { display: inline-flex; background: var(--is-surface); border: 1px solid var(--is-border); border-radius: var(--is-radius); padding: 4px; gap: 2px; }
.inbox-surface .segmented__chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--is-radius-sm); font-size: 13px; color: var(--is-muted); text-decoration: none; transition: background 80ms ease, color 80ms ease; }
.inbox-surface .segmented__chip:hover { background: var(--is-primary-soft); color: var(--is-text); }
.inbox-surface .segmented__chip.is-active { background: var(--is-primary); color: white; }
.inbox-surface .segmented__chip.is-active:hover { background: var(--is-primary); color: white; }
.inbox-surface .segmented__count { font-variant-numeric: tabular-nums; opacity: 0.7; font-size: 12px; }
.inbox-surface .segmented__chip.is-active .segmented__count { opacity: 0.85; }

/* Mailbox segmented control (issue #63) — rendered above the existing
   filter-chip row on /crm/inbox and at the top of /crm/archived.
   Standalone styles so the control still renders correctly outside an
   .inbox-surface ancestor (the archived view doesn't use that wrapper). */
.segmented--mailbox { display: inline-flex; background: var(--is-surface); border: 1px solid var(--is-border); border-radius: var(--is-radius); padding: 4px; gap: 2px; margin-bottom: 12px; }
.segmented--mailbox .segmented__chip { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: var(--is-radius-sm); font-size: 13px; color: var(--is-muted); text-decoration: none; transition: background 80ms ease, color 80ms ease; }
.segmented--mailbox .segmented__chip:hover { background: var(--is-primary-soft); color: var(--is-text); }
.segmented--mailbox .segmented__chip.is-active { background: var(--is-primary); color: white; }
.segmented--mailbox .segmented__chip.is-active:hover { background: var(--is-primary); color: white; }
.inbox-surface .inbox-toolbar__search { flex: 1; display: flex; gap: 8px; min-width: 220px; }
.inbox-surface .inbox-toolbar__search input[type="text"] { flex: 1; padding: 7px 10px; border: 1px solid var(--is-border); border-radius: var(--is-radius-sm); background: var(--is-surface); font-size: 13px; }
.inbox-surface .inbox-toolbar__search input[type="text"]:focus { outline: 2px solid var(--is-accent); outline-offset: 1px; border-color: var(--is-accent); }

.inbox-surface .inbox-substrip { margin: 4px 0 12px; }
.inbox-surface .inbox-substrip a { color: var(--is-muted); text-decoration: underline; }

.inbox-surface .bulk-bar { position: sticky; top: 0; z-index: 5; display: flex; gap: 12px; align-items: center; background: var(--is-primary); color: white; padding: 10px 14px; border-radius: var(--is-radius); margin-bottom: 8px; box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12); }
.inbox-surface .bulk-bar[hidden] { display: none; }
.inbox-surface .bulk-bar .btn { background: white; color: var(--is-primary); border: none; }
.inbox-surface .bulk-bar__pending { background: rgba(255,255,255,0.15); padding: 4px 8px; border-radius: 4px; color: white; }
.inbox-surface .bulk-bar__pending code { background: rgba(0,0,0,0.2); padding: 1px 4px; border-radius: 3px; }

.inbox-surface .inbox-rows { list-style: none; padding: 0; margin: 0; background: var(--is-surface); border: 1px solid var(--is-border); border-radius: var(--is-radius); overflow: hidden; }
.inbox-surface .inbox-row { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: stretch; border-bottom: 1px solid var(--is-border); transition: background 80ms ease; }
.inbox-surface .inbox-row:last-child { border-bottom: none; }
.inbox-surface .inbox-row:hover { background: var(--is-primary-soft); }
.inbox-surface .inbox-row__select { display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 80ms ease; }
.inbox-surface .inbox-row:hover .inbox-row__select,
.inbox-surface .inbox-row:focus-within .inbox-row__select,
.inbox-surface .inbox-row__select:has(input:checked) { opacity: 1; }
.inbox-surface .inbox-row__body { display: block; padding: 14px 18px 14px 0; color: inherit; text-decoration: none; min-width: 0; }
.inbox-surface .inbox-row__line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inbox-surface .inbox-row__line--top { font-size: 14px; font-weight: 600; }
.inbox-surface .inbox-row__line--mid { font-size: 13px; margin-top: 2px; color: var(--is-muted); }
.inbox-surface .inbox-row__subject { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-surface .inbox-row__ambient { color: var(--is-muted); display: inline-flex; align-items: center; }
.inbox-surface .icon-paperclip { vertical-align: middle; }
.inbox-surface .inbox-row__time { font-size: 12px; color: var(--is-muted); font-variant-numeric: tabular-nums; }
.inbox-surface .inbox-row__sender { display: inline-flex; gap: 6px; align-items: baseline; }
.inbox-surface .inbox-row__account { background: var(--is-primary-soft); color: var(--is-primary); padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.inbox-surface .inbox-row__preview { display: block; font-size: 12px; color: var(--is-muted); margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.inbox-surface .chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 500; line-height: 1.6; }
.inbox-surface .chip--danger  { background: rgba(239, 68, 68, 0.1);  color: #b91c1c; }
.inbox-surface .chip--warning { background: rgba(245, 158, 11, 0.12); color: #b45309; }
.inbox-surface .chip--info    { background: rgba(59, 130, 246, 0.1);  color: #1d4ed8; }
.inbox-surface .chip--neutral { background: rgba(100, 116, 139, 0.1); color: #475569; }
.inbox-surface .chip--verdict { font-weight: 600; letter-spacing: 0.02em; }
.inbox-surface .chip--verdict-rfq      { background: rgba(13, 148, 136, 0.12); color: var(--is-accent); }
.inbox-surface .chip--verdict-non-rfq  { background: rgba(100, 116, 139, 0.12); color: var(--is-muted); }
.inbox-surface .chip--verdict-unsure   { background: rgba(245, 158, 11, 0.12); color: #b45309; }

.inbox-surface .inbox-empty { padding: 48px 24px; text-align: center; list-style: none; }
.inbox-surface .inbox-empty__title { font-size: 16px; font-weight: 600; color: var(--is-text); margin: 0; }
.inbox-surface .inbox-empty__sub { margin-top: 6px; }

/* Conversation view two-pane */
.inbox-surface .conversation-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.inbox-surface .conversation-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.inbox-surface .conversation-rail { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 32px); overflow-y: auto; }
.inbox-surface .rail-card { padding: 16px; }
.inbox-surface .rail-popover { margin-top: 4px; padding: 14px; }
.inbox-surface .rail-popover[hidden] { display: none; }
.inbox-surface .rail-footer { display: flex; gap: 8px; }
@media (max-width: 1000px) {
  .inbox-surface .conversation-grid { grid-template-columns: 1fr; }
  .inbox-surface .conversation-rail { position: static; max-height: none; }
}

/* Apply field cards */
.inbox-surface .apply-account { padding: 0; margin: 0 0 14px; border: none; }
.inbox-surface .apply-account legend { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--is-muted); padding: 0; margin-bottom: 6px; }
.inbox-surface .apply-fields { display: flex; flex-direction: column; gap: 10px; }
.inbox-surface .apply-field-card { background: var(--is-bg); border: 1px solid var(--is-border); border-radius: var(--is-radius-sm); padding: 10px 12px; }
.inbox-surface .apply-field-card__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.inbox-surface .apply-field-card__label { font-size: 12px; color: var(--is-muted); font-weight: 500; }
.inbox-surface .apply-field-card__accept { font-size: 11px; color: var(--is-text); display: inline-flex; gap: 4px; align-items: center; }
.inbox-surface .apply-field-card input[type="text"],
.inbox-surface .apply-field-card input[type="date"],
.inbox-surface .apply-field-card select,
.inbox-surface .apply-field-card textarea,
.inbox-surface .apply-account input[type="text"],
.inbox-surface .apply-account select,
.inbox-surface .rail-popover input[type="text"] { width: 100%; padding: 6px 8px; border: 1px solid var(--is-border); border-radius: 4px; font-size: 13px; background: white; box-sizing: border-box; }
.inbox-surface .apply-field-card textarea { font-family: inherit; resize: vertical; }
.inbox-surface .apply-rail__submit { width: 100%; margin-top: 14px; background: var(--is-primary); border-color: var(--is-primary); }
.inbox-surface .new-account-inline { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }

/* Attachment cards */
.inbox-surface .attachment-cards { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.inbox-surface .attachment-card { background: var(--is-bg); border: 1px solid var(--is-border); border-radius: var(--is-radius-sm); padding: 10px 12px; }
.inbox-surface .attachment-card__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inbox-surface .attachment-card__icon { background: var(--is-primary-soft); color: var(--is-primary); padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.inbox-surface .attachment-card__name { font-weight: 500; color: var(--is-text); text-decoration: none; }
.inbox-surface .attachment-card__name:hover { text-decoration: underline; color: var(--is-primary); }
.inbox-surface .attachment-card__vision { width: 100%; margin-top: 6px; }
.inbox-surface .attachment-card__vision summary { cursor: pointer; display: inline-flex; }
.inbox-surface .vision-rows { width: 100%; margin-top: 8px; font-size: 12px; border-collapse: collapse; }
.inbox-surface .vision-rows th { text-align: left; padding: 6px 8px; background: var(--is-surface); border-bottom: 1px solid var(--is-border); font-weight: 600; color: var(--is-muted); }
.inbox-surface .vision-rows td { padding: 6px 8px; border-bottom: 1px solid var(--is-border); }
.inbox-surface .vision-rows tr:last-child td { border-bottom: none; }

/* Thread items */
.inbox-surface .thread-item { padding: 10px 12px; border-left: 3px solid var(--is-border); margin-bottom: 12px; }
.inbox-surface .thread-inbound { border-left-color: var(--is-info); }
.inbox-surface .thread-outbound { border-left-color: var(--is-muted); }
.inbox-surface .thread-meta { margin-bottom: 6px; }
.inbox-surface .email-body { font-size: 13px; line-height: 1.55; }
.inbox-surface pre.email-body { background: var(--is-bg); padding: 10px 12px; border-radius: 4px; white-space: pre-wrap; }

/* Audit footer */
.inbox-surface .audit-footer { padding: 8px 14px; background: var(--is-bg); border-color: var(--is-border); }
.inbox-surface .audit-footer > summary { cursor: pointer; font-size: 12px; color: var(--is-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.inbox-surface .audit-footer details summary { cursor: pointer; padding: 4px 0; font-size: 12px; }
.inbox-surface .audit-footer pre.llm-output { font-size: 11px; max-height: 240px; overflow: auto; background: var(--is-surface); padding: 8px; border-radius: 4px; border: 1px solid var(--is-border); }

/* KV card */
.inbox-surface .kv-card { padding: 12px 16px; }
.inbox-surface .kv-card .kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.inbox-surface .kv-card dt { color: var(--is-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.inbox-surface .kv-card dd { margin: 0; font-size: 13px; }

/* Focus rings */
.inbox-surface a:focus-visible,
.inbox-surface button:focus-visible,
.inbox-surface input:focus-visible,
.inbox-surface select:focus-visible,
.inbox-surface textarea:focus-visible,
.inbox-surface summary:focus-visible {
  outline: 2px solid var(--is-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================================
 * Anti-fog dashboard surface (issue #21)
 * Scoped repaletted tokens — applies only to .dashboard-surface
 * on dashboard/index.html. Same scoping pattern as .inbox-surface.
 * Per-tile colour accents use :nth-child because the template
 * does not (and must not) emit a per-key modifier class — the
 * tile order in dashboard/index.html is the source of truth.
 * ============================================================ */
.dashboard-surface {
  --ds-bg: #f8fafc;
  --ds-surface: #ffffff;
  --ds-border: #e2e8f0;
  --ds-text: #0f172a;
  --ds-muted: #64748b;
  --ds-primary: #4338ca;
  --ds-primary-soft: rgba(67, 56, 202, 0.08);
  --ds-danger: #dc2626;
  --ds-danger-soft: rgba(220, 38, 38, 0.10);
  --ds-warning: #d97706;
  --ds-warning-soft: rgba(217, 119, 6, 0.12);
  --ds-info: #2563eb;
  --ds-info-soft: rgba(37, 99, 235, 0.10);
  --ds-neutral: #475569;
  --ds-neutral-soft: rgba(71, 85, 105, 0.10);
  --ds-success: #15803d;
  --ds-success-soft: rgba(22, 163, 74, 0.10);
  --ds-radius: 10px;
  --ds-radius-sm: 6px;
  color: var(--ds-text);
}

.dashboard-surface .dashboard-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.dashboard-surface .dashboard-header .section-title { color: var(--ds-text); margin: 0; }
.dashboard-surface .dashboard-header .section-subtitle { color: var(--ds-muted); margin: 4px 0 0; }

/* Pulse strip — trailing-24h activity summary (issue #26).
   Sits above the KPI strip; lighter weight (smaller numbers, muted
   tiles) because it's a read-only synthesis, not a click-through
   surface. Hidden entirely when all six counts are zero — empty
   should look intentional. */
.dashboard-surface .pulse-strip {
  padding: 14px 16px 16px;
  margin-bottom: 22px;
  background: var(--ds-neutral-soft);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius);
}
.dashboard-surface .pulse-strip__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ds-muted);
  font-weight: 700;
  margin: 0 0 10px;
}
.dashboard-surface .pulse-strip__title::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ds-primary);
}
.dashboard-surface .pulse-strip__tiles {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.dashboard-surface .pulse-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-left: 3px solid var(--ds-neutral);
  border-radius: var(--ds-radius);
}
.dashboard-surface .pulse-tile.is-zero {
  background: transparent;
  border-color: transparent;
  border-left-color: var(--ds-border);
  color: var(--ds-muted);
}
.dashboard-surface .pulse-tile.is-zero .pulse-tile__count {
  color: var(--ds-muted);
}
.dashboard-surface .pulse-tile__count {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--ds-text);
}
.dashboard-surface .pulse-tile__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ds-muted);
  font-weight: 600;
}
/* Per-metric accent — matches the canonical narrative:
   inbound → applied → quoted → won (good) → lost (caution) →
   newly_breached (alarm). */
.dashboard-surface .pulse-tile--rfqs_received  { border-left-color: var(--ds-info); }
.dashboard-surface .pulse-tile--applied        { border-left-color: var(--ds-neutral); }
.dashboard-surface .pulse-tile--quoted         { border-left-color: var(--ds-primary); }
.dashboard-surface .pulse-tile--won            { border-left-color: var(--ds-success); }
.dashboard-surface .pulse-tile--lost           { border-left-color: var(--ds-warning); }
.dashboard-surface .pulse-tile--newly_breached { border-left-color: var(--ds-danger); }

/* KPI strip — four-up grid */
.dashboard-surface .kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.dashboard-surface .kpi-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-left: 4px solid var(--ds-neutral);
  border-radius: var(--ds-radius);
  text-decoration: none;
  color: var(--ds-text);
  transition: transform 80ms ease, box-shadow 80ms ease, background 80ms ease;
}
.dashboard-surface .kpi-tile:hover {
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}
.dashboard-surface .kpi-tile.is-active {
  background: var(--ds-primary-soft);
  box-shadow: 0 0 0 2px var(--ds-primary) inset;
}
.dashboard-surface .kpi-tile__count {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  color: var(--ds-text);
}
.dashboard-surface .kpi-tile__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ds-muted);
  font-weight: 600;
}

/* Per-tile accent — order matches tile_defs in the template:
   1=untriaged (neutral), 2=breaching_today (warning amber),
   3=breached (danger red), 4=awaiting_outcome (muted info). */
.dashboard-surface .kpi-strip > .kpi-tile:nth-child(1) { border-left-color: var(--ds-neutral); }
.dashboard-surface .kpi-strip > .kpi-tile:nth-child(2) { border-left-color: var(--ds-warning); }
.dashboard-surface .kpi-strip > .kpi-tile:nth-child(3) { border-left-color: var(--ds-danger); }
.dashboard-surface .kpi-strip > .kpi-tile:nth-child(4) { border-left-color: var(--ds-info); }

/* Owner watch strip — one tile per sales_owner with open Enquiries
   (issue #27). Sits between the KPI strip and the action-required list.
   Visual weight: between the loud KPI tiles and the muted pulse strip —
   actionable (each tile is a link) but secondary to the KPI counters. */
.dashboard-surface .owner-strip {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 16px;
  margin-bottom: 22px;
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius);
}
.dashboard-surface .owner-strip__title {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ds-muted);
  white-space: nowrap;
  padding-right: 14px;
  border-right: 1px solid var(--ds-border);
}
.dashboard-surface .owner-strip__items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  flex: 1 1 auto;
}
.dashboard-surface .owner-tile {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 14px;
  background: var(--ds-bg);
  border: 1px solid var(--ds-border);
  border-left: 3px solid var(--ds-neutral);
  border-radius: var(--ds-radius);
  color: var(--ds-text);
  text-decoration: none;
  transition: transform 80ms ease, box-shadow 80ms ease;
  min-width: 120px;
}
.dashboard-surface .owner-tile:hover {
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}
.dashboard-surface .owner-tile__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ds-text);
  line-height: 1.2;
}
.dashboard-surface .owner-tile__counts {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-size: 11px;
}
.dashboard-surface .owner-tile__num {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dashboard-surface .owner-tile__lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ds-muted);
  margin-left: 3px;
}
.dashboard-surface .owner-tile__open .owner-tile__num { color: var(--ds-text); }
.dashboard-surface .owner-tile__breached .owner-tile__num { color: var(--ds-danger); }
.dashboard-surface .owner-tile__breached .owner-tile__lbl { color: var(--ds-danger); }
.dashboard-surface .owner-tile__today .owner-tile__num { color: var(--ds-warning); }
.dashboard-surface .owner-tile__today .owner-tile__lbl { color: var(--ds-warning); }

/* Breached emphasis — louder border + soft background. */
.dashboard-surface .owner-tile--breached {
  border-left-color: var(--ds-danger);
  background: var(--ds-danger-soft, #fdecea);
}

.dashboard-surface .owner-strip--empty { background: var(--ds-bg); }
.dashboard-surface .owner-strip__empty {
  margin: 0;
  font-size: 12px;
  color: var(--ds-muted);
}

/* Action-required card */
.dashboard-surface .action-required {
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius);
  overflow: hidden;
}
.dashboard-surface .action-required__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--ds-border);
  background: var(--ds-bg);
}
.dashboard-surface .action-required__header .section-subtitle {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ds-muted);
  font-weight: 700;
}
.dashboard-surface .action-required__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dashboard-surface .action-required__table thead th {
  text-align: left;
  padding: 10px 14px;
  background: var(--ds-bg);
  color: var(--ds-muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.06em;
  font-weight: 600;
  border-bottom: 1px solid var(--ds-border);
}
.dashboard-surface .action-required__table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--ds-border);
  vertical-align: middle;
}
.dashboard-surface .action-required__table tbody tr:last-child td { border-bottom: none; }
.dashboard-surface .action-row { transition: background 80ms ease; }
.dashboard-surface .action-row:hover { background: var(--ds-primary-soft); }

/* Row state — inset left bar on the first cell */
.dashboard-surface .action-row--breached td:first-child { box-shadow: inset 3px 0 0 var(--ds-danger); }
.dashboard-surface .action-row--breaching_today td:first-child { box-shadow: inset 3px 0 0 var(--ds-warning); }
.dashboard-surface .action-row--awaiting_outcome td:first-child { box-shadow: inset 3px 0 0 var(--ds-info); }

.dashboard-surface .action-row__subject { color: var(--ds-text); font-weight: 500; text-decoration: none; }
.dashboard-surface .action-row__subject:hover { color: var(--ds-primary); text-decoration: underline; }

/* Stale quotes card (issue #28) — `quoted` Enquiries with no recent
   Note activity. Same chrome as action-required so the surfaces feel
   like a set. Stale-row__days carries the eye to "how long ago". */
.dashboard-surface .stale-quotes {
  margin-top: 22px;
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius);
  overflow: hidden;
}
.dashboard-surface .stale-quotes__header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--ds-border);
  background: var(--ds-bg);
}
.dashboard-surface .stale-quotes__header .section-subtitle {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ds-muted);
  font-weight: 700;
}
.dashboard-surface .stale-quotes__hint {
  margin: 0;
  font-size: 12px;
}
.dashboard-surface .stale-quotes__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dashboard-surface .stale-quotes__table thead th {
  text-align: left;
  padding: 10px 14px;
  background: var(--ds-bg);
  color: var(--ds-muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.06em;
  font-weight: 600;
  border-bottom: 1px solid var(--ds-border);
}
.dashboard-surface .stale-quotes__table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--ds-border);
  vertical-align: middle;
}
.dashboard-surface .stale-quotes__table tbody tr:last-child td { border-bottom: none; }
.dashboard-surface .stale-row { transition: background 80ms ease; }
.dashboard-surface .stale-row:hover { background: var(--ds-primary-soft); }
.dashboard-surface .stale-row td:first-child { box-shadow: inset 3px 0 0 var(--ds-info); }
.dashboard-surface .stale-row__no {
  color: var(--ds-text);
  font-weight: 600;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.dashboard-surface .stale-row__no:hover { color: var(--ds-primary); text-decoration: underline; }
.dashboard-surface .stale-row__days {
  color: var(--ds-muted);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.dashboard-surface .stale-quotes .empty {
  margin: 0;
  padding: 16px 18px;
}

/* Badge variants — pill shape; override global .badge inside this scope */
.dashboard-surface .badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.4;
  background: none;
  color: var(--ds-text);
}
.dashboard-surface .badge + .badge { margin-left: 4px; }
.dashboard-surface .badge--untriaged       { background: var(--ds-neutral-soft); color: var(--ds-neutral); }
.dashboard-surface .badge--breached        { background: var(--ds-danger-soft);  color: var(--ds-danger);  }
.dashboard-surface .badge--breaching-today { background: var(--ds-warning-soft); color: var(--ds-warning); }
.dashboard-surface .badge--awaiting-outcome{ background: var(--ds-info-soft);    color: var(--ds-info);    }
.dashboard-surface .badge--green           { background: var(--ds-success-soft); color: var(--ds-success); }

/* Importance pill — softer than state badges */
.dashboard-surface .badge--importance {
  background: var(--ds-bg);
  border: 1px solid var(--ds-border);
  color: var(--ds-muted);
  font-weight: 600;
}
.dashboard-surface .importance--high   { color: #b91c1c; border-color: rgba(185, 28, 28, 0.35); background: rgba(185, 28, 28, 0.06); }
.dashboard-surface .importance--medium { color: #b45309; border-color: rgba(180, 83, 9, 0.35);  background: rgba(180, 83, 9, 0.06);  }
.dashboard-surface .importance--low    { color: var(--ds-muted); border-color: var(--ds-border); background: var(--ds-bg); }

/* Overdue marker */
.dashboard-surface .overdue { color: var(--ds-danger); font-weight: 700; }

/* Empty state */
.dashboard-surface .empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--ds-muted);
}

/* Responsive — collapse strip on narrow viewports */
@media (max-width: 800px) {
  .dashboard-surface .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Focus rings */
.dashboard-surface a:focus-visible,
.dashboard-surface button:focus-visible {
  outline: 2px solid var(--ds-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ----- Per-Account history rollup (issue #18 markup, #23 styles) -----
 * Secondary KPI weight — lighter than .dashboard-surface .kpi-strip.
 * Used on /crm/accounts/<id> above the per-Enquiry list. */
.account-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 6px 0 14px;
}
.account-summary__tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--mf-bg2);
  border: 1px solid var(--mf-border);
  border-left: 3px solid var(--mf-border);
  border-radius: 6px;
}
.account-summary__count {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--mf-text);
  font-variant-numeric: tabular-nums;
}
.account-summary__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mf-muted);
  font-weight: 500;
}

/* Per-metric accents — order matches the tiles in account_view.html:
   1=total (neutral), 2=won (success), 3=lost (muted), 4=breached
   (danger), 5=avg time to quote (info). */
.account-summary > .account-summary__tile:nth-child(1) { border-left-color: var(--mf-border); }
.account-summary > .account-summary__tile:nth-child(2) { border-left-color: var(--mf-success); }
.account-summary > .account-summary__tile:nth-child(3) { border-left-color: var(--mf-muted); }
.account-summary > .account-summary__tile:nth-child(4) { border-left-color: var(--mf-danger); }
.account-summary > .account-summary__tile:nth-child(5) { border-left-color: var(--mf-info); }

