/* Orders (consolidated order-status view) — mirrors Cash Flow / Accounting's
   shell + header so the internal apps feel like one product. Order-specific
   styles (status pills, the per-row lens strip, month groups, the note
   timeline + composer, the attention queue) follow below. */

/* ── Shell ────────────────────────────────────────────────────────── */
.app-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6) var(--space-16);
}

/* Shared chrome (header / auth gate / toolbar / panel / pills) lives in
   /design-system/hive-chrome.css — only app-specific overrides here. */
.nav-badge { background: var(--kiss-red); color: var(--kiss-red-contrast); border-radius: var(--radius-pill); padding: 0 6px; font-size: 10px; }

/* ── Toolbar overrides ────────────────────────────────────────────── */
.toolbar input[type="search"] { min-width: 260px; }
.toolbar label.toggle { display: flex; align-items: center; gap: var(--space-2); font-size: 12px; color: var(--n-600); cursor: pointer; }

/* ── The three headline numbers (Signed / Paid / Fulfilled lens) ──── */
.trio { display: flex; gap: var(--space-3); margin-bottom: var(--space-5); flex-wrap: wrap; }
.trio__item {
  flex: 1 1 0; min-width: 150px; text-align: left; cursor: pointer; font: inherit;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--n-0); border: 1px solid var(--n-200); border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  transition: border-color var(--dur-fast) var(--ease-standard), background var(--dur-fast) var(--ease-standard);
}
.trio__item:hover { background: var(--bg-subtle); }
.trio__item.is-active { border-color: var(--n-900); background: var(--bg-subtle); }
.trio__label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--n-600); }
.trio__blurb { color: var(--n-400); }
.trio__amt { font-size: 20px; font-weight: 600; color: var(--fg-1); font-variant-numeric: tabular-nums; }
.trio__n { font-family: var(--font-mono); font-size: 11px; color: var(--n-500); }
.trio__desc { font-size: 11px; line-height: 1.45; color: var(--n-500); margin-top: 4px; }

/* ── Order list ───────────────────────────────────────────────────── */
.order-list { background: var(--n-0); border: 1px solid var(--n-200); border-radius: var(--radius-lg); overflow: hidden; }

/* Month group header (the F5 "deals closed by month" grouping). */
.group-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-subtle); border-bottom: 1px solid var(--n-200);
  cursor: pointer; user-select: none;
}
.group-head:first-child { border-top: 0; }
.group-head__label { font-weight: 600; font-size: 14px; color: var(--fg-1); }
.group-head__label .chev { display: inline-block; width: 1em; color: var(--n-500); transition: transform var(--dur-fast) var(--ease-standard); }
.group-head.collapsed .chev { transform: rotate(-90deg); }
.group-head__meta {
  display: flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-mono); font-size: 11px; color: var(--n-500);
}
.group-head__meta .gh-sep { color: var(--n-300); }
.group-head__meta .gh-out { color: #b91c1c; font-weight: 600; }
.gh-progress {
  width: 88px; height: 6px; border-radius: var(--radius-pill);
  background: var(--n-200); overflow: hidden; margin-left: var(--space-2);
}
.gh-progress__bar { display: block; height: 100%; background: #10b981; border-radius: var(--radius-pill); }
.gh-pct { color: var(--n-600); min-width: 30px; text-align: right; }

.row-head, .order-row__main {
  display: grid;
  grid-template-columns: 96px 1fr 120px 64px minmax(210px, max-content);
  gap: var(--space-3);
  align-items: center;
}
.row-head {
  padding: var(--space-2) var(--space-4) var(--space-2) calc(var(--space-4) + 3px);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--n-500);
  background: var(--bg-subtle); border-bottom: 1px solid var(--n-100);
}
.row-head > div.num { text-align: right; }
.row-head > .flags-col { text-align: left; }

.order-row {
  position: relative;
  padding: var(--space-3) var(--space-4) var(--space-3) calc(var(--space-4) + 3px);
  border-bottom: 1px solid var(--n-100);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-standard);
}
.order-row:last-child { border-bottom: 0; }
.order-row:hover { background: var(--bg-subtle); }
.order-row.is-selected { background: var(--bg-subtle); }
/* Left accent stripe = progress at a glance. */
.order-row::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent;
}
.order-row.is-partial::before  { background: #f59e0b; }
.order-row.is-complete::before { background: #10b981; }

.order-row__customer { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; color: var(--fg-1); font-weight: 600; }
.order-row__customer .cust-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-row__date { font-family: var(--font-mono); font-size: 12px; color: var(--n-500); }
.order-row__amt { font-size: 14px; font-variant-numeric: tabular-nums; color: var(--fg-1); font-weight: 500; text-align: right; }
.order-row__units { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--n-500); text-align: right; }
.order-row__flags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* Status pills (paid in full / fulfilled). Colored + emoji when true, muted otherwise. */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: 0.03em;
  text-transform: uppercase; padding: 3px 9px; border-radius: var(--radius-pill);
  border: 1px solid transparent; white-space: nowrap;
}
.pill--paid { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.pill--ship { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.pill--off  { background: var(--n-0); color: var(--n-400); border-color: var(--n-200); }

/* Small inline row tag (e.g. a voided / written-off order). */
.row-tag {
  display: inline-block; font-family: var(--font-mono); font-size: 9px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; vertical-align: middle;
  padding: 1px 6px; margin-left: 6px; border-radius: var(--radius-pill);
  background: var(--n-100); color: var(--n-600); border: 1px solid var(--n-200);
}
/* Recognition-vs-fulfillment callout (Fulfilled lens, pre-cutover rows): amber,
   mixed-case, and never shrinks the customer name beside it. */
.row-tag--recog {
  background: #fffbeb; color: #92400e; border-color: #fde68a;
  text-transform: none; letter-spacing: 0.02em; margin-left: 0; flex: none; cursor: help;
}
/* Aging-backlog flag (AR backlog rows). */
.row-tag--stale { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
/* Tranche flag (a row that's one shipment of a multi-delivery commitment). */
.row-tag--tranche { background: #eef2ff; color: #3730a3; border-color: #c7d2fe; text-transform: none; letter-spacing: 0.02em; }

/* Tranche commitment grouping — a quote that books as several shipments, shown
   as nested order rows under one commitment header. */
.commitment { border-left: 3px solid #818cf8; margin-bottom: 2px; }
.commitment-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); padding: 6px var(--space-4); background: #eef2ff; }
.commitment-head__cust { font-weight: 700; font-size: 13px; color: var(--fg-1); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.commitment-head__meta { font-family: var(--font-mono); font-size: 11px; color: #4338ca; white-space: nowrap; }
/* Highlight the current tranche in the drawer's Commitment table. */
.ms-table tr.ms-current td { background: var(--bg-subtle); font-weight: 600; }

/* ── Embedded summary (totals + monthly breakdown) ────────────────── */
.summary { margin-bottom: var(--space-5); }
.summary__wrap { background: var(--n-0); border: 1px solid var(--n-200); border-radius: var(--radius-lg); overflow: hidden; }
.summary__head {
  padding: var(--space-3) var(--space-4); cursor: pointer; user-select: none;
  font-size: 13px; font-weight: 600; color: var(--fg-1); background: var(--bg-subtle);
}
.summary__head::marker { color: var(--n-500); }
.summary__table { width: 100%; border-collapse: collapse; font-size: 13px; }
.summary__table th {
  text-align: left; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--n-500); padding: var(--space-2) var(--space-4);
  border-top: 1px solid var(--n-200); border-bottom: 1px solid var(--n-100);
}
.summary__table th.num, .summary__table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.summary__table td { padding: var(--space-2) var(--space-4); border-bottom: 1px solid var(--n-100); color: var(--fg-1); }
.summary__table tr:last-child td { border-bottom: 0; }
.summary__table tr.summary__total td { font-weight: 600; background: var(--bg-subtle); }
/* Order-count beside each $ figure in the Signed/Paid/Fulfilled matrix. */
.summary__table .sum-n { color: var(--n-400); font-family: var(--font-mono); font-size: 11px; font-weight: 400; }

/* ── Status pill ──────────────────────────────────────────────────── */
.status-pill {
  display: inline-block;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
  padding: 2px 8px; border-radius: var(--radius-pill);
  text-transform: uppercase; border: 1px solid transparent;
}
.status-pill.invoiced     { background: var(--info-soft, #eff6ff); color: #1e3a8a; border-color: #bfdbfe; }
.status-pill.paid         { background: var(--success-soft, #ecfdf5); color: #065f46; border-color: #a7f3d0; }
.status-pill.fulfilled    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.status-pill.complete     { background: var(--success-soft, #ecfdf5); color: #065f46; border-color: #6ee7b7; }
.status-pill.voided,
.status-pill.written_off  { background: var(--n-100); color: var(--n-500); border-color: var(--n-200); text-decoration: line-through; }

/* ── Side panel (detail drawer) ───────────────────────────────────── */
.panel {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(680px, 96vw);
  background: var(--n-0); border-left: 1px solid var(--n-200); box-shadow: var(--shadow-lg);
  transform: translateX(100%); transition: transform var(--dur-base) var(--ease-standard);
  z-index: 50; display: flex; flex-direction: column; overflow-y: auto;
}
.panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); padding: var(--space-5) var(--space-5) var(--space-3); border-bottom: 1px solid var(--n-200); position: sticky; top: 0; background: var(--n-0); z-index: 1; }
.panel__title { font-size: 17px; font-weight: 600; color: var(--fg-1); }
.panel__sub { font-family: var(--font-mono); font-size: 12px; color: var(--n-500); margin-top: 3px; }
.panel section.disabled { opacity: 0.55; }
.panel h2 { font-size: 13px; font-family: var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--n-500); margin: 0 0 var(--space-3); display: flex; align-items: center; gap: var(--space-2); }
.panel h2 .tag { font-size: 9px; color: var(--n-400); letter-spacing: 0.04em; }
.panel__footer { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-6); padding-top: var(--space-3); border-top: 1px solid var(--n-200); font-family: var(--font-mono); font-size: 11px; }
.panel__footer code { background: var(--n-100); padding: 1px 5px; border-radius: var(--radius-sm); }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px var(--space-3); font-size: 13px; }
.kv dd a { color: var(--fg-link); text-decoration: none; }
.kv dd .remark { white-space: pre-wrap; }
.kv dd.empty-val { color: var(--n-400); }

/* ── Note timeline + composer ─────────────────────────────────────── */
/* Per-section notes subheading (Sales notes / Fulfillment notes / Accounting notes). */
.notes-h {
  margin: var(--space-4) 0 var(--space-2);
  font-size: 12px; font-weight: 600; color: var(--n-700);
  display: flex; align-items: center; gap: var(--space-2);
}
.notes-h .tag { font-family: var(--font-mono); font-size: 10px; color: var(--n-500); background: var(--n-100); border-radius: var(--radius-pill); padding: 0 6px; }
.notes { list-style: none; padding: 0; margin: 0 0 var(--space-3); }
.note {
  padding: var(--space-3) 0; border-bottom: 1px solid var(--n-100);
}
.note:last-child { border-bottom: 0; }
.note__meta { display: flex; align-items: center; gap: var(--space-2); margin-bottom: 4px; }
.note__who { font-family: var(--font-mono); font-size: 11px; color: var(--n-500); }
.note__when { font-family: var(--font-mono); font-size: 11px; color: var(--n-400); }
.note__body { font-size: 13px; color: var(--fg-1); white-space: pre-wrap; }

.team-pill {
  display: inline-block; font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.04em; padding: 1px 7px; border-radius: var(--radius-pill);
  text-transform: uppercase; border: 1px solid transparent;
}
.team-pill.sales       { background: #fef3c7; color: #92400e; border-color: #fcd9a3; }
.team-pill.fulfillment { background: #eff6ff; color: #1e3a8a; border-color: #bfdbfe; }
.team-pill.accounting  { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.team-pill.onboarding  { background: var(--n-100); color: var(--n-600); border-color: var(--n-200); }

.composer { border-top: 1px solid var(--n-200); padding-top: var(--space-4); }
.composer textarea {
  width: 100%; min-height: 64px; resize: vertical; font: inherit; font-size: 13px;
  padding: var(--space-3); border: 1px solid var(--n-300); border-radius: var(--radius-md);
  background: var(--n-0); color: var(--fg-1); box-sizing: border-box;
}
.composer__controls { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-3); }
.composer select { font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--n-300); border-radius: var(--radius-md); background: var(--n-0); }
.composer .spacer { flex: 1; }

/* ── Attention queue ──────────────────────────────────────────────── */
.attention { max-width: 1000px; }
.attention .lead { color: var(--n-600); font-size: 14px; margin: 0 0 var(--space-6); }
.att-section { margin-bottom: var(--space-8); }
.att-section h2 { font-size: 13px; font-family: var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--n-700); margin: 0 0 var(--space-3); display: flex; align-items: center; gap: var(--space-2); }
.att-section h2 .pill { background: var(--kiss-red); color: var(--kiss-red-contrast); border-radius: var(--radius-pill); padding: 0 7px; font-size: 11px; }
.att-section h2 .pill.zero { background: var(--n-200); color: var(--n-600); }
.att-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.att-table th { text-align: left; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--n-500); padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--n-200); }
.att-table td { padding: var(--space-3); border-bottom: 1px solid var(--n-100); color: var(--fg-1); vertical-align: middle; cursor: pointer; }
.att-note { display: inline-block; max-width: 340px; white-space: normal; font-size: 12px; color: var(--n-600); line-height: 1.45; }
.att-table tr:hover td { background: var(--bg-subtle); }
/* Orphan SOs (no linked invoice) have nothing to open — make that obvious. */
.att-table tr.inert td { cursor: default; color: var(--n-500); font-style: italic; }
.att-table tr.inert:hover td { background: transparent; }
.att-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.att-table .days { font-variant-numeric: tabular-nums; font-weight: 600; color: #991b1b; }
/* Inline "due in Nd" marker in the merged Expected/Ship-by column (subtle; the
   overdue case uses the red row-tag--stale pill instead). */
.att-soon { font-family: var(--font-mono); font-size: 11px; color: var(--n-500); }
/* Actionable data-gap reason (an order missing its signed date). */
.att-gap-bad { color: #991b1b; font-weight: 600; }

/* ── Collection schedule (drawer milestones) ───────────── */
.ms-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ms-table th {
  text-align: left; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--n-500); padding: var(--space-2) var(--space-2);
  border-bottom: 1px solid var(--n-200);
}
.ms-table td { padding: var(--space-2); border-bottom: 1px solid var(--n-100); color: var(--fg-1); }
.ms-table tr:last-child td { border-bottom: 0; }
.ms-table th.num, .ms-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.ms-collected { color: #065f46; font-weight: 600; }
.ms-overdue   { color: #991b1b; font-weight: 600; }
.ms-open      { color: var(--n-500); }
.btn { background: var(--n-900); color: var(--n-0); border: 0; border-radius: var(--radius-md); padding: 6px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn:disabled { opacity: 0.6; cursor: default; }

/* ── Fulfillment view (shipment queue + build-by + per-SKU stock) ─── */
.fulfillment { max-width: 1100px; }
.fulfillment .lead { color: var(--n-600); font-size: 14px; margin: 0 0 var(--space-5); max-width: 80ch; }
/* Build-to-stay-covered action list. */
.fq-builds .fq-build-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.fq-build-list li { font-size: 13px; color: var(--fg-1); display: flex; align-items: baseline; gap: var(--space-2); }
.fq-build-units { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: #1e40af; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: var(--radius-pill); padding: 1px 8px; }
/* At-risk shipment rows + the short SKU within an Items cell. */
.att-table tr.fq-at-risk td { background: #fef2f2; }
.att-table tr.fq-at-risk:hover td { background: #fee2e2; }
.fq-line-short { color: #991b1b; font-weight: 700; }
.inv-toolbar { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-5); }
.inv-toolbar .spacer { flex: 1; }
.inv-summary { display: flex; align-items: center; gap: var(--space-2); font-size: 13px; flex-wrap: wrap; }
.inv-toolbar label.toggle { display: flex; align-items: center; gap: var(--space-2); font-size: 13px; color: var(--n-600); cursor: pointer; }
.inv-ok { color: #065f46; font-weight: 600; font-size: 12px; }
/* Forecast scenario control (Off / Flat / Grow segmented + optional growth rate). */
.fc-control { display: flex; align-items: center; gap: var(--space-2); }
.fc-control__label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--n-500); }
.seg { display: inline-flex; border: 1px solid var(--n-300); border-radius: var(--radius-md); overflow: hidden; }
.seg__btn { font: inherit; font-size: 12px; padding: 4px 10px; background: var(--n-0); color: var(--n-600); border: 0; border-left: 1px solid var(--n-200); cursor: pointer; }
.seg__btn:first-child { border-left: 0; }
.seg__btn:hover { background: var(--bg-subtle); }
.seg__btn.is-on { background: var(--n-900); color: var(--n-0); }
.fc-growth { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--n-600); }
.fc-growth input { width: 56px; font: inherit; font-size: 12px; padding: 3px 6px; border: 1px solid var(--n-300); border-radius: var(--radius-sm); text-align: right; }
/* "forecast on" badge in the summary row. */
.row-tag.fc-on-badge { background: #fffbeb; color: #92400e; border-color: #fde68a; text-transform: none; letter-spacing: 0.02em; }

/* Full-width per-SKU stack (one chart per SKU, top to bottom). */
.inv-stack { display: flex; flex-direction: column; gap: var(--space-5); }
.inv-card {
  background: var(--n-0); border: 1px solid var(--n-200); border-radius: var(--radius-lg);
  padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3);
}
.inv-card.is-short { border-color: #fecaca; box-shadow: inset 3px 0 0 #ef4444; }
.inv-card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.inv-card__title { display: flex; align-items: baseline; gap: var(--space-2); min-width: 0; }
.inv-sku { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--n-500); }
.inv-label { font-size: 17px; font-weight: 700; color: var(--fg-1); }
/* Covered / short headline chip in the card head. */
.inv-status { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; padding: 3px 10px; border-radius: var(--radius-pill); border: 1px solid transparent; white-space: nowrap; }
.inv-status.is-ok    { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.inv-status.is-short { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.inv-status.is-warn  { background: #fffbeb; color: #92400e; border-color: #fde68a; }
/* Per-card unscheduled-demand alert + page-level banner. */
.inv-alert { font-size: 13px; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); }
.inv-banner { font-size: 13px; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-left: 4px solid #f59e0b; border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-4); line-height: 1.5; }
/* KPI tiles — make the per-SKU numbers pop. */
.inv-stats { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.inv-stat {
  flex: 0 0 auto; min-width: 100px; display: flex; flex-direction: column; gap: 1px;
  background: var(--bg-subtle); border: 1px solid var(--n-200); border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
}
.inv-stat__label { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--n-500); }
.inv-stat__val { font-size: 22px; font-weight: 700; color: var(--fg-1); font-variant-numeric: tabular-nums; line-height: 1.15; }
.inv-stat__sub { font-size: 10px; color: var(--n-500); }
.inv-stat--neg { border-color: #fecaca; background: #fef2f2; }
.inv-stat--neg .inv-stat__val { color: #991b1b; }

/* Projected-balance chart (inline SVG). */
.proj-chart { width: 100%; height: auto; display: block; }
.proj-area { fill: rgba(16, 185, 129, 0.08); stroke: none; }
.proj-zero { stroke: var(--n-300); stroke-width: 1; stroke-dasharray: 3 3; }
.proj-line { fill: none; stroke: #10b981; stroke-width: 2; }
.proj-dot { fill: #10b981; stroke: var(--n-0); stroke-width: 1; cursor: pointer; transition: r var(--dur-fast) var(--ease-standard); }
.proj-dot.inflow  { fill: #2563eb; }
.proj-dot.outflow { fill: #6b7280; }
.proj-dot.start   { fill: var(--n-900); }
.proj-dot.neg     { fill: #ef4444; }
.proj-dot.unsched { fill: #f59e0b; stroke: var(--n-0); stroke-width: 1.5; }
.proj-dot:hover, .proj-dot:focus { r: 5; outline: none; }
/* Monthly gridlines + axis labels. Month labels are prominent (this is a
   rolling analysis); y ticks + the units caption stay subtle. */
.proj-grid { stroke: var(--n-200); stroke-width: 1; }
.proj-axis { fill: var(--n-500); font-family: var(--font-mono); font-size: 9px; }
.proj-axis--cap { fill: var(--n-400); font-size: 8px; letter-spacing: 0.04em; text-transform: uppercase; }
.proj-axis--month { fill: var(--n-700); font-size: 11px; font-weight: 600; }
/* Floating hover tooltip for chart dots. */
.proj-tip {
  position: fixed; z-index: 60; pointer-events: none;
  background: var(--n-900); color: var(--n-0);
  font-family: var(--font-mono); font-size: 11px; line-height: 1.3;
  padding: 5px 9px; border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  max-width: 300px; white-space: normal;
}

/* Per-SKU builds + shipments, in a list that's collapsed by default — open a
   SKU's queue for detail. SO numbers link out to Inflow; the row (SO with a
   linked order) opens the Hive drawer; short rows tint red. */
details.inv-events { margin-top: var(--space-3); }
details.inv-events > summary { cursor: pointer; user-select: none; font-family: var(--font-mono); font-size: 11px; color: var(--n-600); padding: 4px 0; }
details.inv-events > summary:hover { color: var(--n-900); }
details.inv-events[open] > summary { margin-bottom: var(--space-1); }
.fq-summary-short { color: #991b1b; font-weight: 700; }
.inv-events-table td { cursor: default; }
.inv-events-table tr.fq-open td { cursor: pointer; }
.inv-events-table tr.is-short td { background: #fef2f2; color: #991b1b; }
/* SO number → Inflow deep link (MO numbers stay plain text — no Inflow id yet). */
.fq-inflow { color: var(--fg-link); text-decoration: none; font-variant-numeric: tabular-nums; }
.fq-inflow:hover { text-decoration: underline; }
/* Unpaid marker on an unpaid sales-order row (muted — informational). */
.row-tag.fq-unpaid { background: var(--n-100); color: var(--n-600); border-color: var(--n-200); }
/* Synthetic forecast-demand rows in the per-SKU list (planning overlay) — amber,
   visually distinct from real builds/shipments. */
.inv-events-table tr.fq-forecast td { background: #fffbeb; color: #92400e; }
.inv-events-table tr.fq-forecast.is-short td { background: #fef2f2; color: #991b1b; }
.row-tag.fq-fc-tag { background: #fef3c7; color: #92400e; border-color: #fde68a; }
/* Unscheduled (no ship date) SO rows + their "no date" tag + summary marker. */
.inv-events-table tr.fq-unsched td { background: #fffbeb; }
.row-tag.fq-nodate { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.fq-summary-uns { color: #92400e; font-weight: 700; }
/* Past-due SO rows (ship date passed; often held for payment) — red, more urgent
   than the amber "no date" rows. Overdue demand, drawn at week 1. */
.row-tag.fq-pastdue { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.inv-events-table tr.fq-pastdue-row td { background: #fef2f2; }
.fq-summary-pastdue { color: #991b1b; font-weight: 700; }
