/* HT ORDER TRACKER — clean, big, fast */
:root {
  --bg: #F5F6FA;
  --card: #FFFFFF;
  --ink: #0F172A;
  --ink2: #475569;
  --muted: #94A3B8;
  --line: #E2E8F0;
  --soft: #EEF2FF;
  --field: #F1F5F9;

  --orange: #F97316;
  --orange-d: #EA580C;
  --orange-bg: #FFF7ED;
  --orange-bd: #FDBA74;
  --brown: #9A3412;
  --brown-bg: #FFEDD5;

  --red: #DC2626;
  --red-d: #B91C1C;
  --red-bg: #FEF2F2;
  --red-bd: #FCA5A5;
  --blue: #2563EB;
  --blue-bg: #EFF6FF;
  --blue-bd: #93C5FD;
  --green: #16A34A;
  --green-bg: #F0FDF4;
  --green-bd: #86EFAC;
  --purple: #7C3AED;
  --purple-bg: #F5F3FF;
  --wa: #22C55E;
  --wa-d: #16A34A;

  --r: 18px;
  --r-sm: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 16px rgba(15, 23, 42, .05);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --glass: rgba(255, 255, 255, .94);
  --purple-bd: #C4B5FD;
  color-scheme: light;
}
/* dark background (button in the top bar; follows the phone setting until chosen) */
:root[data-theme="dark"] {
  --bg: #0B1120; --card: #151E2E; --ink: #E5E7EB; --ink2: #A5B3C7; --muted: #6B7A90; --line: #273449; --soft: #1C2740; --field: #1D2738;
  --orange-d: #FB923C; --orange-bg: #2B1B0E; --orange-bd: #9A3F12; --brown: #C2410C; --brown-bg: #3A2212;
  --red: #EF4444; --red-d: #F87171; --red-bg: #2A1316; --red-bd: #7F1D1D;
  --blue: #3B82F6; --blue-bg: #0F1D38; --blue-bd: #1E40AF;
  --green: #16A34A; --green-bg: #0D2317; --green-bd: #166534;
  --purple: #8B5CF6; --purple-bg: #1E1737; --purple-bd: #5B21B6;
  --glass: rgba(21, 30, 46, .94);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
:root[data-theme="dark"] img { filter: none; }
:root[data-theme="dark"] .person.on small, :root[data-theme="dark"] .tile.on small { color: #FED7AA; }
:root[data-theme="dark"] .toast:not(.err) { background: #F1F5F9; color: #0F172A; }
.theme-btn { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--field); font-size: 18px; flex: none; }


* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 16px; line-height: 1.4; -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.ink2 { color: var(--ink2); }
.red { color: var(--red); }
.green { color: var(--green); }
.orange { color: var(--orange-d); }
.blue { color: var(--blue); }
.b { font-weight: 700; }
.nowrap { white-space: nowrap; }
.sm { font-size: 13px; }
.xs { font-size: 12px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ico { width: 1.2em; height: 1.2em; flex: none; vertical-align: -0.2em; }

.boot { display: grid; place-items: center; min-height: 100vh; }
.logo {
  width: 40px; height: 40px; border-radius: 11px; background: var(--orange); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 15px; letter-spacing: -.5px; flex: none;
  box-shadow: 0 4px 12px rgba(249, 115, 22, .35);
}
.logo.big { width: 72px; height: 72px; border-radius: 20px; font-size: 26px; }

/* ---------- shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--glass);
  backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line); padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
}
.topbar-in { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.brand h1 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.3px; line-height: 1.15; white-space: nowrap; }
.brand h1 small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.brand .store { font-size: 12px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; position: relative;
  color: var(--ink2); flex: none;
}
.icon-btn:active { background: var(--field); }
.icon-btn .dot {
  position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--brown); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; flex: none;
}
.avatar.sm { width: 26px; height: 26px; font-size: 12px; background: var(--brown-bg); color: var(--brown); }
.lang-switch { display: flex; background: var(--field); border-radius: 10px; padding: 3px; flex: none; }
.lang-switch button { padding: 5px 9px; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--ink2); }
.lang-switch button.on { background: var(--card); color: var(--orange-d); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.desk-nav { display: none; gap: 4px; }
.desk-nav a { padding: 9px 14px; border-radius: 10px; font-weight: 600; color: var(--ink2); display: flex; gap: 6px; align-items: center; }
.desk-nav a.on { background: var(--orange-bg); color: var(--orange-d); }

main { max-width: 1200px; margin: 0 auto; padding: 16px 16px calc(110px + env(safe-area-inset-bottom)); }

.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--glass);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line);
  display: flex; justify-content: space-around; align-items: flex-end;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; font-weight: 600;
  color: var(--muted); padding: 4px 0;
}
.bottom-nav a .ico { width: 24px; height: 24px; }
.bottom-nav a.on { color: var(--orange-d); }
.bottom-nav a.plus .bubble {
  width: 52px; height: 52px; border-radius: 50%; background: var(--orange); color: #fff; display: grid; place-items: center;
  margin-top: -26px; box-shadow: 0 6px 16px rgba(249, 115, 22, .45); border: 4px solid #fff;
}
.bottom-nav a.plus { color: var(--orange-d); }

/* ---------- common blocks ---------- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; border: 1px solid rgba(15, 23, 42, .04); }
.card + .card, .card + .section, .section + .card { margin-top: 14px; }
.section { margin-top: 18px; }
.sec-title { display: flex; align-items: center; gap: 8px; margin: 22px 2px 12px; }
.sec-title h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.2px; }
.sec-title .pill { background: var(--soft); color: var(--blue); font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; }
.card h3.ct { margin: 0 0 12px; font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 18px;
  border-radius: 14px; font-weight: 700; font-size: 16px; background: var(--field); color: var(--ink);
  transition: transform .08s, filter .15s; user-select: none; text-align: center; line-height: 1.2;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.block { width: 100%; }
.btn.big { min-height: 60px; font-size: 18px; border-radius: 16px; }
.btn.sm { min-height: 40px; font-size: 14px; border-radius: 11px; padding: 0 12px; }
.btn.primary { background: var(--orange); color: #fff; box-shadow: 0 4px 12px rgba(249, 115, 22, .3); }
.btn.primary:hover { filter: brightness(1.04); }
.btn.brown { background: var(--brown); color: #fff; }
.btn.wa { background: var(--wa); color: #fff; box-shadow: 0 4px 12px rgba(34, 197, 94, .3); }
.btn.soft { background: var(--blue-bg); color: var(--blue); }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); }
.btn.danger { background: var(--red-bg); color: var(--red); }
.btn.green { background: var(--green); color: #fff; }

/* big CTA */
.cta {
  display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, #FB923C, var(--orange) 40%, var(--orange-d));
  color: #fff; border-radius: 20px; padding: 16px 18px; box-shadow: 0 8px 22px rgba(249, 115, 22, .35);
  transition: transform .08s;
}
.cta:active { transform: scale(.985); }
.cta .plus { width: 46px; height: 46px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .7); display: grid; place-items: center; flex: none; background: rgba(255,255,255,.15); }
.cta .plus .ico { width: 26px; height: 26px; }
.cta b { font-size: 21px; display: block; letter-spacing: -.2px; }
.cta span { font-size: 13px; opacity: .92; }
.cta .arrow { margin-left: auto; width: 26px; height: 26px; }

/* stat cards */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.stat {
  border-radius: var(--r); padding: 14px 14px 12px; border: 2px solid; text-align: left; display: flex; flex-direction: column;
  gap: 4px; min-height: 108px; transition: transform .08s, box-shadow .15s; position: relative;
}
.stat:active { transform: scale(.97); }
.stat.on { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px currentColor; }
.stat .st-head { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 15px; }
.stat .st-head .ico { width: 20px; height: 20px; }
.stat .st-head small { margin-left: auto; font-size: 10.5px; font-weight: 700; opacity: .8; letter-spacing: .3px; }
.stat .st-num { display: flex; align-items: baseline; justify-content: space-between; margin-top: auto; }
.stat .st-num b { font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: -1px; }
.stat .st-num span { font-size: 12.5px; font-weight: 700; opacity: .85; }
.stat.red { background: var(--red-bg); border-color: var(--red-bd); color: var(--red); }
.stat.orange { background: var(--orange-bg); border-color: var(--orange-bd); color: var(--orange-d); }
.stat.blue { background: var(--blue-bg); border-color: var(--blue-bd); color: var(--blue); }
.stat.green { background: var(--green-bg); border-color: var(--green-bd); color: var(--green); }
.stat.red .st-num b { color: var(--red-d); }

.alert-strip {
  margin-top: 14px; display: flex; gap: 10px; align-items: center; background: var(--red); color: #fff; padding: 12px 14px;
  border-radius: 14px; font-weight: 700; font-size: 15px;
}
.alert-strip .ico { width: 22px; height: 22px; }

/* search + chips */
.search {
  margin-top: 16px; display: flex; align-items: center; gap: 10px; background: var(--card); border: 1.5px solid var(--line);
  border-radius: 99px; padding: 0 16px; height: 50px;
}
.search input { border: 0; outline: 0; background: transparent; flex: 1; font-size: 16px; min-width: 0; }
.search .ico { color: var(--ink2); width: 20px; height: 20px; }
.search .clear { color: var(--muted); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 2px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 9px 15px; border-radius: 99px; background: var(--card); border: 1.5px solid var(--line); font-weight: 700;
  font-size: 14px; color: var(--ink2); display: inline-flex; gap: 6px; align-items: center;
}
.chip .n { background: var(--field); border-radius: 99px; padding: 0 7px; font-size: 12px; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.on .n { background: rgba(127, 127, 127, .25); }
.chip.tag { background: var(--brown-bg); color: var(--brown); border-color: transparent; }

.list-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.seg { display: flex; background: var(--field); border-radius: 10px; padding: 3px; }
.seg button { padding: 6px 10px; border-radius: 8px; color: var(--ink2); display: flex; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }

/* order cards */
.orders { display: grid; grid-template-columns: 1fr; gap: 14px; }
.ocard {
  background: var(--card); border-radius: var(--r); padding: 14px; border: 2px solid var(--line); box-shadow: var(--shadow);
  cursor: pointer; transition: transform .08s; display: flex; flex-direction: column; gap: 10px;
}
.ocard:active { transform: scale(.99); }
.ocard.s-overdue { border-color: var(--red-bd); }
.ocard.s-today { border-color: var(--orange-bd); }
.ocard.s-partial { border-color: var(--blue-bd); }
.ocard.s-done { opacity: .75; }
.oc-top { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; min-width: 0; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 8px; font-weight: 800; font-size: 13px;
  white-space: nowrap;
}
.badge .ico { width: 15px; height: 15px; }
.badge.red { background: var(--red); color: #fff; }
.badge.orange { background: var(--orange); color: #fff; }
.badge.blue { background: var(--blue-bg); color: var(--blue); }
.badge.gray { background: var(--field); color: var(--ink2); }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.purple { background: var(--purple-bg); color: var(--purple); }
.oc-state { font-size: 13px; font-weight: 700; }
.oc-po { margin-left: auto; font-size: 13px; color: var(--ink2); font-weight: 600; white-space: nowrap; }
.oc-body { display: flex; gap: 12px; align-items: flex-start; }
.thumb {
  width: 76px; height: 76px; border-radius: 14px; background: var(--field); flex: none; object-fit: cover;
  display: grid; place-items: center; font-size: 34px; overflow: hidden; border: 1px solid var(--line);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.oc-body h3 { margin: 0; font-size: 19px; font-weight: 800; line-height: 1.25; letter-spacing: -.2px; word-break: break-word; }
.oc-sup { font-size: 14px; color: var(--ink2); margin-top: 3px; display: flex; gap: 5px; align-items: center; }
.oc-sup .ico { width: 15px; height: 15px; }
.qty-pill {
  display: inline-block; background: var(--orange-bg); color: var(--brown); border-radius: 9px; padding: 4px 11px;
  font-weight: 800; font-size: 16px; margin-top: 7px;
}
.oc-dates { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; color: var(--ink2); }
.oc-dates b { color: var(--ink); }
.oc-dates s { color: var(--muted); }
.pic-row {
  display: flex; align-items: center; gap: 8px; background: var(--field); border-radius: 12px; padding: 8px 10px; font-size: 14px;
}
.pic-row .rem { margin-left: auto; font-weight: 700; font-size: 13px; text-align: right; }
.s-overdue .pic-row { background: var(--red-bg); }
.s-today .pic-row { background: var(--orange-bg); }
.oc-actions { display: flex; gap: 10px; }
.oc-actions .btn { flex: 1; min-height: 50px; }
.progress { height: 10px; background: var(--card); border-radius: 99px; overflow: hidden; border: 1px solid var(--blue-bd); }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), #FB923C); border-radius: 99px; }
.partial-box { background: var(--blue-bg); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; font-size: 14px; }

/* table view */
.tbl-wrap { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow-x: auto; border: 1px solid var(--line); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 900px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 12px; border-bottom: 1px solid var(--line); background: var(--field); position: sticky; top: 0; }
.tbl td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr { cursor: pointer; }
.tbl tr:hover td { background: var(--field); }
.tbl tr.s-overdue td:first-child { box-shadow: inset 4px 0 0 var(--red); }
.tbl tr.s-today td:first-child { box-shadow: inset 4px 0 0 var(--orange); }

.empty { text-align: center; padding: 40px 16px; color: var(--ink2); font-size: 17px; background: var(--card); border-radius: var(--r); border: 2px dashed var(--line); }

/* ---------- detail ---------- */
.page-head { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.page-head h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.back { width: 44px; height: 44px; border-radius: 50%; background: var(--card); display: grid; place-items: center; box-shadow: var(--shadow); flex: none; }
.hero { border-radius: 22px; padding: 18px; color: #fff; }
.hero.red { background: linear-gradient(145deg, #EF4444, var(--red-d)); }
.hero.orange { background: linear-gradient(145deg, #FB923C, var(--orange-d)); }
.hero.blue { background: linear-gradient(145deg, #3B82F6, #1D4ED8); }
.hero.green { background: linear-gradient(145deg, #22C55E, #15803D); }
.hero.gray { background: linear-gradient(145deg, #64748B, #334155); }
.hero-top { display: flex; align-items: center; gap: 12px; }
.hero-top .ico { width: 40px; height: 40px; flex: none; }
.hero h2 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.5px; line-height: 1.1; }
.hero .sub { font-size: 13px; opacity: .9; margin-top: 3px; letter-spacing: .3px; }
.hero .urgent { margin-left: auto; background: var(--card); color: var(--red); font-weight: 800; border-radius: 99px; padding: 8px 14px; font-size: 14px; text-align: center; line-height: 1.1; }
.eta-box { margin-top: 14px; background: var(--card); color: var(--ink); border-radius: 16px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.eta-box .col { flex: 1; }
.eta-box small { display: block; font-size: 11px; font-weight: 700; color: var(--ink2); letter-spacing: .3px; }
.eta-box .old { font-size: 20px; font-weight: 800; color: var(--red); text-decoration: line-through; }
.eta-box .new { background: var(--orange-bg); border: 1.5px solid var(--orange-bd); border-radius: 12px; padding: 6px 12px; }
.eta-box .new b { font-size: 22px; color: var(--brown); }
.eta-box .same b { font-size: 22px; }

.prod-card { display: flex; gap: 14px; align-items: center; }
.prod-card .thumb { width: 104px; height: 104px; border-radius: 16px; font-size: 48px; position: relative; }
.prod-card h2 { margin: 4px 0 0; font-size: 23px; font-weight: 800; letter-spacing: -.3px; line-height: 1.2; word-break: break-word; }
.sup-chip { display: inline-flex; gap: 5px; align-items: center; background: var(--soft); color: var(--blue); font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 8px; }
.owe { display: inline-flex; align-items: baseline; gap: 8px; margin-top: 8px; background: var(--red-bg); border: 1.5px solid var(--red-bd); color: var(--red); border-radius: 12px; padding: 6px 12px; font-weight: 700; font-size: 13px; }
.owe b { font-size: 24px; }
.owe.ok { background: var(--green-bg); border-color: var(--green-bd); color: var(--green); }
.photo-btn { position: absolute; bottom: 6px; right: 6px; width: 32px; height: 32px; border-radius: 50%; background: rgba(15,23,42,.7); color: #fff; display: grid; place-items: center; }
.photo-btn .ico { width: 18px; height: 18px; }

.msg-preview { background: var(--green-bg); border: 1.5px solid var(--green-bd); border-radius: 14px; padding: 12px 14px; white-space: pre-line; font-size: 15px; color: #14532D; }
.online { background: var(--green-bg); color: var(--green); font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; margin-left: auto; }

.qa { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.qa button {
  border-radius: 16px; min-height: 96px; color: #fff; font-weight: 800; font-size: 16px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; padding: 10px 6px; text-align: center; line-height: 1.15;
  transition: transform .08s;
}
.qa button:active { transform: scale(.96); }
.qa button .ico { width: 30px; height: 30px; }
.qa .g { background: var(--green); }
.qa .b { background: var(--blue); }
.qa .o { background: var(--brown); }

.reasons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.reason {
  border: 2px solid var(--line); background: var(--field); border-radius: 14px; padding: 12px; text-align: left; display: flex; gap: 10px;
  align-items: center; min-height: 64px; font-weight: 700; font-size: 15px; line-height: 1.2;
}
.reason .em { font-size: 24px; flex: none; }
.reason.on { border-color: var(--red); background: var(--red-bg); color: var(--red-d); }
.need-box { border: 2px solid var(--red); background: var(--red-bg); }
.need-box .need { color: var(--red); font-weight: 800; display: flex; gap: 6px; align-items: center; margin-bottom: 10px; }

.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick button {
  padding: 11px 16px; border-radius: 12px; background: var(--field); font-weight: 700; font-size: 15px; border: 2px solid transparent;
  display: inline-flex; align-items: center; gap: 6px;
}
.pick button.on { background: var(--brown); color: #fff; }
.pick.soft button.on { background: var(--orange-bg); color: var(--brown); border-color: var(--orange-bd); }

.timeline { list-style: none; margin: 0; padding: 0 0 0 6px; }
.timeline li { position: relative; padding: 0 0 18px 30px; }
.timeline li::before { content: ""; position: absolute; left: 9px; top: 22px; bottom: -2px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .tdot { position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--field); }
.timeline .tdot.red { background: var(--red); color: #fff; }
.timeline .tdot.green { background: var(--green); color: #fff; }
.timeline .tdot.orange { background: var(--orange); color: #fff; }
.timeline .tdot.blue { background: var(--blue); color: #fff; }
.timeline .tdot.wa { background: var(--wa); color: #fff; }
.timeline .when { font-weight: 800; font-size: 15px; }
.timeline .what { font-size: 15px; font-weight: 700; }
.timeline .who { font-size: 13px; color: var(--ink2); }
.timeline .tnote { font-size: 14px; background: var(--field); padding: 6px 10px; border-radius: 10px; margin-top: 4px; white-space: pre-line; }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.info-grid div small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.info-grid div b { font-size: 15px; word-break: break-word; }
.info-grid .full { grid-column: 1 / -1; }

.pic-card { display: flex; align-items: center; gap: 12px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label, .lbl { font-weight: 700; font-size: 14px; color: var(--ink2); }
.input, select.input, textarea.input {
  width: 100%; border: 1.5px solid var(--line); background: var(--field); border-radius: 13px; padding: 0 14px; height: 52px;
  font-size: 17px; outline: none; transition: border-color .15s, background .15s;
}
textarea.input { height: auto; min-height: 84px; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--orange); background: var(--card); }
.input.big { height: 58px; font-size: 19px; font-weight: 700; }
.step { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 18px; font-weight: 800; }
.step .num { width: 30px; height: 30px; border-radius: 50%; background: var(--brown-bg); color: var(--brown); display: grid; place-items: center; font-size: 15px; flex: none; }
.step .req { margin-left: auto; color: var(--red); font-size: 12px; font-weight: 700; }
.hint-card { display: flex; align-items: center; gap: 12px; background: var(--blue-bg); border: 1.5px solid var(--blue-bd); border-radius: 16px; padding: 12px 14px; }
.hint-card b { font-size: 16px; }
.hint-card .ico { width: 26px; height: 26px; color: var(--brown); }
.po-pill { background: var(--orange-bg); color: var(--brown); border-radius: 99px; padding: 8px 14px; font-weight: 800; margin-left: auto; white-space: nowrap; }

.product-row { display: flex; gap: 8px; }
.product-row .input { flex: 1; }
.cam-btn { background: var(--brown); color: #fff; border-radius: 13px; padding: 0 14px; display: flex; align-items: center; gap: 6px; font-weight: 700; flex: none; height: 58px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.tile {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--field); text-align: left;
  min-height: 62px; border: 2px solid transparent; min-width: 0;
}
.tile .em { font-size: 28px; flex: none; width: 40px; height: 40px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; }
.tile .em img { width: 100%; height: 100%; object-fit: cover; }
.tile b { font-size: 15px; display: block; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tile small { font-size: 12px; color: var(--ink2); }
.tile.on { background: var(--brown); color: #fff; }
.tile.on small { color: #FED7AA; }
.photo-prev { display: flex; align-items: center; gap: 12px; margin-top: 12px; background: var(--green-bg); border-radius: 14px; padding: 8px; }
.photo-prev img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; }

.stepper { display: flex; align-items: center; gap: 10px; background: var(--field); border-radius: 18px; padding: 10px; }
.stepper button { width: 64px; height: 64px; border-radius: 16px; background: var(--blue-bg); color: var(--ink); display: grid; place-items: center; flex: none; }
.stepper button .ico { width: 30px; height: 30px; }
.stepper input { flex: 1; min-width: 0; text-align: center; border: 0; background: transparent; font-size: 40px; font-weight: 800; color: var(--brown); outline: none; }
.stepper .u { display: block; text-align: center; font-size: 14px; color: var(--ink2); font-weight: 600; }
.unit-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.unit-grid button { background: var(--field); border-radius: 12px; min-height: 48px; font-weight: 700; font-size: 15px; }
.unit-grid button.on { background: var(--brown); color: #fff; }
.qty-grid button.on { background: var(--brown-bg); color: var(--brown); }
.date-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.date-grid button { background: var(--field); border-radius: 14px; min-height: 58px; font-weight: 800; font-size: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; }
.date-grid button small { font-weight: 600; font-size: 12px; opacity: .8; }
.date-grid button.on { background: var(--brown); color: #fff; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.person {
  background: var(--field); border-radius: 16px; padding: 14px 8px; text-align: center; display: flex; flex-direction: column;
  align-items: center; gap: 6px; font-weight: 800; font-size: 15px; border: 2px solid transparent;
}
.person .avatar { width: 44px; height: 44px; font-size: 18px; background: var(--card); color: var(--brown); }
.person small { font-size: 11.5px; font-weight: 600; color: var(--ink2); }
.person.on { background: var(--brown); color: #fff; }
.person.on small { color: #FED7AA; }
.sticky-save { /* floating save bar: always visible while filling the form */
  position: fixed; left: 0; right: 0; bottom: calc(68px + env(safe-area-inset-bottom)); z-index: 25;
  display: flex; flex-direction: row; gap: 10px; padding: 10px 14px; margin: 0 auto; width: min(1040px, calc(100% - 16px));
  background: var(--glass, rgba(255,255,255,.85)); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 30px rgba(15,23,42,.18);
}
.sticky-save #save-btn { flex: 1; margin: 0; }
.sticky-save > a.btn { flex: 0 0 auto; width: auto; padding-left: 18px; padding-right: 18px; margin: 0; }
form:has(.sticky-save) { padding-bottom: 96px; }
.form-err { background: var(--red-bg); color: var(--red); font-weight: 700; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--red-bd); }

/* ---------- suppliers / staff / admin ---------- */
.grid-list { display: grid; grid-template-columns: 1fr; gap: 12px; }
.ent { display: flex; flex-direction: column; gap: 12px; }
.ent-head { display: flex; align-items: center; gap: 12px; }
.ent-head .avatar { width: 46px; height: 46px; font-size: 18px; background: var(--brown-bg); color: var(--brown); border-radius: 14px; }
.ent-head h3 { margin: 0; font-size: 18px; font-weight: 800; }
.counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.counts.c3 { grid-template-columns: repeat(3, 1fr); }
.counts div { background: var(--field); border-radius: 12px; padding: 8px 6px; text-align: center; }
.counts div b { display: block; font-size: 22px; font-weight: 800; }
.counts div small { font-size: 12px; font-weight: 700; color: var(--ink2); }
.counts .c-red { background: var(--red-bg); color: var(--red); }
.counts .c-orange { background: var(--orange-bg); color: var(--orange-d); }
.counts .c-green { background: var(--green-bg); color: var(--green); }
.counts .c-red small, .counts .c-orange small, .counts .c-green small { color: inherit; }

.tabs { display: flex; gap: 6px; background: var(--field); padding: 4px; border-radius: 14px; margin-bottom: 14px; overflow-x: auto; }
.tabs button { flex: 1; padding: 11px 12px; border-radius: 11px; font-weight: 700; color: var(--ink2); white-space: nowrap; }
.tabs button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.perm-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.checks { display: flex; flex-direction: column; gap: 8px; }
.check {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 13px; background: var(--field); border: 1.5px solid var(--line);
  font-weight: 600; cursor: pointer;
}
.check input { width: 24px; height: 24px; accent-color: var(--orange); flex: none; }
.check.dis { opacity: .6; }
.sync-status { font-size: 14px; padding: 10px 12px; border-radius: 12px; background: var(--field); }
.sync-status.ok { background: var(--green-bg); color: #166534; }
.sync-status.bad { background: var(--red-bg); color: var(--red-d); }
.steps-help { font-size: 14px; color: var(--ink2); padding-left: 20px; margin: 6px 0 14px; }
.steps-help li { margin-bottom: 4px; }
code { background: var(--field); padding: 1px 6px; border-radius: 6px; font-size: 13px; }

/* ---------- login ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-box { width: 100%; max-width: 400px; }
.auth-box .head { text-align: center; margin-bottom: 20px; }
.auth-box .head .logo { margin: 0 auto 14px; }
.auth-box h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.4px; }
.auth-box .head p { margin: 6px 0 0; color: var(--ink2); }

/* ---------- sheet (modal) ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 60; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet {
  background: var(--card); width: 100%; max-width: 560px; border-radius: 24px 24px 0 0; padding: 10px 18px calc(20px + env(safe-area-inset-bottom));
  max-height: 92vh; overflow-y: auto; animation: up .2s ease-out;
}
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.sheet h3 { margin: 0 0 14px; font-size: 20px; font-weight: 800; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 80;
  background: #1E293B; color: #fff; padding: 14px 18px; border-radius: 16px; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  opacity: 0; pointer-events: none; transition: all .25s; max-width: calc(100% - 32px); display: flex; gap: 10px; align-items: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--red); }
.toast .ico { width: 24px; height: 24px; color: #4ADE80; }
.toast.err .ico { color: #fff; }

.rem-item { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--field); cursor: pointer; }
.rem-item + .rem-item { margin-top: 8px; }
.rem-item.red { background: var(--red-bg); }
.rem-item.orange { background: var(--orange-bg); }
.rem-item .em { font-size: 24px; }
.menu-list { display: flex; flex-direction: column; gap: 8px; }

/* ---------- desktop ---------- */
@media (min-width: 720px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .orders { grid-template-columns: repeat(2, 1fr); }
  .grid-list { grid-template-columns: repeat(2, 1fr); }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .sheet-bg { align-items: center; }
  .sheet { border-radius: 24px; }
}
@media (min-width: 1000px) {
  .desk-nav { display: flex; }
  .bottom-nav { display: none; }
  main { padding-bottom: 40px; }
  .orders { grid-template-columns: repeat(3, 1fr); }
  .grid-list { grid-template-columns: repeat(3, 1fr); }
  .sticky-save { bottom: 16px; }
  .toast { bottom: 30px; }
  .detail-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 16px; align-items: start; }
  .detail-grid > div > .card:first-child, .detail-grid > div > .hero:first-child { margin-top: 0; }
  .form-wrap { max-width: 760px; margin: 0 auto; }
}
@media (max-width: 380px) {
  .brand h1 small { display: none; }
  .stat .st-num b { font-size: 34px; }
  .qa button { font-size: 14px; }
}

/* fixes */
.stepper input { width: 100%; }
.oc-actions .btn { font-size: 15px; padding: 0 10px; white-space: nowrap; }
@media (max-width: 480px) {
  .brand h1 small { display: none; }
  .brand h1 { font-size: 17px; }
  .lang-switch button { padding: 5px 7px; font-size: 12px; }
  .topbar-in { gap: 6px; }
}
.notif-card { display: flex; gap: 12px; align-items: center; }
.notif-card .em { font-size: 28px; }

/* setup check */
.cfg-list { display: flex; flex-direction: column; gap: 10px; }
.cfg-item { background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.cfg-item.miss { border-color: var(--red-bd); background: var(--field); }
.cfg-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cfg-name code { font-size: 17px; font-weight: 800; padding: 6px 10px; background: var(--field); border-radius: 10px; word-break: break-all; }
.cfg-name.sm code { font-size: 14px; font-weight: 700; }
.copy-btn { display: inline-flex; align-items: center; gap: 5px; background: var(--ink); color: var(--bg); border-radius: 10px; padding: 8px 12px; font-weight: 700; font-size: 14px; margin-left: auto; }
.copy-btn .ico { width: 16px; height: 16px; }
.copy-btn.done { background: var(--green); }
.auth-box { max-width: 520px; }

/* purchase requests */
.purple { color: var(--purple); }
.ocard.s-request { border-color: #C4B5FD; }
.s-request .pic-row { background: var(--purple-bg); }
.btn.purple { background: var(--purple); color: #fff; }
.alert-strip.purple { background: var(--purple); color: #fff; }
.alert-strip.purple > *, .alert-strip.blue > * { color: #fff; }
.hero.purple { background: linear-gradient(145deg, #8B5CF6, #6D28D9); }
.timeline .tdot.purple { background: var(--purple); color: #fff; }
.rem-item.purple { background: var(--purple-bg); }
.who-line { font-size: 12.5px; color: var(--ink2); margin-top: -4px; }
.who-line b { color: var(--ink); font-weight: 700; }
.tbl tr.s-request td:first-child { box-shadow: inset 4px 0 0 var(--purple); }

/* quick buttons on each order card */
.card-qa { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.card-qa button { border-radius: 14px; min-height: 64px; color: #fff; font-weight: 800; font-size: 14px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; padding: 8px 4px; line-height: 1.15; text-align: center; transition: transform .08s; }
.card-qa button:active { transform: scale(.96); }
.card-qa .ico { width: 22px; height: 22px; }
.card-qa .g { background: var(--green); }
.card-qa .b { background: var(--blue); }
.card-qa .o { background: var(--brown); }
.card-status { display: flex; flex-direction: column; gap: 6px; }
.card-status .cs-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.card-status button { padding: 9px 4px; border-radius: 10px; background: var(--field); font-weight: 700; font-size: 13.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.card-status button.on { background: var(--brown); color: #fff; }
.push-times { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 480px) { .push-times { grid-template-columns: repeat(2, 1fr); } }

/* sort + filter bar */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 14px; align-items: flex-end; }
.fb { display: flex; flex-direction: column; gap: 3px; flex: 1 1 150px; min-width: 0; }
.fb span { font-size: 12px; font-weight: 700; color: var(--ink2); display: flex; align-items: center; gap: 4px; }
.fb span .ico { width: 14px; height: 14px; }
.fb select { height: 40px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); padding: 0 10px; font-weight: 600; font-size: 14px; width: 100%; }
.fb-clear { flex: none; min-height: 44px; background: var(--card); border: 1.5px solid var(--line); color: var(--ink2); }
.fb-clear.on { background: var(--orange-bg); border-color: var(--orange-bd); color: var(--brown); }
.fb-clear:disabled { opacity: .5; cursor: default; }
@media (max-width: 480px) { .fb { flex-basis: calc(50% - 4px); } }
/* table: sortable headers + row actions */
.tbl th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.tbl th.sortable:hover { color: var(--ink); }
.tbl th.sortable.on { color: var(--orange-d); }
.tbl th .arr { margin-left: 4px; font-size: 10px; opacity: .8; }
.ta-row { display: flex; gap: 6px; align-items: center; }
.ta { display: inline-flex; align-items: center; gap: 4px; border-radius: 9px; padding: 7px 9px; color: #fff; font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.ta .ico { width: 15px; height: 15px; }
.ta.g { background: var(--green); } .ta.b { background: var(--blue); } .ta.o { background: var(--brown); } .ta.purple { background: var(--purple); }
.ta-sel { height: 34px; border-radius: 9px; border: 1.5px solid var(--line); background: var(--field); font-weight: 700; font-size: 12.5px; padding: 0 6px; }
table.tbl { min-width: 1180px; }

/* full product picker */
.prod-list-head { display: flex; justify-content: space-between; align-items: baseline; margin: 12px 2px 6px; font-weight: 700; font-size: 13px; color: var(--ink2); }
.prod-list { max-height: 420px; overflow-y: auto; padding: 2px; }
.prod-list .tiles { margin-top: 0; }
.prod-list .tile { min-height: 72px; background: var(--field); }
.prod-list .tile .em { width: 46px; height: 46px; font-size: 32px; }
.prod-list .tile b { font-size: 17px; font-weight: 800; }
.prod-list .tile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prod-list .tile.on { background: var(--brown); }
.prod-list .tile.other { background: var(--card); border: 2px dashed var(--line); }
.prod-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); min-height: 56px; }
.prod-item:last-child { border-bottom: 0; }
.prod-item:hover { background: var(--card); }
.prod-item .em { width: 38px; height: 38px; border-radius: 9px; overflow: hidden; display: grid; place-items: center; font-size: 24px; flex: none; background: var(--card); }
.prod-item .em img { width: 100%; height: 100%; object-fit: cover; }
.prod-item b { display: block; font-size: 15px; line-height: 1.25; word-break: break-word; }
.prod-item small { font-size: 12px; color: var(--ink2); }
.prod-item.on { background: var(--brown); color: #fff; }
.prod-item.on small { color: #FED7AA; }

/* WhatsApp group */
.btn.wa-group { background: var(--green-bg); color: #166534; border: 1.5px solid #86EFAC; }
.oc-actions .btn.wa-group { flex: 0 0 auto; padding: 0 14px; }
.wa-pair { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; margin-top: 12px; }
.wa-pair .btn { min-width: 0; }
@media (max-width: 420px) { .wa-pair { grid-template-columns: 1fr; } }

/* supplier quotes */
.quotes { display: flex; flex-direction: column; gap: 10px; }
.quote { border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 12px; background: var(--field); }
.quote.sel { border-color: var(--green-bd); background: var(--green-bg); }
.quote b { font-size: 16px; }
.q-price { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.q-price label { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.q-price label span { font-size: 12px; font-weight: 700; color: var(--ink2); }
.q-price .input { height: 44px; font-size: 16px; }
.q-price .q-note { grid-column: 1 / -1; }
.extra-sup .pick button { font-size: 14px; padding: 8px 12px; }
.done-line { display: flex; align-items: center; gap: 6px; background: var(--green-bg); color: #166534; border-radius: 10px; padding: 8px 10px; font-size: 13.5px; }
.done-line b { color: #14532D; }
.danger-card { border: 1.5px solid var(--red-bd); }
.log-tgt { color: var(--ink); font-weight: 600; text-decoration: none; }
a.log-tgt { color: var(--orange, #F97316); }
.timeline li.empty { padding-left: 0; }
.timeline li.empty::before { display: none; }
.alert-strip.blue { background: var(--blue); }

/* ---------- layout wrappers (no effect on phone / tablet) ---------- */
.dash, .dash-side, .dash-main, .fcols, .fcol { display: contents; }
.dcol { min-width: 0; }

/* ---------- PC: wider layout (page scrolls normally) ---------- */
@media (min-width: 1000px) {
  main, .topbar-in { max-width: 1680px; }
  main { padding-left: 24px; padding-right: 24px; }
  .orders { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
  .grid-list { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  .form-wrap { max-width: 1040px; }
  .prod-list .tiles { grid-template-columns: repeat(4, 1fr); }
  .detail-grid { grid-template-columns: 1.15fr .85fr; gap: 20px; }
}
@media (min-width: 1500px) {
  .form-wrap { max-width: 1200px; }
  .prod-list .tiles { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 600px) {
  .notif-card { flex-wrap: wrap; }
  .notif-card .grow { flex: 1 1 60%; }
  .notif-card .row { flex-direction: row !important; width: 100%; }
  .notif-card .row .btn { flex: 1; }
}

/* ---------- phone / tablet: never wider than the screen ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { max-width: 100%; overflow-x: hidden; }
img, video, canvas, svg { max-width: 100%; }
.sec-title { flex-wrap: wrap; row-gap: 8px; }
.page-head { min-width: 0; }
.page-head h2 { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .list-tools { width: 100%; margin-left: 0; flex-wrap: wrap; }
  .list-tools > .btn { flex: 1 1 auto; justify-content: center; white-space: nowrap; }
  .seg { flex: none; }
}
@media (max-width: 380px) {
  .po-pill { padding: 6px 10px; font-size: 13px; }
  .page-head h2 { font-size: 19px; }
  .reasons { grid-template-columns: 1fr; }
  .list-tools .btn.sm { padding: 0 8px; font-size: 13px; }
}
.brand .grow { min-width: 0; }
.brand h1 { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1280px) { .brand h1 small { display: none; } }
@media (min-width: 1000px) and (max-width: 1150px) {
  .desk-nav a { padding: 8px 10px; }
  .topbar-in { gap: 8px; }
}

/* ---------- tick many orders -> all received ---------- */
.bulk-btn.on { background: var(--green); color: #fff; }
.ocard.selecting { cursor: pointer; position: relative; }
.ocard.selecting .oc-actions, .ocard.selecting .oc-actions + *, .ocard.selecting [data-act]:not(.ocard) { pointer-events: none; }
.ocard.selecting .oc-actions { display: none; }
.ocard.picked { border-color: var(--green) !important; box-shadow: 0 0 0 3px rgba(34, 197, 94, .25); }
.ocard.sel-dis, tr.sel-dis { opacity: .45; }
.sel-box { width: 28px; height: 28px; border-radius: 8px; border: 2.5px solid var(--line); background: var(--card); display: grid; place-items: center; color: #fff; flex: none; }
.ocard .sel-box { position: absolute; top: -10px; left: -10px; z-index: 2; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.picked .sel-box { background: var(--green); border-color: var(--green); }
.sel-box .ico { width: 18px; height: 18px; }
.tbl .sel-col { width: 40px; }
tr.selecting { cursor: pointer; }
tr.picked td { background: var(--green-bg); }
tr.selecting .ta { pointer-events: none; }
.bulk-bar { position: fixed; left: 50%; transform: translateX(-50%); width: min(1100px, calc(100% - 24px)); bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 45; margin: 0; }
body.selecting #list { padding-bottom: 110px; }
.bulk-in { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--card); border: 2px solid var(--green); border-radius: 16px; padding: 10px 12px; box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.bulk-in b { margin-right: auto; }
.bulk-in .btn.green { min-height: 44px; padding: 0 16px; }
.bulk-in .btn.green:disabled { opacity: .5; }
.bulk-list { max-height: 40vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.bulk-list > div { background: var(--field); border-radius: 10px; padding: 8px 10px; }
@media (min-width: 1000px) { .bulk-bar { bottom: 16px; } }
.ocard.selecting .card-qa, .ocard.selecting .card-status { display: none; }

/* product photo + name in "received" confirmations */
.rcv-head { display: flex; gap: 14px; align-items: center; background: var(--field); border-radius: 16px; padding: 12px; margin: 0 0 14px; }
.rcv-img { width: 120px; height: 120px; border-radius: 14px; overflow: hidden; background: var(--card); display: grid; place-items: center; font-size: 56px; flex: none; border: 1px solid var(--line); }
.rcv-img img { width: 100%; height: 100%; object-fit: cover; }
.rcv-name { font-size: 20px; font-weight: 800; line-height: 1.25; word-break: break-word; }
.rcv-qty { display: inline-block; margin: 6px 0 4px; background: var(--orange-bg); color: var(--brown); font-weight: 800; border-radius: 10px; padding: 3px 10px; font-size: 16px; }
@media (max-width: 380px) { .rcv-img { width: 92px; height: 92px; } .rcv-name { font-size: 18px; } }
.bulk-list .bl-row { display: flex; gap: 10px; align-items: center; }
.bl-img { width: 48px; height: 48px; border-radius: 10px; overflow: hidden; background: var(--card); display: grid; place-items: center; font-size: 26px; flex: none; }
.bl-img img { width: 100%; height: 100%; object-fit: cover; }
.ta.c { background: var(--card); color: var(--ink); border: 1.5px solid var(--line); }
.ta-row .ta-row { display: contents; }

/* ---------- offline ---------- */
.net-bar { display: flex; align-items: center; gap: 10px; background: #334155; color: #fff; border-radius: 12px; padding: 9px 12px; margin-bottom: 12px; font-weight: 700; font-size: 14px; }
.net-bar span { flex: 1; }
.net-bar.sync { background: var(--blue); }
.net-bar .btn { background: var(--card); color: var(--ink); border: 0; min-height: 34px; }
.pend-badge { background: #334155 !important; color: #fff !important; }

/* ---------- urgent ---------- */
.urgent-toggle { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-top: 14px; box-shadow: var(--shadow); }
.urgent-toggle .ut-ico { font-size: 28px; filter: grayscale(1); opacity: .6; }
.urgent-toggle b { display: block; font-size: 17px; }
.urgent-toggle small { display: block; font-size: 12.5px; color: var(--ink2); }
.ut-sw { width: 52px; height: 30px; border-radius: 99px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.ut-sw i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s; }
.urgent-toggle.on { border-color: var(--red); background: var(--red-bg); }
.urgent-toggle.on b { color: var(--red-d); }
.urgent-toggle.on .ut-ico { filter: none; opacity: 1; }
.urgent-toggle.on .ut-sw { background: var(--red); }
.urgent-toggle.on .ut-sw i { left: 25px; }
.urgent-badge { background: var(--red) !important; color: #fff !important; font-weight: 800; }
.urgent-badge.sm { font-size: 11px; padding: 2px 7px; }
.ocard.is-urgent { border-color: var(--red) !important; box-shadow: 0 0 0 2px rgba(239, 68, 68, .18), var(--shadow); }
.urgent-strip { background: var(--red); color: #fff; font-weight: 800; border-radius: 14px; padding: 10px 14px; margin-bottom: 10px; font-size: 16px; }

.ed-box { margin-top: 4px; background: var(--field); border-radius: 10px; padding: 6px 10px; font-size: 13.5px; display: flex; flex-direction: column; gap: 3px; }
.ed-line s { color: var(--muted); }
.ed-urgent { color: var(--red-d); font-weight: 800; }

.trash-list { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow-y: auto; }
.trash-row { display: flex; gap: 10px; align-items: center; background: var(--field); border-radius: 12px; padding: 10px 12px; }

.list-tools > .btn { white-space: nowrap; }

/* ---------- calendar ---------- */
.cal { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px; }
.cal-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.cal-head h3 { margin: 0 6px; font-size: 20px; min-width: 150px; text-align: center; }
.cal-head .btn.primary { margin-left: auto; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { text-align: center; font-weight: 800; font-size: 13px; color: var(--ink2); padding: 6px 0; }
.cal-wd:first-child { color: var(--red); }
.cal-wd .short { display: none; }
.cal-day { min-height: 108px; background: var(--field); border-radius: 10px; padding: 5px; text-align: left; display: flex; flex-direction: column; gap: 3px; border: 2px solid transparent; min-width: 0; }
.cal-day.other { opacity: .45; }
.cal-day.today { border-color: var(--orange); background: var(--orange-bg); }
.cal-n { font-weight: 800; font-size: 15px; }
.cal-day:nth-child(7n+1) .cal-n { color: var(--red); }
.cal-items { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-it { font-size: 11.5px; line-height: 1.25; padding: 2px 5px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--card); border-left: 3px solid var(--blue); }
.cal-it.or.s-overdue { border-left-color: var(--red); } .cal-it.or.s-today { border-left-color: var(--orange); } .cal-it.or.s-done { opacity: .6; border-left-color: var(--green); }
.cal-it.or.s-partial { border-left-color: var(--blue); } .cal-it.urg { background: var(--red-bg); font-weight: 700; }
.cal-it.ev { font-weight: 700; }
.cal-more { font-size: 11px; font-weight: 800; color: var(--ink2); padding-left: 4px; }
.cal-dots { display: none; gap: 3px; flex-wrap: wrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--blue); }
.dot.s-overdue { background: var(--red); } .dot.s-today { background: var(--orange); } .dot.s-done { background: var(--green); } .dot.s-request { background: var(--purple); } .dot.s-wait, .dot.s-partial { background: var(--blue); }
.ev-blue { --evc: #2563EB; } .ev-green { --evc: #16A34A; } .ev-orange { --evc: #EA580C; } .ev-red { --evc: #DC2626; } .ev-purple { --evc: #7C3AED; }
.cal-it.ev { border-left-color: var(--evc); color: var(--evc); }
.dot[class*=ev-] { background: var(--evc); border-radius: 2px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 12.5px; color: var(--ink2); font-weight: 700; }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.sec-mini { font-weight: 800; font-size: 14px; color: var(--ink2); margin: 4px 2px 8px; }
.ev-row { display: flex; gap: 10px; align-items: center; background: var(--field); border-left: 5px solid var(--evc); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.day-orders { display: flex; flex-direction: column; gap: 6px; max-height: 40vh; overflow-y: auto; }
.day-o { display: flex; align-items: center; gap: 8px; text-align: left; background: var(--field); border-radius: 10px; padding: 8px 10px; border-left: 5px solid var(--blue); }
.day-o.s-overdue { border-left-color: var(--red); } .day-o.s-today { border-left-color: var(--orange); } .day-o.s-done { border-left-color: var(--green); opacity: .7; }
.ev-colors { display: flex; gap: 10px; }
.ev-c input { display: none; }
.ev-c span { display: block; width: 38px; height: 38px; border-radius: 50%; background: var(--evc); border: 4px solid var(--card); box-shadow: 0 0 0 2px var(--line); cursor: pointer; }
.ev-c input:checked + span { box-shadow: 0 0 0 3px var(--ink); }
@media (max-width: 700px) {
  .cal { padding: 8px; }
  .cal-grid { gap: 3px; }
  .cal-wd .long { display: none; } .cal-wd .short { display: inline; }
  .cal-day { min-height: 58px; padding: 4px; border-radius: 8px; }
  .cal-items { display: none; }
  .cal-dots { display: flex; }
  .cal-n { font-size: 14px; }
  .cal-head h3 { font-size: 17px; min-width: 0; flex: 1; }
  .cal-head .btn.primary { margin-left: 0; width: 100%; }
}

.card-qa.two, .qa.two { grid-template-columns: 1fr 1fr; }

/* help button: on small phones keep the header on one line (logo only, no title text) */
@media (max-width: 430px) { .topbar .brand .grow { display: none; } }

/* wrong item received */
.wr-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wr-modes button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 10px; border-radius: 14px; background: var(--field); border: 2px solid transparent; text-align: center; color: var(--ink); }
.wr-modes button .em { font-size: 30px; }
.wr-modes button b { font-size: 17px; }
.wr-modes button small { font-size: 12px; color: var(--ink2); font-weight: 600; }
.wr-modes button.on { border-color: var(--red, #DC2626); background: var(--red-bg, #FEF2F2); }
.wrong-badge { white-space: normal; }
.wrong-strip { background: #991B1B; }

/* staff page: search + table view */
.staff-tools { gap: 10px; margin-bottom: 14px; flex-wrap: nowrap; align-items: center; }
.staff-tbl { min-width: 860px; }
.staff-tbl td.num, .staff-tbl th.num { text-align: center; width: 90px; }
.staff-tbl .perm-badges { margin: 0; max-width: 440px; }
.staff-tbl .perm-badges .badge { font-size: 11px; padding: 3px 7px; }
.icon-btn.del-user { color: var(--red); }
.sup-tbl { min-width: 980px; }
.sup-tbl td.num, .sup-tbl th.num { text-align: center; width: 84px; }
.sup-tbl .clamp1 { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* chase a supplier about all orders not delivered */
.alert-strip.wa-strip { background: #16A34A; color: #fff; margin: 0 0 12px; }
.chase-list { display: flex; flex-direction: column; gap: 8px; max-height: 38vh; overflow: auto; }
.chase-it { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--field); cursor: pointer; }
.chase-it.late { box-shadow: inset 4px 0 0 var(--red); }
.chase-it input { width: 22px; height: 22px; flex: none; accent-color: #16A34A; }
.chase-it .badge { flex: none; }

/* products catalogue */
.pr-card { text-align: left; cursor: pointer; border: 0; font: inherit; color: inherit; width: 100%; }
.pr-pic { width: 52px; height: 52px; border-radius: 14px; background: var(--field); display: grid; place-items: center; font-size: 28px; overflow: hidden; flex: none; }
.pr-pic img { width: 100%; height: 100%; object-fit: cover; }
.pr-pic.sm { width: 36px; height: 36px; font-size: 20px; border-radius: 10px; }
.pr-tbl { min-width: 960px; }
.pr-tbl td.num, .pr-tbl th.num { text-align: center; width: 86px; }
.pr-sups, .pr-orders { display: flex; flex-direction: column; gap: 8px; }
.pr-sup { background: var(--field); border-radius: 12px; padding: 10px 12px; }
.pr-ord { display: flex; gap: 10px; align-items: center; background: var(--field); border-radius: 12px; padding: 10px 12px; color: inherit; text-decoration: none; }
.badge .ico { width: 13px; height: 13px; }
.pr-qr { display: flex; gap: 14px; align-items: center; background: var(--field); border-radius: 14px; padding: 12px; margin-top: 14px; }
.pr-qr-img { width: 104px; height: 104px; background: #fff; border-radius: 10px; padding: 4px; flex: none; }
.pr-qr-img svg { width: 100%; height: 100%; display: block; }

/* product photo + codes */
.pr-photo { position: relative; border-radius: 16px; background: var(--field); min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; overflow: hidden; }
.pr-photo img { width: 100%; max-height: 300px; object-fit: contain; background: #fff; display: block; cursor: zoom-in; }
.pr-photo.none { padding: 18px 10px 0; } .pr-photo.none .em { font-size: 54px; }
.pr-photo-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.pr-photo .pr-photo-btns { padding: 8px; justify-content: center; }
.pr-photo-edit { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
#pr-photo-prev { width: 72px; height: 72px; border-radius: 12px; background: var(--field); display: grid; place-items: center; overflow: hidden; flex: none; font-size: 34px; }
#pr-photo-prev img { width: 100%; height: 100%; object-fit: cover; }
#pr-photo-prev .sm { font-size: 11px; text-align: center; padding: 4px; }
.pr-codes { display: grid; grid-template-columns: 150px 150px 1fr; gap: 10px; margin-top: 14px; }
.pr-code { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: zoom-in; font: inherit; color: #0F172A; }
.pr-code.empty { background: var(--field); cursor: default; justify-content: center; text-align: center; color: var(--ink2); }
.pc-img.qr { width: 120px; height: 120px; } .pc-img.bar { width: 100%; height: 84px; }
.pc-img svg { width: 100%; height: 100%; display: block; }
.pc-num { font: 700 15px/1 monospace; letter-spacing: 1px; }
.pc-lbl { font-size: 11px; color: #64748B; font-weight: 700; }
.code-zoom { position: fixed; inset: 0; z-index: 9999; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 20px; cursor: zoom-out; color: #000; }
.code-zoom .cz-box.qr { width: min(80vw, 70vh); height: min(80vw, 70vh); }
.code-zoom .cz-box.bar { width: min(94vw, 900px); height: min(40vh, 260px); }
.code-zoom .cz-box svg { width: 100%; height: 100%; display: block; }
.code-zoom .cz-txt { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.code-zoom .cz-txt b { font-size: 20px; } .code-zoom .cz-txt code { font: 700 26px monospace; letter-spacing: 2px; }
.code-zoom .cz-hint { font-size: 13px; color: #64748B; }
.code-zoom.photo { background: rgba(0,0,0,.92); } .code-zoom.photo img { max-width: 96vw; max-height: 92vh; object-fit: contain; }
@media (max-width: 560px) { .pr-codes { grid-template-columns: 1fr 1fr; } .pr-codes .pr-code:last-child { grid-column: 1 / -1; } }

.pc-img.ph { width: 120px; height: 120px; border-radius: 10px; overflow: hidden; padding: 0; border: 0; background: #F1F5F9; display: grid; place-items: center; cursor: zoom-in; }
.pc-img.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-img.ph.none { font-size: 46px; cursor: default; }
.pr-code.ph { position: relative; cursor: default; }
.pc-btns { position: absolute; top: 6px; right: 6px; display: flex; flex-direction: column; gap: 4px; }
.pc-ib { width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 1px solid #E2E8F0; box-shadow: 0 1px 4px rgba(0,0,0,.15); display: grid; place-items: center; cursor: pointer; font-size: 14px; color: #2563EB; }
.pc-ib .ico { width: 16px; height: 16px; }

.cam-btn.add-prod { background: var(--field); color: var(--orange-d); border: 2px dashed var(--orange-bd); padding: 0; width: 58px; justify-content: center; }
.cam-btn.add-prod .ico { width: 26px; height: 26px; }
.pr-tbl.slim { min-width: 640px; }
.pchg { background: #FEFCE8; border: 1px solid #FDE68A; border-radius: 12px; padding: 10px 12px; margin-top: 8px; }
.pchg-wrap { margin-top: 12px; } .pchg-wrap > b { font-size: 15px; }
.pchg-img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; background: #fff; }
.pchg-img.new { outline: 3px solid #16A34A; cursor: zoom-in; }
:root[data-theme="dark"] .pchg { background: #2A2510; border-color: #713F12; }

.pchg-card { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border-radius: 10px; padding: 10px; }
.pchg-photo { display: flex; align-items: center; gap: 6px; flex: none; flex-wrap: wrap; max-width: 170px; }
.pchg-photo.chg { background: #FEF08A; border-radius: 10px; padding: 6px; }
.pchg-photo .arrow { font-weight: 800; }
.pchg-img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; background: #fff; cursor: zoom-in; }
.pchg-img.none { display: grid; place-items: center; font-size: 34px; background: var(--field); cursor: default; }
.pchg-tbl { border-collapse: collapse; width: 100%; font-size: 13px; }
.pchg-tbl th { text-align: left; color: var(--ink2); font-weight: 700; padding: 4px 8px 4px 0; white-space: nowrap; vertical-align: top; width: 1%; }
.pchg-tbl td { padding: 4px 6px; word-break: break-word; }
.pchg-tbl tr.chg td, .pchg-tbl tr.chg th { background: #FEF08A; color: #713F12; }
.pchg-tbl tr.chg b { color: #15803D; }
.chg-tag { display: inline-block; font-size: 10px; font-weight: 800; background: #EA580C; color: #fff; border-radius: 6px; padding: 1px 6px; margin-left: 4px; text-transform: uppercase; }
:root[data-theme="dark"] .pchg-tbl tr.chg td, :root[data-theme="dark"] .pchg-tbl tr.chg th, :root[data-theme="dark"] .pchg-photo.chg { background: #713F12; color: #FEF3C7; }
:root[data-theme="dark"] .pchg-tbl tr.chg b { color: #86EFAC; }
@media (max-width: 480px) { .pchg-card { flex-direction: column; } .pchg-photo { max-width: none; } }
.pchg-photo.chg { flex-wrap: wrap; max-width: 200px; justify-content: center; }
.pchg-photo.chg .pchg-img { width: 64px; height: 64px; }
.pchg-photo.chg .chg-tag { flex-basis: 100%; text-align: center; margin: 2px 0 0; }
.staff-tbl.slim { min-width: 620px; }

/* smaller people tiles (order for / who follows up) */
.people.compact { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.people.compact .person { padding: 8px 4px; gap: 3px; font-size: 13px; border-radius: 12px; line-height: 1.15; word-break: break-word; }
.people.compact .person .avatar { width: 32px; height: 32px; font-size: 14px; }
.people.compact .person small { font-size: 10.5px; }
.barcode-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.barcode-row .bc-ico { width: 34px; display: grid; place-items: center; color: var(--ink2); flex: none; }
.barcode-row .bc-ico .ico { width: 22px; height: 22px; }
.barcode-row .input { flex: 1; min-width: 0; font-family: monospace; letter-spacing: 1px; }
.barcode-row .btn { flex: none; }
.photo-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .photo-choice .btn { min-height: 64px; }
.req-pop { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow: auto; }
.req-pop-it { display: flex; gap: 10px; align-items: center; background: var(--purple-bg, #F5F3FF); border-radius: 12px; padding: 10px; border-left: 4px solid var(--purple, #7C3AED); }
@media (max-width: 480px) { .req-pop-it { flex-wrap: wrap; } .req-pop-it .btn { width: 100%; } }
.add-item { margin-top: 12px; border: 2px dashed var(--orange-bd); }
.nf-items { margin-top: 12px; background: var(--field); border-radius: 12px; padding: 10px; }
.nf-item { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px dashed var(--line); }
.nf-item:first-of-type { border-top: 0; }
.nf-item .n { width: 24px; height: 24px; border-radius: 50%; background: var(--orange); color: #fff; font-weight: 800; font-size: 13px; display: grid; place-items: center; flex: none; }
.nf-item img { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; }
.nf-tbl { min-width: 640px; }
.nf-tbl td { padding: 6px; } .nf-tbl tr { cursor: default; } .nf-tbl tr:hover td { background: transparent; }
.nf-tbl .input.sm { height: 40px; padding: 6px 10px; font-size: 14px; border-radius: 10px; width: 100%; }
.nf-tbl .input.mono { font-family: monospace; }
.nf-tbl td:first-child { width: 28px; font-weight: 800; color: var(--orange-d); text-align: center; }
.nf-tbl td.num { width: 90px; } .nf-tbl .qty { text-align: center; }
.nf-tbl tr.first td { background: var(--field); }
.nf-table-card { margin-top: 0; }
.nf-img { width: 48px; height: 48px; border-radius: 10px; background: var(--field); border: 1px dashed var(--line); display: grid; place-items: center; overflow: hidden; color: var(--ink2); font-size: 22px; cursor: pointer; padding: 0; }
.nf-img img { width: 100%; height: 100%; object-fit: cover; }
.nf-img .ico { width: 20px; height: 20px; }
.nf-tbl td:nth-child(2) { width: 56px; }
.nf-tbl thead th { white-space: nowrap; }
.ac-btn { border-color: #2563EB !important; color: #1D4ED8; }
#ac-text.mono, .ac-tbl .mono { font-family: monospace; font-size: 12px; }
.ac-tbl { min-width: 520px; font-size: 13px; } .ac-tbl tr { cursor: default; } .ac-tbl tr.warn td { background: #FEF3C7; }
.ac-tbl td.num, .ac-tbl th.num { text-align: center; }
.alert-strip.ac-strip { background: #1D4ED8; color: #fff; margin: 0 0 12px; }

/* orders made together */
.tbl tr.grp-head td { background: #FFF7ED; color: #9A3412; font-size: 13px; padding: 8px 12px; border-top: 2px solid #FB923C; cursor: default; }
.tbl tr.grp-head:hover td { background: #FFF7ED; }
.tbl tr.grp-row td:first-child { box-shadow: inset 4px 0 0 #FB923C; }
.tbl tr.grp-row td:nth-child(1) { padding-left: 18px; }
.tbl tr.grp-last td { border-bottom: 2px solid #FB923C; }
.grp-box { grid-column: 1 / -1; border: 2px solid #FB923C; border-radius: 18px; padding: 10px; background: #FFF7ED; }
.grp-hd { font-size: 14px; color: #9A3412; padding: 2px 6px 10px; }
.grp-box > .orders { margin: 0; }
:root[data-theme="dark"] .tbl tr.grp-head td, :root[data-theme="dark"] .tbl tr.grp-head:hover td, :root[data-theme="dark"] .grp-box { background: #2A1A0E; color: #FDBA74; }
:root[data-theme="dark"] .grp-hd { color: #FDBA74; }
.grp-sel { display: inline-flex; align-items: center; gap: 8px; margin-right: 12px; padding: 4px 12px 4px 6px; border-radius: 10px; background: #fff; border: 2px solid #16A34A; color: #15803D; font-weight: 800; font-size: 13px; cursor: pointer; vertical-align: middle; }
.grp-sel .sel-box { width: 24px; height: 24px; border-radius: 7px; border: 2px solid #16A34A; display: grid; place-items: center; background: #fff; }
.grp-sel.on { background: #16A34A; color: #fff; } .grp-sel.on .sel-box { background: #fff; color: #16A34A; }
.grp-sel .sel-box .ico { width: 16px; height: 16px; }

/* order table: the header row stays visible while scrolling (table scrolls inside its box) */
#list .tbl-wrap { max-height: calc(100vh - 150px); overflow: auto; }
#list .tbl thead th { position: sticky; top: 0; z-index: 3; box-shadow: 0 1px 0 var(--line); }
#list .tbl tr.grp-head td { position: static; }
.ac-chip { display:inline-block; padding:0 6px; border-radius:6px; background:var(--chip, rgba(37,99,235,.1)); color:var(--accent, #2563eb); font-weight:600; font-family:ui-monospace,Menlo,Consolas,monospace; }
/* AutoCount-look preview of a pasted Purchase Order */
.sheet.ac-wide { max-width: 1020px; }
.acw { background: #F0F0F0; color: #000; border: 1px solid #A0A0A0; padding: 8px 10px 10px; font: 12px/1.25 Tahoma, "Segoe UI", Arial, sans-serif; border-radius: 4px; }
.acw-head { display: grid; grid-template-columns: 1.15fr 1fr; gap: 0 18px; }
.acw-l, .acw-r { display: grid; grid-template-columns: 108px 1fr; gap: 2px 6px; align-items: center; align-content: start; }
.acw-r { grid-template-columns: 100px minmax(0, 120px); }
.acw label { color: #000; font-weight: 400; margin: 0; font-size: 12px; white-space: nowrap; }
.acw-in { background: #fff; border: 1px solid #ABADB3; min-height: 19px; padding: 1px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #000; }
.acw-in.dd { display: flex; justify-content: space-between; gap: 4px; }
.acw-in.dd span { color: #555; font-size: 9px; }
.acw-cred { display: flex; gap: 3px; align-items: center; }
.acw-cred .acw-in { width: 78px; }
.acw-ico { border: 1px solid #ABADB3; background: #E6EEF8; font-size: 11px; padding: 0 3px; }
.acw-bar { display: flex; gap: 12px; align-items: center; margin: 8px 0 6px 8px; }
.acw-bar b { color: #2E7D32; font-size: 14px; }
.acw-bar .acw-in { width: 280px; }
.acw-tabs { display: flex; gap: 2px; margin-left: 4px; }
.acw-tabs span { border: 1px solid #A0A0A0; border-bottom: 0; padding: 2px 8px; background: #E4E4E4; font-size: 12px; }
.acw-tabs span.on { background: #fff; }
.acw-grid { background: #fff; border: 1px solid #A0A0A0; overflow: auto; min-height: 110px; }
.acw-grid table { border-collapse: collapse; width: 100%; }
.acw-grid th { background: linear-gradient(#FDFDFD, #E8E8E8); border: 1px solid #C8C8C8; font-weight: 400; text-align: left; padding: 2px 4px; white-space: nowrap; color: #000; font-size: 12px; }
.acw-grid td { border: 1px solid #E2E2E2; padding: 2px 4px; color: #1B7A1B; white-space: nowrap; max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.acw-grid td.num { text-align: right; }
.acw-grid td.c { text-align: center; color: #333; }
.acw-grid .sel { width: 14px; background: #F4F4F4; color: #333; text-align: center; }
.acw-grid tr.zero td { background: #FFF6D6; }
.acw-grid td.q0 { color: #C62828; font-weight: 700; }
.acw-foot { text-align: right; margin-top: 6px; font-size: 12px; }
.acw i { display: block; }
@media (max-width: 720px) { .acw-head { grid-template-columns: 1fr; } }
/* save error: jump to the field and blink red */
@keyframes flashErr { 0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); border-color: inherit; } 50% { box-shadow: 0 0 0 4px rgba(220,38,38,.55); border-color: #DC2626; background-color: rgba(254,226,226,.9); } }
@keyframes flashCard { 0%, 100% { box-shadow: var(--shadow, 0 1px 2px rgba(0,0,0,.05)); } 50% { box-shadow: 0 0 0 3px rgba(220,38,38,.45); } }
.flash-err { animation: flashErr .5s ease-in-out 5; border-color: #DC2626 !important; position: relative; z-index: 1; }
.flash-card { animation: flashCard .5s ease-in-out 5; }
body:has(.sticky-save) .toast { bottom: calc(160px + env(safe-area-inset-bottom)); }
@media (min-width: 720px) { body:has(.sticky-save) .toast { bottom: 110px; } }
/* folded groups */
.tbl tr.grp-head, .grp-hd { cursor: pointer; }
.tbl tr.grp-head td { cursor: pointer; }
.tbl tr.grp-head.closed td { border-bottom: 2px solid #FB923C; }
.grp-chev { display: inline-block; width: 16px; font-size: 13px; color: #EA580C; }
.grp-tog { margin-left: 10px; font-size: 12px; font-weight: 700; color: #EA580C; background: #FFEDD5; border-radius: 999px; padding: 2px 10px; }
.grp-box.closed { padding-bottom: 0; }
.grp-box.closed .grp-hd { padding-bottom: 10px; }
:root[data-theme="dark"] .grp-tog { background: #43260F; color: #FDBA74; }
/* edit name / quantity right on the order page */
.inl { cursor: pointer; border-radius: 10px; transition: background .15s; }
h2.inl:hover { background: var(--field); }
.inl-pen { display: inline-flex; vertical-align: middle; margin-left: 8px; opacity: .45; }
.inl-pen .ico, .inl-pen svg { width: 16px; height: 16px; }
.inl:hover .inl-pen { opacity: 1; }
.inl-q { margin-top: 8px; }
.inl-form { display: flex; flex-direction: column; gap: 4px; max-width: 460px; }
.inl-form .input { padding: 10px 12px; }
/* type-or-pick drop-down */
.combo { position: relative; min-width: 0; }
.combo > .input { width: 100%; padding-right: 44px; }
.combo-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--ink2); font-size: 16px; width: 34px; height: 34px; border-radius: 10px; cursor: pointer; }
.combo-btn:hover { background: var(--line); }
.combo-pane { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 34px rgba(15,23,42,.18); max-height: 300px; overflow-y: auto; padding: 6px; }
.combo-it { padding: 9px 12px; border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; }
.combo-it small { color: var(--ink2); font-size: 12px; }
.combo-it:hover, .combo-it.hi { background: var(--field); }
.combo-it.on { background: var(--orange-bg, #FFF7ED); }
.combo-empty { padding: 10px 12px; color: var(--ink2); font-size: 13px; }
.ac-zero-msg { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--red-bg, #FEE2E2); color: var(--red, #DC2626); font-weight: 700; font-size: 13px; border: 1.5px solid var(--red-bd, #FCA5A5); }
.btn.blocked { opacity: .55; filter: grayscale(.4); }
@keyframes flashRow { 0%, 100% { background: #FFF6D6; } 50% { background: #FCA5A5; } }
.acw-grid tr.flash-row td { animation: flashRow .5s ease-in-out 5; }
/* received more than ordered */
.btn.extra-btn { background: #FFF7ED; color: #C2410C; border: 1.5px solid #FDBA74; }
.extra-strip { background: #FFEDD5 !important; color: #9A3412 !important; display: flex; align-items: center; gap: 10px; }
.extra-strip small { display: block; font-weight: 600; opacity: .8; }
.extra-strip.done { background: #DCFCE7 !important; color: #166534 !important; }
.extra-strip .btn { background: #fff; color: #9A3412; }
.alert-strip.extra-alert { background: #EA580C; }
/* receive: the group this order belongs to */
.grp-info { background: #FFF7ED; border: 1.5px solid #FDBA74; border-radius: 14px; padding: 8px 12px; margin: 0 0 12px; }
.grp-info summary { cursor: pointer; font-weight: 700; color: #9A3412; font-size: 14px; }
.grp-info-list { margin-top: 8px; max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.grp-info .gi { display: flex; gap: 8px; align-items: center; font-size: 13px; padding: 5px 8px; border-radius: 8px; background: rgba(255,255,255,.7); }
.grp-info .gi.me { outline: 2px solid #EA580C; background: #fff; }
.grp-info .gi.ok { opacity: .65; }
.grp-info .gi-now { color: #EA580C; font-size: 12px; }
:root[data-theme="dark"] .grp-info { background: #2A1A0E; }
:root[data-theme="dark"] .grp-info .gi { background: rgba(0,0,0,.25); }
/* group receive */
.grp-sum { color: #9A3412; background: #FFF7ED; border: 1.5px solid #FDBA74; border-radius: 12px; padding: 8px 12px; }
.gr-wrap { max-height: 52vh; overflow: auto; }
.gr-tbl td, .gr-tbl th { vertical-align: middle; }
.gr-tbl tr.gr-row { cursor: pointer; }
.gr-tbl tr.gr-row.on td { background: #F0FDF4; }
.gr-tbl tr.gr-me td:first-child { box-shadow: inset 4px 0 0 #EA580C; }
.gr-tbl tr.gr-done td { opacity: .55; }
.gr-tbl .gr-cb { width: 22px; height: 22px; accent-color: #16A34A; cursor: pointer; }
.gr-tbl .gr-qty { width: 80px; text-align: right; padding: 6px 8px; display: inline-block; }
.gr-tbl .gr-qty.off { opacity: .4; }
.gi-now { color: #EA580C; font-size: 12px; font-weight: 700; }
:root[data-theme="dark"] .gr-tbl tr.gr-row.on td { background: #0F2A1A; }
:root[data-theme="dark"] .grp-sum { background: #2A1A0E; color: #FDBA74; }
.gr-tbl { min-width: 0; width: 100%; }
#list .gr-tbl, .gr-tbl { min-width: 0 !important; }
.gr-tag { margin-top: 4px; min-height: 0; }
.gr-tag:empty { display: none; }
.gr-tag .btn { padding: 2px 10px; min-height: 0; height: 24px; font-size: 12px; }
.grp-view { margin-left: 8px; font-size: 12px; font-weight: 700; color: #fff; background: #EA580C; border: 0; border-radius: 999px; padding: 3px 12px; cursor: pointer; }
.grp-view:hover { background: #C2410C; }
.gr-tbl tr.gr-done, .gr-tbl tr.gr-ro { cursor: pointer; }
.gr-tbl tr.gr-done:hover td { opacity: .85; }
.gr-alldone { margin-top: 12px; text-align: center; font-weight: 800; color: #16A34A; font-size: 16px; }
.grp-ret { color: #C2410C; font-weight: 800; background: #FFEDD5; border-radius: 999px; padding: 1px 8px; }
.gr-pick-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }
.gr-pick-it { display: flex; align-items: center; gap: 10px; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--field); cursor: pointer; font: inherit; color: inherit; }
.gr-pick-it:hover { border-color: #EA580C; }
.gr-pick-it.me { border-color: #EA580C; background: #FFF7ED; }
.gr-pick-it small { display: block; color: var(--ink2); font-size: 12px; }
.wrong-strip { display: flex; align-items: center; gap: 10px; }
.wrong-strip .btn { background: #fff; color: #B91C1C; }
.acr-box { background: #EFF6FF; border: 1.5px solid #BFDBFE; border-radius: 14px; padding: 10px 12px; margin-bottom: 12px; }
.acr-btn { margin-top: 6px; justify-content: flex-start; }
:root[data-theme="dark"] .acr-box { background: #0F1E33; border-color: #1E3A8A; }
.btn.wa-mini { background: #25D366 !important; color: #fff !important; border: 0; }
.wr-modes:has(> :nth-child(3)) { grid-template-columns: repeat(3, 1fr); }
.wa-box { background: #F0FDF4; border-color: #BBF7D0; }
