/* Shelfmint: a working pharmacy stock and billing demo (concept project, made-up sample data only). */
:root {
  --bg: #eff4f0; --surface: #ffffff; --surface-2: #f5f9f6; --surface-3: #e9f2eb; --border: #dde8e0; --border-2: #c9dacd;
  --text: #0e1f13; --text-2: #2c4233; --muted: #5f7765; --faint: #98ad9e;
  --primary: #15803d; --primary-2: #166534; --primary-soft: #dcfce7; --primary-ring: rgba(21, 128, 61, .22);
  --mint: #86efac; --coral: #f0674f; --coral-soft: #fdebe6;
  --green: #047857; --green-soft: #d8f5ea; --amber: #b45309; --amber-soft: #fef1db; --yellow: #8a6a00; --yellow-soft: #fbf5cf;
  --red: #d92d20; --red-soft: #fdecea; --wine: #8f1d3a; --wine-soft: #f9e5ea;
  --blue: #2457d6; --blue-soft: #e7eefd; --violet: #6d3fd6; --violet-soft: #f0eafd;
  --side: #0a2414; --side-2: #13341f; --side-3: #1b4229; --side-text: #c4d9ca; --side-muted: #7e9b86;
  --shadow-sm: 0 1px 2px rgba(14, 31, 19, .06);
  --shadow: 0 1px 2px rgba(14, 31, 19, .05), 0 10px 28px rgba(14, 31, 19, .06);
  --shadow-lg: 0 30px 80px rgba(14, 31, 19, .24);
  --r: 18px; --r-sm: 11px;
  --font: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Bahnschrift", "DIN Alternate", "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", monospace;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #07100a; --surface: #0e1a12; --surface-2: #122117; --surface-3: #17291c; --border: #1d2f22; --border-2: #29412f;
  --text: #e8f3eb; --text-2: #c3d5c8; --muted: #88a18f; --faint: #5b7160;
  --primary: #4ade80; --primary-2: #86efac; --primary-soft: rgba(74, 222, 128, .14); --primary-ring: rgba(74, 222, 128, .32);
  --coral: #ff8a70; --coral-soft: rgba(255, 138, 112, .14);
  --green: #34d399; --green-soft: rgba(52, 211, 153, .12); --amber: #fbbf24; --amber-soft: rgba(251, 191, 36, .13); --yellow: #e9d04a; --yellow-soft: rgba(233, 208, 74, .13);
  --red: #f87171; --red-soft: rgba(248, 113, 113, .14); --wine: #fb7193; --wine-soft: rgba(251, 113, 147, .14);
  --blue: #8fb0ff; --blue-soft: rgba(96, 140, 255, .16); --violet: #c3a8ff; --violet-soft: rgba(167, 139, 250, .16);
  --side: #050d08; --side-2: #0f2015; --side-3: #16301d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px rgba(0, 0, 0, .35);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
.i { flex: none; display: block; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .92em; }
:focus-visible { outline: 3px solid var(--primary-ring); outline-offset: 2px; border-radius: 8px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 258px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 12px 0 12px 12px; }
.side-in { height: 100%; border-radius: 22px; background: radial-gradient(circle at 0 0, rgba(134, 239, 172, .12), rgba(134, 239, 172, 0) 46%), var(--side); color: var(--side-text); display: flex; flex-direction: column; padding: 18px 12px 14px; gap: 16px; overflow: hidden; }
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px; }
.brand svg { width: 38px; height: 38px; flex: none; }
.brand b { display: block; color: #fff; font: 600 19px/1.1 var(--display); letter-spacing: .005em; }
.brand small { color: var(--side-muted); font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.nav-g { font: 700 10.5px var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--side-muted); padding: 12px 12px 6px; opacity: .8; }
.nav-i { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; color: var(--side-text); font-weight: 600; font-size: 14px; position: relative; }
.nav-i:hover { background: var(--side-2); color: #fff; }
.nav-i.on { background: linear-gradient(90deg, rgba(134, 239, 172, .2), rgba(134, 239, 172, .06)); color: #fff; box-shadow: inset 0 0 0 1px rgba(134, 239, 172, .16); }
.nav-i.on .i { color: var(--mint); }
.nb { margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--mint); color: #052e16; font: 700 11px/20px var(--font); text-align: center; }
.nb.warn { background: rgba(240, 103, 79, .2); color: #ffb3a3; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.shop { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--side-muted); padding: 10px 12px; border-radius: 12px; background: var(--side-2); }
.shop b { color: #fff; font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(134, 239, 172, .16); flex: none; }
.demo-tag { font-size: 11.5px; color: var(--side-muted); padding: 0 12px; line-height: 1.4; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .06); }
.me b { display: block; color: #fff; font-size: 13.5px; }
.me small { color: var(--side-muted); font-size: 12px; }
.me .icon-btn { margin-left: auto; color: var(--side-muted); border-color: transparent; background: transparent; box-shadow: none; width: 36px; height: 36px; }
.me .icon-btn:hover { color: #fff; background: var(--side-2); }
.avatar { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; font: 700 13px var(--font); color: #fff; flex: none; }
.avatar.sm { width: 30px; height: 30px; font-size: 11px; border-radius: 10px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; height: 72px; display: flex; align-items: center; gap: 12px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); }
.top-brand { display: none; }
.top-brand svg { width: 34px; height: 34px; }
.branch-btn { height: 46px; display: inline-flex; align-items: center; gap: 10px; padding: 0 12px 0 8px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); text-align: left; flex: none; }
.branch-btn .bi { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-2); }
.branch-btn b { display: block; font: 600 14.5px/1.1 var(--display); }
.branch-btn small { display: block; color: var(--muted); font-size: 11.5px; }
.branch-btn:hover { border-color: var(--border-2); }
.search-trigger { flex: 1; max-width: 440px; height: 46px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); text-align: left; box-shadow: var(--shadow-sm); }
.search-trigger span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
kbd { font: 600 11px var(--font); padding: 3px 7px; border-radius: 6px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--muted); }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 10px; position: relative; }
.clock { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; padding: 0 6px; white-space: nowrap; }
.clock b { color: var(--text); font-weight: 700; }
.icon-btn { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-sm); flex: none; }
.icon-btn:hover { border-color: var(--border-2); color: var(--text); }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 10px; }
.dot-badge { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; border-radius: 10px; background: var(--coral); color: #fff; font: 700 10.5px/19px var(--font); font-style: normal; text-align: center; padding: 0 5px; border: 2px solid var(--bg); }
.page { padding: 10px 28px 48px; min-width: 0; }
.tabbar { display: none; }

/* ---------- common ---------- */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.ph h1 { font: 600 30px/1.1 var(--display); letter-spacing: -.005em; }
.ph p { color: var(--muted); margin-top: 6px; }
.ph-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.card-h h3 { font: 600 17px var(--display); letter-spacing: .005em; }
.card-h small { color: var(--muted); }
.grid { display: grid; gap: 18px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.mt { margin-top: 18px; }
.btn { height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 650; white-space: nowrap; box-shadow: var(--shadow-sm); }
.btn:hover { border-color: var(--border-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(180deg, #1b9a4b, #15803d); border-color: #137535; color: #fff; box-shadow: 0 8px 18px rgba(21, 128, 61, .26), inset 0 1px 0 rgba(255, 255, 255, .22); }
.btn-primary:hover { border-color: #166534; background: linear-gradient(180deg, #1ea552, #15763a); }
[data-theme="dark"] .btn-primary { background: linear-gradient(180deg, #5ee58f, #3ccb70); border-color: #3ccb70; color: #052e16; }
.btn-soft { background: var(--primary-soft); border-color: transparent; color: var(--primary-2); box-shadow: none; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--red-soft); color: var(--red); border-color: transparent; box-shadow: none; }
.btn-coral { background: var(--coral-soft); color: var(--coral); border-color: transparent; box-shadow: none; }
.btn-sm { height: 34px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
.btn-xs { height: 28px; padding: 0 10px; border-radius: 8px; font-size: 12px; gap: 5px; }
.btn-lg { height: 52px; font-size: 15.5px; border-radius: 14px; }
.w100 { width: 100%; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 36px; display: inline-flex; align-items: center; gap: 7px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: 13px; white-space: nowrap; }
.chip:hover { border-color: var(--border-2); }
.chip.on { background: var(--side); border-color: var(--side); color: #fff; }
[data-theme="dark"] .chip.on { background: var(--primary); border-color: var(--primary); color: #052e16; }
.chip b { font-weight: 700; opacity: .6; }
.chip .sw { width: 9px; height: 9px; border-radius: 3px; }
.seg { display: inline-flex; padding: 4px; border-radius: 13px; background: var(--surface-3); border: 1px solid var(--border); gap: 2px; }
.seg button { height: 34px; padding: 0 12px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); font-weight: 650; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
.seg.xs { padding: 2px; border-radius: 9px; }
.seg.xs button { height: 24px; padding: 0 8px; border-radius: 7px; font-size: 11.5px; }
.input, select.input, textarea.input { height: 42px; width: 100%; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); padding: 0 14px; outline: none; }
textarea.input { height: auto; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field label, .field .lbl { font-weight: 650; font-size: 13px; color: var(--text-2); }
.search { position: relative; }
.search .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search .input { padding-left: 42px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-weight: 700; font-size: 12px; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.nd::before { display: none; }
.p-green { background: var(--green-soft); color: var(--green); }
.p-teal { background: var(--primary-soft); color: var(--primary-2); }
.p-amber { background: var(--amber-soft); color: var(--amber); }
.p-yellow { background: var(--yellow-soft); color: var(--yellow); }
.p-red { background: var(--red-soft); color: var(--red); }
.p-wine { background: var(--wine-soft); color: var(--wine); }
.p-blue { background: var(--blue-soft); color: var(--blue); }
.p-violet { background: var(--violet-soft); color: var(--violet); }
.p-gray { background: var(--surface-3); color: var(--muted); }
/* schedule tags */
.sch { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 7px; font: 700 11px var(--font); letter-spacing: .02em; white-space: nowrap; border: 1px solid transparent; }
.sch-otc { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.sch-h { background: var(--violet-soft); color: var(--violet); }
.sch-h1 { background: var(--red-soft); color: var(--red); }
.rack { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 7px; font: 700 11px var(--mono); color: var(--text-2); background: var(--surface-3); white-space: nowrap; }
/* expiry bands */
.xp { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font: 700 12px var(--font); white-space: nowrap; }
.xp::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.xp-0 { background: var(--wine-soft); color: var(--wine); }
.xp-1 { background: var(--red-soft); color: var(--red); }
.xp-2 { background: var(--amber-soft); color: var(--amber); }
.xp-3 { background: var(--yellow-soft); color: var(--yellow); }
.xp-4 { background: var(--primary-soft); color: var(--primary-2); }
.life { height: 8px; border-radius: 6px; background: var(--surface-3); overflow: hidden; min-width: 70px; }
.life i { display: block; height: 100%; border-radius: 6px; }
.lv-0 { background: #9f1239; } .lv-1 { background: #ef4444; } .lv-2 { background: #f59e0b; } .lv-3 { background: #d9b80b; } .lv-4 { background: #22c55e; }
.switch { position: relative; width: 42px; height: 24px; border-radius: 12px; background: var(--border-2); border: 0; flex: none; transition: background .2s; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch.on { background: var(--primary); }
.switch.on::after { transform: translateX(18px); }
.toggle-line { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 13px; color: var(--text-2); background: none; border: 0; padding: 0; text-align: left; }
.empty { display: grid; place-items: center; gap: 8px; text-align: center; padding: 30px 16px; color: var(--muted); }
.empty .eic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.bar { height: 8px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #86efac, #15803d); }
.bar.r > i { background: var(--coral); } .bar.a > i { background: #f59e0b; } .bar.v > i { background: #8b5cf6; } .bar.b > i { background: #3b6ff0; }
.tile { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.tile.sm { width: 34px; height: 34px; border-radius: 10px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 12px; background: var(--blue-soft); color: var(--blue); font-size: 13px; font-weight: 600; }
.note.amber { background: var(--amber-soft); color: var(--amber); }
.note.violet { background: var(--violet-soft); color: var(--violet); }
.note.teal { background: var(--primary-soft); color: var(--primary-2); }
.note .grow b { color: var(--text); }
.ellip { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* tables */
.tbl-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.t td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--surface-2); }
table.t td.r, table.t th.r { text-align: right; }
table.t .nowrap { white-space: nowrap; }
.cell-main { font-weight: 650; }
.cell-sub { color: var(--muted); font-size: 12.5px; }
.med-cell { display: flex; gap: 12px; align-items: center; min-width: 0; }
.med-cell .grow b { display: block; font-weight: 650; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; gap: 10px; }

/* ---------- KPIs and charts ---------- */
.kpi { position: relative; overflow: hidden; }
.kpi .lbl { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 650; font-size: 13px; }
.kpi .ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.kpi .ico.coral { background: var(--coral-soft); color: var(--coral); }
.kpi .ico.amber { background: var(--amber-soft); color: var(--amber); }
.kpi .ico.violet { background: var(--violet-soft); color: var(--violet); }
.kpi .ico.blue { background: var(--blue-soft); color: var(--blue); }
.kpi .val { font: 600 31px/1.05 var(--display); letter-spacing: -.01em; margin-top: 14px; }
.kpi .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; min-height: 34px; }
.kpi .foot .muted { font-size: 12.5px; }
.delta { font-weight: 700; font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.delta.up { color: var(--green); } .delta.down { color: var(--red); }
.spark { width: 104px; height: 34px; flex: none; }
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font: 11px var(--font); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut-wrap svg { width: 146px; height: 146px; flex: none; }
.mix { flex: 1; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.mix-row { display: flex; align-items: center; gap: 10px; }
.mix-row .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.mix-row b { margin-left: auto; }
.mix-row small { color: var(--muted); }
.att { display: flex; flex-direction: column; }
.att a { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px dashed var(--border); }
.att a:last-child { border-bottom: 0; }
.att a:hover .grow b { color: var(--primary-2); }
.att .n { font: 600 24px/1 var(--display); min-width: 34px; }
.att .grow b { display: block; font-size: 13.5px; }
.att .grow small { color: var(--muted); font-size: 12px; }
.att .go { color: var(--faint); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow b { display: block; font-size: 13.5px; }
.branch-cmp { display: flex; flex-direction: column; gap: 14px; }
.bc { border: 1px solid var(--border); border-radius: 14px; padding: 14px; background: var(--surface-2); }
.bc.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); background: var(--surface); }
.bc-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bc-h b { font: 600 16px var(--display); }
.bc-v { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.bc-v small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.bc-v b { font: 600 17px var(--display); }

/* ---------- billing counter ---------- */
.counter { display: grid; grid-template-columns: minmax(0, 1fr) 430px; gap: 22px; align-items: start; }
.counter-tools { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.counter-tools .search { flex: 1; }
.counter-tools .search .input { height: 52px; font-size: 16px; border-radius: 15px; box-shadow: var(--shadow-sm); }
.counter-tools .search kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }
.results { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.res-h { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12.5px; font-weight: 650; margin-top: 16px; }
.mrow { display: grid; grid-template-columns: 44px minmax(0, 1fr) 150px auto; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.mrow:hover { border-color: var(--border-2); box-shadow: var(--shadow); }
.mrow.out { opacity: .55; }
.mrow .nm { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mrow .nm b { font: 600 16px var(--display); letter-spacing: .005em; }
.mrow .gn { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.mrow .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.mrow .stk { font-size: 12.5px; color: var(--muted); }
.mrow .stk b { display: block; color: var(--text); font-size: 13.5px; }
.mrow .stk b.low { color: var(--coral); }
.mrow .buy { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.mrow .price { font: 600 17px var(--display); white-space: nowrap; }
.mrow .price small { font: 600 11.5px var(--font); color: var(--muted); }
.mrow .adds { display: flex; gap: 6px; }
.mrow .inq { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--primary); color: #fff; font: 700 11.5px var(--font); }
.bill { position: sticky; top: 82px; display: flex; flex-direction: column; max-height: calc(100vh - 96px); padding: 0; overflow: hidden; }
.bill-h { padding: 16px 18px 14px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.bill-h .row { justify-content: space-between; }
.bill-h h3 { font: 600 19px var(--display); }
.cust-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.rx-box { display: flex; flex-direction: column; gap: 8px; padding: 11px 12px; border-radius: 12px; background: var(--violet-soft); color: var(--violet); font-size: 12.5px; font-weight: 600; }
.rx-box .row { gap: 8px; }
.rx-box .input { height: 36px; border-radius: 10px; font-size: 13px; }
.rx-box .check { color: var(--text); font-size: 13px; }
.rx-box.need { box-shadow: 0 0 0 2px var(--violet); }
.lines { flex: 1; overflow-y: auto; padding: 4px 18px; min-height: 120px; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.line:last-child { border-bottom: 0; }
.line b.n { display: block; font: 600 15px/1.2 var(--display); }
.line .g { color: var(--muted); font-size: 12px; }
.line .meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 7px; }
.batch-sel { height: 26px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); font: 600 11.5px var(--font); color: var(--text-2); padding: 0 6px; max-width: 210px; }
.line .rm { border: 0; background: none; color: var(--muted); font-size: 12px; font-weight: 650; padding: 0 2px; }
.line .rm:hover { color: var(--red); }
.line .qty { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.line .qty strong { font: 600 15px var(--display); }
.line .qty small { color: var(--muted); font-size: 11.5px; }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 6px; height: 34px; border: 1px solid var(--border); border-radius: 10px; padding: 0 3px; background: var(--surface); }
.stepper button { width: 26px; height: 26px; border-radius: 7px; border: 0; background: var(--surface-3); display: grid; place-items: center; color: var(--text-2); }
.stepper b { font-size: 13.5px; min-width: 20px; text-align: center; }
.bill-f { border-top: 1px solid var(--border); padding: 14px 18px 18px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.sum { display: flex; justify-content: space-between; color: var(--text-2); font-size: 13.5px; gap: 10px; }
.sum.sub { color: var(--muted); font-size: 12.5px; }
.sum.total { font: 600 22px var(--display); color: var(--text); padding-top: 8px; border-top: 1px dashed var(--border-2); margin-top: 2px; }
.disc-chips { display: flex; gap: 6px; align-items: center; }
.disc-chips span { font-size: 12.5px; color: var(--muted); font-weight: 650; margin-right: auto; }
.disc-chips button { height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); font-weight: 700; font-size: 12px; color: var(--text-2); }
.disc-chips button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.bill-btns { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; margin-top: 6px; }
.bill-toggle, .bill-x, .bill-backdrop { display: none; }
.bill-toggle[hidden] { display: none !important; }

/* ---------- stock & expiry ---------- */
.band-legend { display: flex; gap: 8px; flex-wrap: wrap; }
.hz text { fill: var(--muted); font: 11px var(--font); }
.qty-cell b { display: block; }

/* ---------- purchases, suppliers ---------- */
.sup-g { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.sup .row { align-items: flex-start; }
.sup h3 { font: 600 17px var(--display); }
.sup .kv { margin: 14px 0; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.kv div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.kv small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.kv b { font-size: 14.5px; }
.po-lines { display: flex; flex-direction: column; gap: 8px; }
.po-line { display: grid; grid-template-columns: minmax(0, 1fr) 84px 96px 92px 34px; gap: 8px; align-items: center; }
.po-line .input { height: 38px; padding: 0 10px; border-radius: 10px; }
.po-line .amt { text-align: right; font-weight: 650; }
.po-head { display: grid; grid-template-columns: minmax(0, 1fr) 84px 96px 92px 34px; gap: 8px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.rcv-line { display: grid; grid-template-columns: minmax(0, 1fr) 80px 120px 128px; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.rcv-line:last-child { border-bottom: 0; }
.rcv-line .input { height: 38px; padding: 0 10px; border-radius: 10px; }
.timeline { display: flex; flex-direction: column; margin-top: 6px; }
.tl-i { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.tl-i::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 2px; background: var(--border); }
.tl-i:last-child::before { display: none; }
.tl-i i { width: 14px; height: 14px; border-radius: 50%; background: var(--border-2); margin-top: 3px; flex: none; }
.tl-i.done i { background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.tl-i small { display: block; color: var(--muted); }

/* ---------- customers ---------- */
.refills { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.rf { border: 1px solid var(--border); border-radius: 15px; padding: 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.rf .row { align-items: flex-start; }
.rf .grow b { display: block; }
.rf .med { font-size: 13px; color: var(--text-2); }
.rf .acts { display: flex; gap: 8px; }
.rf .acts .btn { flex: 1; }
.plan { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.plan:last-child { border-bottom: 0; }

/* ---------- reports ---------- */
.mbar { display: flex; flex-direction: column; gap: 13px; }
.mbar .r1 { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; gap: 8px; }
.mbar .r1 b { color: var(--text); }
.mbar .r1 span { color: var(--muted); white-space: nowrap; }
.mbar .stackbar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--surface-3); }
.mbar .stackbar i { display: block; height: 100%; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(6, 24, 12, .45); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; animation: fade .15s ease-out; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; }
.modal.wide { width: min(720px, 100%); }
.modal-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 24px 8px; }
.modal-h h2 { font: 600 22px var(--display); letter-spacing: .002em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.modal-h p { color: var(--muted); margin-top: 4px; font-size: 13.5px; }
.modal-b { padding: 14px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-f { padding: 14px 24px 22px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.overlay.side-panel { place-items: stretch end; padding: 0; }
.overlay.side-panel .modal { width: min(500px, 100%); max-height: none; height: 100vh; border-radius: 22px 0 0 22px; animation: slide .2s ease-out; display: flex; flex-direction: column; }
.overlay.side-panel .modal-b { flex: 1; }
.overlay.top-panel { place-items: start center; padding-top: 12vh; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.pay-amt { text-align: center; padding: 6px 0 2px; }
.pay-amt small { color: var(--muted); font-weight: 650; }
.pay-amt div { font: 600 42px var(--display); letter-spacing: -.01em; }
.pay-panel { border: 1px solid var(--border); border-radius: 16px; padding: 18px; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.qr { width: 176px; height: 176px; padding: 10px; background: #fff; border-radius: 14px; box-shadow: var(--shadow-sm); }
.quick { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.change { font: 600 19px var(--display); color: var(--green); }
.card-art { width: 236px; height: 142px; border-radius: 16px; background: linear-gradient(135deg, #0a2414, #1f6b3a); color: #fff; padding: 16px; text-align: left; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow); }
.card-art .chip-art { width: 34px; height: 26px; border-radius: 6px; background: linear-gradient(135deg, #e9f8b4, #7fb48a); }
.invoice { font-family: var(--mono); font-size: 12px; background: #fff; color: #0f2015; border: 1px solid #d5e2d8; border-radius: 12px; padding: 18px 18px 14px; }
.invoice .ih { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.invoice h3 { font: 700 15px var(--display); letter-spacing: .02em; }
.invoice .c { color: #4d6253; font-size: 11px; line-height: 1.45; }
.invoice .tag { font: 700 10px var(--font); letter-spacing: .12em; text-transform: uppercase; color: #166534; border: 1.5px solid #166534; border-radius: 6px; padding: 3px 6px; white-space: nowrap; }
.invoice hr { border: 0; border-top: 1px dashed #b9cbbf; margin: 9px 0; }
.invoice .rw { display: flex; justify-content: space-between; gap: 10px; }
.invoice table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.invoice th { text-align: left; font-weight: 700; color: #4d6253; padding: 3px 2px; border-bottom: 1px solid #d5e2d8; }
.invoice td { padding: 4px 2px; vertical-align: top; }
.invoice td.r, .invoice th.r { text-align: right; }
.invoice td small { display: block; color: #6a7f6f; font-size: 10.5px; }
.invoice .tot { font-weight: 800; font-size: 14px; }
.invoice .foot { text-align: center; color: #4d6253; font-size: 10.5px; margin-top: 4px; }
.pal-in { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.pal-in input { flex: 1; border: 0; outline: none; background: none; font-size: 16px; height: 34px; min-width: 0; }
.pal-list { max-height: 400px; overflow-y: auto; padding: 8px; }
.pal-g { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 10px 10px 6px; }
.pal-i { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 11px; border: 0; background: none; text-align: left; }
.pal-i.on { background: var(--primary-soft); }
.pal-i .k { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.pal-i .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); flex: none; }
.pal-i .lb { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pal-i .lb small { color: var(--muted); margin-left: 6px; }
.pop { position: absolute; top: 56px; right: 0; width: 370px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); z-index: 60; overflow: hidden; animation: pop .15s ease-out; }
.pop.left { left: 0; right: auto; width: 330px; }
.pop-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.pop-h b { font: 600 16px var(--display); }
.ntf { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.ntf:last-child { border-bottom: 0; }
.ntf .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.ntf.unread .ico { background: var(--primary-soft); color: var(--primary); }
.ntf small { color: var(--muted); }
.bopt { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--border); background: none; text-align: left; }
.bopt:last-child { border-bottom: 0; }
.bopt:hover { background: var(--surface-2); }
.bopt .grow b { display: block; font: 600 15px var(--display); }
.bopt .grow small { color: var(--muted); }
.bopt .ok { color: var(--primary); }
#toasts { position: fixed; right: 22px; bottom: 22px; z-index: 200; pointer-events: none; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: var(--side); color: #fff; box-shadow: var(--shadow-lg); font-weight: 600; animation: pop .18s ease-out; max-width: 380px; }
.toast .i { color: var(--mint); }
.toast.warn .i { color: #ffb3a3; }
.toast.out { opacity: 0; transform: translateY(6px); transition: all .3s; }
[data-theme="dark"] .toast { background: #e8f3eb; color: #0e1f13; }
[data-theme="dark"] .toast .i { color: #166534; }
[data-theme="dark"] .toast.warn .i { color: #c2410c; }
.settings { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--border); }
.set-row:last-child { border-bottom: 0; }
.set-row b { display: block; }
.set-row small { color: var(--muted); }
.sc { display: grid; grid-template-columns: 1fr auto; gap: 10px 20px; font-size: 13.5px; align-items: center; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-art { position: relative; overflow: hidden; background: #071c0e; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 30px; }
.login-art::before { content: ""; position: absolute; width: 680px; height: 680px; right: -230px; top: -220px; border-radius: 50%; background: radial-gradient(circle, rgba(74, 222, 128, .38), rgba(74, 222, 128, 0) 68%); }
.login-art::after { content: ""; position: absolute; width: 560px; height: 560px; left: -200px; bottom: -260px; border-radius: 50%; background: radial-gradient(circle, rgba(163, 230, 53, .2), rgba(163, 230, 53, 0) 70%); }
.login-art > * { position: relative; z-index: 1; }
.login-art .brand b { font-size: 21px; }
.login-art h2 { font: 600 48px/1.04 var(--display); letter-spacing: -.01em; max-width: 540px; }
.login-art h2 em { font-style: normal; background: linear-gradient(90deg, #bbf7d0, #86efac, #d9f99d); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-art p.lead { color: #c2d6c8; font-size: 16px; max-width: 470px; margin-top: 16px; }
.feat { display: flex; flex-direction: column; gap: 12px; margin-top: 28px; }
.feat div { display: flex; align-items: center; gap: 12px; color: #e0eee4; font-weight: 600; }
.feat .i { color: var(--mint); }
.floaters { position: relative; height: 176px; margin-top: 30px; }
.fl { position: absolute; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .13); backdrop-filter: blur(10px); border-radius: 16px; padding: 13px 16px; box-shadow: 0 20px 40px rgba(0, 0, 0, .3); }
.fl small { color: #a9c2b0; font-size: 12px; display: block; }
.fl b { display: block; font: 600 22px var(--display); }
.login-form { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.login-box { width: min(420px, 100%); display: flex; flex-direction: column; gap: 18px; }
.login-box .brand { display: none; padding: 0; }
.login-box .brand b { color: var(--text); }
.login-box h1 { font: 600 34px var(--display); letter-spacing: -.005em; }
.login-box > p { color: var(--muted); margin-top: -8px; }
.role-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.role-chips button { border: 1px solid var(--border); background: var(--surface); border-radius: 13px; padding: 11px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 650; font-size: 13px; color: var(--text-2); }
.role-chips button.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-2); box-shadow: 0 0 0 3px var(--primary-ring); }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12px; font-weight: 650; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.demo-note { font-size: 12.5px; color: var(--muted); text-align: center; line-height: 1.5; }

/* ---------- responsive ---------- */
@media (max-width: 1320px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .counter { grid-template-columns: minmax(0, 1fr) 390px; }
  .mrow { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .mrow .stk { display: none; }
  .clock span.d { display: none; }
}
@media (max-width: 1080px) {
  .g2-1, .g3, .g2, .settings { grid-template-columns: minmax(0, 1fr); }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-box .brand { display: flex; }
  .search-trigger { max-width: 260px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .top { padding: 0 16px; height: 64px; gap: 8px; }
  .top-brand { display: flex; }
  .branch-btn { height: 42px; padding: 0 10px 0 6px; gap: 8px; }
  .branch-btn .bi { width: 28px; height: 28px; }
  .branch-btn small { display: none; }
  .search-trigger, .clock { display: none; }
  .top-r { gap: 8px; }
  .top .icon-btn { width: 42px; height: 42px; }
  .top .btn-primary span { display: none; }
  .top .btn-primary { width: 42px; padding: 0; }
  .page { padding: 8px 16px 170px; }
  .ph { margin-bottom: 18px; }
  .ph h1 { font-size: 25px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .grid { gap: 14px; }
  .mt { margin-top: 14px; }
  .card { padding: 16px; }
  .kpi .val { font-size: 23px; }
  .kpi .lbl { font-size: 12px; gap: 8px; }
  .kpi .ico { width: 30px; height: 30px; }
  .spark { display: none; }
  .counter { grid-template-columns: minmax(0, 1fr); }
  .counter-tools .search kbd { display: none; }
  .mrow { grid-template-columns: 40px minmax(0, 1fr); gap: 10px 12px; padding: 12px; }
  .mrow .tile { width: 40px; height: 40px; }
  .mrow .buy { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
  .bill { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 70; max-height: 86vh; border-radius: 22px 22px 0 0; transform: translateY(105%); transition: transform .25s; }
  .bill.open { transform: none; }
  .bill-x { display: grid; }
  .bill-backdrop { display: block; position: fixed; inset: 0; z-index: 66; background: rgba(6, 24, 12, .45); }
  .bill-toggle { display: flex; position: fixed; left: 16px; right: 16px; bottom: 84px; z-index: 65; height: 56px; border-radius: 16px; align-items: center; justify-content: space-between; padding: 0 18px; border: 0; background: var(--side); color: #fff; font-weight: 700; box-shadow: var(--shadow-lg); }
  [data-theme="dark"] .bill-toggle { background: var(--primary); color: #052e16; }
  .pop, .pop.left { position: fixed; top: 70px; left: 12px; right: 12px; width: auto; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--surface); border-top: 1px solid var(--border); padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 650; color: var(--muted); border: 0; background: none; padding: 4px 0; }
  .tabbar .on { color: var(--primary); }
  .hide-m { display: none !important; }
  table.t td, table.t th { padding: 11px 8px; }
  .two, .three { grid-template-columns: 1fr; }
  .po-head { display: none; }
  .po-line { grid-template-columns: minmax(0, 1fr) 70px 34px; }
  .po-line .cost, .po-line .amt { display: none; }
  .rcv-line { grid-template-columns: minmax(0, 1fr) 70px; }
  .rcv-line .bn, .rcv-line .ex { grid-column: span 1; }
  .modal-h, .modal-b, .modal-f { padding-left: 18px; padding-right: 18px; }
  .overlay { padding: 12px; }
  .donut-wrap { gap: 16px; }
  .donut-wrap svg { width: 124px; height: 124px; }
  .refills { grid-template-columns: minmax(0, 1fr); }
  .sup-g { grid-template-columns: minmax(0, 1fr); }
  .seg { max-width: 100%; overflow-x: auto; }
  #toasts { left: 16px; right: 16px; bottom: 150px; align-items: stretch; }
}
@media print {
  body * { visibility: hidden !important; }
  .invoice, .invoice * { visibility: visible !important; }
  .invoice { position: fixed; left: 0; top: 0; width: 100%; border: 0; }
}

/* ---------- small additions ---------- */
.sm-only { display: none; }
.mrow .inq { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; background: var(--primary); color: #fff; font: 700 11.5px var(--font); white-space: nowrap; }
[data-theme="dark"] .mrow .inq, [data-theme="dark"] .disc-chips button.on { color: #052e16; }
.modal .nb { margin-left: auto; }
.modal .nb.warn { background: var(--coral-soft); color: var(--coral); }
.hist-list { display: flex; flex-direction: column; }
@media (max-width: 860px) {
  .sm-only { display: inline; }
}
.cat-chips { flex-wrap: wrap; }
table.t.tight td { padding: 11px 8px; }
table.t.tight th { padding: 10px 8px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.stats div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.stats small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 650; }
.stats b { display: block; font: 600 17px var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rf-meds { display: flex; flex-direction: column; gap: 7px; }
.rf-med { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); min-width: 0; }
.rf-med .pill { flex: none; height: 22px; font-size: 11.5px; }
@media (max-width: 860px) {
  .cat-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.rf-med { flex-direction: column; align-items: flex-start; gap: 5px; }
.rf .acts { margin-top: auto; }
.sm-only-b { display: none; }
.line .meta .batch-sel { flex: 1 1 100%; max-width: 100%; }
@media (max-width: 860px) {
  .sm-only-b { display: block; }
  .med-cell .ellip { max-width: 150px !important; }
  .mrow .stk { display: none; }
}
@media (max-width: 860px) {
  table.t.stack-m thead { display: none; }
  table.t.stack-m, table.t.stack-m tbody { display: block; width: 100%; }
  table.t.stack-m tr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 2px; border-bottom: 1px solid var(--border); }
  table.t.stack-m tbody tr:last-child { border-bottom: 0; }
  table.t.stack-m td { display: block; padding: 0; border: 0; }
  table.t.stack-m td:first-child { flex: 1 1 100%; min-width: 0; }
  table.t.stack-m td.hide-m { display: none; }
  table.t.stack-m td.r { margin-left: auto; text-align: right; }
  table.t.stack-m .med-cell .ellip { max-width: 240px !important; }
  table.t.stack-m tr.click:hover td { background: none; }
}
