/* ============ EvoStock — Suppliers (scoped port of prototype) ============ */
/* Ported from specs/evostock-handoff/evostock/project/Suppliers/styles.css.
   All component rules are scoped under .evostock-suppliers via native CSS
   nesting so they cannot leak into the host Bootstrap 5 app. Full-page chrome
   (reset, html/body, .app, .topbar, .topnav) was intentionally dropped; the
   app supplies its own chrome. @keyframes stay top-level (cannot be nested). */

@keyframes skuPop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px);} to {opacity:1; transform: none;} }
@keyframes drawerIn { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }

.evostock-suppliers {
  /* neutral cool palette */
  --bg:        oklch(0.975 0.004 250);
  --surface:   oklch(1 0 0);
  --surface-2: oklch(0.985 0.004 250);
  --surface-3: oklch(0.965 0.005 250);
  --border:    oklch(0.918 0.006 255);
  --border-strong: oklch(0.86 0.008 255);

  --ink:       oklch(0.27 0.02 262);
  --ink-2:     oklch(0.44 0.02 262);
  --ink-3:     oklch(0.50 0.018 262); /* AA: ~6.0:1 on --surface (headroom above 4.5:1) */
  --ink-4:     oklch(0.54 0.014 262); /* AA: ~5.0:1 on --surface — real margin, not the bare 4.5:1 cutoff (was 0.565 → ~4.5:1, borderline) */

  /* accent (primary action) */
  --accent:    oklch(0.55 0.16 262);
  --accent-ink:oklch(0.42 0.16 262);
  --accent-bg: oklch(0.955 0.03 262);

  /* status semaphore — shared chroma, varied hue */
  --alert:     oklch(0.62 0.18 25);    /* shortage / stockout */
  --alert-bg:  oklch(0.955 0.035 25);
  --warn:      oklch(0.72 0.13 75);    /* overstock / caution */
  --warn-bg:   oklch(0.965 0.045 85);
  --ok:        oklch(0.62 0.12 165);   /* healthy */
  --ok-bg:     oklch(0.96 0.03 165);
  --info:      oklch(0.58 0.13 250);   /* existing orders */
  --info-bg:   oklch(0.96 0.03 250);

  /* chart colors */
  --c-stock:    oklch(0.55 0.11 195);
  --c-proposed: oklch(0.68 0.16 50);
  --c-existing: oklch(0.55 0.1 175);
  --c-shortage: oklch(0.62 0.18 25);
  --c-overstock:oklch(0.6 0.12 250);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px oklch(0.5 0.03 262 / 0.06), 0 1px 3px oklch(0.5 0.03 262 / 0.05);
  --shadow:    0 2px 4px oklch(0.5 0.03 262 / 0.05), 0 6px 16px oklch(0.5 0.03 262 / 0.08);
  --shadow-lg: 0 8px 24px oklch(0.4 0.03 262 / 0.12), 0 2px 6px oklch(0.4 0.03 262 / 0.08);

  --font: "Hanken Grotesk", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  font-family: var(--font);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1, "cv11" 1;

  * { box-sizing: border-box; }

  .mono { font-family: var(--mono); font-feature-settings: "tnum" 1; }
  .tnum { font-variant-numeric: tabular-nums; }

  /* ---- SKU search: icon button reveals a popover switcher ---- */
  .sku-search { position: relative; display: inline-flex; align-self: center; }
  .sku-search-btn {
    appearance: none; cursor: pointer; display: inline-grid; place-items: center;
    width: 26px; height: 26px; border-radius: 7px;
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-3);
    transition: background .14s, color .14s, border-color .14s;
  }
  .sku-search-btn:hover { background: var(--surface-3); color: var(--ink); }
  .sku-search-btn.on { background: var(--accent); border-color: transparent; color: #fff; }

  .sku-search-pop {
    position: absolute; top: calc(100% + 9px); left: 0; z-index: 80;
    width: 268px; padding: 12px; border-radius: 12px;
    background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg, 0 12px 32px -8px oklch(0.2 0.03 262 / 0.28));
    animation: skuPop .12s ease-out;
  }
  .sku-search-pop .lbl {
    font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--ink-4); margin-bottom: 8px;
  }
  .sku-search-pop .box {
    display: flex; align-items: center; gap: 7px;
    background: var(--surface); border: 1px solid var(--border-strong);
    border-radius: 9px; padding: 5px 6px 5px 10px; transition: border-color .14s, box-shadow .14s;
  }
  .sku-search-pop .box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
  .sku-search-pop .box svg { color: var(--ink-4); flex: none; }
  .sku-search-pop input {
    appearance: none; border: 0; background: transparent; outline: none; min-width: 0; flex: 1;
    font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
    color: var(--ink); padding: 1px 0;
  }
  .sku-search-pop input::placeholder { color: var(--ink-4); font-weight: 500; }
  .sku-search-pop .go {
    appearance: none; cursor: pointer; border: 0; border-radius: 7px; flex: none;
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    background: var(--accent); color: #fff; font-family: var(--font); font-size: 12px; font-weight: 700;
    padding: 5px 10px; transition: filter .14s, opacity .14s;
  }
  .sku-search-pop .go:hover { filter: brightness(1.08); }
  .sku-search-pop .go:disabled { opacity: 0.45; cursor: default; filter: none; }
  .sku-search-pop .hint { font-size: 11.5px; color: var(--ink-4); margin-top: 8px; line-height: 1.4; }

  /* segmented control for layout switch */
  .seg {
    display: inline-flex; background: oklch(0.34 0.02 262);
    border-radius: 10px; padding: 3px; gap: 2px;
  }
  .seg.light { background: var(--surface-3); border: 1px solid var(--border); }
  .seg button {
    appearance: none; border: 0; background: transparent;
    color: oklch(0.8 0.02 262); font-family: var(--font); font-weight: 600;
    font-size: 12.5px; padding: 7px 13px; border-radius: 8px; cursor: pointer;
    display: flex; align-items: center; gap: 7px; transition: all .15s;
    white-space: nowrap;
  }
  .seg.light button { color: var(--ink-3); }
  .seg button .num {
    font-size: 10px; width: 16px; height: 16px; border-radius: 5px;
    display: grid; place-items: center; background: oklch(0.42 0.02 262);
    color: oklch(0.85 0.02 262);
  }
  .seg button[aria-pressed="true"] {
    background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm);
  }
  .seg button[aria-pressed="true"] .num { background: var(--accent); color: #fff; }
  .seg button:not([aria-pressed="true"]):hover { color: oklch(0.95 0.01 262); }
  .seg.light button:not([aria-pressed="true"]):hover { color: var(--ink); }

  /* scroll stage holds each variation */
  .sup-stage { position: relative; display: flex; flex-direction: column; gap: 16px; }

  /* ---- detail layout: main content + persistent selected-line drawer ---- */
  .sup-detail-row { display: flex; align-items: flex-start; gap: 16px; }
  .sup-detail-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

  .drawer {
    flex: none; width: 366px; align-self: flex-start;
    position: sticky; top: var(--sup-drawer-top, 76px); max-height: calc(100vh - var(--sup-drawer-top, 76px) - 16px); overflow-y: auto;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex; flex-direction: column;
    animation: drawerIn .2s cubic-bezier(.2,.7,.3,1);
  }
  .drawer-head {
    position: sticky; top: 0; z-index: 2; background: var(--surface);
    display: flex; align-items: center; gap: 10px;
    padding: 14px 14px 13px 16px; border-bottom: 1px solid var(--border);
  }
  .drawer-body { padding: 14px 16px 28px; display: flex; flex-direction: column; gap: 18px; }
  .dp-link { color: inherit; text-decoration: none; border-bottom: 1px dashed var(--border); transition: color .12s, border-color .12s; }
  .dp-link:hover { color: var(--info); border-bottom-color: var(--info); }
  .dp-sec { display: flex; flex-direction: column; gap: 10px; }
  .dp-sec:not(:last-child) { padding-bottom: 18px; border-bottom: 1px solid var(--border); }
  .dp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }

  /* drawer stacks below content on narrow viewports */
  @media (max-width: 1080px) {
    .sup-detail-row { flex-direction: column; }
    .drawer { width: auto; align-self: stretch; position: static; max-height: none; }
  }

  /* ---- generic surfaces ---- */
  .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
  }
  .card-pad { padding: 18px 20px; }

  .eyebrow {
    font-size: 11px; font-weight: 700; letter-spacing: 0.07em;
    text-transform: uppercase; color: var(--ink-4);
  }
  .section-title { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }

  /* ---- buttons ---- */
  .btn {
    appearance: none; font-family: var(--font); font-weight: 600; font-size: 13px;
    border-radius: 9px; padding: 9px 15px; cursor: pointer; border: 1px solid var(--border-strong);
    background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; gap: 7px;
    transition: all .14s; white-space: nowrap;
  }
  .btn:hover { background: var(--surface-3); }
  .btn.primary { background: var(--accent); color: #fff; border-color: transparent; box-shadow: var(--shadow-sm); }
  .btn.primary:hover { filter: brightness(1.06); }
  .btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
  .btn.ghost:hover { background: var(--surface-3); }
  .btn.sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
  .btn.danger { background: var(--alert); color: #fff; border-color: transparent; }

  /* ---- status badge ---- */
  .badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11.5px; font-weight: 700; letter-spacing: 0.01em;
    padding: 4px 10px; border-radius: 999px; white-space: nowrap;
  }
  .badge .led { width: 7px; height: 7px; border-radius: 999px; }
  .badge.alert { background: var(--alert-bg); color: oklch(0.46 0.16 25); }
  .badge.alert .led { background: var(--alert); }
  .badge.warn  { background: var(--warn-bg); color: oklch(0.5 0.12 70); }
  .badge.warn .led { background: var(--warn); }
  .badge.ok    { background: var(--ok-bg); color: oklch(0.42 0.1 165); }
  .badge.ok .led { background: var(--ok); }
  .badge.info  { background: var(--info-bg); color: oklch(0.44 0.12 250); }
  .badge.info .led { background: var(--info); }
  .badge.neutral { background: var(--surface-3); color: var(--ink-2); }
  .badge.neutral .led { background: var(--ink-4); }

  /* ---- field cards ---- */
  .field-grid { display: grid; gap: 1px; background: var(--border); border-radius: var(--radius-sm); overflow: hidden; }
  .field {
    background: var(--surface); padding: 10px 13px; display: flex; flex-direction: column; gap: 3px;
  }
  .field .k { font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-4); display:flex; align-items:center; gap:5px; }
  .field .v { font-size: 14px; font-weight: 600; color: var(--ink); }
  .field .v.mono { font-size: 13px; }

  /* tooltip-able acronym */
  .term { border-bottom: 1px dotted var(--ink-4); cursor: help; }

  /* ---- toggle ---- */
  .toggle {
    --w: 38px; --h: 22px;
    width: var(--w); height: var(--h); border-radius: 999px; border: 0; padding: 0;
    background: var(--border-strong); position: relative; cursor: pointer; transition: background .16s; flex: none;
  }
  .toggle::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
    border-radius: 999px; background: #fff; box-shadow: var(--shadow-sm); transition: transform .16s;
  }
  .toggle[aria-pressed="true"] { background: var(--ok); }
  .toggle[aria-pressed="true"]::after { transform: translateX(16px); }
  .toggle.sm { --w: 32px; --h: 18px; }
  .toggle.sm::after { width: 12px; height: 12px; }
  .toggle.sm[aria-pressed="true"]::after { transform: translateX(14px); }

  /* ---- input ---- */
  .input {
    font-family: var(--font); font-size: 13px; color: var(--ink); font-weight: 600;
    border: 1px solid var(--border-strong); border-radius: 8px; padding: 7px 10px; background: var(--surface);
    transition: border-color .14s, box-shadow .14s; width: 100%;
  }
  .input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
  .input.mono { font-family: var(--mono); }
  .input.num { text-align: right; }
  .input.edited { border-color: var(--c-proposed); box-shadow: 0 0 0 3px oklch(0.68 0.16 50 / 0.16); }

  /* small chips for plan parameters */
  .chip {
    display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600;
    padding: 4px 10px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2);
    border: 1px solid var(--border); white-space: nowrap;
  }
  .chip b { color: var(--ink); font-weight: 700; }

  /* ---- tooltip bubble ---- */
  .tip {
    position: fixed; z-index: 200; max-width: 260px; pointer-events: none;
    background: oklch(0.24 0.02 262); color: oklch(0.96 0.01 262);
    font-size: 12px; line-height: 1.45; padding: 9px 11px; border-radius: 9px;
    box-shadow: var(--shadow-lg); transform: translate(-50%, -100%);
  }
  .tip .tip-k { font-weight: 700; color: #fff; }
  .tip::after {
    content:""; position:absolute; left:50%; bottom:-5px; transform: translateX(-50%);
    border:5px solid transparent; border-top-color: oklch(0.24 0.02 262);
  }

  /* table */
  .po-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
  .po-table th {
    text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--ink-4); padding: 9px 12px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface);
  }
  .po-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
  .po-table tr.disabled { opacity: 0.45; }
  .po-table tr:hover td { background: var(--surface-2); }
  .po-row-flag { width: 3px; padding: 0 !important; }

  .date-stack { display: flex; flex-direction: column; gap: 1px; line-height: 1.3; }
  .date-stack .d-main { font-weight: 600; font-family: var(--mono); font-size: 12px; }
  .d-sub { font-size: 10.5px; color: var(--ink-4); }
  .d-sub.sug { color: var(--c-proposed); font-weight: 600; }

  /* native date input, sized compact + monospace to match the date language */
  .input.dt { font-family: var(--mono); font-size: 12px; padding: 6px 8px; width: auto; min-width: 138px; }
  .input.dt::-webkit-calendar-picker-indicator { opacity: 0.5; cursor: pointer; }
  .input.dt:disabled { background: var(--surface-3); color: var(--ink-3); cursor: not-allowed; }

  /* rich read-only orders data table */
  .po-data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
  .po-data th {
    text-align: left; font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
    color: var(--ink-4); padding: 9px 13px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2);
  }
  .po-data td { padding: 11px 13px; border-bottom: 1px solid var(--border); vertical-align: top; white-space: nowrap; }
  .po-data tbody tr { cursor: pointer; }
  .po-data tbody tr:hover td { background: var(--surface-2); }
  .po-data tbody tr.disabled { opacity: 0.45; }
  .po-data tbody tr.sel td { background: var(--accent-bg); }
  .po-data tbody tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
  .dlabel { font-size: 9.5px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ink-4); }

  /* divider */
  .hr { height: 1px; background: var(--border); border: 0; margin: 0; }

  /* scrollbars */
  .sup-stage::-webkit-scrollbar, .scroll-y::-webkit-scrollbar { width: 11px; height: 11px; }
  .sup-stage::-webkit-scrollbar-thumb, .scroll-y::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 3px solid var(--bg); }
  .scroll-y { overflow-y: auto; }

  /* link-ish */
  .lnk { color: var(--accent-ink); font-weight: 600; text-decoration: none; cursor: pointer; }
  .lnk:hover { text-decoration: underline; }

  /* fade-in for variation swap */
  .variation { opacity: 1; }

  /* ============ Supplier view — lens additions ============ */

  /* lens switcher (light segmented) reuses .seg.light */

  /* ---- status filter chips ---- */
  .fchip {
    display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
    font-size: 11.5px; font-weight: 600; padding: 5px 11px; border-radius: 999px;
    background: var(--surface); color: var(--ink-2); border: 1px solid var(--border);
    transition: all .14s; white-space: nowrap;
  }
  .fchip:hover { background: var(--surface-3); }
  .fchip .led { width: 8px; height: 8px; border-radius: 999px; }
  .fchip .cnt { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--ink-3); }
  .fchip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-bg); color: var(--accent-ink); }
  .fchip[aria-pressed="true"] .cnt { color: var(--accent-ink); }
  .fchip.on-soft { border-color: var(--ok); background: var(--ok-bg); color: oklch(0.42 0.1 165); }
  .fchip.on-soft .cnt { color: oklch(0.42 0.1 165); }
  .fchip[role="checkbox"] .led { transition: background .14s; }
  .fchip.off { opacity: 0.5; text-decoration: line-through; text-decoration-color: var(--ink-4); }
  .fchip.off:hover { opacity: 0.75; }

  /* ---- Gantt ---- */
  .gantt { position: relative; }
  .g-row { display: grid; grid-template-columns: 188px 1fr; align-items: stretch; }
  .g-head { height: 30px; }
  .g-head .g-plot { border-bottom: 1px solid var(--border); }
  .g-body { height: 38px; cursor: pointer; transition: background .12s; }
  .g-body:hover { background: var(--surface-2); }
  .g-body.sel { background: var(--accent-bg); }
  .g-body.sel .g-label { box-shadow: inset 3px 0 0 var(--accent); }
  .g-label {
    padding: 0 12px; display: flex; align-items: center; gap: 9px; min-width: 0;
    border-bottom: 1px solid var(--border);
  }
  .g-plot { position: relative; height: 100%; }
  .g-overlay { position: absolute; pointer-events: none; z-index: 0; }
  .g-monthline { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border); }
  .g-monthlabel { position: absolute; top: 8px; font-size: 10px; font-weight: 600; color: var(--ink-4); transform: translateX(3px); white-space: nowrap; }
  .g-today { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed var(--alert); opacity: 0.6; z-index: 3; }
  .g-todaylabel { position: absolute; font-size: 9px; font-weight: 800; letter-spacing: 0.04em; color: var(--alert); text-transform: uppercase; transform: translateX(4px); }
  .g-seg { position: absolute; top: 50%; transform: translateY(-50%); border-radius: 3px; z-index: 1; }
  .g-seg.prod { height: 9px; }
  .g-seg.gap  { height: 3px; background-image: repeating-linear-gradient(90deg, var(--ink-4) 0 2px, transparent 2px 5px); opacity: 0.6; }
  .g-seg.transit { height: 9px; }
  .g-dot { position: absolute; top: 50%; width: 9px; height: 9px; border-radius: 999px; background: var(--surface); border: 2px solid var(--ink-3); transform: translate(-50%, -50%); z-index: 2; }
  .g-cap { position: absolute; top: 50%; transform: translate(-50%, -50%); z-index: 2; display: grid; place-items: center; }
  .g-qty { position: absolute; top: 50%; transform: translate(6px, -50%); font-family: var(--mono); font-size: 10.5px; font-weight: 800; white-space: nowrap; z-index: 2; }
  .g-reqtick { position: absolute; top: 50%; width: 0; height: 16px; border-left: 1.5px dotted var(--alert); transform: translate(-50%, -50%); z-index: 2; opacity: 0.75; }

  /* ---- per-container loading stack (scales with container count) ---- */
  .cstack { display: flex; flex-direction: column; gap: 6px; }
  .crow { display: grid; grid-template-columns: 110px 1fr 104px 42px; align-items: center; gap: 11px; }
  .crow-c { font-family: var(--mono); font-size: 11px; font-weight: 800; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cbar2 { position: relative; height: 24px; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--border); overflow: hidden; display: flex; }
  .cseg2 { height: 100%; display: flex; align-items: center; min-width: 0; box-shadow: inset -1.5px 0 0 var(--surface); }
  .cseg2:last-child { box-shadow: none; }
  .cseg2-lbl { font-family: var(--mono); font-size: 9px; font-weight: 800; color: oklch(1 0 0 / 0.92); padding-left: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .crow-meta { font-family: var(--mono); font-size: 11px; color: var(--ink-2); text-align: right; white-space: nowrap; }
  .crow-meta b { font-weight: 700; }
  .crow-meta .u { color: var(--ink-4); }
  .crow-pct { font-family: var(--mono); font-size: 12.5px; font-weight: 800; text-align: right; }

  /* ---- cashflow bars ---- */
  .cashflow { display: flex; align-items: flex-end; gap: 10px; height: 168px; }
  .cf-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
  .cf-stack { width: 100%; max-width: 54px; display: flex; flex-direction: column-reverse; border-radius: 5px 5px 0 0; overflow: hidden; }
  .cf-seg { width: 100%; }
  .cf-x { font-size: 10px; font-weight: 600; color: var(--ink-4); white-space: nowrap; }
  .cf-x.now { color: var(--alert); font-weight: 800; }
  .cf-val { font-family: var(--mono); font-size: 10.5px; font-weight: 700; color: var(--ink-2); }

  /* swatch dot for sku legends */
  .swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }

  /* ============ Suppliers list + Dashboard ============ */

  .wrap { max-width: 1320px; margin: 0 auto; padding: 24px 24px 64px; display: flex; flex-direction: column; gap: 18px; }

  .page-title { font-size: 26px; font-weight: 800; letter-spacing: -0.025em; margin: 0; color: var(--ink); }
  .page-sub { font-size: 13px; color: var(--ink-3); margin: 5px 0 0; max-width: 620px; line-height: 1.5; }

  /* search */
  .search-box {
    display: flex; align-items: center; gap: 8px; background: var(--surface);
    border: 1px solid var(--border-strong); border-radius: 10px; padding: 8px 12px; min-width: 300px;
    transition: border-color .14s, box-shadow .14s;
  }
  .search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
  .search-box svg { color: var(--ink-4); flex: none; }
  .search-box input { appearance: none; border: 0; background: transparent; outline: none; flex: 1; min-width: 0;
    font-family: var(--font); font-size: 13px; font-weight: 500; color: var(--ink); }
  .search-box input::placeholder { color: var(--ink-4); }
  .search-box .clr { appearance: none; border: 0; background: var(--surface-3); color: var(--ink-3); cursor: pointer;
    width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; flex: none; }
  .search-box .clr:hover { background: var(--border-strong); color: var(--ink); }

  /* KPI filter pills (list) */
  .kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); grid-auto-rows: 1fr; gap: 10px; }
  .kpi-pill {
    appearance: none; cursor: pointer; text-align: left; font-family: var(--font);
    display: flex; align-items: center; gap: 11px; padding: 13px 15px; height: 100%;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); transition: border-color .14s, box-shadow .14s, transform .12s;
  }
  .kpi-pill:hover { border-color: var(--border-strong); transform: translateY(-1px); }
  .kpi-pill.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg), var(--shadow-sm); }
  .kpi-ic { width: 34px; height: 34px; flex: none; border-radius: 9px; display: grid; place-items: center;
    background: var(--accent-bg); color: var(--accent-ink); }
  .kpi-pill.alert .kpi-ic { background: var(--alert-bg); color: oklch(0.5 0.16 25); }
  .kpi-pill.warn  .kpi-ic { background: var(--warn-bg);  color: oklch(0.52 0.12 70); }
  .kpi-pill.on .kpi-ic { background: var(--accent); color: #fff; }
  .kpi-pill.alert.on { border-color: var(--alert); box-shadow: 0 0 0 3px var(--alert-bg), var(--shadow-sm); }
  .kpi-pill.alert.on .kpi-ic { background: var(--alert); color: #fff; }
  .kpi-pill.warn.on { border-color: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg), var(--shadow-sm); }
  .kpi-pill.warn.on .kpi-ic { background: var(--warn); color: #fff; }
  .kpi-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .kpi-lbl { font-size: 11.5px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
  .kpi-num { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); line-height: 1; }
  .kpi-sub { font-size: 10.5px; font-weight: 600; color: var(--ink-4); letter-spacing: 0; white-space: nowrap; }

  /* list head */
  .list-head { padding: 13px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }

  /* suppliers table */
  .sup-table-wrap { overflow-x: auto; }
  .sup-table { width: 100%; border-collapse: collapse; font-size: 13px; }
  .sup-table th {
    text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--ink-4); padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2);
    position: sticky; top: 0; z-index: 1;
  }
  .sup-table td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
  .sup-table tbody tr { cursor: pointer; transition: background .12s; }
  .sup-table tbody tr:hover td { background: var(--accent-bg); }
  .sup-table tbody tr:last-child td { border-bottom: 0; }

  .pref-star { width: 22px; height: 22px; border-radius: 7px; flex: none; display: grid; place-items: center;
    background: var(--warn-bg); color: oklch(0.55 0.13 70); }
  .late-pill { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px;
    border-radius: 999px; background: var(--alert-bg); color: oklch(0.48 0.16 25); font-weight: 700; font-size: 12px; }

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

  /* ---- dashboard ---- */
  .dash-section-title { font-size: 13px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink-2); margin: 4px 0 2px; }

  .kpi-grid { display: grid; gap: 12px; }
  .kpi-card {
    position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); padding: 16px 17px; display: flex; flex-direction: column; gap: 8px; overflow: hidden;
  }
  .kpi-card .kc-top { display: flex; align-items: center; gap: 9px; }
  .kpi-card .kc-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
  .kpi-card .kc-lbl { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
  .kpi-card .kc-val { font-size: 30px; font-weight: 800; letter-spacing: -0.025em; line-height: 1; color: var(--ink); }
  .kpi-card .kc-sub { font-size: 11.5px; color: var(--ink-3); font-weight: 500; }
  .kpi-card.accent-line::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
  .kpi-card.t-alert::after { background: var(--alert); } .kpi-card.t-alert .kc-ic { background: var(--alert-bg); color: oklch(0.5 0.16 25); }
  .kpi-card.t-warn::after  { background: var(--warn); }  .kpi-card.t-warn .kc-ic  { background: var(--warn-bg); color: oklch(0.52 0.12 70); }
  .kpi-card.t-ok::after    { background: var(--ok); }    .kpi-card.t-ok .kc-ic    { background: var(--ok-bg); color: oklch(0.42 0.1 165); }
  .kpi-card.t-info::after  { background: var(--info); }  .kpi-card.t-info .kc-ic  { background: var(--info-bg); color: oklch(0.44 0.12 250); }
  .kpi-card.t-accent::after{ background: var(--accent); }.kpi-card.t-accent .kc-ic{ background: var(--accent-bg); color: var(--accent-ink); }

  .panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
  .panel-head { padding: 15px 18px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .panel-title { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
  .panel-pill { font-size: 10.5px; font-weight: 700; color: var(--ink-3); background: var(--surface-3); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; }

  /* donut legend rows */
  .leg-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .leg-row:last-child { border-bottom: 0; }
  .leg-row .lk { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
  .leg-row .lc { width: 9px; height: 9px; border-radius: 999px; flex: none; }
  .leg-row .ln { font-family: var(--mono); font-weight: 700; font-size: 13px; }
  .leg-row .lv { font-family: var(--mono); font-size: 12px; color: var(--ink-3); min-width: 64px; text-align: right; }

  /* top suppliers bar list */
  .tsup { display: flex; flex-direction: column; gap: 2px; }
  .tsup-row { display: grid; grid-template-columns: 150px 1fr 78px; align-items: center; gap: 12px; padding: 7px 0; cursor: pointer; border-radius: 8px; }
  .tsup-row:hover { background: var(--surface-2); }
  .tsup-name { display: flex; align-items: center; gap: 7px; min-width: 0; }
  .tsup-name .c { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--accent-ink); }
  .tsup-name .n { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tsup-bar { height: 14px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
  .tsup-bar > div { height: 100%; border-radius: 4px; }
  .tsup-val { font-family: var(--mono); font-size: 12.5px; font-weight: 700; text-align: right; }

  .trend-leg { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
  .trend-leg .d { width: 12px; height: 3px; border-radius: 2px; flex: none; }
}
