/* ============================================================
   SunInventory — Design System
   Clean white SaaS UI · teal actions · amber/red warning states
   Pixel (Design) — tokens extracted from the product mockups.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  /* Brand / teal */
  --brand:        #0F766E;
  --brand-600:    #0D9488;
  --brand-700:    #0F766E;
  --brand-800:    #115E56;
  --brand-900:    #134E4A;
  --brand-tint:   #E6F4F2;
  --brand-tint-2: #CCEAE6;

  /* Sidebar (deep teal) */
  --sidebar-bg:     #0E433D;
  --sidebar-ink:    #CFE6E2;
  --sidebar-ink-2:  #8FBDB7;
  --sidebar-active: rgba(255,255,255,.14);
  --sidebar-hover:  rgba(255,255,255,.07);

  /* Neutrals */
  --ink:    #0F172A;
  --ink-2:  #334155;
  --muted:  #64748B;
  --muted-2:#94A3B8;
  --line:   #E5E9EF;
  --line-2: #EEF2F6;
  --bg:     #F4F6F8;
  --card:   #FFFFFF;
  --card-2: #F8FAFC;

  /* Status */
  --ok:        #16A34A;
  --ok-bg:     #DCFCE7;
  --ok-ink:    #15803D;
  --warn:      #D97706;
  --warn-bg:   #FEF3C7;
  --warn-ink:  #B45309;
  --danger:    #DC2626;
  --danger-bg: #FEE2E2;
  --danger-ink:#B91C1C;
  --info:      #2563EB;
  --info-bg:   #DBEAFE;
  --info-ink:  #1D4ED8;

  /* Radius / shadow */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --pill: 999px;
  --sh-1: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.08);
  --sh-2: 0 4px 12px rgba(16,24,40,.10), 0 2px 4px rgba(16,24,40,.06);
  --sh-3: 0 18px 40px rgba(16,24,40,.18);

  /* Layout */
  --sidebar-w: 248px;
  --topbar-h:  64px;
  --maxw:      1180px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;            /* app shell never scrolls sideways; tables scroll inside .table-wrap */
}
h1,h2,h3,h4,p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--brand-700); text-decoration: none; }
input, select, textarea { font-family: inherit; font-size: 15px; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

/* ---------- Utility ---------- */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny  { font-size: 12px; }
.bold  { font-weight: 600; }
.right { text-align: right; }
.center{ text-align: center; }
.nowrap{ white-space: nowrap; }
.mono  { font-variant-numeric: tabular-nums; }
.flex  { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-4{ gap: 4px; } .gap-6{ gap:6px;} .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.col   { display: flex; flex-direction: column; }
.grow  { flex: 1; }
.wrap  { flex-wrap: wrap; }
.hide  { display: none !important; }
.hide-desktop { display: none; }
@media (max-width: 768px) { .hide-mobile { display: none !important; } .hide-desktop { display: inline-flex; } }
.pos-up   { color: var(--ok); }
.pos-down { color: var(--danger); }

/* ============================================================
   App shell
   ============================================================ */
.app { min-height: 100%; display: flex; }

/* Sidebar (desktop) */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--sidebar-ink);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
}
.sidebar__brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px;
  color: #fff; font-weight: 700; font-size: 17px;
  letter-spacing: .2px;
}
.sidebar__logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, #FBBF24, #F59E0B);
  display: grid; place-items: center; flex: 0 0 auto;
  box-shadow: 0 2px 8px rgba(245,158,11,.4);
}
.sidebar__nav { padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.sidebar__section { color: var(--sidebar-ink-2); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 14px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--sidebar-ink); font-weight: 500; font-size: 14.5px;
  border: 0; background: transparent; width: 100%; text-align: left;
  transition: background .12s ease, color .12s ease;
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; }
.nav-item svg { width: 19px; height: 19px; flex: 0 0 auto; opacity: .92; }
.nav-item .nav-badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700; border-radius: var(--pill);
  min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center;
}
.sidebar__foot { margin-top: auto; padding: 12px; border-top: 1px solid rgba(255,255,255,.08); }

/* Main column */
.main {
  flex: 1; min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 30;
}
.topbar__title { font-size: 18px; font-weight: 700; }
.topbar__sub { color: var(--muted); font-size: 13px; }
.topbar__spacer { flex: 1; }
.topbar__date {
  display: flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 13px; font-weight: 500;
  background: var(--card-2); border: 1px solid var(--line);
  padding: 6px 11px; border-radius: var(--pill);
}
.topbar__date svg { width: 15px; height: 15px; color: var(--muted-2); }
.hamburger { display: none; }

/* User chip */
.userchip { display:flex; align-items:center; gap:9px; padding:5px 6px 5px 5px; border-radius: var(--pill); border:1px solid var(--line); background:#fff; }
.userchip:hover { background: var(--card-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-700); color:#fff; display:grid; place-items:center; font-weight:700; font-size:13px; flex:0 0 auto; }
.avatar.lg { width: 44px; height: 44px; font-size: 16px; }

/* Content area */
.content { padding: 24px; flex: 1; }
.content__inner { max-width: var(--maxw); margin: 0 auto; }
.page-head { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -.2px; }
.page-head p { color: var(--muted); font-size: 14px; margin-top: 2px; }

/* Bottom nav (mobile) */
.bottomnav { display: none; }

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.card__head { padding: 16px 18px; border-bottom: 1px solid var(--line-2); display:flex; align-items:center; justify-content:space-between; gap: 10px; }
.card__head h3 { font-size: 15.5px; font-weight: 700; }
.card__body { padding: 18px; }
.card__body.flush { padding: 0; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Stat / KPI card */
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px; box-shadow: var(--sh-1); display: flex; gap: 14px; align-items: flex-start;
}
.stat__icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 auto; }
.stat__icon svg { width: 22px; height: 22px; }
.stat__icon.teal   { background: var(--brand-tint); color: var(--brand-700); }
.stat__icon.amber  { background: var(--warn-bg); color: var(--warn-ink); }
.stat__icon.red    { background: var(--danger-bg); color: var(--danger-ink); }
.stat__icon.green  { background: var(--ok-bg); color: var(--ok-ink); }
.stat__icon.blue   { background: var(--info-bg); color: var(--info-ink); }
.stat__label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat__value { font-size: 28px; font-weight: 800; line-height: 1.1; margin-top: 2px; letter-spacing: -.5px; }
.stat__sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.stat__foot { margin-top: 12px; }
.delta { font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px;
  padding: 10px 16px; font-size: 14.5px; font-weight: 600;
  background: var(--card-2); color: var(--ink-2);
  transition: background .14s ease, box-shadow .14s ease, border-color .14s, transform .04s;
  white-space: nowrap; line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; }
.btn--primary { background: var(--brand-700); color: #fff; box-shadow: 0 1px 2px rgba(15,118,110,.4); }
.btn--primary:hover { background: var(--brand-800); }
.btn--outline { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn--outline:hover { background: var(--card-2); border-color: var(--muted-2); }
.btn--ghost { background: transparent; color: var(--ink-2); }
.btn--ghost:hover { background: var(--card-2); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: var(--danger-ink); }
.btn--danger-soft { background: var(--danger-bg); color: var(--danger-ink); }
.btn--sm { padding: 7px 11px; font-size: 13px; border-radius: 8px; }
.btn--lg { padding: 14px 20px; font-size: 16px; border-radius: 12px; }
.btn--block { width: 100%; }
.btn--icon { padding: 8px; width: 36px; height: 36px; }

/* ============================================================
   Badges / pills
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: var(--pill);
  background: var(--line-2); color: var(--ink-2); line-height: 1.5;
}
.badge.ok    { background: var(--ok-bg); color: var(--ok-ink); }
.badge.warn  { background: var(--warn-bg); color: var(--warn-ink); }
.badge.danger{ background: var(--danger-bg); color: var(--danger-ink); }
.badge.info  { background: var(--info-bg); color: var(--info-ink); }
.badge.teal  { background: var(--brand-tint); color: var(--brand-800); }
.badge.neutral { background: var(--line-2); color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ============================================================
   Tables
   ============================================================ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 600; padding: 11px 14px; border-bottom: 1px solid var(--line);
  background: var(--card-2); white-space: nowrap; position: sticky; top: 0;
}
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:hover { background: var(--card-2); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .item-cell { display: flex; align-items: center; gap: 11px; }
.thumb { width: 38px; height: 38px; border-radius: 9px; background: var(--brand-tint); color: var(--brand-700); display:grid; place-items:center; flex:0 0 auto; font-size: 18px; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   Forms
   ============================================================ */
.field { margin-bottom: 16px; }
.field > label, .label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.input, .select, .textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); transition: border-color .14s, box-shadow .14s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand-600); box-shadow: 0 0 0 3px rgba(13,148,136,.15);
}
.textarea { resize: vertical; min-height: 78px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 38px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.help { font-size: 12px; color: var(--muted); margin-top: 5px; }
.link-btn { border: 0; background: none; color: var(--brand-700); font-weight: 600; font-size: 12.5px; cursor: pointer; padding: 0; }
.link-btn:hover { color: var(--brand-800); text-decoration: underline; }
.inline-add { display: flex; gap: 8px; margin-top: 8px; }
.inline-add .input { flex: 1; }
.do-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.do-thumb { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 104px; }
.do-thumb img { width: 104px; height: 104px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--card-2); }
.do-thumb:hover img { border-color: var(--brand-600); }
.do-capture { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 16px; border: 1.5px dashed var(--brand-tint-2); border-radius: 12px; background: var(--brand-tint); color: var(--ink); }
.do-capture:hover { border-color: var(--brand-600); background: #ddf0ec; }
.do-capture__ico { font-size: 26px; line-height: 1; }
.do-capture__txt { display: flex; flex-direction: column; gap: 2px; }
.input-error { border-color: var(--danger) !important; }
.field-error { color: var(--danger-ink); font-size: 12px; margin-top: 5px; }

/* Search input */
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted-2); }
.search .input { padding-left: 38px; }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--muted-2); border-radius: var(--pill); transition: .18s; }
.switch .track::before { content:""; position:absolute; height:18px; width:18px; left:3px; top:3px; background:#fff; border-radius:50%; transition:.18s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked + .track { background: var(--brand-600); }
.switch input:checked + .track::before { transform: translateX(18px); }

/* Quantity stepper */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background:#fff; }
.stepper button { width: 38px; height: 40px; border: 0; background: var(--card-2); color: var(--ink-2); font-size: 20px; font-weight: 600; display:grid; place-items:center; }
.stepper button:hover { background: var(--brand-tint); color: var(--brand-800); }
.stepper input { width: 56px; height: 40px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; font-weight: 700; font-size: 16px; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Segmented control */
.segmented { display: inline-flex; background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented button { border: 0; background: transparent; padding: 7px 14px; border-radius: 7px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.segmented button.active { background: #fff; color: var(--brand-800); box-shadow: var(--sh-1); }

/* Progress */
.progress { height: 8px; background: var(--line-2); border-radius: var(--pill); overflow: hidden; }
.progress__bar { height: 100%; background: var(--brand-600); border-radius: var(--pill); transition: width .3s ease; }

/* ============================================================
   Item rows (receive / count / low-stock cards)
   ============================================================ */
.item-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 4px; border-bottom: 1px solid var(--line-2);
}
.item-row:last-child { border-bottom: 0; }
.item-row__main { flex: 1; min-width: 0; }
.item-row__name { font-weight: 600; }
.item-row__meta { font-size: 12.5px; color: var(--muted); }
.row-check { width: 24px; height: 24px; border-radius: 50%; display:grid; place-items:center; background: var(--ok-bg); color: var(--ok); flex:0 0 auto; }
.row-check.off { background: var(--line-2); color: var(--muted-2); }

/* ============================================================
   Toast
   ============================================================ */
.toast-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.toast {
  background: #0F172A; color: #fff; padding: 12px 15px; border-radius: 12px;
  box-shadow: var(--sh-3); display: flex; align-items: flex-start; gap: 10px;
  animation: toast-in .22s ease; font-size: 14px;
}
.toast.ok { background: #0F766E; }
.toast.danger { background: #B91C1C; }
.toast svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ============================================================
   Modal
   ============================================================ */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 80; display: grid; place-items: center; padding: 18px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: var(--r-lg); width: 100%; max-width: 520px;
  box-shadow: var(--sh-3); max-height: 92vh; display: flex; flex-direction: column;
  animation: modal-in .2s ease;
}
@keyframes modal-in { from { transform: translateY(14px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__head { padding: 18px 20px; border-bottom: 1px solid var(--line-2); display:flex; align-items:center; justify-content:space-between; }
.modal__head h3 { font-size: 17px; font-weight: 700; }
.modal__body { padding: 20px; overflow-y: auto; }
.modal__foot { padding: 16px 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 10px; }
.x-btn { border: 0; background: var(--card-2); width: 32px; height: 32px; border-radius: 8px; display:grid; place-items:center; color: var(--muted); }
.x-btn:hover { background: var(--line-2); color: var(--ink); }

/* ============================================================
   Empty / loading states
   ============================================================ */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty svg { width: 44px; height: 44px; color: var(--muted-2); margin-bottom: 12px; }
.empty h3 { font-size: 16px; color: var(--ink-2); margin-bottom: 4px; }
.skeleton { background: linear-gradient(90deg, #eef2f6 25%, #f6f8fa 50%, #eef2f6 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; } }
.spinner { width: 20px; height: 20px; border: 2.5px solid var(--brand-tint-2); border-top-color: var(--brand-700); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-screen { min-height: 60vh; display: grid; place-items: center; }

/* ============================================================
   Bar chart (hand-rolled, no deps)
   ============================================================ */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 8px; }
.bars__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars__bar { width: 70%; max-width: 34px; background: var(--brand-600); border-radius: 6px 6px 0 0; transition: height .4s ease; position: relative; min-height: 3px; }
.bars__bar:hover { background: var(--brand-800); }
.bars__bar .bars__val { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.bars__label { font-size: 11.5px; color: var(--muted); }

/* ============================================================
   Login
   ============================================================ */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth__hero { background: linear-gradient(150deg, var(--brand-900), var(--brand-700) 70%, var(--brand-600)); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth__hero::after { content:""; position:absolute; width: 380px; height: 380px; border-radius: 50%; background: rgba(251,191,36,.18); bottom: -120px; right: -90px; filter: blur(8px); }
.auth__brand { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 700; }
.auth__pitch h2 { font-size: 30px; font-weight: 800; line-height: 1.2; letter-spacing: -.4px; max-width: 420px; }
.auth__pitch p { color: rgba(255,255,255,.82); margin-top: 12px; max-width: 420px; }
.auth__features { display: flex; flex-direction: column; gap: 12px; margin-top: 26px; }
.auth__feature { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.92); font-size: 14.5px; }
.auth__feature svg { width: 18px; height: 18px; color: #FBBF24; }
.auth__form-side { display: grid; place-items: center; padding: 32px; }
.auth__card { width: 100%; max-width: 380px; }
.auth__card h1 { font-size: 23px; font-weight: 800; }
.auth__card > p { color: var(--muted); margin: 6px 0 24px; }
.demo-accounts { margin-top: 20px; border-top: 1px dashed var(--line); padding-top: 16px; }
.demo-accounts h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 10px; }
.demo-acc { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; cursor: pointer; transition: border-color .12s, background .12s; }
.demo-acc:hover { border-color: var(--brand-600); background: var(--brand-tint); }
.demo-acc > div { min-width: 0; }            /* allow text to shrink instead of overflowing */
.demo-acc .tiny { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-acc .role-pill { margin-left: auto; flex: 0 0 auto; }

/* ============================================================
   Misc helpers
   ============================================================ */
.divider { height: 1px; background: var(--line-2); margin: 16px 0; }
.kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; }
.summary-foot { display: flex; gap: 26px; align-items: center; padding: 16px 18px; flex-wrap: wrap; }
.summary-foot .metric { display: flex; flex-direction: column; }
.summary-foot .metric .n { font-size: 20px; font-weight: 800; }
.summary-foot .metric .l { font-size: 12px; color: var(--muted); }

.list-reset { list-style: none; padding: 0; margin: 0; }
.shortage-row { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.shortage-row:last-child { border-bottom: 0; }

/* ============================================================
   Responsive — tablet & mobile (staff-first)
   ============================================================ */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --topbar-h: 58px; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform .22s ease; width: 270px;
    box-shadow: var(--sh-3);
  }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open::after { content:""; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 35; }
  .main { margin-left: 0; padding-bottom: 70px; }
  .hamburger { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); }
  .topbar { padding: 0 14px; }
  .topbar__date { display: none; }
  .content { padding: 16px; }
  .page-head h1 { font-size: 21px; }

  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }

  /* Bottom tab bar */
  .bottomnav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: 62px;
    background: #fff; border-top: 1px solid var(--line); z-index: 45;
    padding: 6px 4px env(safe-area-inset-bottom);
  }
  .bottomnav button {
    flex: 1; border: 0; background: transparent; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 600;
  }
  .bottomnav button svg { width: 22px; height: 22px; }
  .bottomnav button.active { color: var(--brand-700); }

  /* Auth becomes single column */
  .auth { grid-template-columns: 1fr; }
  .auth__hero { display: none; }

  /* Stat cards a touch tighter */
  .stat__value { font-size: 24px; }

  /* Responsive tables → stacked cards */
  .tbl.responsive thead { display: none; }
  .tbl.responsive, .tbl.responsive tbody, .tbl.responsive tr, .tbl.responsive td { display: block; width: 100%; }
  .tbl.responsive tr { border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 12px; padding: 6px 4px; background:#fff; }
  .tbl.responsive td { border: 0; display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; text-align: right; }
  .tbl.responsive td::before { content: attr(data-label); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; text-align: left; }
  .tbl.responsive td.item-cell-td { justify-content: flex-start; }
  .tbl.responsive td.item-cell-td::before { display: none; }
}

/* On-screen numeric keypad (closing count, mobile) */
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button { padding: 16px; font-size: 20px; font-weight: 700; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
.keypad button:active { background: var(--brand-tint); }
.keypad button.action { background: var(--card-2); }

/* ============================================================
   Branch switcher + status banner (multi-tenant)
   ============================================================ */
.topbar__titles { min-width: 0; }
.branch-switch { position: relative; }
.branch-btn { display: flex; align-items: center; gap: 6px; background: var(--card-2); border: 1px solid var(--line); border-radius: var(--pill); padding: 6px 12px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); max-width: 210px; }
.branch-btn:hover:not([disabled]) { border-color: var(--brand-600); }
.branch-btn[disabled] { opacity: .85; cursor: default; }
.branch-btn .branch-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.branch-btn svg { width: 15px; height: 15px; color: var(--muted); }
.branch-menu { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-2); padding: 6px; min-width: 210px; z-index: 50; }
.branch-menu button { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; border: 0; background: transparent; padding: 9px 11px; border-radius: 8px; font-size: 14px; color: var(--ink); text-align: left; font-weight: 500; }
.branch-menu button:hover { background: var(--card-2); }
.branch-menu button.active { color: var(--brand-800); font-weight: 700; }
.branch-menu button svg { width: 16px; height: 16px; color: var(--brand-700); }

.banner { display: flex; align-items: center; gap: 10px; justify-content: center; padding: 9px 16px; font-size: 13.5px; font-weight: 500; flex-wrap: wrap; }
.banner.trial { background: var(--warn-bg); color: var(--warn-ink); border-bottom: 1px solid #f3e2b3; }
.banner.locked { background: var(--danger-bg); color: var(--danger-ink); border-bottom: 1px solid #f3c0c0; }
.banner__cta { border: 0; background: rgba(0,0,0,.08); color: inherit; font-weight: 700; padding: 4px 12px; border-radius: var(--pill); font-size: 12.5px; }
.banner__cta:hover { background: rgba(0,0,0,.14); }
@media (max-width: 768px) {
  .branch-btn { max-width: 130px; padding: 6px 10px; }
  .topbar__sub { display: none; }
}

/* ============================================================
   Print (PDF export via browser "Save as PDF")
   ============================================================ */
@media print {
  .sidebar, .topbar, .bottomnav, .toast-wrap, .btn, .no-print, .page-head .btn { display: none !important; }
  .main { margin-left: 0; }
  body { background: #fff; font-size: 12px; }
  .content { padding: 0; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .print-only { display: block !important; }
  @page { margin: 16mm; }
}
.print-only { display: none; }
