:root {
  --bg: #f6f1e9;
  --bg-2: #efe7da;
  --panel: #fffdf9;
  --panel-2: #faf5ec;
  --ink: #221a14;
  --ink-2: #4a3c30;
  --muted: #8a7a6b;
  --line: #e6dccd;
  --line-soft: #efe7da;
  --coffee: #5b3a29;
  --coffee-2: #7d5138;
  --espresso: #2b1d15;
  --cream: #f3e9d8;
  --gold: #b98341;
  --gold-soft: #e2c79a;
  --green: #4c7a5a;
  --green-soft: #dfe9de;
  --amber: #c8873b;
  --amber-soft: #f6e6cb;
  --red: #b4543f;
  --red-soft: #f5ddd6;
  --progress: #3d7ea6;      /* in-progress bar — distinct from source colours */
  --teal: #2f8577;          /* completed / packed */
  --teal-soft: #d9ece8;
  /* Source colours — Shopify green, Ordermentum blue (per §7.3) */
  --shopify: #2f7d4a;
  --shopify-soft: #e6f3e9;
  --shopify-bg: #f1f8f3;      /* faint card tint */
  --ordermentum: #2f6fbf;
  --ordermentum-soft: #e3edf8;
  --ordermentum-bg: #eff4fb;   /* faint card tint */
  /* Manual (RDS-created) orders — orange */
  --manual: #c9761d;
  --manual-soft: #fbe9d2;
  --manual-bg: #fdf3e4;
  --shadow-sm: 0 1px 2px rgba(43, 29, 21, 0.05), 0 1px 1px rgba(43, 29, 21, 0.03);
  --shadow-md: 0 8px 24px -12px rgba(43, 29, 21, 0.22), 0 2px 6px -2px rgba(43, 29, 21, 0.06);
  --shadow-lg: 0 24px 60px -20px rgba(43, 29, 21, 0.35);
  --radius: 16px;
  --radius-sm: 11px;
  --font: "Inter", -apple-system, "SF Pro Text", "Helvetica Neue", sans-serif;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
}

/* ---------------- Dark theme ---------------- */
[data-theme="dark"] {
  --bg: #16120e;
  --bg-2: #1d1813;
  --panel: #23201b;
  --panel-2: #2a251f;
  --ink: #f3ece1;
  --ink-2: #c9bbaa;
  --muted: #8f8170;
  --line: #3a332b;
  --line-soft: #2f2922;
  --coffee: #8a6244;
  --coffee-2: #a97a56;
  --espresso: #0f0c09;
  --cream: #f3ece1;
  --gold: #cf9d5c;
  --gold-soft: #4a3823;
  --green: #6fb98a;
  --green-soft: #22322a;
  --amber: #d9a154;
  --amber-soft: #3a2d18;
  --red: #d97560;
  --red-soft: #3b2320;
  --progress: #5fa8d3;
  --teal: #6ec4b4;
  --teal-soft: #1e3532;
  --shopify: #4aa06a;
  --shopify-soft: #1e3127;
  --shopify-bg: #1c2621;
  --ordermentum: #5a93d6;
  --ordermentum-soft: #1c2a3a;
  --ordermentum-bg: #1d2431;
  --manual: #e0902f;
  --manual-soft: #3a2a15;
  --manual-bg: #2a2013;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 8px 24px -12px rgba(0,0,0,.6), 0 2px 6px -2px rgba(0,0,0,.4);
  --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.7);
}
[data-theme="dark"] body {
  background:
    radial-gradient(1100px 600px at 85% -10%, #221c15 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 110%, #1c1710 0%, transparent 55%),
    var(--bg);
}
[data-theme="dark"] .t-toggle:hover { background: #2a251f; }
[data-theme="dark"] .modal-close:hover { background: var(--panel-2); }
[data-theme="dark"] .warn-banner { border-color: #5a421f; color: #e8c48a; }
[data-theme="dark"] .link-btn { color: #e8c48a; }
[data-theme="dark"] .tag.origin { color: #e8c48a; }

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Always reserve the vertical scrollbar gutter so page width — and thus the
   centred .main — never shifts between tabs (Orders is taller and scrolls,
   Tally/Completed may not). */
html, body { height: 100%; }
html { scrollbar-gutter: stable; }

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 85% -10%, #fbf6ec 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 110%, #eee3d1 0%, transparent 55%),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv02", "cv03", "cv04";
}

button { font-family: var(--font); cursor: pointer; border: none; background: none; }

/* ---------------- App shell ---------------- */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main {
  padding: 26px 40px 60px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

/* ---------------- Topbar (brand + tabs + actions, card) ---------------- */
.topbar {
  display: flex; align-items: center; gap: 20px;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 12px 18px;
  margin-bottom: 22px;
}

.brand { display: flex; align-items: center; gap: 11px; flex: none; }
.brand-mark {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 12px; height: 38px;
  background: var(--coffee); color: #fff;
  border-radius: 10px;
  font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: .02em;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
  flex: none; white-space: nowrap;
}
.brand-bean { display: block; flex: none; }

.nav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; }
.nav::-webkit-scrollbar { display: none; }

.tab-btn {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 13px; border-radius: 10px;
  color: var(--ink-2);
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.tab-btn svg { flex: none; opacity: .8; }
.tab-btn:hover { background: var(--panel-2); color: var(--ink); }
.tab-btn.active { background: var(--gold-soft); color: var(--coffee); font-weight: 600; }
.tab-btn.active svg { opacity: 1; }
.tab-btn.active::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: -1px;
  height: 2px; border-radius: 2px; background: var(--coffee);
}
[data-theme="dark"] .tab-btn.active { background: rgba(207,157,92,.16); color: var(--gold); }
[data-theme="dark"] .tab-btn.active::after { background: var(--gold); }
.nav-count {
  font-size: 11px; font-weight: 600;
  background: rgba(0,0,0,.08); color: inherit;
  border-radius: 999px; padding: 1px 7px; min-width: 20px; text-align: center;
}
[data-theme="dark"] .nav-count { background: rgba(255,255,255,.12); }
.tab-btn.active .nav-count { background: rgba(91,58,41,.16); color: var(--coffee); }
[data-theme="dark"] .tab-btn.active .nav-count { background: rgba(207,157,92,.22); color: var(--gold); }
.nav-count.warn { background: var(--amber); color: #221a14; }

/* ---------------- Topbar actions ---------------- */
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: none; margin-left: auto; }

.seg { padding: 8px 13px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; background: var(--panel); transition: all .15s ease; }
.seg:hover { border-color: var(--coffee-2); }
.seg.active { background: var(--ink); color: var(--cream); border-color: var(--ink); }
[data-theme="dark"] .seg.active { background: var(--cream); color: var(--espresso); border-color: var(--cream); }

.btn { padding: 9px 15px; font-size: 13px; font-weight: 600; border-radius: 11px; transition: all .15s ease; }
.btn-primary { background: var(--coffee); color: #fff; }
.btn-primary:hover { background: var(--coffee-2); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary { display: inline-flex; align-items: center; gap: 6px; background: var(--panel); color: var(--ink-2); border: 1px solid var(--line); }
.btn-secondary:hover { border-color: var(--coffee-2); color: var(--ink); background: var(--panel-2); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
#labels-btn { display: inline-flex; align-items: center; gap: 8px; }
#labels-btn .btn-logo { height: 18px; width: 18px; display: block; flex: none; background: #fff; border-radius: 5px; padding: 2px; box-sizing: border-box; }

.theme-btn {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink-2);
  transition: all .15s ease;
}
.theme-btn:hover { border-color: var(--coffee-2); color: var(--ink); }
.theme-btn .ico-sun { display: none; }
[data-theme="dark"] .theme-btn .ico-moon { display: none; }
[data-theme="dark"] .theme-btn .ico-sun { display: block; }

/* ---------------- Banner ---------------- */
.banner { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 22px; font-size: 13.5px; }
.banner[hidden] { display: none; }
.warn-banner { background: var(--amber-soft); border: 1px solid #ecd6ab; color: #6d4a1b; }
.warn-banner svg { flex: none; color: var(--amber); }
.warn-banner span { flex: 1; }
.link-btn { color: #6d4a1b; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; font-size: 13px; }

/* ---------------- Panel ---------------- */
.card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.panel { padding: 22px; }
.panel-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
/* when a header ends with an action button, align items and push the button right */
.panel-head .btn { margin-left: auto; align-self: center; }
/* button-only header (e.g. Completed tab): keep the action on the left */
.panel-head-btn-only .btn { margin-left: 0; align-self: auto; }
.panel-head h2 { font-family: var(--serif); font-weight: 500; font-size: 19px; }
.panel-head p { color: var(--muted); font-size: 12.5px; }

/* ---------------- Product list (list-style tally) ---------------- */
.product-list { display: flex; flex-direction: column; gap: 8px; min-width: 0; overflow-x: auto; }
.plist-row {
  display: grid;
  grid-template-columns: 30px minmax(160px, 1fr) 92px 92px 96px 152px 152px;
  align-items: center; gap: 14px;
  padding: 12px 16px; border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  background: var(--panel-2); transition: all .15s ease;
}
.plist-row[data-product] { cursor: pointer; }
.plist-row[data-product]:hover { border-color: var(--line); background: var(--panel); box-shadow: var(--shadow-sm); }
.plist-row[data-product]:focus-visible { outline: 2px solid var(--coffee-2); outline-offset: 2px; }
.plist-head { background: transparent; border-color: transparent; padding: 4px 16px 8px; cursor: default; }
/* sortable column headers */
.plist-sort {
  display: inline-flex; align-items: center; gap: 4px; padding: 0; border: none; background: none;
  font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); cursor: pointer; white-space: nowrap; transition: color .15s ease;
}
.plist-main .plist-sort { justify-content: flex-start; }
.plist-size .plist-sort, .plist-bags .plist-sort, .plist-kg .plist-sort { justify-content: flex-end; }
.plist-sort:hover { color: var(--ink); }
.plist-sort:focus-visible { outline: 2px solid var(--coffee-2); outline-offset: 3px; border-radius: 5px; }
.plist-sort.is-active { color: var(--ink); }
.plist-sort-ind { font-size: 8px; line-height: 1; }
.plist-tag {
  width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  font-size: 10px; font-weight: 700; letter-spacing: .02em;
}
.plist-tag.blend { background: var(--coffee); color: #fff; }
.plist-tag.origin { background: var(--gold-soft); color: #6d4a1b; }
.plist-head .plist-tag { visibility: hidden; }
.plist-main { min-width: 0; }
.plist-name { font-size: 14.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* boxed container around each column's cards (data rows only) */
.plist-row:not(.plist-head) .plist-size,
.plist-row:not(.plist-head) .plist-bags,
.plist-row:not(.plist-head) .plist-kg,
.plist-row:not(.plist-head) .plist-orders-total {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2px;
}
/* per-size columns: orders card + kilos card */
.plist-size { display: flex; gap: 4px; justify-content: flex-end; align-items: center; min-width: 0; }
.plist-size .plist-size-card { min-width: 32px; flex: none; background: var(--panel-2); border: 1px solid var(--line-soft); }
.plist-size .plist-size-orders { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.plist-size .plist-size-kg { font-family: var(--serif); font-size: 15px; font-weight: 600; }
.plist-size.is-empty .plist-bag-n { color: var(--muted); opacity: .45; font-weight: 500; }
.plist-250 .plist-size-orders { color: #6d4a1b; }
.plist-1k .plist-size-orders { color: var(--coffee); }
[data-theme="dark"] .plist-250 .plist-size-orders { color: #b07b3d; }
[data-theme="dark"] .plist-1k .plist-size-orders { color: #d8b48a; }
.plist-head .plist-size { text-align: right; align-items: center; }
/* compact total-orders cell: only used on the narrowest layout */
.plist-orders-total { display: none; justify-content: flex-end; }
.plist-orders-total .plist-bag { min-width: 0; }
/* per-source order counts */
.plist-sources { display: flex; gap: 8px; justify-content: flex-end; align-items: center; min-width: 0; }
.plist-src { display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; }
.plist-src img { height: 15px; width: auto; max-width: 18px; object-fit: contain; display: block; flex: none; }
.plist-src .plist-src-n { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.plist-src.is-empty { opacity: .3; }
.plist-src-head { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.plist-head .plist-sources { justify-content: flex-end; }
.plist-head .plist-bags, .plist-head .plist-kg { display: flex; justify-content: flex-end; }
.plist-bags, .plist-kg { text-align: right; }
.plist-bags, .plist-kg { display: flex; gap: 4px; justify-content: flex-end; min-width: 0; }
.plist-bag { display: flex; flex-direction: column; align-items: center; justify-content: center; box-sizing: border-box; flex: none; min-width: 40px; padding: 4px 6px; border-radius: 8px; font-variant-numeric: tabular-nums; }
.plist-bag-n { font-family: var(--serif); font-size: 17px; font-weight: 600; line-height: 1; }
.plist-bag-l { font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; margin-top: 2px; }
.plist-bag-packed { background: var(--green-soft); }
.plist-bag-packed .plist-bag-n { color: var(--green); }
.plist-bag-packed .plist-bag-l { color: var(--green); opacity: .8; }
.plist-bag-left { background: #f3ddd4; }
.plist-bag-left .plist-bag-n { color: #9a3f2a; }
.plist-bag-left .plist-bag-l { color: #9a3f2a; opacity: .8; }
[data-theme="dark"] .plist-bag-packed { background: #22322a; }
[data-theme="dark"] .plist-bag-packed .plist-bag-n,
[data-theme="dark"] .plist-bag-packed .plist-bag-l { color: #8fe0ac; }
[data-theme="dark"] .plist-bag-left { background: #4a2a24; }
[data-theme="dark"] .plist-bag-left .plist-bag-n,
[data-theme="dark"] .plist-bag-left .plist-bag-l { color: #f0a08a; }
.plist-bag-total { background: var(--ink); }
.plist-bag-total .plist-bag-n { color: var(--cream); }
.plist-bag-total .plist-bag-l { color: var(--cream); opacity: .7; }
[data-theme="dark"] .plist-bag-total { background: var(--cream); }
[data-theme="dark"] .plist-bag-total .plist-bag-n,
[data-theme="dark"] .plist-bag-total .plist-bag-l { color: var(--espresso); }

@media (max-width: 1080px) {
  /* hide Sources */
  .plist-row { grid-template-columns: 26px minmax(150px, 1fr) 90px 90px 150px 150px; gap: 12px; }
  .plist-sources, .plist-head .plist-sources { display: none; }
}
@media (max-width: 920px) {
  /* hide Kilos */
  .plist-row { grid-template-columns: 26px minmax(130px, 1fr) 88px 88px 150px; gap: 10px; }
  .plist-kg, .plist-head .plist-kg { display: none; }
}
@media (max-width: 760px) {
  /* hide 1kg */
  .plist-row { grid-template-columns: 24px minmax(110px, 1fr) 84px 150px; gap: 10px; padding: 10px 12px; }
  .plist-1k, .plist-head .plist-1k { display: none; }
}
@media (max-width: 560px) {
  /* hide 250g and Bags — keep tag + product name + total orders */
  .plist-row { grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; padding: 10px 12px; }
  .plist-250, .plist-head .plist-250,
  .plist-bags, .plist-head .plist-bags { display: none; }
  .plist-orders-total { display: flex; align-items: center; }
  .plist-orders-total .plist-bag-l { display: none; }
}

/* ---------------- Banner ---------------- */
.filter-wrap { margin-bottom: 16px; padding: 12px 14px; }
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-search {
  display: flex; align-items: center; gap: 8px;
  height: 40px; min-width: 200px; flex: 1 1 220px; max-width: 340px;
  padding: 0 10px; color: var(--muted);
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-sm); transition: border-color .15s ease;
}
.filter-search:focus-within { border-color: var(--coffee-2); }
.filter-search svg { flex: none; }
.filter-search input {
  flex: 1; min-width: 0; border: none; background: none; outline: none;
  font-family: var(--font); font-size: 13.5px; color: var(--ink);
}
.filter-search input::placeholder { color: var(--muted); }
.filter-search input::-webkit-search-cancel-button { display: none; }
.filter-clear { flex: none; width: 22px; height: 22px; border-radius: 999px; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line-soft); color: var(--muted); font-size: 11px; }
.filter-clear:hover { color: var(--ink); }
.filter-clear[hidden] { display: none; }
.filter-sources, .filter-dates {
  display: flex; gap: 4px; flex-wrap: wrap;
  padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2);
}
.filter-sources .seg, .filter-dates .seg { border-color: transparent; background: transparent; }
.filter-sources .seg.active, .filter-dates .seg.active { border-color: var(--ink); }
.filter-sources .seg { display: inline-flex; align-items: center; gap: 6px; }
.filter-sources .seg img { height: 15px; width: auto; max-width: 18px; object-fit: contain; display: block; }
.filter-count { margin-left: auto; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.filter-count[hidden] { display: none; }

/* ---------------- KDS bar ---------------- */
.kds-bar {
  margin-bottom: 22px;
  display: flex; align-items: center; gap: 14px;
}
.kds-bar .kds-stats { flex: 1; }
.kds-create { flex: none; }
/* stats layout — transparent wrapper so the child cards are the flush
   top edge, matching the .card used by the Product Tally and Completed tabs */
.kds-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px;
  align-items: stretch;
}
.kds-stat {
  display: flex; flex-direction: column; gap: 4px; justify-content: center;
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 14px 20px; box-shadow: var(--shadow-sm);
  min-width: 0;
}
.kds-stat[hidden] { display: none; }
.kds-stat .k-val { font-size: 30px; font-weight: 800; letter-spacing: -.5px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink); }
.kds-stat .k-lab { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
/* open-orders card: total on the left, per-source breakdown stacked on the right */
.kds-open-card { flex-direction: row; align-items: center; justify-content: space-between; gap: 14px; }
.kds-open-main { display: flex; flex-direction: column; gap: 4px; }
.kds-open-sources { display: flex; flex-direction: column; gap: 6px; flex: none; }
.kds-src { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.kds-src img { width: 18px; height: 18px; object-fit: contain; display: block; flex: none; }
.kds-src b { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); min-width: 1ch; text-align: right; }
.kds-stat.warn { border-color: var(--amber); }
.kds-stat.warn .k-val { color: var(--amber); }
.kds-stat.crit { border-color: var(--red); }
.kds-stat.crit .k-val { color: var(--red); }

/* ---------------- KDS board ---------------- */
.kds-board {
  /* strict left-to-right reading order (card 1 top-left, card 2 to its right).
     Trade-off: a taller card pushes its whole row down, so a gap can appear
     beside shorter cards in the same row when one is expanded. */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  align-items: start;
}

.ticket {
  background: var(--panel); border: 2px solid var(--line); border-radius: 14px;
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm);
  /* compact by default — grows naturally with content */
  transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
.ticket:hover { box-shadow: var(--shadow-md); }
.ticket.shopify { border-color: var(--shopify); background: var(--shopify-bg); }
.ticket.ordermentum { border-color: var(--ordermentum); background: var(--ordermentum-bg); }
.ticket.manual { border-color: var(--manual); background: var(--manual-bg); }

.t-head { padding: 12px 13px 10px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: flex-start; gap: 9px; transition: background .18s ease; border-radius: 12px 12px 0 0; }
.ticket.all-packed .t-head { background: var(--gold-soft); }
/* completed state overrides the source colour on the order number */
.ticket.shopify.all-packed .t-num,
.ticket.ordermentum.all-packed .t-num,
.ticket.manual.all-packed .t-num { color: var(--ink); }

/* progress bar — one signal per axis: bar = work done, colour = state */
.t-progressbar { height: 3px; background: var(--line-soft); overflow: hidden; }
.t-progressbar i { display: block; height: 100%; width: 0; background: var(--muted); transition: width .25s ease, background .2s ease; }
.ticket.in-progress .t-progressbar i { background: var(--progress); }
.ticket.all-packed .t-progressbar i { background: var(--gold); }
.ticket.shopify .t-num { color: var(--shopify); }
.ticket.ordermentum .t-num { color: var(--ordermentum); }
.ticket.manual .t-num { color: var(--manual); }
.t-main { flex: 1; min-width: 0; }
.t-num-row { display: flex; align-items: center; gap: 7px; min-width: 0; }
.t-source-logo { height: 20px; width: auto; max-width: 60px; object-fit: contain; flex: none; display: block; }
.ticket.manual .t-source-logo { height: 20px; width: 20px; }
.t-num { font-family: var(--font); font-weight: 700; font-size: 15px; line-height: 1.25; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.t-num[data-open] { cursor: pointer; }
.t-num[data-open]:hover { text-decoration: underline; text-underline-offset: 2px; }
.t-num[data-open]:focus-visible { outline: 2px solid var(--coffee-2); outline-offset: 2px; border-radius: 4px; }
.t-num-row > .t-badge { flex: none; }
.t-cust-row { display: flex; align-items: center; gap: 8px; margin-top: 3px; min-width: 0; }
.t-cust { font-family: var(--font); font-weight: 500; font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
/* info icon beside the customer name — the only control that opens the customer modal */
.cust-info { display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; padding: 0; border-radius: 999px; color: var(--muted); background: transparent; border: 1px solid transparent; cursor: pointer; transition: color .15s ease, background .15s ease, border-color .15s ease; }
.cust-info:hover { color: var(--coffee); background: var(--panel-2); border-color: var(--line-soft); }
.cust-info:focus-visible { outline: 2px solid var(--coffee-2); outline-offset: 2px; }
.t-badges { display: flex; gap: 4px; flex-wrap: wrap; flex: none; }
.t-badge { font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 6px; border-radius: 999px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line-soft); }
.t-badge.unit-tribu { background: var(--gold-soft); color: #6d4a1b; border-color: transparent; }
.t-badge.unit-wood_and_co { background: var(--coffee); color: var(--cream); border-color: transparent; }
[data-theme="dark"] .t-badge.unit-tribu { background: #4a3823; color: #f0c98a; }
[data-theme="dark"] .t-badge.unit-wood_and_co { background: #8a6244; color: #fff3e0; }
.t-badge.overdue-tag { background: var(--red); color: #fff; border-color: transparent; font-weight: 800; letter-spacing: .05em; }
[data-theme="dark"] .t-badge.overdue-tag { background: var(--red); color: #16120e; }

.t-right { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.t-timer { text-align: right; flex: none; }
.t-timer[hidden] { visibility: hidden; }
.t-timer .t-count { font-size: 15px; font-weight: 800; letter-spacing: -.3px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.t-foot .t-count { font-size: 14px; }
.t-timer.tone-normal .t-count { color: var(--green); }
.t-timer.tone-warning .t-count { color: var(--amber); }
.t-timer.tone-critical .t-count { color: var(--red); }

.t-lines { padding: 8px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.t-line[hidden] { display: none; }
.t-line { display: flex; align-items: center; gap: 11px; padding: 10px 9px; border: 1px solid var(--line-soft); background: var(--panel-2); border-radius: 9px; cursor: pointer; transition: background .1s ease, border-color .1s ease; }
.t-line:hover { background: var(--panel); border-color: var(--line); }
.t-check { width: 22px; height: 22px; border: 2px solid var(--line); border-radius: 7px; display: grid; place-items: center; color: #fff; flex: none; transition: all .15s ease; }
.t-check svg { width: 13px; height: 13px; opacity: 0; }
.t-line.packed .t-check { background: var(--green); border-color: var(--green); }
.t-line.packed .t-check svg { opacity: 1; }
.t-line.packed .t-name { text-decoration: line-through; color: var(--muted); }
.t-info { flex: 1; min-width: 0; }
.t-name { font-size: 13.5px; font-weight: 600; line-height: 1.25; min-height: calc(2 * 1.25em); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.t-sub { font-size: 11px; color: var(--muted); display: flex; gap: 6px; align-items: center; margin-top: 2px; flex-wrap: wrap; }
.t-qty { font-weight: 800; font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; flex: none; }
.g-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 5px; }
.g-badge[hidden] { display: none; }
.w-badge { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 800; letter-spacing: .02em; padding: 2px 8px; border-radius: 6px; background: var(--coffee); color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
[data-theme="dark"] .w-badge { background: var(--coffee-2); color: #fff; }
.g-badge.wb { background: var(--green-soft); color: var(--green); }
.g-badge.gr { background: var(--amber-soft); color: #8a5a1b; }
[data-theme="dark"] .g-badge.gr { background: #5a4520; color: #ffd08a; }
[data-theme="dark"] .g-badge.wb { background: #24402f; color: #8fe0ac; }
[data-theme="dark"] .g-badge.merch { background: #3a332a; color: #d8c9b4; }
.g-badge.merch { background: #eee4d4; color: #8a7a6b; }

.t-expand {
  flex: none;
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  font-size: 22px; font-weight: 600; line-height: 1;
  color: var(--ink-2); background: var(--panel-2);
  border: 1px solid var(--line-soft);
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .12s ease;
}
.t-expand:hover { background: var(--panel); border-color: var(--coffee-2); color: var(--ink); }
.t-expand:active { transform: scale(.94); }
.ticket.all-packed .t-expand { background: #ffffff88; border-color: #ffffffcc; color: var(--ink); }
[data-theme="dark"] .ticket.all-packed .t-expand { background: #ffffff1a; border-color: #ffffff33; color: var(--ink); }

.t-foot { padding: 11px 16px; border-top: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.t-foot-right { display: flex; align-items: center; gap: 10px; flex: none; }
.t-progress { font-size: 15px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.2px; }
.t-progress .tp-sub { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .03em; margin-left: 2px; }
.ticket.all-packed .t-progress { color: #8a5a1b; }
[data-theme="dark"] .ticket.all-packed .t-progress { color: var(--gold-soft); }
.t-done { padding: 8px 16px; border-radius: 9px; font-size: 12.5px; font-weight: 700; background: var(--ink); color: var(--cream); transition: all .15s ease; }
[data-theme="dark"] .t-done { background: var(--cream); color: var(--espresso); }
[data-theme="dark"] .t-done:hover { background: #fff; }
.t-done:hover { background: var(--coffee); }
.t-done.is-complete { background: var(--green); color: #fff; }
.t-done.is-complete:hover { background: var(--green); filter: brightness(1.08); }
[data-theme="dark"] .t-done.is-complete,
[data-theme="dark"] .t-done.is-complete:hover { background: var(--green); color: #14211a; }

/* ---------------- Completed ---------------- */
.done-list { display: flex; flex-direction: column; gap: 10px; }
.done-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); background: var(--panel-2); }
/* Completed rows: icon · order # · customer · address · checkbox · remove (X). */
.d-completed {
  display: grid;
  grid-template-columns: 28px 120px minmax(140px, 1fr) minmax(160px, 1.4fr) 18px 30px;
  align-items: center; gap: 12px; padding: 10px 14px;
}
.d-completed .d-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-completed .d-icon { width: 28px; height: 28px; border-radius: 7px; }
.d-cust { min-width: 0; font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-cust[data-cust] { cursor: pointer; }
.d-cust[data-cust]:hover { color: var(--coffee); text-decoration: underline; text-underline-offset: 2px; }
.d-cust[data-cust]:focus-visible { outline: 2px solid var(--coffee-2); outline-offset: 3px; border-radius: 6px; }
.d-address { min-width: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-address.is-empty { font-style: italic; opacity: .7; }
.d-remove { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 18px; line-height: 1; color: var(--muted); border: 1px solid var(--line); background: var(--panel); transition: all .15s ease; }
.d-remove:hover { color: #fff; background: var(--red); border-color: var(--red); }
.d-remove:focus-visible { outline: 2px solid var(--coffee-2); outline-offset: 2px; }
.done-row .d-check { width: 18px; height: 18px; flex: none; accent-color: var(--teal); cursor: pointer; }
.done-row:has(.d-check:not(:checked)) { opacity: .6; }
.done-row .d-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: none; }
.done-row .d-icon.shopify,
.done-row .d-icon.ordermentum { background: var(--panel); border: 1px solid var(--line-soft); padding: 4px; }
.done-row .d-icon.shopify img,
.done-row .d-icon.ordermentum img { width: 100%; height: 100%; object-fit: contain; display: block; }
.done-row .d-icon.unmapped { background: var(--amber); }
.d-info { flex: 1; min-width: 0; }
.d-title { font-size: 14px; font-weight: 600; }
.d-title[data-open] { cursor: pointer; }
.d-title[data-open]:hover { text-decoration: underline; text-underline-offset: 2px; }
.d-title[data-open]:focus-visible { outline: 2px solid var(--coffee-2); outline-offset: 3px; border-radius: 6px; }
.d-meta-row { display: flex; align-items: center; gap: 6px; margin-top: 2px; min-width: 0; }
.d-meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.d-stamp { font-size: 11.5px; color: var(--muted); }
.undo-btn { padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--ink-2); transition: all .15s ease; }
.undo-btn:hover { border-color: var(--coffee-2); color: var(--ink); background: #fff; }

/* ---------------- Admin (products + customers) ---------------- */
.admin-switch { display: inline-flex; gap: 6px; margin-bottom: 18px; }
.admin-list { display: flex; flex-direction: column; gap: 8px; }
.admin-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); background: var(--panel-2); }
.admin-row-main { flex: 1; min-width: 0; }
.admin-row-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-row-sub { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-row-address { flex: 0 1 42%; min-width: 0; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-pill { flex: none; font-size: 11px; font-weight: 700; letter-spacing: .03em; padding: 3px 9px; border-radius: 999px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line-soft); }
.admin-pill.ok { background: var(--green-soft); color: var(--green); border-color: transparent; }
.admin-pill.warn { background: var(--amber-soft); color: #6d4a1b; border-color: transparent; }
.admin-pill.muted { background: var(--panel-2); color: var(--muted); }

/* Analytics: orders & kilos by client */
.analytics-filter { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.analytics-fetch { margin-left: auto; }

/* Vertical stacked bar chart (profit + cost = revenue) — vanilla, no library. */
.analytics-chart-wrap { margin-bottom: 18px; }
.analytics-chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.analytics-chart-title { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.analytics-legend { display: flex; gap: 14px; }
.analytics-legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--muted); }
.analytics-legend-item i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.analytics-legend-item .sw-profit { background: var(--teal); }
.analytics-legend-item .sw-cost { background: var(--line); }
[data-theme="dark"] .analytics-legend-item .sw-profit { background: #6ec4b4; }
[data-theme="dark"] .analytics-legend-item .sw-cost { background: #4a4238; }

.analytics-chart { display: flex; align-items: flex-end; gap: 8px; height: 200px; padding: 8px 4px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.an-col { flex: 1 1 0; min-width: 34px; max-width: 72px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.an-bar { width: 100%; max-width: 46px; display: flex; flex-direction: column-reverse; border-radius: 4px 4px 0 0; overflow: hidden; background: var(--line); transition: height .25s ease; }
.an-seg { width: 100%; flex-basis: 0; transition: flex-grow .25s ease; }
.an-profit { background: var(--teal); }
.an-cost { background: var(--line); }
[data-theme="dark"] .an-profit { background: #6ec4b4; }
[data-theme="dark"] .an-cost { background: #4a4238; }
.an-label { margin-top: 6px; font-size: 10px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-col:hover .an-bar { filter: brightness(1.06); }
.analytics-row { position: relative; overflow: hidden; }
.analytics-row::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--share, 0%); background: linear-gradient(90deg, var(--teal-soft), transparent); opacity: .55; pointer-events: none; }
.analytics-row > * { position: relative; }
.analytics-stat { flex: none; display: flex; flex-direction: column; align-items: flex-end; min-width: 64px; text-align: right; }
.analytics-num { font-family: var(--serif); font-size: 20px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink); }
.analytics-kg { color: var(--green); }
[data-theme="dark"] .analytics-kg { color: #8fe0ac; }
.analytics-rev { color: var(--coffee); }
[data-theme="dark"] .analytics-rev { color: var(--gold); }
.analytics-profit { color: var(--teal); }
[data-theme="dark"] .analytics-profit { color: #6ec4b4; }
.analytics-lbl { font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
[data-theme="dark"] .admin-pill.warn { color: #ffd08a; }

.hint { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 20px; }

/* ---------------- Order detail modal ---------------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20,14,10,.5); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 24px; animation: mfade .16s ease; }
.modal-backdrop[hidden] { display: none; }
@keyframes mfade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 480px; max-height: 86vh; overflow-y: auto; padding: 24px 26px 22px; position: relative; animation: mpop .2s cubic-bezier(.2,.9,.3,1.2); }
@keyframes mpop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-close { position: absolute; top: 14px; right: 16px; font-size: 22px; color: var(--muted); line-height: 1; width: 30px; height: 30px; border-radius: 8px; }
.modal-close:hover { background: var(--panel-2); color: var(--ink); }
.m-head { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; padding-right: 28px; }
.m-num { font-family: var(--serif); font-weight: 600; font-size: 20px; }
.m-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.m-section { margin-top: 16px; }
.m-section h4 { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.m-field { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.m-field:last-child { border-bottom: none; }
.m-field .f-label { width: 92px; flex: none; font-size: 12px; color: var(--muted); }
.m-field .f-value { font-size: 13.5px; color: var(--ink); }
.m-field .f-value.empty { color: var(--muted); font-style: italic; }
.m-items { display: flex; flex-direction: column; gap: 6px; }
.m-item { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.m-item .q { font-weight: 700; font-variant-numeric: tabular-nums; }
.m-item .n { flex: 1; }
.m-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.m-chip { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; }
.m-chip.src-shopify { background: var(--shopify-soft); color: var(--shopify); }
.m-chip.src-ordermentum { background: var(--ordermentum-soft); color: var(--ordermentum); }
.m-chip.t-red { background: var(--red-soft); color: var(--red); }
.m-chip.t-amber { background: var(--amber-soft); color: var(--amber); }
.m-chip.t-green { background: var(--teal-soft); color: var(--teal); }

/* ---------------- Responsive ---------------- */
@media (max-width: 1080px) {
  .topbar { gap: 14px; }
  .tab-btn { padding: 8px 10px; }
  .main { padding: 22px 24px 56px; }
}
@media (max-width: 780px) {
  .main { padding: 18px 14px 48px; }
  /* single header row: brand + tabs (icon + count) + actions all at the same level */
  .topbar { flex-wrap: nowrap; gap: 8px; }
  .brand { flex: none; }
  .brand-mark { padding: 0 9px; font-size: 15px; }
  .nav { order: 0; flex: 1 1 0; min-width: 0; gap: 4px; overflow-x: auto; }
  /* show labels but let each tab shrink + truncate its label with an ellipsis as the screen narrows */
  .tab-btn { padding: 7px 9px; gap: 6px; min-width: 0; flex: 1 1 auto; overflow: hidden; }
  .tab-btn svg { flex: none; }
  .tab-btn .nav-count { flex: none; }
  .tab-label { display: inline-block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-actions { order: 0; flex-wrap: nowrap; flex: none; margin-left: 0; gap: 6px; }
  #mock-btn { padding: 9px 11px; font-size: 12.5px; }
  .kds-board { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  /* Completed: drop the address column on narrow screens. */
  .d-completed { grid-template-columns: 28px 110px minmax(120px, 1fr) 18px 30px; }
  .d-completed .d-address { display: none; }
}
@media (max-width: 600px) {
  /* Completed: hide customer too — icon · order # · check · remove. */
  .d-completed { grid-template-columns: 28px minmax(0, 1fr) 18px 30px; }
  .d-completed .d-cust { display: none; }
}
@media (max-width: 520px) {
  .kds-stat .k-val { font-size: 21px; }
  .kds-board { gap: 10px; }
  /* compact tickets so two fit per row on phones */
  .t-head { padding: 10px 10px 9px; gap: 7px; }
  .t-num { font-size: 13.5px; }
  .t-cust { font-size: 12px; }
  .t-badge { font-size: 8px; padding: 1px 5px; }
  .t-expand { width: 28px; height: 28px; font-size: 18px; }
  .t-timer .t-count { font-size: 13px; }
  .t-line { padding: 8px 6px; gap: 7px; }
  .t-name { font-size: 12px; }
  .t-qty { font-size: 13px; }
  .t-foot { padding: 9px 10px; }
  /* very narrow: shrink "New order" to just the ＋ so the single header row still fits */
  .mock-btn-label { display: none; }
  #mock-btn { width: 38px; height: 38px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 11px; font-size: 18px; }
}
@media (max-width: 360px) {
  /* smallest screens: one card per row */
  .kds-board { grid-template-columns: 1fr; }
}
@media print {
  .topbar-actions { display: none !important; }
  body { background: #fff; }
}

/* ---------------------------------------------------------------------------
 * RDS production additions (not in the mockup)
 * ------------------------------------------------------------------------- */

/* Empty / loading state */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  padding: 40px 16px;
}

/* Connection-lost banner (§7.7 floor-device resilience) */
.net-banner {
  background: var(--red-soft, #fbe6e3);
  border: 1px solid #efc3bd;
  color: #8a2f24;
}

/* Item sub-line in the order detail modal */
.m-item-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.m-item { justify-content: space-between; }

/* Weight badge for items whose weight is unknown */
.w-badge.unknown { opacity: .65; border-style: dashed; }
.t-line.has-warning .w-badge.unknown { border-color: var(--amber); color: #8a5a17; }

/* Toast (§7.7 feedback for accepted / reverted writes) */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 60;
  max-width: min(560px, calc(100vw - 32px));
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  background: var(--card, #fff);
  color: var(--ink, #2b1d15);
  box-shadow: 0 10px 30px rgba(20, 14, 10, .22);
  border: 1px solid rgba(0, 0, 0, .08);
}
.toast[hidden] { display: none; }
.toast[data-tone="error"] { background: #8a2f24; color: #fff; }
.toast[data-tone="success"] { background: #2f6b3f; color: #fff; }

/* Shift-start overlay (§7.7) */
.shift-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 14, 10, .62);
  backdrop-filter: blur(4px);
}
.shift-overlay[hidden] { display: none; }
.shift-card { max-width: 380px; text-align: center; padding: 28px; }
.shift-card h2 { font-family: Fraunces, Georgia, serif; margin: 0 0 8px; }
.shift-card p { color: var(--muted); font-size: 13.5px; margin: 0 0 18px; }

/* Blend footer: kg as a pill tag next to the kind tag */
.blend-footer-tag { display: flex; align-items: center; gap: 8px; }
.blend-kg { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; letter-spacing: .03em; padding: 2px 8px; border-radius: 999px; background: var(--amber-soft); color: #7a4a12; font-variant-numeric: tabular-nums; }
[data-theme="dark"] .blend-kg { background: #3a2d18; color: #e8c48a; }

/* Blend card → order-breakdown modal */
.blend-card { cursor: pointer; }
.blend-card:focus-visible { outline: 2px solid var(--coffee-2); outline-offset: 2px; }
.m-blend-orders { display: flex; flex-direction: column; gap: 8px; }
.m-blend-order { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--panel-2); }
.mbo-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mbo-num { font-weight: 700; font-size: 13.5px; color: var(--ink); font-variant-numeric: tabular-nums; }
.mbo-num[data-open] { cursor: pointer; }
.mbo-num[data-open]:hover { text-decoration: underline; text-underline-offset: 2px; }
.mbo-cust { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mbo-meta { display: flex; align-items: center; gap: 8px; flex: none; }
.mbo-qty { font-size: 12.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.mbo-src { font-size: 10px; font-weight: 700; letter-spacing: .03em; padding: 2px 7px; border-radius: 999px; text-transform: uppercase; color: var(--muted); background: var(--panel); }
.mbo-src.shopify { background: var(--shopify-soft); color: var(--shopify); }
.mbo-src.ordermentum { background: var(--ordermentum-soft); color: var(--ordermentum); }
.m-empty { color: var(--muted); font-size: 13px; font-style: italic; }

/* Tally nav badge warning state */
.nav-count.warn { background: var(--amber); color: #fff; }
