/* Garnish Hunt Billing */
:root {
  --bg: #f5f4ef; --card: #fff; --ink: #18241e; --ink-2: #3d4a43; --muted: #6f7a74; --line: #e6e3db; --line-2: #f0eee8;
  --brand: #2f7d4f; --brand-2: #256a41; --brand-soft: #e7f3ec; --brand-ink: #fff;
  --danger: #b93a2c; --danger-soft: #fbe3df; --warn: #8a5a00; --warn-soft: #fff4d6; --ok: #1d6b3d; --ok-soft: #dcf2e4;
  --radius: 12px; --shadow: 0 1px 2px rgba(24,36,30,.05), 0 4px 16px rgba(24,36,30,.04);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Bengali", sans-serif;
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 14.5px; line-height: 1.5; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
main { max-width: 1240px; margin: 0 auto; padding: 22px 18px 70px; }
main.bare { max-width: 520px; }
h1 { font-size: 1.55rem; margin: 0 0 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; letter-spacing: -.01em; }
h2 { font-size: 1.02rem; margin: 0 0 12px; letter-spacing: -.005em; }
h3 { font-size: .95rem; margin: 18px 0 8px; }
small, .muted { color: var(--muted); }
code { background: var(--line-2); padding: 1px 5px; border-radius: 5px; font-size: .88em; }
pre { background: #1d2a24; color: #dcefe3; padding: 12px; border-radius: 8px; overflow: auto; font-size: .82rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 12px; }

/* ---------- top bar ---------- */
.top { background: var(--ink); color: #fff; display: flex; align-items: center; gap: 18px; padding: 10px 22px; position: sticky; top: 0; z-index: 20; }
.top .brand { color: #fff; font-weight: 700; font-size: 1.08rem; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.top .brand img { height: 28px; border-radius: 6px; }
.top nav { display: flex; gap: 4px; align-items: center; flex: 1; flex-wrap: wrap; }
.top nav a { color: #cfdcd4; padding: 6px 10px; border-radius: 8px; }
.top nav a:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.top nav a.on { color: #fff; background: rgba(255,255,255,.14); }
.top nav .new { margin-left: auto; color: #fff; padding: 6px 12px; }
.top .who { color: #cfdcd4; padding: 0 6px; }
.top .who a { padding: 0; }
.top .who small { color: #8fb39d; }
.top .link { color: #cfdcd4; }
.menu-toggle { display: none; margin-left: auto; background: none; border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 8px; padding: 4px 10px; font-size: 1.1rem; cursor: pointer; }
@media (max-width: 900px) {
  .top { flex-wrap: wrap; }
  .menu-toggle { display: block; }
  .top nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; }
  .top nav.open { display: flex; }
  .top nav .new { margin: 6px 0; justify-content: center; }
}

/* ---------- cards & layout ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); overflow-x: auto; }
.card.flush { padding: 0; }
.pad { padding: 16px 18px 6px; margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2.wide-left { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid2 > *, .grid3 > * { min-width: 0; }
@media (max-width: 860px) { .grid2, .grid2.wide-left, .grid3 { grid-template-columns: 1fr; } .sticky { position: static; } }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.row h1, .row h2 { margin-bottom: 10px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.sticky { position: sticky; top: 70px; }
.narrow-card { max-width: 520px; }
.empty { padding: 18px; }
.empty-state { text-align: center; padding: 40px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--brand); color: var(--brand-ink); border: 1px solid var(--brand); padding: 8px 14px; border-radius: 9px;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .12s; }
.btn:hover { background: var(--brand-2); text-decoration: none; }
.btn.ghost { background: #fff; color: var(--brand); border-color: #cfe3d6; }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.danger { background: #fff; color: var(--danger); border-color: #efc4bd; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { padding: 4px 10px; font-size: .86rem; }
.btn.block { width: 100%; justify-content: center; padding: 10px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.link { background: none; border: none; color: var(--brand); cursor: pointer; font: inherit; padding: 0; }
.danger-text, .error-text { color: var(--danger); }
.ok-text { color: var(--ok); font-weight: 600; }
.warn-text { color: var(--warn); font-weight: 600; }
form.inline { display: inline; }
.inline-form { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; margin-top: 12px; }
.inline-form label { margin: 0; }
.grow { flex: 1; min-width: 180px; }

/* ---------- forms ---------- */
label { display: block; margin-bottom: 12px; font-size: .86rem; color: var(--ink-2); font-weight: 500; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
input, select, textarea { display: block; width: 100%; margin-top: 5px; padding: 8px 10px; border: 1px solid #d9d6cd; border-radius: 9px; font: inherit; color: var(--ink); background: #fff; }
textarea { resize: vertical; }
input[type=checkbox] { margin: 0; accent-color: var(--brand); width: 16px; height: 16px; }
.inline-form input, .inline-form select, .filters input, .filters select { width: auto; margin-top: 0; }
.inline-form .grow input { width: 100%; }
input:focus, select:focus, textarea:focus { outline: 3px solid #cfe7d8; border-color: var(--brand); }
input[readonly] { background: var(--line-2); }
details summary { cursor: pointer; margin-bottom: 8px; color: var(--muted); }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: #fbfaf7; }
.card.flush th:first-child, .card.flush td:first-child { padding-left: 18px; }
.card.flush th:last-child, .card.flush td:last-child { padding-right: 18px; }
tbody tr:hover { background: #fbfaf6; }
tfoot td { border-bottom: none; }
tr.due td { border-top: 2px solid var(--ink); font-size: 1.04rem; }
.r { text-align: right; }
.w1 { width: 1%; }
.w-qty { width: 90px; }
.w-amt { width: 110px; }
table.narrow { max-width: 480px; }
.items td { padding: 6px 4px; }
.items input, .items select { margin: 0; }
.items tr.over input { border-color: var(--danger); background: var(--danger-soft); }
.stock-adj input { width: 64px; display: inline-block; padding: 4px 6px; margin: 0; }

/* ---------- tiles & charts ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--ink); box-shadow: var(--shadow); display: block; }
a.tile:hover { border-color: var(--brand); text-decoration: none; }
.tile span { display: block; color: var(--muted); font-size: .8rem; font-weight: 500; }
.tile strong { display: block; font-size: 1.45rem; letter-spacing: -.02em; margin: 2px 0; }
.tile small { font-size: .78rem; }
.tile.hot { border-color: #f0c96a; background: #fffaf0; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 180px; padding-top: 8px; border-bottom: 1px solid var(--line); }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; position: relative; }
.bar-col .bar { width: 72%; background: linear-gradient(180deg, #3f9a64, var(--brand)); border-radius: 4px 4px 0 0; }
.bar-col:hover .bar { opacity: .75; }
.bar-col span { position: absolute; bottom: -20px; font-size: .68rem; color: var(--muted); }
.chart-max { margin: 26px 0 0; font-size: .8rem; }
.statuslist { list-style: none; margin: 0; padding: 0; }
.statuslist li { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-2); }

/* ---------- badges ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .74rem; font-weight: 600; text-transform: capitalize; background: #eeece6; color: #4d554f; white-space: nowrap; }
.s-pending { background: #fff1c9; color: #7a5a00; }
.s-confirmed, .s-staff { background: #dcebff; color: #1f4f8f; }
.s-shipped, .s-in_transit { background: #e9e4ff; color: #4a3a9a; }
.s-on_hold { background: #ffe3cc; color: #8a4500; }
.s-delivered, .s-admin { background: var(--ok-soft); color: var(--ok); }
.s-partial_delivered, .s-manager { background: #e6f2d8; color: #4b6b1d; }
.s-returned, .s-cancelled { background: var(--danger-soft); color: #8f2a1f; }
.risk-high { background: var(--danger-soft); color: #8f2a1f; }
.risk-medium { background: var(--warn-soft); color: var(--warn); }
.risk-low { background: var(--ok-soft); color: var(--ok); }

/* ---------- messages ---------- */
.flash { padding: 11px 14px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; transition: opacity .6s; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.fade { opacity: 0; }
.flash.error, p.error { background: var(--danger-soft); color: #8f2a1f; padding: 11px 14px; border-radius: 10px; }
.warn { background: var(--warn-soft); color: #5e4300; padding: 10px 14px; border-radius: 10px; margin: 0 0 12px; }
.note { background: #fffbe8; border: 1px solid #f3e6ad; padding: 10px 14px; border-radius: 10px; }
.customer-info { padding: 8px 12px; border-radius: 9px; margin: -4px 0 12px; font-size: .88rem; background: var(--line-2); }
.customer-info.bad { background: var(--danger-soft); color: #8f2a1f; }

/* ---------- filters, tabs, bulk ---------- */
.filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs a { padding: 8px 12px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }
.bulkbar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; padding: 8px 12px; border-radius: 10px; background: var(--line-2); flex-wrap: wrap; }
.bulkbar select { width: auto; margin: 0; }
.bulkbar.active { background: var(--brand-soft); }
.pager { display: flex; gap: 14px; justify-content: center; }

/* ---------- order page ---------- */
.events { list-style: none; padding: 0; margin: 0; max-height: 360px; overflow: auto; }
.events li { padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: .88rem; }
.events time { color: var(--muted); font-size: .78rem; margin-right: 6px; }
.events .ev-error { color: var(--danger); }
.events .ev-note { background: #fffbe8; }
.summary { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 6px 0 16px; padding: 12px; background: var(--line-2); border-radius: 10px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; text-align: right; font-weight: 600; }
.summary .big { font-size: 1.25rem; color: var(--brand); }
.copy { display: flex; gap: 6px; align-items: center; margin-top: 5px; }
.copy input { margin: 0; font-family: ui-monospace, Menlo, monospace; font-size: .84rem; }
.newkey { background: var(--ok-soft); padding: 12px; border-radius: 10px; margin-bottom: 12px; }
.roles dt { font-weight: 600; text-transform: capitalize; margin-top: 6px; }
.roles dd { margin: 0 0 4px; color: var(--muted); font-size: .88rem; }

/* ---------- auth & tracking ---------- */
.auth { margin: 70px auto; }
.auth h1 { margin-bottom: 2px; }
.track { max-width: 520px; margin: 30px auto; }
.track-head { text-align: center; margin-bottom: 16px; }
.track-head img { height: 54px; border-radius: 10px; }
.track-head h1 { justify-content: center; margin: 6px 0 0; }
.steps { list-style: none; padding: 0; margin: 14px 0; display: flex; counter-reset: s; }
.steps li { flex: 1; text-align: center; font-size: .76rem; color: var(--muted); position: relative; counter-increment: s; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 28px; height: 28px; margin: 0 auto 6px; border-radius: 50%; background: var(--line); color: var(--muted); font-weight: 700; position: relative; z-index: 1; }
.steps li::after { content: ""; position: absolute; top: 14px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.steps li:first-child::after { display: none; }
.steps li.done { color: var(--ink); font-weight: 600; }
.steps li.done::before { background: var(--brand); color: #fff; content: "✓"; }
.steps li.done::after { background: var(--brand); }

/* ---------- printing ---------- */
body.print { background: #e9e7e1; }
.printbar { position: sticky; top: 0; background: #fff; padding: 10px 16px; display: flex; gap: 12px; align-items: center; justify-content: center; border-bottom: 1px solid var(--line); z-index: 5; }
.sheet { background: #fff; max-width: 780px; margin: 24px auto; padding: 40px; border-radius: 6px; }
.inv-head { display: flex; justify-content: space-between; border-bottom: 2px solid var(--ink); padding-bottom: 14px; margin-bottom: 18px; gap: 20px; }
.inv-head h1 { margin: 0 0 4px; }
.inv-head h2 { margin: 0; letter-spacing: .12em; color: var(--brand); }
.inv-head p { margin: 0; color: var(--muted); }
.inv-head .logo { height: 46px; margin-bottom: 6px; }
.inv-to { margin-bottom: 18px; }
.sheet th { background: none; }
.thanks { text-align: center; margin-top: 28px; color: var(--muted); }
.labels { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 800px; margin: 20px auto; padding: 0 10px; }
.label { background: #fff; border: 1.5px dashed #555; border-radius: 6px; padding: 12px 14px; font-size: 13px; break-inside: avoid; page-break-inside: avoid; display: flex; flex-direction: column; gap: 6px; }
.lab-head { display: flex; justify-content: space-between; border-bottom: 1px solid #ccc; padding-bottom: 4px; }
.lab-inv { font-family: ui-monospace, monospace; }
.lab-to { font-size: 14px; line-height: 1.35; }
.lab-items { font-size: 12px; color: #444; }
.lab-cod { font-size: 18px; border: 2px solid #000; border-radius: 6px; padding: 4px 8px; align-self: flex-start; }
.lab-note { font-size: 12px; font-style: italic; }
@media print {
  @page { margin: 10mm; }
  body.print { background: #fff; }
  .noprint { display: none !important; }
  .sheet { margin: 0; padding: 0; max-width: none; break-after: page; }
  .sheet:last-child { break-after: auto; }
  .labels { margin: 0; padding: 0; max-width: none; gap: 6mm; }
}

/* ---------- fixes from visual review ---------- */
[hidden] { display: none !important; }
.grid2, .grid3 { align-items: start; }
.customer-info.risk-high { background: var(--danger-soft); color: #8f2a1f; }
.customer-info.risk-medium { background: var(--warn-soft); color: var(--warn); }
.customer-info.risk-low { background: var(--ok-soft); color: var(--ok); }
.items select { min-width: 0; }
body.print { min-height: 100vh; }
@media (max-width: 600px) {
  main { padding: 16px 12px 60px; }
  .items .w-qty { width: 60px; }
  .items .w-amt { width: 66px; }
  .items td { padding: 4px 2px; }
  .labels { grid-template-columns: 1fr; }
  .sheet { padding: 20px; }
}

/* ---------- stock rule ---------- */
.stock-alert { background: var(--danger-soft); color: #7d2318; border: 1px solid #f1c3bb; padding: 10px 14px; border-radius: 10px; margin: 0 0 14px; }
.stock-alert ul { margin: 6px 0; padding-left: 20px; }
.stock-alert a { color: #7d2318; font-weight: 600; text-decoration: underline; }
p.stock-alert { margin: 12px 0 0; }
.badge.stock-short { background: var(--danger-soft); color: #8f2a1f; text-transform: none; }
tr.row-short td { background: #fff5f3; }

/* ---------- barcodes ---------- */
svg.barcode { display: block; max-width: 100%; height: auto; }
.inv-head .r svg.barcode { margin: 6px 0 4px auto; }
.lab-inv { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.badge.packed { background: #e6f0ff; color: #24508f; text-transform: none; }
.barcode-form { margin: 0 0 10px; align-items: center; }
.barcode-form label { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.barcode-form input { width: 70px; }

/* ---------- packing station ---------- */
.scan-input { font-size: 1.35rem; padding: 14px 16px; border-width: 2px; font-family: ui-monospace, Menlo, monospace; letter-spacing: .03em; }
.scan-input:focus { outline: 4px solid #cfe7d8; }
.scan-input.has-error { border-color: var(--danger); outline-color: #f6cfc8; }
.scan-step.compact { padding: 10px 16px; }
.scan-step.compact .scan-input { font-size: 1rem; padding: 8px 12px; }
.scan-msg { margin: 10px 0 0; padding: 10px 14px; border-radius: 10px; font-weight: 600; }
.scan-msg.bad { background: var(--danger-soft); color: #8f2a1f; }
.pack-lines tr.pl-done td { background: var(--ok-soft); }
.pack-lines tr.pl-done td:last-child { color: var(--ok); font-weight: 700; }
.pack-lines tr.pl-part td { background: #fffaf0; }
.progress { height: 10px; background: var(--line-2); border-radius: 99px; overflow: hidden; margin: 14px 0 6px; }
.bar-fill { height: 100%; width: 0; background: #3f9a64; transition: width .2s; }
.bar-fill.full { background: var(--brand); }
.pack-status { margin: 12px 0; padding: 10px 14px; border-radius: 10px; background: var(--line-2); font-weight: 600; }
.pack-status.ok { background: var(--ok-soft); color: var(--ok); }
.pack-status.bad { background: var(--danger); color: #fff; }
.scans { list-style: none; margin: 0; padding: 0; max-height: 380px; overflow: auto; }
.scans li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; margin-bottom: 6px; border: 1px solid var(--line); }
.scans li.ok { background: var(--ok-soft); border-color: #b9e2c7; }
.scans li.bad { background: var(--danger-soft); border-color: #eeb3a9; color: #7d2318; animation: shake .3s; }
.scans li.empty { color: var(--muted); justify-content: center; border-style: dashed; }
.sc-icon { font-weight: 800; width: 18px; text-align: center; }
.sc-text { flex: 1; min-width: 0; }
.sc-del { background: #fff; border: 1px solid currentColor; color: inherit; border-radius: 8px; padding: 2px 9px; cursor: pointer; font: inherit; opacity: .8; }
.scans li.ok .sc-del { color: var(--muted); border-color: var(--line); }
.sc-del:hover { opacity: 1; }
.btn.big { font-size: 1.1rem; padding: 12px 22px; }
.pack-actions { margin: 14px 0 0; }
.done-card { text-align: center; padding: 30px; }
.done-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 2rem; display: grid; place-items: center; margin: 0 auto 10px; }
.help ol { padding-left: 20px; }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* ---------- SKU sticker sheet ---------- */
.stickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; max-width: 980px; margin: 20px auto; padding: 0 10px; }
.sticker { background: #fff; border: 1px dashed #999; border-radius: 4px; padding: 8px 10px; break-inside: avoid; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.sticker svg.barcode { margin: 2px auto; }
.st-name { font-size: 12px; font-weight: 600; text-align: center; line-height: 1.2; }
.st-foot { display: flex; justify-content: space-between; width: 100%; font-size: 11px; font-family: ui-monospace, monospace; }
@media print { .stickers { margin: 0; padding: 0; max-width: none; grid-template-columns: repeat(3, 1fr); gap: 3mm; } .sticker { border-color: #ccc; } }

/* ---------- orders table (EcomDrive style) ---------- */
main.wide { max-width: none; padding-left: 16px; padding-right: 16px; }
.otable-wrap { overflow-x: auto; }
.otable { font-size: .86rem; min-width: 1500px; }
.otable th { position: sticky; top: 0; z-index: 2; background: #f1eff9; color: #3f3a5a; font-size: .74rem; white-space: nowrap; }
.otable td { vertical-align: top; padding: 12px 10px; border-bottom: 1px solid var(--line); }
.otable tbody tr:hover { background: #faf9ff; }
.otable tr.row-cancelled td { opacity: .6; }
.c-date { width: 110px; white-space: nowrap; }
.c-date small { display: block; font-size: .72rem; white-space: normal; }
.c-inv { width: 120px; }
.inv-wrap { display: flex; align-items: center; gap: 6px; }
.c-cust { width: 270px; }
.c-cust .cl { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.c-cust .ic { width: 16px; font-size: .8rem; opacity: .7; flex: none; }
.c-cust .cn { font-weight: 600; }
.c-cust .addr span:last-child { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.copy-btn { background: none; border: none; cursor: pointer; color: var(--muted); padding: 0 2px; font-size: .85rem; }
.copy-btn:hover { color: var(--brand); }
.wa { font-size: .7rem; text-decoration: none; }
.rate { font-size: .72rem; font-weight: 700; padding: 0 6px; border-radius: 99px; }
.rate.good { color: #1d6b3d; background: var(--ok-soft); }
.rate.mid { color: var(--warn); background: var(--warn-soft); }
.rate.bad { color: #8f2a1f; background: var(--danger-soft); }
.rate.new { color: var(--muted); background: var(--line-2); font-weight: 500; }
.c-note { width: 160px; }
.c-note .nt { font-size: .8rem; background: #fffbe8; border-radius: 6px; padding: 3px 6px; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.c-note .nt.courier { background: #eef4ff; }
.c-prod { width: 250px; }
.st-dot { font-size: .72rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; background: none !important; }
.st-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-dot.s-pending { color: #b07d00; } .st-dot.s-confirmed { color: #2563eb; } .st-dot.s-shipped, .st-dot.s-in_transit { color: #5b4bd6; }
.st-dot.s-on_hold { color: #c26100; } .st-dot.s-delivered, .st-dot.s-partial_delivered { color: var(--ok); } .st-dot.s-returned, .st-dot.s-cancelled { color: var(--danger); }
.pi { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.pi img, .ph, img.thumb { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; flex: none; border: 1px solid var(--line); }
.ph { display: grid; place-items: center; background: var(--line-2); color: var(--muted); font-size: .66rem; font-weight: 700; }
.pi .pn { font-weight: 500; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pi small { font-size: .72rem; }
.prod-cell { display: flex; gap: 8px; align-items: center; }
.c-tags, .c-stags { width: 150px; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.tag, .stag { display: inline-flex; align-items: center; gap: 3px; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; margin: 0; }
.tag { background: #e3f6f1; color: #11735c; border: 1px solid #bfe9de; }
.tag a { color: inherit; }
.tag.auto { background: #e7f6ef; }
.tag.risk { background: var(--danger-soft); color: #8f2a1f; border-color: #f0c2ba; }
.stag { background: #eaf0ff; color: #2b4c9b; border: 1px solid #c9d7fb; }
.tag button, .stag button { background: none; border: none; color: inherit; cursor: pointer; padding: 0; font-size: .9rem; line-height: 1; opacity: .6; }
.tag button:hover, .stag button:hover { opacity: 1; }
details.tagadd, details.rowmenu { position: relative; display: inline-block; }
details.tagadd > summary, details.rowmenu > summary { list-style: none; cursor: pointer; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-weight: 700; }
details.tagadd > summary::-webkit-details-marker, details.rowmenu > summary::-webkit-details-marker { display: none; }
details.rowmenu > summary { width: 26px; height: 26px; font-size: 1rem; }
details[open] > summary { border-color: var(--brand); color: var(--brand); }
.pop, .menu { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(24,36,30,.14); padding: 8px; min-width: 200px; }
.pop { display: flex; gap: 6px; }
.pop input { margin: 0; }
.pop.list { flex-direction: column; gap: 0; }
.menu { min-width: 220px; padding: 6px; }
.menu form { margin: 0; }
.mi { display: block; width: 100%; text-align: left; background: none; border: none; padding: 7px 10px; border-radius: 7px; font: inherit; color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; }
.mi:hover { background: var(--line-2); text-decoration: none; }
.mi.danger { color: var(--danger); }
.mi.disabled { color: var(--muted); cursor: not-allowed; }
.menu hr { border: none; border-top: 1px solid var(--line); margin: 4px 0; }
.c-print { width: 50px; text-align: center; font-size: 1.1rem; }
.c-total { width: 90px; white-space: nowrap; }
.c-up { width: 140px; font-size: .82rem; line-height: 1.6; }
.c-up a { text-decoration: underline; }
.c-user, .c-src { width: 90px; }

/* ---------- SMS ---------- */
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; margin-bottom: 14px; color: var(--ink); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .knob { width: 42px; height: 24px; border-radius: 99px; background: #cfd3cf; position: relative; flex: none; transition: background .15s; }
.switch .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .knob { background: var(--brand); }
.switch input:checked + .knob::after { transform: translateX(18px); }
.switch input:focus-visible + .knob { outline: 3px solid #cfe7d8; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { font: inherit; font-size: .78rem; font-family: ui-monospace, monospace; background: var(--brand-soft); color: var(--brand-2); border: 1px solid #cfe3d6; border-radius: 99px; padding: 2px 9px; cursor: pointer; }
.chip:hover { background: #d6ecdf; }
.sms-preview { background: #e9f7ee; border-radius: 14px 14px 14px 4px; padding: 10px 14px; white-space: pre-wrap; max-width: 360px; font-size: .92rem; min-height: 40px; }
.sms-form textarea { margin-bottom: 6px; }
/* chips stay on one line; wider tag/upload columns */
.tag, .stag { white-space: nowrap; border-radius: 7px; }
.c-tags, .c-stags { width: 200px; min-width: 190px; }
.c-up { width: 150px; min-width: 140px; white-space: nowrap; }
.c-print { width: 44px; }
.otable { min-width: 1650px; }

/* ---------- returns ---------- */
.return-alert { background: #fff4e5; border: 1px solid #f6d3a1; color: #6b4300; padding: 12px 14px; border-radius: 10px; margin: 0 0 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.s-pending_return { background: #ffe9d6; color: #9a4b00; }
.st-dot.s-pending_return { color: #c26100; }

/* ---------- parcel barcode, pick lists ---------- */
.parcel-bc, .lab-parcel { display: flex; flex-direction: column; align-items: flex-end; margin: 6px 0 4px; }
.lab-parcel { align-items: flex-start; }
.parcel-bc .pid, .lab-parcel .pid { font-family: ui-monospace, monospace; font-size: 12px; margin-top: 2px; }
.inv-bc { display: flex; justify-content: flex-end; margin: 4px 0; }
.list-sheet { max-width: 1000px; }
.list-head { display: flex; justify-content: space-between; border-bottom: 2px solid var(--ink); margin-bottom: 14px; }
.list-head h1 { margin: 0; }
table.pick td { vertical-align: top; }
.big-num { font-size: 1.15rem; font-weight: 700; }
.tick { display: inline-block; width: 16px; height: 16px; border: 1.5px solid #444; border-radius: 3px; }
.order-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.order-chips span { border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font-size: .85rem; }
.sign { margin-top: 30px; }
.mini-stats { display: flex; gap: 24px; margin: 0 0 14px; }
.mini-stats div { display: flex; flex-direction: column; }
.mini-stats b { font-size: 1.4rem; }
.mini-stats span { color: var(--muted); font-size: .8rem; }
.printbar a.on { font-weight: 700; text-decoration: underline; }
@media print { .list-sheet { break-after: auto; } }

/* =================== v3: minimal motion & charts =================== */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes ring { from { stroke-dasharray: 0 999; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(47,125,79,.45); } 50% { box-shadow: 0 0 0 5px rgba(47,125,79,0); } }
main > .card, main > .grid2 > *, main > .grid3 > *, main > .tiles > * { animation: rise .45s ease both; }
main > .grid2 > :nth-child(2), main > .grid3 > :nth-child(2) { animation-delay: .06s; }
main > .grid3 > :nth-child(3) { animation-delay: .12s; }
.tiles > * { animation-delay: calc(var(--i, 0) * 50ms) !important; }
.card, .tile { transition: box-shadow .2s, transform .2s, border-color .2s; }
a.tile:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(24,36,30,.08); }

/* KPI tiles */
.kpi { position: relative; overflow: hidden; }
.kpi .trend { position: absolute; top: 12px; right: 12px; font-style: normal; font-size: .72rem; font-weight: 700; padding: 1px 6px; border-radius: 99px; }
.trend.up { color: var(--ok); background: var(--ok-soft); } .trend.down { color: #8f2a1f; background: var(--danger-soft); }
.tile.good { border-color: #b9e2c7; } .tile.bad { border-color: #f0c2ba; background: #fff8f6; }

/* vertical bars */
.vbars { display: flex; align-items: flex-end; gap: 3px; border-bottom: 1px solid var(--line); padding-top: 6px; }
.vbar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; position: relative; }
.vbar i { display: block; width: 72%; height: var(--h); min-height: 0; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #4aa872, var(--brand)); transform-origin: bottom; animation: grow-y .6s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 18ms); }
.vbar:hover i { filter: brightness(1.12); }
.vbar span { position: absolute; bottom: -19px; font-size: .66rem; color: var(--muted); white-space: nowrap; }
.bars .bar { transform-origin: bottom; animation: grow-y .6s cubic-bezier(.2,.8,.2,1) both; }

/* horizontal bars */
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { animation: rise .4s ease both; animation-delay: calc(var(--i) * 40ms); }
.hl { display: flex; justify-content: space-between; gap: 10px; font-size: .86rem; margin-bottom: 3px; }
.hl span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ht { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.ht i { display: block; height: 100%; width: var(--w); border-radius: 99px; background: var(--brand); transform-origin: left; animation: grow-x .7s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 40ms + 80ms); }
.hbar small { font-size: .74rem; }

/* donut */
.donut-wrap { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; flex: none; }
.donut circle { animation: ring .9s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 70ms); transition: stroke-width .15s; }
.donut circle:hover { stroke-width: 17; }
.donut .dc { font-size: 11px; font-weight: 700; fill: var(--ink); }
.donut .ds { font-size: 7px; fill: var(--muted); }
.legend { list-style: none; margin: 0; padding: 0; font-size: .84rem; flex: 1; min-width: 160px; }
.legend li { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.legend li b { margin-left: auto; font-weight: 600; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend.inline { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.legend.inline li b { margin-left: 0; }

/* line chart */
.linechart { width: 100%; height: 200px; display: block; }
.linechart .ln { stroke-dasharray: 1; animation: draw 1.1s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 120ms); vector-effect: non-scaling-stroke; }
.linechart .pt { opacity: 0; animation: rise .3s ease both .9s; }
.linechart .axis-line, .linechart .zero { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.linechart .zero { stroke-dasharray: 4 4; }
.line-labels { display: flex; justify-content: space-between; font-size: .68rem; color: var(--muted); padding: 0 2%; }
.spark { width: 100%; height: 28px; } .spark .ln { stroke-dasharray: 1; animation: draw 1s ease both; vector-effect: non-scaling-stroke; }

/* division tile map */
.tilemap { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 74px); gap: 6px; max-width: 460px; margin: 4px auto 10px; }
.tile-div { border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; justify-content: center; background: rgba(47,125,79,var(--a)); color: var(--ink);
  border: 1px solid rgba(47,125,79,.25); animation: rise .5s ease both; animation-delay: calc(var(--i) * 60ms); transition: transform .15s; }
.tile-div:hover { transform: scale(1.04); }
.tile-div span { font-size: .74rem; font-weight: 600; }
.tile-div b { font-size: 1.1rem; }
.tile-div small { font-size: .68rem; opacity: .75; }

/* HRM */
.presence { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.presence::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #c7ccc9; }
.presence.online { color: var(--ok); } .presence.online::before { background: #34a853; animation: pulse 1.8s infinite; }
.presence.idle { color: var(--warn); } .presence.idle::before { background: #e0a32e; }
.presence.offline, .presence.never { color: var(--muted); }
.tl-cell { min-width: 260px; }
.timeline { position: relative; height: 26px; background: var(--line-2); border-radius: 6px; overflow: hidden; }
.timeline i { position: absolute; top: 5px; height: 12px; width: var(--w); border-radius: 4px; background: var(--brand); transform-origin: left; animation: grow-x .6s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 60ms); }
.timeline span { position: absolute; bottom: 0; font-size: .58rem; color: var(--muted); transform: translateX(-50%); }
table.hrm td { vertical-align: middle; }

/* reports */
.filters.range .btn.sm { padding: 3px 9px; }
table.pl tr.profit td b { color: var(--ok); } table.pl tr.loss td b { color: var(--danger); }
.report-preview { border-top: 1px solid var(--line); padding: 12px 0; }
.report-preview .sms-preview { margin: 6px 0 8px; max-width: 520px; }
.new-sup { margin-top: -4px; }

/* nav fits more modules */
.top nav a { padding: 6px 8px; }
@media (max-width: 1280px) { .top .brand { font-size: 1rem; } .top nav { gap: 2px; } .top nav a { font-size: .9rem; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
/* fixes from visual review (v3) */
.tile strong .count { display: inline; font-size: inherit; color: inherit; font-weight: inherit; }
.kpi .trend { position: static; display: inline-block; margin-top: 4px; }
.linechart { height: auto; max-height: 270px; }
.linechart .ln { vector-effect: none; stroke-width: 2.5; }
.tile-div.dark { color: #fff; } .tile-div.dark small { opacity: .85; }
.linechart .xl { font-size: 10px; fill: var(--muted); }

/* product photo field */
.photo-field { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.photo-field label { margin: 0; }
.ph-prev { width: 64px; height: 64px; border-radius: 10px; border: 1px dashed #c9c6bd; display: grid; place-items: center; font-size: 1.4rem; overflow: hidden; flex: none; background: #fff; }
.ph-prev img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- picking list (print) ---------- */
body.picking { background: #fff; color: #000; font-family: Arial, Helvetica, sans-serif; font-size: 12px; }
html:has(body.picking) { background: #fff; }
.pk-sheet { max-width: 1000px; margin: 20px auto; padding: 0 20px; }
.pk-summary { text-align: center; line-height: 1.5; margin: 10px 0 14px; }
.pk-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.pk-table th, .pk-table td { border: 1px solid #d9d9d9; padding: 5px 6px; text-align: left; vertical-align: middle; }
.pk-table th { background: #f2f2f2; color: #000; text-transform: none; letter-spacing: 0; font-size: 11px; font-weight: 700; text-align: center; }
.pk-table tbody tr:hover { background: none; }
.pk-img { width: 50px; text-align: center !important; }
.pk-img img { width: 34px; height: 34px; object-fit: contain; display: block; margin: 0 auto; }
.pk-qty { width: 34px; }
.pk-orders { width: 120px; } .pk-orders small { color: #b3261e; font-size: 9px; }
.pk-picked { width: 60px; }
.pk-empty { text-align: center; padding: 30px; }
.pk-sign { display: flex; justify-content: space-between; margin-top: 26px; gap: 40px; }
.pk-sign div { display: flex; align-items: flex-end; gap: 6px; }
.pk-sign span { display: inline-block; width: 130px; border-bottom: 1px solid #000; }
.pk-sign.full { margin-top: 18px; } .pk-sign.full div { flex: 1; } .pk-sign.full span { flex: 1; width: auto; }
@media print {
  @page { size: landscape; margin: 10mm; }
  .pk-sheet { margin: 0; max-width: none; padding: 0; }
}
