/* Insignia Planning Desk — application layout & components. */

/* ------------------------------------------------------------------ */
/* Shell                                                               */
/* ------------------------------------------------------------------ */

.shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar — the brand lives here */

.sb {
  width: 216px;
  flex: none;
  background: var(--steel-950);
  color: #cfe0ec;
  display: flex;
  flex-direction: column;
  padding: 18px 12px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 8px 18px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--steel-800);
  color: var(--ice-500);
  flex: none;
}

.brand-name {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
  line-height: 1.1;
}

.brand-sub {
  font-size: 10.5px;
  font-weight: 550;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #7d9ab1;
  margin-top: 2px;
}

.sb nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 550;
  color: #a7bfd2;
  transition: background 130ms var(--ease), color 130ms var(--ease);
}

.nav-item svg {
  flex: none;
  opacity: 0.85;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #e8f1f8;
}

.nav-item[aria-current="page"] {
  background: var(--steel-800);
  color: #fff;
}

.nav-badge {
  margin-left: auto;
  min-width: 19px;
  height: 19px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--ice-500);
  color: var(--steel-950);
  font-size: 11px;
  font-weight: 700;
}

.sb-sites {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sb-sites-hd {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #7d9ab1;
  padding: 0 10px 6px;
}

.sb-site {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 30px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  color: #a7bfd2;
  transition: background 130ms var(--ease), color 130ms var(--ease);
}

.sb-site:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #e8f1f8;
}

.sb-site-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ice-500);
  flex: none;
}

.sb-site-n {
  margin-left: auto;
  color: #7d9ab1;
  font-size: 11.5px;
}

.sb-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sb-foot .who .nm {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.sb-foot .who .em {
  font-size: 11.5px;
  color: #7d9ab1;
}

/* Main column */

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 56px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex: none;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 420px;
  max-width: 44vw;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--paper);
  color: var(--ink-400);
}

.search input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  outline: none;
  font-size: 13.5px;
  color: var(--ink-900);
}

.search input::placeholder {
  color: var(--ink-400);
}

.search:focus-within {
  border-color: var(--steel-600);
  background: var(--surface);
}

.search kbd {
  flex: none;
}

.search-pop {
  position: absolute;
  top: 40px;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 60;
}

.search-pop .hit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--r-md);
  font-size: 13px;
  text-align: left;
}

.search-pop .hit:hover {
  background: var(--surface-2);
}

.search-pop .hit .kind {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-400);
}

.search-pop .none {
  padding: 12px 10px;
  font-size: 13px;
  color: var(--ink-500);
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r-md);
  color: var(--ink-500);
  transition: background 130ms var(--ease), color 130ms var(--ease);
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--ink-900);
}

.icon-btn .ping {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red-600);
  border: 2px solid var(--surface);
}

/* Notifications popover */

.notif-pop {
  position: absolute;
  top: 52px;
  right: 60px;
  width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 60;
}

.notif-pop .hd {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-400);
  padding: 8px 10px 6px;
}

.notif-pop .it {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--r-md);
  font-size: 13px;
  text-align: left;
  line-height: 1.4;
}

.notif-pop .it:hover {
  background: var(--surface-2);
}

.notif-pop .it .t {
  flex: none;
  font-size: 11.5px;
  color: var(--ink-400);
}

.notif-pop .it.new {
  background: var(--ice-100);
}

/* Content area */

.content {
  flex: 1;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.content-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 22px 28px 48px;
}

.view-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

.view-head h1 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.view-head .sub {
  font-size: 13px;
  color: var(--ink-500);
}

.view-head .right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-400);
}

/* Filter chips */

.filters {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.fchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 550;
  color: var(--ink-500);
  transition: all 130ms var(--ease);
}

.fchip:hover {
  border-color: var(--ink-400);
  color: var(--ink-900);
}

.fchip[aria-pressed="true"] {
  background: var(--steel-700);
  border-color: var(--steel-700);
  color: #fff;
}

.fchip .fcount {
  font-size: 11px;
  opacity: 0.75;
}

.fsep {
  width: 1px;
  height: 20px;
  background: var(--line-2);
  margin: 0 6px;
}

/* ------------------------------------------------------------------ */
/* KPI strip                                                           */
/* ------------------------------------------------------------------ */

.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.kpi {
  position: relative;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 16px 12px;
  transition: border-color 130ms var(--ease), box-shadow 130ms var(--ease);
}

button.kpi:hover {
  border-color: var(--line-2);
  box-shadow: var(--shadow-md);
}

.kpi .kpi-go {
  opacity: 0;
  transition: opacity 130ms var(--ease);
  color: var(--sky-600);
}

button.kpi:hover .kpi-go {
  opacity: 1;
}

.kpi .lbl {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-400);
}

.kpi .val {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 4px 0 2px;
}

.kpi .sub {
  font-size: 12px;
  color: var(--ink-500);
}

.kpi.static {
  cursor: default;
}

/* ------------------------------------------------------------------ */
/* Board tables                                                        */
/* ------------------------------------------------------------------ */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.panel table.board {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.panel table.board th {
  text-align: left;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-400);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  user-select: none;
}

.panel table.board th.r,
.panel table.board td.r {
  text-align: right;
}

.panel table.board th.sortable {
  cursor: pointer;
}

.panel table.board th.sortable:hover {
  color: var(--ink-900);
}

.panel table.board th .arr {
  font-size: 9px;
  margin-left: 4px;
}

.panel table.board td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.panel table.board tbody tr:last-child > td {
  border-bottom: none;
}

tr.group-row > td {
  padding: 0;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.group-hd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
}

.group-nm {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.01em;
  color: var(--ink-900);
}

.group-meta {
  font-size: 11px;
  color: var(--ink-400);
  white-space: nowrap;
}

tr.rowbtn {
  cursor: pointer;
  transition: background 110ms var(--ease);
}

tr.rowbtn:hover {
  background: var(--paper);
}

tr.rowbtn.open-row {
  background: var(--paper);
}

.cell-product .nm,
.nm-inline {
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.005em;
}

.cell-product .sp {
  font-size: 11.5px;
  color: var(--ink-400);
  margin-top: 1px;
}

.cp-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.row-chev {
  display: inline-flex;
  color: var(--ink-400);
  transition: transform 160ms var(--ease);
  flex: none;
}

.row-chev.is-open {
  transform: rotate(180deg);
}

.sitechip {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 550;
  color: var(--ink-500);
  white-space: nowrap;
}

.cover-big {
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}

.nowrap {
  white-space: nowrap;
}

.c-red { color: var(--red-600); }
.c-amber { color: var(--amber-600); }
.c-over { color: var(--sky-600); }
.c-ok { color: var(--ink-900); }

.cell-sub {
  font-size: 11px;
  color: var(--ink-400);
  margin-top: 1px;
}

.cell-dim {
  color: var(--ink-400);
}

.spark-cell {
  width: 132px;
}

.spark-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.spark-delta {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* Next move cell */

.cell-move {
  width: 168px;
}

.move {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 27px;
  padding: 0 11px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 120ms var(--ease);
}

.move-red {
  background: var(--red-600);
  color: #fff;
}

.move-red:hover {
  background: #b2301f;
}

.move-amber {
  background: var(--amber-100);
  color: var(--amber-600);
  border: 1px solid #ecd9b8;
}

.move-amber:hover {
  border-color: var(--amber-600);
}

.move-sky {
  background: var(--sky-100);
  color: var(--sky-600);
  border: 1px solid #cdddf8;
}

.move-sky:hover {
  border-color: var(--sky-600);
}

.move-chip {
  background: var(--surface-2);
  color: var(--ink-500);
  border: 1px solid var(--line);
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}

.move-chip:hover {
  color: var(--ink-900);
  border-color: var(--line-2);
}

/* Expanded row detail */

tr.expand > td {
  background: var(--paper);
  padding: 0 14px 16px;
}

.expand-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 28px;
  padding: 14px 6px 0 34px;
}

.expand-col .hd {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-400);
  margin-bottom: 6px;
}

.qline {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}

.qline:last-child {
  border-bottom: none;
}

.qline .who {
  flex: 1;
  min-width: 0;
  font-weight: 550;
}

.qline .px {
  font-weight: 600;
}

.qline .muted,
.muted {
  color: var(--ink-400);
}

.qline.gone {
  color: var(--ink-400);
}

.qline.gone .who,
.qline.gone .px {
  font-weight: 450;
}

.qline.qline-total {
  border-top: 1px solid var(--line-2);
  border-bottom: none;
  font-weight: 600;
}

.qline-link {
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.qline-link:hover .who {
  color: var(--ink-900);
}

.dline {
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  width: 100%;
  text-align: left;
}

.dline:last-child {
  border-bottom: none;
}

.dline .top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 550;
}

.dline .sub {
  color: var(--ink-400);
  font-size: 11.5px;
  margin-top: 1px;
}

button.dline-link {
  border-radius: var(--r-sm);
  transition: background 110ms var(--ease);
}

button.dline-link:hover {
  background: var(--surface-2);
}

/* Row glow (jump/flash) */

@keyframes row-glow {
  0% { background: var(--ice-100); }
  70% { background: var(--ice-100); }
  100% { background: transparent; }
}

tr.glow {
  animation: row-glow 1.7s var(--ease);
}

@keyframes panel-glow {
  0% { box-shadow: 0 0 0 3px var(--ice-100); border-color: var(--ice-500); }
  70% { box-shadow: 0 0 0 3px var(--ice-100); border-color: var(--ice-500); }
  100% { box-shadow: none; }
}

.panel-glow {
  animation: panel-glow 1.7s var(--ease);
}

.bar-others .bar-lbl {
  color: var(--ink-400);
}

.bars .bar-fill.bar-fill-dim {
  background: var(--line-2);
}

/* ------------------------------------------------------------------ */
/* Today dashboard                                                     */
/* ------------------------------------------------------------------ */

.dash-head {
  align-items: center;
}

.dash-head h1 {
  font-size: 23px;
}

.dash-head .sub {
  margin-top: 3px;
}

.mode-switch {
  display: inline-flex;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
}

.mode-switch button {
  height: 32px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 550;
  color: var(--ink-500);
  transition: all 130ms var(--ease);
}

.mode-switch button + button {
  border-left: 1px solid var(--line-2);
}

.mode-switch button[aria-pressed="true"] {
  background: var(--steel-700);
  color: #fff;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 16px;
  align-items: start;
}

.dash-rail {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px 10px;
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -0.005em;
}

.panel-hd .muted {
  font-size: 12px;
  font-weight: 450;
}

.panel-ft {
  padding: 10px 16px 12px;
  font-size: 12px;
  color: var(--ink-400);
  border-top: 1px solid var(--line);
}

/* Action queue */

.qitem {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
}

.q-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink-500);
  flex: none;
}

.q-ic.u-red {
  background: var(--red-100);
  color: var(--red-600);
}

.q-ic.u-amber {
  background: var(--amber-100);
  color: var(--amber-600);
}

.q-ic.u-done {
  background: var(--green-100);
  color: var(--green-600);
}

.q-body {
  flex: 1;
  min-width: 0;
}

.q-text {
  font-size: 13px;
  font-weight: 550;
  line-height: 1.35;
}

.q-due {
  font-size: 11.5px;
  color: var(--ink-400);
  margin-top: 1px;
}

.q-due.u-red {
  color: var(--red-600);
  font-weight: 600;
}

.q-due.u-amber {
  color: var(--amber-600);
  font-weight: 550;
}

.qitem.qdone .q-text {
  color: var(--ink-400);
  font-weight: 450;
  text-decoration: line-through;
  text-decoration-color: var(--line-2);
}

/* Movers / inbound rows */

.mover {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 16px;
  border-top: 1px solid var(--line);
  text-align: left;
  transition: background 110ms var(--ease);
}

.mover:hover {
  background: var(--paper);
}

.mover > div:first-child {
  flex: 1;
  min-width: 0;
}

.mv-nm {
  font-size: 12.5px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mv-sub {
  font-size: 11.5px;
  color: var(--ink-400);
  margin-top: 1px;
}

.mv-val {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* Owner: leaderboard table */

table.lb {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

table.lb th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-400);
  padding: 6px 16px;
  border-bottom: 1px solid var(--line);
}

table.lb th.r,
table.lb td.r {
  text-align: right;
}

table.lb td {
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
}

table.lb tbody tr:last-child > td {
  border-bottom: none;
}

table.lb .strong {
  font-weight: 650;
}

tr.rowlink {
  cursor: pointer;
}

tr.rowlink:hover {
  background: var(--paper);
}

.lb-who {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lb-who .avatar {
  width: 22px;
  height: 22px;
  font-size: 9px;
}

/* Owner: bars */

.bars {
  padding: 4px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.terms-list {
  padding: 2px 16px 8px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
}

.bar-row:hover .bar-lbl {
  color: var(--ink-900);
}

.bar-lbl {
  width: 168px;
  flex: none;
  font-size: 12px;
  color: var(--ink-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 110ms var(--ease);
}

.bar-track {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: var(--surface-2);
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--steel-700);
}

.bar-val {
  width: 58px;
  flex: none;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
}

/* Owner: missed */

.miss {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  text-align: left;
  transition: background 110ms var(--ease);
}

.miss:hover {
  background: var(--paper);
}

.miss-val {
  font-size: 13px;
  font-weight: 650;
  color: var(--red-600);
  white-space: nowrap;
}

.fillbox {
  padding: 6px 16px 14px;
}

.fill-now {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 650;
}

.fill-now .muted {
  font-size: 12px;
  font-weight: 450;
}

/* ------------------------------------------------------------------ */
/* Demand signals                                                      */
/* ------------------------------------------------------------------ */

.sig {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--ink-500);
  border: 1px solid var(--line);
  white-space: nowrap;
  transition: all 120ms var(--ease);
}

button.sig:hover {
  border-color: var(--ink-400);
  color: var(--ink-900);
}

.sig-red {
  background: var(--red-100);
  color: var(--red-600);
  border-color: #f2cfc9;
}

button.sig-red:hover {
  border-color: var(--red-600);
  color: var(--red-600);
}

.sig-amber {
  background: var(--amber-100);
  color: var(--amber-600);
  border-color: #ecd9b8;
}

button.sig-amber:hover {
  border-color: var(--amber-600);
  color: var(--amber-600);
}

.sig-ok {
  background: var(--green-100);
  color: var(--green-600);
  border-color: #cfe8da;
}

/* ------------------------------------------------------------------ */
/* Purchasing                                                          */
/* ------------------------------------------------------------------ */

.sect-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.01em;
  margin: 2px 2px 10px;
}

.rec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.rec-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 16px 12px;
  transition: border-color 130ms var(--ease), box-shadow 130ms var(--ease);
}

.rec-card:hover {
  border-color: var(--line-2);
  box-shadow: var(--shadow-md);
}

.rec-card.rec-hot {
  border-color: #f2cfc9;
  box-shadow: 0 0 0 3px var(--red-100);
}

.rc-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rc-kind {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-400);
}

.rc-when {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--ink-400);
}

.rc-title {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.rc-reason {
  font-size: 12px;
  color: var(--ink-500);
  line-height: 1.45;
}

.rc-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--ink-500);
}

.rc-mini-bar {
  flex: none;
  width: 84px;
  height: 7px;
  border-radius: 4px;
  background: var(--surface-2);
  overflow: hidden;
}

.rc-mini-bar span {
  display: block;
  height: 100%;
  background: var(--ice-500);
  border-radius: 4px;
}

.rc-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--steel-700);
}

/* ------------------------------------------------------------------ */
/* Truck build — the signature moment                                  */
/* ------------------------------------------------------------------ */

.tk-build {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.tk-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tk-lbl {
  width: 52px;
  flex: none;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-400);
}

.tk-slots {
  flex: 1;
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.tk-slot {
  width: 10px;
  height: 22px;
  border-radius: 3px;
  flex: none;
}

.tk-anim .tk-slot:not(.tk-empty) {
  transform: scaleY(0.2);
  opacity: 0;
  transition: transform 240ms var(--ease), opacity 240ms var(--ease);
  transform-origin: bottom;
}

.tk-anim.tk-built .tk-slot:not(.tk-empty) {
  transform: scaleY(1);
  opacity: 1;
}

.tk-slot.tk-empty {
  background: var(--surface);
  border: 1px dashed var(--line-2);
}

.tk-bar {
  flex: 1;
  height: 10px;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}

.tk-fill {
  display: block;
  height: 100%;
  background: var(--ice-500);
  border-radius: 5px;
  transition: width 620ms var(--ease) 240ms;
}

.tk-fill.is-over {
  background: var(--red-600);
}

.tk-val {
  flex: none;
  width: 128px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-500);
}

.tk-val.tk-full {
  color: var(--green-600);
}

.tk-note {
  font-size: 12px;
  color: var(--ink-500);
  padding-left: 64px;
}

/* Rec drawer lines */

.recline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.recline:last-child {
  border-bottom: none;
}

.rl-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  flex: none;
}

.rl-main {
  flex: 1;
  min-width: 0;
}

.rl-nm {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rl-sub {
  font-size: 11.5px;
  color: var(--ink-400);
  margin-top: 1px;
}

.rl-nums {
  flex: none;
  text-align: right;
  font-size: 12.5px;
  font-weight: 600;
}

.rl-post {
  font-size: 11px;
  font-weight: 500;
  color: var(--green-600);
  margin-top: 1px;
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  flex: none;
}

.step-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 26px;
  color: var(--ink-500);
  transition: all 110ms var(--ease);
}

.step-btn:hover {
  background: var(--surface-2);
  color: var(--ink-900);
}

.step-val {
  min-width: 26px;
  text-align: center;
  font-size: 13px;
  font-weight: 650;
}

/* Why box */

.why {
  background: var(--ice-100);
  border: 1px solid #cbe2f0;
  border-radius: var(--r-lg);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.5;
}

.why-hd {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--steel-700);
  margin-bottom: 4px;
}

.why-math {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #cbe2f0;
  font-size: 12px;
  color: var(--steel-700);
  font-weight: 550;
}

.why-late {
  background: var(--red-100);
  border-color: #f2cfc9;
}

.why-late .why-hd {
  color: var(--red-600);
}

/* ------------------------------------------------------------------ */
/* Timeline (PO / shipment)                                            */
/* ------------------------------------------------------------------ */

.timeline {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
}

.tl-step {
  flex: 1;
  position: relative;
  padding: 0 8px 0 0;
}

.tl-step::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 14px;
  right: 2px;
  height: 2px;
  background: var(--line);
}

.tl-step:last-child::before {
  display: none;
}

.tl-step.on::before {
  background: var(--steel-600);
}

.tl-dot {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line-2);
  margin-bottom: 7px;
  position: relative;
  z-index: 1;
}

.tl-step.on .tl-dot {
  background: var(--steel-600);
  border-color: var(--steel-600);
}

.tl-step.now .tl-dot {
  box-shadow: 0 0 0 4px var(--ice-100);
}

.tl-lbl {
  font-size: 12px;
  font-weight: 650;
}

.tl-step:not(.on) .tl-lbl {
  color: var(--ink-400);
  font-weight: 550;
}

.tl-when {
  font-size: 11px;
  color: var(--ink-400);
  margin-top: 1px;
  white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* Drawer                                                              */
/* ------------------------------------------------------------------ */

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(11, 30, 48, 0.32);
  z-index: 80;
  animation: fade-in 160ms var(--ease);
}

@keyframes fade-in {
  from { opacity: 0; }
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 500px;
  max-width: 92vw;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  z-index: 90;
  display: flex;
  flex-direction: column;
  animation: drawer-in 200ms var(--ease);
}

@keyframes drawer-in {
  from { transform: translateX(24px); opacity: 0; }
}

.drawer-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.drawer-head h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.drawer-head .sub {
  font-size: 12px;
  color: var(--ink-500);
  margin-top: 2px;
}

.drawer-head .x {
  margin-left: auto;
  flex: none;
}

.drawer-head .bk {
  flex: none;
  margin-right: 2px;
  transform: rotate(180deg);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
}

.drawer-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  flex: none;
}

.drawer-foot .tag {
  margin-right: auto;
}

.chartbox {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 12px 14px 8px;
  margin-bottom: 16px;
}

.cb-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.cb-price {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.cb-delta {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-500);
}

.cb-range {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--ink-400);
}

/* Legend under the projection chart. */
.cb-legend {
  display: flex;
  gap: 14px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--ink-400);
}

.cb-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.cb-legend .lg {
  width: 12px;
  height: 0;
  border-top-width: 2px;
  border-top-style: solid;
}

.cb-legend .lg-stock { border-top-color: #27995f; }
.cb-legend .lg-floor { border-top-color: var(--red-600); border-top-style: dashed; }
.cb-legend .lg-inb { border-top-color: var(--sky-600); border-top-style: dashed; }

/* Demand / supply variance pills above the projection chart. */
.proj-var {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 2px 0 10px;
}

.proj-var .vp {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: help;
}

.proj-var .vp-l {
  font-size: 10px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-400);
}

.proj-var .vp-v {
  font-size: 13px;
  font-weight: 650;
}

.proj-var .vp.hi .vp-v { color: var(--amber-600); }

/* Explanatory caption tying the variances to the projection. */
.proj-note {
  margin-top: 8px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-400);
}

/* Milestone summary row under the projection chart. */
.proj-miles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.proj-miles .pm {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.proj-miles .pm-l {
  font-size: 10.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-400);
}

.proj-miles .pm-v {
  font-size: 14px;
  font-weight: 650;
}

/* Stat rows carrying a tooltip get a help affordance. */
.spreadbox .row .has-tip {
  text-decoration: underline dotted var(--ink-300, var(--line));
  text-underline-offset: 3px;
  cursor: help;
}

.spreadbox {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 4px 14px;
  margin-bottom: 16px;
}

.spreadbox .row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.spreadbox .row:last-child {
  border-bottom: none;
}

.spreadbox .row > span:first-child {
  color: var(--ink-500);
}

.spreadbox .row.total {
  font-weight: 650;
}

.spreadbox .row.total > span:first-child {
  color: var(--ink-900);
}

.sect {
  margin-bottom: 16px;
}

.sect .hd {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-400);
  margin-bottom: 4px;
}

/* ------------------------------------------------------------------ */
/* Toast                                                               */
/* ------------------------------------------------------------------ */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--steel-950);
  color: #fff;
  font-size: 13.5px;
  font-weight: 550;
  padding: 11px 18px;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  animation: toast-in 240ms var(--ease);
  white-space: nowrap;
}

.toast .ok {
  display: inline-flex;
  color: var(--ice-500);
}

@keyframes toast-in {
  from { transform: translate(-50%, 12px); opacity: 0; }
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 1180px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
  .spark-cell,
  .spark-th {
    display: none;
  }
}

@media (max-width: 1080px) {
  .sb {
    width: 64px;
    padding: 18px 8px 14px;
  }
  .brand > div,
  .nav-item span,
  .nav-badge,
  .sb-sites,
  .sb-foot .who {
    display: none;
  }
  .nav-item {
    justify-content: center;
  }
  .search {
    max-width: 38vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ------------------------------------------------------------------ */
/* Presenter autoguide (Shift+G) — visible only to the presenter       */
/* ------------------------------------------------------------------ */

.gd {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 340px;
  z-index: 210; /* above drawer (90), scrim (80) and toast (200) — always visible */
  background: rgba(11, 30, 48, 0.94);
  color: #eaf1f7;
  border: 1px solid var(--steel-700);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 13px 14px 11px;
  font-family: var(--sans);
  backdrop-filter: blur(6px);
  animation: gd-in 0.18s var(--ease);
}

@keyframes gd-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.gd-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  cursor: move;
  user-select: none;
}
.gd-hd button { cursor: pointer; }

.gd-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--steel-950);
  background: var(--ice-500);
  border-radius: var(--r-sm);
  padding: 2px 6px;
  flex: none;
}

.gd-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  flex: 1;
  line-height: 1.2;
}

.gd-x {
  flex: none;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: #9db6ca;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.gd-x:hover { background: var(--steel-800); color: #fff; }

.gd-mini {
  flex: none;
  height: 22px;
  min-width: 22px;
  padding: 0 5px;
  border: 1px solid var(--steel-700);
  border-radius: var(--r-sm);
  background: transparent;
  color: #9db6ca;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}
.gd-mini:hover { background: var(--steel-800); color: #fff; }

.gd-nar {
  font-size: 13px;
  line-height: 1.5;
  color: #eaf1f7;
}

.gd-note {
  margin-top: 8px;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--ice-500);
  border-left: 2px solid var(--steel-700);
  padding-left: 8px;
}

.gd-ft {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.gd-nav {
  display: flex;
  align-items: center;
  gap: 7px;
}

.gd-btn {
  border: 1px solid var(--steel-700);
  background: var(--steel-800);
  color: #eaf1f7;
  font-size: 11.5px;
  font-weight: 550;
  border-radius: var(--r-sm);
  padding: 4px 9px;
  cursor: pointer;
}
.gd-btn:hover:not(:disabled) { background: var(--steel-700); }
.gd-btn:disabled { opacity: 0.4; cursor: default; }

.gd-count {
  font-size: 11px;
  color: #9db6ca;
  min-width: 26px;
  text-align: center;
}

.gd-cases {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.gd-chip {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  border: 1px solid var(--steel-700);
  background: transparent;
  color: #7d9ab1;
  border-radius: var(--r-sm);
  padding: 2px 4px;
  cursor: pointer;
}
.gd-chip:hover { color: #eaf1f7; }
.gd-chip.on {
  background: var(--steel-700);
  color: #fff;
  border-color: var(--ice-500);
}

.gd-hint {
  margin-top: 9px;
  font-size: 10px;
  color: #6f8ba1;
  letter-spacing: 0.01em;
}

/* Minimized — a compact pill that still steps through beats */
.gd.min {
  width: auto;
  min-width: 210px;
  padding: 9px 11px;
}
.gd.min .gd-hd {
  margin-bottom: 0;
}
.gd.min .gd-title {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gd-mininav {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
}

/* Spotlight — highlight the beat's target, dim everything else via one big shadow */
.gd-spot {
  /* position is set inline by the render hook (only when the target is static),
     so we never clobber a fixed/absolute element like the drawer. */
  z-index: 95; /* above scrim (80) and drawer (90) so the target pops; guide (210) stays on top */
  border-radius: var(--r-md);
  box-shadow: 0 0 0 3px var(--ice-500), 0 0 0 9999px rgba(11, 30, 48, 0.55);
  transition: box-shadow 0.25s var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .gd-spot { transition: none; }
}
