/* ==========================================================================
   Corner Stop — Inventory & POS
   Mobile-first; grows into a sidebar layout on tablets/desktop.
   ========================================================================== */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --ink: #10151f;
  --ink-2: #4a5568;
  --ink-3: #8792a2;
  --line: #e4e8ee;
  --line-2: #eef1f5;

  --brand: #1c5fd8;
  --brand-ink: #124aab;
  --brand-soft: #e8f0fe;

  --ok: #14875a;
  --ok-soft: #e3f6ec;
  --warn: #b45309;
  --warn-soft: #fdf3e2;
  --danger: #c02b2b;
  --danger-soft: #fdeaec;
  --violet: #6d3bd1;
  --violet-soft: #f1ebfd;

  --nav-h: 62px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-1: 0 1px 2px rgba(16, 21, 31, .06), 0 1px 3px rgba(16, 21, 31, .04);
  --shadow-2: 0 10px 30px rgba(16, 21, 31, .12);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body { min-height: 100dvh; }

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.015em; }
h1 { font-size: 1.4rem; }
h2 { font-size: 1.12rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 16px; }
[hidden] { display: none !important; }

/* ---------------------------------- boot --------------------------------- */

.boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background: var(--bg);
  z-index: 100;
}
.boot__logo {
  width: 58px; height: 58px;
  border-radius: 18px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #1c5fd8, #3b82f6);
  color: #fff; font-weight: 800; font-size: 20px; letter-spacing: .04em;
  box-shadow: var(--shadow-2);
}
.boot__text { color: var(--ink-3); font-size: .88rem; }
.boot.hide { opacity: 0; pointer-events: none; transition: opacity .25s; }

/* ---------------------------------- layout -------------------------------- */

.app { min-height: 100dvh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(10px + var(--safe-t)) 16px 10px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar__title { flex: 1; min-width: 0; }
.topbar__title h1 { font-size: 1.1rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__sub { font-size: .74rem; color: var(--ink-3); letter-spacing: .01em; }

.avatar {
  width: 34px; height: 34px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 700; font-size: .8rem;
  border: 1px solid #d7e3fb;
}
.avatar--mgr { background: var(--violet-soft); color: #5730a8; border-color: #e2d6fb; }

.content {
  padding: 16px 16px calc(var(--nav-h) + var(--safe-b) + 24px);
  max-width: 1180px;
  margin: 0 auto;
}

/* bottom nav (mobile) */
.nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 45;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
}
.nav__item {
  flex: 1;
  border: 0; background: none;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  color: var(--ink-3);
  font-size: .62rem; font-weight: 600;
  letter-spacing: .015em;
  cursor: pointer;
  padding: 0;
}
.nav__item svg { width: 22px; height: 22px; }
.nav__item.on { color: var(--brand); }
.nav__item.on .nav__dot { opacity: 1; }
.nav__dot { width: 4px; height: 4px; border-radius: 50%; background: var(--brand); opacity: 0; }

/* --------------------------------- sidebar -------------------------------- */
@media (min-width: 1024px) {
  .app { display: grid; grid-template-columns: 232px 1fr; }
  .sidebar {
    position: sticky; top: 0; height: 100dvh;
    border-right: 1px solid var(--line);
    background: var(--surface);
    padding: 18px 12px;
    display: flex; flex-direction: column; gap: 4px;
    overflow-y: auto;
  }
  .sidebar__brand {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 10px 18px;
  }
  .sidebar__brand .boot__logo { width: 36px; height: 36px; border-radius: 11px; font-size: 14px; }
  .sidebar__name { font-weight: 700; font-size: .92rem; line-height: 1.1; }
  .sidebar__role { font-size: .68rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .07em; }
  .sidebar__item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 11px;
    border: 0; background: none; border-radius: 9px;
    color: var(--ink-2); font-size: .87rem; font-weight: 550;
    cursor: pointer; text-align: left; width: 100%;
  }
  .sidebar__item svg { width: 18px; height: 18px; opacity: .75; flex: none; }
  .sidebar__item:hover { background: var(--surface-2); color: var(--ink); }
  .sidebar__item.on { background: var(--brand-soft); color: var(--brand-ink); font-weight: 650; }
  .sidebar__item.on svg { opacity: 1; }
  .sidebar__spacer { flex: 1; }
  .sidebar__foot { border-top: 1px solid var(--line-2); padding-top: 10px; margin-top: 6px; }
  .nav { display: none; }
  .content { padding: 22px 28px 40px; }
  .topbar { display: none; }
  .app--auth { grid-template-columns: 1fr; }
}

/* ---------------------------------- cards --------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
.card__head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line-2);
}
.card__head h2, .card__head h3 { flex: 1; font-size: .95rem; }
.card__body { padding: 14px 15px; }
.card__body--flush { padding: 0; }

.section { display: grid; gap: 14px; }
.section__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.section__head h2 { flex: 1; }
.sub { color: var(--ink-3); font-size: .78rem; }

.grid { display: grid; gap: 12px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
@media (min-width: 780px) {
  .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------------------------------- stats --------------------------------- */

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px;
  box-shadow: var(--shadow-1);
  display: flex; flex-direction: column; gap: 3px;
  position: relative;
  overflow: hidden;
  text-align: left;
  cursor: default;
}
button.stat { cursor: pointer; }
button.stat:active { transform: scale(.99); }
.stat__label {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-3); font-weight: 650;
}
.stat__value { font-size: 1.5rem; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }
.stat__value small { font-size: .78rem; font-weight: 600; color: var(--ink-3); margin-left: 3px; letter-spacing: 0; }
.stat__meta { font-size: .74rem; color: var(--ink-3); }
.stat--accent { background: linear-gradient(160deg, #10408f, #1c5fd8 60%, #2d74ee); border-color: transparent; color: #fff; }
.stat--accent .stat__label { color: rgba(255,255,255,.72); }
.stat--accent .stat__meta { color: rgba(255,255,255,.78); }
.stat--danger .stat__value { color: var(--danger); }
.stat--warn .stat__value { color: var(--warn); }
.stat--ok .stat__value { color: var(--ok); }
.stat__spark { position: absolute; right: -6px; bottom: -8px; opacity: .1; width: 66px; height: 66px; }

.delta { font-weight: 650; }
.delta--up { color: var(--ok); }
.delta--down { color: var(--danger); }

/* --------------------------------- buttons -------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: .88rem; font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, transform .06s;
}
.btn:active { transform: scale(.98); }
.btn svg { width: 17px; height: 17px; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-ink); }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn--soft { background: var(--brand-soft); border-color: #d7e3fb; color: var(--brand-ink); }
.btn--sm { padding: 6px 11px; font-size: .8rem; }
.btn--block { width: 100%; }
.btn--lg { padding: 14px 20px; font-size: .96rem; border-radius: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--icon { padding: 9px; border-radius: 11px; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------- forms --------------------------------- */

.field { display: grid; gap: 5px; }
.field__label { font-size: .75rem; font-weight: 650; color: var(--ink-2); letter-spacing: .01em; }
.field__hint { font-size: .72rem; color: var(--ink-3); }
.input, .select, .textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  outline: none;
  transition: border-color .12s, background .12s;
  font-size: 16px;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(28, 95, 216, .12);
}
.textarea { min-height: 74px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238792a2' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.input--mono { font-family: var(--mono); letter-spacing: .02em; }
.form-grid { display: grid; gap: 12px; }
@media (min-width: 620px) { .form-grid--2 { grid-template-columns: 1fr 1fr; } }

.search-wrap { position: relative; }
.search-wrap .input { padding-left: 38px; }
.search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--ink-3); }

/* ---------------------------------- chips --------------------------------- */

.chips { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips--wrap { flex-wrap: wrap; overflow: visible; }
.chip {
  flex: none;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: .79rem; font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip__n { font-size: .7rem; opacity: .65; font-weight: 700; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .68rem; font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--low { background: var(--warn-soft); color: var(--warn); }
.badge--out { background: var(--danger-soft); color: var(--danger); }
.badge--muted { background: #eff1f5; color: var(--ink-2); }
.badge--info { background: var(--brand-soft); color: var(--brand-ink); }
.badge--violet { background: var(--violet-soft); color: #5730a8; }

/* ---------------------------------- lists --------------------------------- */

.list { display: grid; }
.list__row {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 15px;
  border-bottom: 1px solid var(--line-2);
  background: none; border-left: 0; border-right: 0; border-top: 0;
  width: 100%; text-align: left; font: inherit; color: inherit;
}
.list__row:last-child { border-bottom: 0; }
button.list__row { cursor: pointer; }
button.list__row:active { background: var(--surface-2); }
.list__main { flex: 1; min-width: 0; }
.list__title { font-weight: 600; font-size: .89rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list__meta { font-size: .73rem; color: var(--ink-3); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.list__right { text-align: right; flex: none; }
.list__num { font-weight: 700; font-variant-numeric: tabular-nums; font-size: .9rem; }

.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

.empty {
  padding: 34px 18px;
  text-align: center;
  color: var(--ink-3);
  font-size: .85rem;
  display: grid; gap: 8px; justify-items: center;
}
.empty svg { width: 30px; height: 30px; opacity: .35; }

/* ---------------------------------- table --------------------------------- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .84rem; }
table.tbl th {
  text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-3); font-weight: 700; padding: 9px 12px; background: var(--surface-2);
  white-space: nowrap; border-bottom: 1px solid var(--line);
}
table.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tbl tbody tr.clickable { cursor: pointer; }
table.tbl tbody tr.clickable:active { background: var(--surface-2); }

/* --------------------------------- scanner -------------------------------- */

.scanner {
  position: fixed; inset: 0; z-index: 90;
  background: #06080c;
  display: flex; flex-direction: column;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.scanner__video-wrap { position: relative; flex: 1; overflow: hidden; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner__overlay { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.scanner__frame {
  width: min(76vw, 340px);
  height: min(38vw, 170px);
  border-radius: 16px;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .55);
  position: relative;
}
.scanner__frame::before, .scanner__frame::after {
  content: ''; position: absolute; width: 26px; height: 26px;
  border: 3px solid #fff; border-radius: 4px;
}
.scanner__frame::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.scanner__frame::after { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }
.scanner__laser {
  position: absolute; left: 8%; right: 8%; height: 2px; top: 50%;
  background: linear-gradient(90deg, transparent, #3b82f6, #60a5fa, #3b82f6, transparent);
  box-shadow: 0 0 14px 2px rgba(59, 130, 246, .8);
  animation: scanline 2.1s ease-in-out infinite;
  border-radius: 2px;
}
@keyframes scanline { 0%,100% { transform: translateY(-52px) } 50% { transform: translateY(52px) } }
.scanner__top {
  position: absolute; top: 0; left: 0; right: 0;
  padding: calc(12px + var(--safe-t)) 14px 12px;
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(rgba(0,0,0,.72), transparent);
  color: #fff;
  z-index: 2;
}
.scanner__top h3 { font-size: .95rem; flex: 1; }
.scanner__btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.12);
  color: #fff; display: grid; place-items: center; cursor: pointer;
  backdrop-filter: blur(6px);
}
.scanner__btn svg { width: 19px; height: 19px; }
.scanner__btn.on { background: #fbbf24; border-color: #fbbf24; color: #422006; }
.scanner__bottom {
  padding: 14px 14px calc(16px + var(--safe-b));
  background: #06080c;
  display: grid; gap: 10px;
}
.scanner__hint { color: rgba(255,255,255,.62); font-size: .78rem; text-align: center; }
.scanner__manual { display: flex; gap: 8px; }
.scanner__manual .input { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #fff; }
.scanner__manual .input::placeholder { color: rgba(255,255,255,.4); }
.scanner__manual .btn--primary { background: #2563eb; }
.scanner__err { color: #fca5a5; font-size: .78rem; text-align: center; }

/* toast flash for successful scan */
.scan-flash {
  position: fixed; inset: 0; z-index: 95;
  background: rgba(34, 197, 94, .22);
  pointer-events: none;
  animation: flash .3s ease;
}
@keyframes flash { from { opacity: 1 } to { opacity: 0 } }

/* ---------------------------------- toasts -------------------------------- */

.toasts {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + var(--safe-b) + 14px);
  z-index: 120;
  display: grid; gap: 8px; justify-items: center;
  width: min(92vw, 420px);
  pointer-events: none;
}
.toast {
  background: #10151f;
  color: #fff;
  padding: 10px 16px;
  border-radius: 11px;
  font-size: .84rem;
  font-weight: 550;
  box-shadow: var(--shadow-2);
  animation: toastIn .22s ease;
  display: flex; align-items: center; gap: 8px;
  max-width: 100%;
}
.toast--ok { background: #0f7a4f; }
.toast--err { background: #a82020; }
.toast--warn { background: #8a4b06; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }

/* ---------------------------------- sheet --------------------------------- */

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(8, 12, 20, .5);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .16s ease;
}
@media (min-width: 700px) { .sheet-backdrop { align-items: center; } }
.sheet {
  background: var(--surface);
  width: 100%;
  max-width: 620px;
  max-height: 92dvh;
  border-radius: 20px 20px 0 0;
  display: flex; flex-direction: column;
  animation: sheetUp .24s cubic-bezier(.2,.9,.3,1);
  overflow: hidden;
}
@media (min-width: 700px) { .sheet { border-radius: 18px; max-height: 86dvh; } }
@keyframes sheetUp { from { transform: translateY(24px); opacity: .6 } to { transform: none; opacity: 1 } }
.sheet__head {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 16px 12px;
  border-bottom: 1px solid var(--line-2);
}
.sheet__head h3 { flex: 1; }
.sheet__body { padding: 15px 16px; overflow-y: auto; display: grid; gap: 13px; }
.sheet__foot {
  padding: 12px 16px calc(14px + var(--safe-b));
  border-top: 1px solid var(--line-2);
  display: flex; gap: 9px;
  background: var(--surface-2);
}
.sheet__foot .btn { flex: 1; }
.sheet__grab { width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 8px auto -4px; }

/* ----------------------------------- auth --------------------------------- */

.auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 18px calc(24px + var(--safe-b));
  background:
    radial-gradient(1100px 520px at 50% -10%, #1c5fd8 0%, #10337a 42%, #0b1c3d 100%);
}
.auth__card {
  width: 100%; max-width: 392px;
  background: var(--surface);
  border-radius: 20px;
  padding: 26px 22px;
  box-shadow: 0 24px 70px rgba(3, 10, 25, .45);
  display: grid; gap: 15px;
}
.auth__logo {
  width: 50px; height: 50px; border-radius: 15px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #1c5fd8, #3b82f6);
  color: #fff; font-weight: 800; letter-spacing: .04em;
  margin-bottom: 2px;
}
.auth__title { font-size: 1.28rem; }
.auth__sub { color: var(--ink-3); font-size: .84rem; margin-top: -8px; }
.auth__err {
  background: var(--danger-soft); color: var(--danger);
  padding: 9px 12px; border-radius: 9px;
  font-size: .82rem; font-weight: 550;
}
.auth__demo {
  border-top: 1px dashed var(--line);
  padding-top: 13px;
  display: grid; gap: 7px;
}
.auth__demo-row {
  display: flex; align-items: center; gap: 8px;
  font-size: .78rem; color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  text-align: left;
}
.auth__demo-row b { font-family: var(--mono); font-size: .74rem; }
.auth__demo-row .badge { margin-left: auto; }

/* ------------------------------------ POS --------------------------------- */

.pos { display: grid; gap: 13px; }
@media (min-width: 900px) {
  .pos { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
}

.scan-cta {
  display: flex; align-items: center; gap: 13px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px dashed #b9cdf3;
  background: linear-gradient(150deg, #f2f7ff, #e8f0fe);
  cursor: pointer;
  text-align: left;
  width: 100%;
  color: inherit;
}
.scan-cta:active { transform: scale(.995); }
.scan-cta__icon {
  width: 44px; height: 44px; flex: none;
  border-radius: 13px;
  background: var(--brand);
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(28, 95, 216, .32);
}
.scan-cta__icon svg { width: 22px; height: 22px; }
.scan-cta__main { flex: 1; min-width: 0; }
.scan-cta__title { font-weight: 700; font-size: .95rem; }
.scan-cta__sub { font-size: .76rem; color: var(--ink-2); }

.cart { display: grid; }
.cart__row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-2);
}
.cart__main { flex: 1; min-width: 0; }
.cart__name { font-weight: 600; font-size: .87rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart__meta { font-size: .72rem; color: var(--ink-3); }
.cart__qty { display: flex; align-items: center; gap: 2px; flex: none; }
.cart__qty button {
  width: 28px; height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 1rem; line-height: 1;
  color: var(--ink-2);
  cursor: pointer;
  display: grid; place-items: center;
}
.cart__qty button:active { background: var(--surface-2); }
.cart__qty span { min-width: 26px; text-align: center; font-weight: 700; font-size: .85rem; font-variant-numeric: tabular-nums; }
.cart__price { font-weight: 700; font-size: .87rem; font-variant-numeric: tabular-nums; min-width: 54px; text-align: right; flex: none; }

.totals { padding: 13px 15px; display: grid; gap: 7px; border-top: 1px solid var(--line); background: var(--surface-2); }
.totals__row { display: flex; justify-content: space-between; font-size: .84rem; color: var(--ink-2); }
.totals__row--grand { font-size: 1.18rem; font-weight: 750; color: var(--ink); letter-spacing: -.02em; padding-top: 5px; border-top: 1px dashed var(--line); }

.pos-sticky { position: sticky; bottom: calc(var(--nav-h) + var(--safe-b) + 8px); }
@media (min-width: 900px) { .pos-sticky { position: static; } }

.pay-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.pay-grid .chip { justify-content: center; }

/* -------------------------------- misc bits -------------------------------- */

.kv { display: grid; gap: 8px; }
.kv__row { display: flex; justify-content: space-between; gap: 12px; font-size: .85rem; }
.kv__row dt { color: var(--ink-3); }
.kv__row dd { margin: 0; font-weight: 600; text-align: right; }

.progress { height: 6px; border-radius: 3px; background: #eef1f5; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 3px; background: var(--brand); }

.bars { display: grid; gap: 9px; }
.bars__row { display: grid; gap: 4px; }
.bars__label { display: flex; justify-content: space-between; font-size: .78rem; }
.bars__label span:last-child { font-weight: 700; font-variant-numeric: tabular-nums; }
.bars__track { height: 8px; border-radius: 4px; background: #eef1f5; overflow: hidden; }
.bars__fill { height: 100%; border-radius: 4px; transition: width .4s cubic-bezier(.3,.9,.3,1); }

.spark { display: flex; align-items: flex-end; gap: 3px; height: 44px; }
.spark > i { flex: 1; background: var(--brand-soft); border-radius: 3px 3px 0 0; min-height: 3px; position: relative; }
.spark > i.on { background: var(--brand); }

.price-preview {
  background: linear-gradient(150deg, #f0f7ff, #e6effe);
  border: 1px solid #cfe0fb;
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  display: grid; gap: 4px;
}
.price-preview__row { display: flex; justify-content: space-between; font-size: .82rem; color: var(--ink-2); }
.price-preview__big { display: flex; justify-content: space-between; align-items: baseline; padding-top: 4px; border-top: 1px dashed #c4d8f7; }
.price-preview__big b { font-size: 1.35rem; letter-spacing: -.02em; color: var(--brand-ink); }
.price-preview__big span { font-size: .78rem; color: var(--ink-2); }

.offline-bar {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 14px;
  background: #fff4e0;
  border-bottom: 1px solid #f6dfb4;
  color: #8a4b06;
  font-size: .79rem; font-weight: 600;
}
.offline-bar button { margin-left: auto; }

.tiny { font-size: .72rem; color: var(--ink-3); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-1 { flex: 1; min-width: 0; }
.gap-6 { gap: 6px; }
.gap-10 { gap: 10px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mb-8 { margin-bottom: 8px; }
.wrap { flex-wrap: wrap; }

.skeleton {
  background: linear-gradient(90deg, #eef1f5 25%, #f6f8fa 50%, #eef1f5 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: 8px;
}
@keyframes shimmer { from { background-position: 200% 0 } to { background-position: -200% 0 } }

@media print {
  .nav, .topbar, .sidebar, .btn, .chips { display: none !important; }
  .content { padding: 0; }
  .card { box-shadow: none; border-color: #ccc; }
}
