/* Dashboard screen, 1:1 with Stock Pulse Dashboard.dc.html. */

/* ---------- KPI tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 26px; }
.kpi {
  display: flex; flex-direction: column; gap: 10px; min-height: 120px; padding: 16px 20px;
  border: 1px solid var(--border-subtle); border-radius: var(--r-md); background: var(--bg-card); color: inherit;
  transition: border-color var(--dur) var(--ease);
}
.kpi:hover { border-color: var(--border-strong); color: inherit; }
.kpi__head { display: flex; align-items: center; gap: 8px; }
.kpi__label { color: var(--text-secondary); font-size: var(--fs-body); font-weight: 500; }
.kpi__arrow { margin-left: auto; color: var(--text-tertiary); }
.kpi__value { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.kpi__num { font-family: var(--font-mono); font-size: var(--fs-kpi); font-weight: 600; letter-spacing: -0.01em; }
.kpi__unit { color: var(--text-secondary); font-size: var(--fs-body); }
.kpi__sub { margin-top: auto; color: var(--text-tertiary); font-size: var(--fs-caption); }
.kpi__lock { padding: 4px 0; }

/* ---------- Needs attention ---------- */
.attention {
  margin-top: 28px; padding: 16px; border: 1px solid var(--danger-line); border-radius: var(--r-xl); background: var(--danger-soft);
}
.attention__title {
  display: flex; align-items: center; gap: 10px; margin: 0 0 14px 4px;
  font-size: var(--fs-h2); font-weight: 600; letter-spacing: -0.01em;
}
.attention__dot { width: 8px; height: 8px; flex: none; border-radius: var(--r-full); background: var(--danger); box-shadow: 0 0 0 4px var(--danger-glow); }
.attention__count {
  padding: 2px 8px; border-radius: var(--r-full); background: var(--danger-glow); color: var(--danger);
  font-family: var(--font-mono); font-size: var(--fs-micro); font-weight: 600;
}
.attention__list { display: flex; flex-direction: column; gap: 12px; }
.alert {
  display: flex; flex-direction: column; gap: 6px; padding: 16px 20px 16px 21px;
  border: 1px solid var(--border-subtle); border-left: 3px solid var(--st-error); border-radius: var(--r-md); background: var(--bg-card);
}
.alert--out { border-left-color: var(--st-out); }
.alert--order { border-left-color: var(--st-order); }
.alert__head { display: flex; align-items: center; gap: 10px; }
.alert__title { font-size: var(--fs-nav); font-weight: 600; }
.alert__time { margin-left: auto; color: var(--text-tertiary); font-family: var(--font-mono); font-size: var(--fs-micro); white-space: nowrap; }
.alert__body { margin: 0 0 0 22px; max-width: 92ch; color: var(--text-secondary); font-size: var(--fs-meta); line-height: 1.55; text-wrap: pretty; }
.alert__body .hi { color: var(--text-primary); font-family: var(--font-mono); }
.alert__actions { display: flex; align-items: center; gap: 8px; margin: 8px 0 0 22px; flex-wrap: wrap; }
.alert .btn--xs { font-size: var(--fs-meta); }
.alert .btn--xs svg { width: 14px; height: 14px; }
.alert .alert__ghost:hover:not(:disabled) { background: var(--bg-input); }
.assign-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; margin-top: -2px; }

/* ---------- Order now ---------- */
.dash-order { margin-top: 28px; }
.dash-order__head { display: flex; align-items: center; gap: 12px; padding: 16px 24px; flex-wrap: wrap; }
.dash-order__meta { color: var(--text-tertiary); font-size: var(--fs-small); }
.dash-order__all { margin-left: auto; }
.dash-order .btn--xs { font-size: var(--fs-meta); }
.dash-order .tbl th { box-shadow: inset 0 1px 0 var(--border-subtle), inset 0 -1px 0 var(--border-subtle); }
.dash-order .tbl td.dash-muted { color: var(--text-secondary); }
.dash-order .btn.dash-prep { padding: 0 14px; }
.dash-product { display: flex; align-items: center; gap: 12px; }
.dash-product__text { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.dash-product__name { color: var(--text-primary); font-size: var(--fs-nav); font-weight: 450; }
.dash-product__name:hover { color: var(--accent-hover); }
.dash-st { display: flex; align-items: center; gap: 5px; font-size: var(--fs-caption); font-weight: 500; }

/* ---------- Transit + activity ---------- */
.dash-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; margin-top: 16px; }
.dash-card__head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; }
.dash-card__head .count-pill { padding: 2px 8px; font-size: var(--fs-micro); }
.dash-card__link { margin-left: auto; color: var(--text-secondary); font-size: var(--fs-meta); font-weight: 500; }
.dash-card__link:hover { color: var(--text-primary); }
.dash-empty { padding: 12px 0 8px; color: var(--text-tertiary); font-size: var(--fs-body); }

.dash-transit { display: flex; flex-direction: column; }
.dash-transit__rows { display: flex; flex-direction: column; flex: 1; justify-content: space-between; gap: 6px; padding: 4px 20px 16px; }
.dash-po {
  display: flex; flex: 1; flex-direction: column; justify-content: center; gap: 5px; margin: 0 -8px; padding: 12px 8px;
  border-top: 1px solid var(--border-subtle); border-radius: var(--r-sm); color: inherit; cursor: pointer;
}
.dash-po:hover { background: var(--bg-row-hover); color: inherit; }
.dash-po__top, .dash-po__bottom { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dash-po__bottom { gap: 12px; flex-wrap: nowrap; }
.dash-po__num { font-family: var(--font-mono); font-size: var(--fs-meta); font-weight: 500; }
.dash-po__eta { display: flex; align-items: center; gap: 6px; margin-left: auto; color: var(--text-secondary); font-family: var(--font-mono); font-size: var(--fs-small); }
.dash-po__line { color: var(--text-secondary); font-size: var(--fs-meta); }
.dash-po__right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.dash-po__late { color: var(--st-order); font-size: var(--fs-small); font-weight: 500; white-space: nowrap; }
.dash-po__cost { color: var(--text-secondary); font-family: var(--font-mono); font-size: var(--fs-small); white-space: nowrap; }

.dash-activity__list { display: flex; flex-direction: column; gap: 14px; padding: 4px 20px 20px; }
.dash-ev { display: flex; align-items: flex-start; gap: 12px; }
.dash-ev__icon { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: var(--r-full); background: var(--bg-raised); }
.dash-ev__text { display: flex; flex-direction: column; gap: 3px; padding-top: 3px; }
.dash-ev__msg { font-size: var(--fs-body); }
.dash-ev__meta { color: var(--text-tertiary); font-family: var(--font-mono); font-size: var(--fs-micro); }

.dash-retry { display: flex; justify-content: center; margin-top: 16px; }
