/* SKMRT StockPilot — glass, pill and pastel design system */
:root {
  --page: #efeff2;
  --frame: #dcdce1;
  --panel: rgba(255, 255, 255, .55);
  --panel-strong: rgba(255, 255, 255, .86);
  --pill: rgba(255, 255, 255, .5);
  --pill-hover: rgba(255, 255, 255, .8);
  --ink: #1d1d21;
  --ink-2: #3c3c43;
  --muted: #74747c;
  --line: rgba(20, 20, 30, .08);
  --line-strong: rgba(20, 20, 30, .14);
  --thead: rgba(215, 215, 222, .75);
  --lime: #e6f76b;
  --lime-deep: #cfe23f;
  --lime-ink: #1d1d21;
  --purple: #9a6bff;
  --purple-deep: #7d4bf2;
  --cyan: #19b8cc;
  --yellow: #e6a700;
  --green: #16a34a;
  --red: #e5484d;
  --soft-yellow: #fdf6dc;
  --soft-purple: #f1e8fd;
  --soft-cyan: #e0f8fb;
  --soft-green: #e6f7e9;
  --soft-pink: #fde8ef;
  --soft-white: #ffffff;
  --blob-1: rgba(178, 150, 245, .55);
  --blob-2: rgba(140, 214, 226, .55);
  --blob-3: rgba(222, 232, 160, .6);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(30, 30, 60, .06);
  --radius: 22px;
  --radius-sm: 14px;
  --scroll-thumb: rgba(20, 20, 30, .16);
  --scroll-thumb-active: rgba(20, 20, 30, .32);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --page: #0e0e11;
  --frame: #17171b;
  --panel: rgba(38, 38, 46, .6);
  --panel-strong: rgba(42, 42, 50, .92);
  --pill: rgba(255, 255, 255, .05);
  --pill-hover: rgba(255, 255, 255, .1);
  --ink: #f2f2f5;
  --ink-2: #d4d4da;
  --muted: #9a9aa4;
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .14);
  --thead: rgba(255, 255, 255, .07);
  --soft-yellow: rgba(230, 167, 0, .14);
  --soft-purple: rgba(154, 107, 255, .16);
  --soft-cyan: rgba(25, 184, 204, .14);
  --soft-green: rgba(22, 163, 74, .15);
  --soft-pink: rgba(229, 72, 77, .14);
  --soft-white: rgba(255, 255, 255, .07);
  --blob-1: rgba(120, 80, 220, .28);
  --blob-2: rgba(25, 150, 170, .22);
  --blob-3: rgba(170, 190, 60, .16);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
  --scroll-thumb: rgba(255, 255, 255, .16);
  --scroll-thumb-active: rgba(255, 255, 255, .32);
  color-scheme: dark;
}

* { box-sizing: border-box; }

/* Scrollbars: thin and invisible until you point at the area that scrolls, then a faint pill.
   scrollbar-color covers Firefox and current Chrome/Edge; the ::-webkit rules cover Safari and older Chromium. */
* { scrollbar-width: thin; scrollbar-color: transparent transparent; }
*:hover { scrollbar-color: var(--scroll-thumb) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: transparent; border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
:hover::-webkit-scrollbar-thumb { background-color: var(--scroll-thumb); }
::-webkit-scrollbar-thumb:hover, ::-webkit-scrollbar-thumb:active { background-color: var(--scroll-thumb-active); }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }  /* the hidden attribute wins over display rules like the one above */
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.mt { margin-top: 16px; }
.mt-lg { margin-top: 28px; }
[data-lucide], .lucide { width: 18px; height: 18px; stroke-width: 1.7; flex-shrink: 0; }

/* ---------------------------------------------------------------- app frame */
.app {
  position: relative;
  max-width: 1480px;
  min-height: calc(100vh - 40px);
  margin: 20px auto;
  padding: 22px 24px 28px;
  border-radius: 30px;
  background: var(--frame);
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: 18px 26px;
  overflow: hidden;
  isolation: isolate;
}
.app::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(38% 30% at 45% 100%, var(--blob-1), transparent 70%),
    radial-gradient(30% 28% at 78% 96%, var(--blob-2), transparent 70%),
    radial-gradient(26% 24% at 98% 62%, var(--blob-3), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px; font-weight: 500; }
.brand svg { width: 42px; height: 42px; color: var(--ink); }
.brand b { display: block; font-size: 15px; line-height: 1.1; }
.brand small { color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: .02em; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0;
  position: relative; z-index: 60; /* keep its dropdowns above glass bars (backdrop-filter makes new layers) */ }
.greeting h1 { font-size: 20px; font-weight: 600; }
.greeting p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.top-actions {
  display: flex; align-items: center; gap: 4px; padding: 6px 8px 6px 12px;
  background: var(--pill); border-radius: 999px; backdrop-filter: blur(12px);
}
.icon-btn {
  position: relative; width: 36px; height: 36px; display: inline-grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--pill-hover); }
.icon-btn .dot {
  position: absolute; top: 5px; right: 5px; min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 999px; background: var(--red); color: #fff; font-size: 9.5px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--frame);
}
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #ffd24a, #f59e0b); color: #3b2500; font-weight: 700; font-size: 13px;
  position: relative; border: 0; cursor: pointer;
}
.avatar::after {
  content: ""; position: absolute; right: 0; top: 1px; width: 9px; height: 9px; border-radius: 50%;
  background: #22c55e; border: 2px solid var(--frame);
}
.avatar { padding: 0; }  /* buttons get default padding, which squeezed photos into ovals */
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar:has(img) { background: var(--panel-strong); }
.avatar img.is-logo { object-fit: contain; padding: 16%; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.avatar.xl { width: 68px; height: 68px; font-size: 22px; }
.avatar-pick { position: relative; display: inline-block; cursor: pointer; border-radius: 50%; }
.avatar-pick .avatar { cursor: pointer; }
.avatar-pick .avatar::after { display: none; }
.avatar-pick:hover .avatar { filter: brightness(.94); }
.avatar-cam { position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--page); border: 2px solid var(--panel-strong); }
.avatar-cam svg, .avatar-cam [data-lucide] { width: 13px; height: 13px; }
.menu-toggle { display: none; }

/* ---------------------------------------------------------------- sidebar */
.sidebar { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 14px;
  border-radius: var(--radius-sm); background: var(--pill); color: var(--ink-2);
  font-weight: 500; transition: background .15s, transform .15s;
}
.nav-item:hover { background: var(--pill-hover); }
.nav-item.active { background: var(--lime); color: var(--lime-ink); font-weight: 600; }
.nav-sep { height: 6px; }
.biz-card {
  margin-top: auto; padding: 14px; border-radius: var(--radius-sm); background: var(--pill);
  font-size: 12px; color: var(--muted);
}
.biz-card b { color: var(--ink); display: block; font-size: 13px; }
.biz-me { display: flex; align-items: center; gap: 10px; min-width: 0; }
.biz-me .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.biz-me .avatar { width: 38px; height: 38px; flex-shrink: 0; font-size: 12.5px; cursor: pointer; }
.biz-me .avatar::after { display: none; }
.biz-me:hover .avatar { filter: brightness(.95); }
.biz-card:has(.biz-me.active) { background: var(--lime); color: var(--lime-ink); }  /* you're on My profile */
.biz-card:has(.biz-me.active) b { color: var(--lime-ink); }
.biz-card code { background: var(--panel-strong); padding: 1px 6px; border-radius: 6px; color: var(--ink); }

/* ---------------------------------------------------------------- main */
.main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; border-radius: 999px; background: var(--pill); backdrop-filter: blur(12px);
}
.bar.square { border-radius: var(--radius); }
.bar h2 { font-size: 16px; padding-left: 8px; }
/* section tabs: a compact segmented control that only takes the room it needs */
.bar.tabs-bar { background: none; backdrop-filter: none; padding: 0; border-radius: 0; flex-wrap: nowrap; min-width: 0; }
.tabs { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--pill); backdrop-filter: blur(12px);
  max-width: 100%; overflow-x: auto; scrollbar-width: none; flex-shrink: 1; min-width: 0; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 6px 14px; border-radius: 999px; color: var(--muted); font-weight: 500; font-size: 13px; white-space: nowrap;
  transition: background .15s, color .15s; }
.tabs a:hover { color: var(--ink); background: var(--pill-hover); }
.tabs a.active { background: var(--panel-strong); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(20, 20, 30, .1); }

.card {
  background: var(--panel-strong); border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow); min-width: 0;
}
.card.glass { background: var(--panel); backdrop-filter: blur(16px); box-shadow: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h3 { font-size: 16px; }
.card.flush { padding: 8px; }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.grid.split { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }

/* pastel tiles (KPIs) */
.tile { border-radius: var(--radius); padding: 18px 20px; position: relative; box-shadow: var(--shadow); }
.tile.yellow { background: var(--soft-yellow); }
.tile.purple { background: var(--soft-purple); }
.tile.cyan { background: var(--soft-cyan); }
.tile.green { background: var(--soft-green); }
.tile.pink { background: var(--soft-pink); }
.tile.white { background: var(--soft-white); }
.tile-icon {
  display: grid; place-items: center; flex-shrink: 0; line-height: 0;
  background: none; color: var(--ink-2);
}
.tile.yellow .tile-icon { color: var(--yellow); }
.tile.purple .tile-icon { color: var(--purple-deep); }
.tile.cyan .tile-icon { color: var(--cyan); }
.tile.green .tile-icon { color: var(--green); }
.tile.pink .tile-icon { color: var(--red); }
.tile.white .tile-icon { color: var(--muted); }
.tile-icon [data-lucide], .tile-icon svg { width: 20px; height: 20px; }

.kpi { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.kpi .tile-icon { margin-top: 3px; }
.kpi > div { min-width: 0; }
.kpi .value { font-size: 22px; font-weight: 600; letter-spacing: -.03em; line-height: 1.15; white-space: nowrap; }
.kpi .label { color: var(--muted); font-size: 12.5px; }
.trend { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; margin-top: 10px; }
.trend.up { color: var(--green); }
.trend.down { color: var(--red); }
.trend span { color: var(--muted); font-weight: 400; }
.trend [data-lucide] { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table thead th {
  text-align: left; font-weight: 500; color: var(--ink-2); padding: 11px 14px; background: var(--thead); white-space: nowrap;
}
.table thead th.right { text-align: right; }
.table thead th:first-child { border-radius: 999px 0 0 999px; padding-left: 20px; }
.table thead th:last-child { border-radius: 0 999px 999px 0; padding-right: 20px; }
.table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: middle; }
.table tbody td:first-child { padding-left: 20px; }
.table tbody td:last-child { padding-right: 20px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: rgba(127, 127, 140, .06); }
.table tbody tr.flash { animation: rowflash 1.8s ease-out; }
@keyframes rowflash { from { background: var(--lime); } to { background: transparent; } }
.table td.actions { text-align: right; white-space: nowrap; }  /* a flex <td> stops being a table cell and its row line drifts */
.table td.actions > * { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; margin-left: 2px; }
.table .actions .icon-btn { width: 30px; height: 30px; }
.table .actions [data-lucide] { width: 16px; height: 16px; }
.table td.strong, .table .strong { color: var(--ink); font-weight: 500; }
.cell-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cell-main.end { align-items: flex-end; }
.cell-main .sub { color: var(--muted); font-size: 12px; font-weight: 400; }
.table tfoot td { padding: 12px 14px; font-weight: 600; }

.thumb {
  width: 38px; height: 38px; border-radius: 10px; object-fit: cover; background: var(--thead);
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); flex-shrink: 0;
}

.status { font-size: 12px; font-weight: 600; text-transform: capitalize; }
.status.pending, .status.late { color: var(--yellow); }
.status.delivered, .status.completed, .status.present, .status.paid { color: var(--cyan); }
.status.cancelled, .status.refunded, .status.absent { color: var(--red); }
.status.draft, .status.leave { color: var(--muted); }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; background: var(--thead); color: var(--ink-2); white-space: nowrap;
}
.badge.lime { background: var(--lime); color: var(--lime-ink); }
.badge.green { background: var(--soft-green); color: var(--green); }
.badge.red { background: var(--soft-pink); color: var(--red); }
.badge.yellow { background: var(--soft-yellow); color: var(--yellow); }
.badge.purple { background: var(--soft-purple); color: var(--purple-deep); }
.badge.cyan { background: var(--soft-cyan); color: var(--cyan); }
.badge .pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.tier-Bronze { color: #b7791f; } .tier-Silver { color: #7c8594; } .tier-Gold { color: #d4a106; } .tier-Platinum { color: var(--purple-deep); }

/* pagination */
.pager { display: inline-flex; gap: 6px; padding: 6px; border-radius: 999px; background: var(--pill); align-items: center; }
.pager a, .pager span {
  min-width: 40px; height: 28px; padding: 0 12px; border-radius: 999px; display: grid; place-items: center;
  font-size: 12.5px; color: var(--ink-2); border: 1px solid var(--line-strong);
}
.pager a:hover { background: var(--pill-hover); }
.pager .current { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); font-weight: 600; }
.pager .disabled { opacity: .4; }
.pager .next { background: var(--panel-strong); border: 0; min-width: 28px; padding: 0; box-shadow: var(--shadow); }

/* ---------------------------------------------------------------- forms & buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--panel-strong); color: var(--ink);
  font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; transition: transform .1s, background .15s;
}
.btn:hover { background: var(--pill-hover); }
.btn:active { transform: scale(.98); }
.btn svg, .btn [data-lucide] { width: 16px; height: 16px; stroke-width: 2; flex-shrink: 0; }
.btn.sm svg, .btn.sm [data-lucide] { width: 14px; height: 14px; }
.btn.lg svg, .btn.lg [data-lucide] { width: 18px; height: 18px; }
.btn.primary { background: var(--ink); color: var(--page); border-color: var(--ink); }
.btn.primary:hover { opacity: .9; }
.btn.lime { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); font-weight: 600; }
.btn.lime:hover { background: var(--lime-deep); }
.btn.purple { background: var(--purple); border-color: var(--purple); color: #fff; }
.btn.purple:hover { background: var(--purple-deep); }
.btn.danger { color: var(--red); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { height: 28px; padding: 0 11px; font-size: 12.5px; }
.btn.lg { height: 40px; padding: 0 18px; font-size: 14px; }
.btn.block { width: 100%; }
.btn.round { width: 34px; padding: 0; }
.btn[disabled] { opacity: .5; pointer-events: none; }
/* a moving yellow → red → blue ring (conic gradient masked down to the border) */
@property --glow-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.btn-glow { position: relative; isolation: isolate; border-color: transparent; }
.btn-glow::before { content: ""; position: absolute; inset: -1px; z-index: -1; padding: 1.5px; border-radius: inherit; pointer-events: none;
  background: conic-gradient(from var(--glow-angle), #f5c400, #e5484d, #2f7bf5, #f5c400);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: glow-spin 3.2s linear infinite; }
.btn-glow:hover::before { animation-duration: 1.6s; }
@keyframes glow-spin { to { --glow-angle: 360deg; } }
@media (prefers-reduced-motion: reduce) { .btn-glow::before { animation: none; } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.field .hint { font-size: 11.5px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; height: 38px; padding: 0 13px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--panel-strong); color: var(--ink); font: inherit; outline: none; transition: border .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 90px; padding: 10px 14px; resize: vertical; }
.input:focus { border-color: var(--ink-2); box-shadow: 0 0 0 3px rgba(154, 107, 255, .15); }
.input.pill { border-radius: 999px; height: 36px; }
select.input { appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2374747c' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.check input { width: 16px; height: 16px; accent-color: var(--ink); }
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap .input { padding-right: 44px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 10px;
  background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.pw-eye:hover { color: var(--ink); background: var(--pill-hover); }
.pw-eye svg, .pw-eye [data-lucide] { width: 18px; height: 18px; }
.search-pill { position: relative; display: flex; align-items: center; }
.search-pill [data-lucide] { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--muted); }
.search-pill .input { padding-left: 36px; }

/* flash toasts */
/* toasts drop in at the top; a small coloured dot says what kind they are */
.toasts { position: fixed; top: 16px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px;
  width: min(380px, calc(100vw - 24px)); pointer-events: none; }
.toast {
  display: flex; gap: 10px; align-items: center; padding: 11px 12px 11px 14px; border-radius: 14px; pointer-events: auto;
  background: var(--panel-strong); box-shadow: 0 10px 30px rgba(0, 0, 0, .15); backdrop-filter: blur(16px);
  animation: slidein .25s ease-out;
}
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--ink); }
.toast.success::before { background: var(--green); }
.toast.error::before { background: var(--red); }
.toast.info::before { background: var(--cyan); }
.toast.sale::before { background: var(--lime-deep); }
.toast button { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 2px; }
@keyframes slidein { from { transform: translateY(-10px); opacity: 0; } }

/* modal */
dialog.modal {
  border: 0; padding: 0; border-radius: var(--radius); background: var(--panel-strong); color: var(--ink);
  width: min(var(--modal-w, 520px), calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0, 0, 0, .25);
  /* a dialog that wants to be wider on desktop sets --modal-w; phones always get the full-width sheet below */
  -webkit-backdrop-filter: blur(28px) saturate(1.3); backdrop-filter: blur(28px) saturate(1.3);
}
dialog.modal::backdrop { background: rgba(20, 20, 30, .35); backdrop-filter: blur(3px); }
.modal-body { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { font-size: 17px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
/* every button in a modal's footer is the same size, whatever its colour */
.modal-foot .btn { height: 38px; padding: 0 18px; font-size: 14px; }

/* dropdown */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; z-index: 50; padding: 8px;
  background: var(--panel-strong); border-radius: 16px; box-shadow: 0 20px 50px rgba(0, 0, 0, .18);
  display: none; backdrop-filter: blur(16px);
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button {
  display: flex; gap: 10px; align-items: center; width: 100%; padding: 9px 10px; border-radius: 10px;
  border: 0; background: none; font: inherit; color: var(--ink-2); cursor: pointer; text-align: left;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--pill-hover); }
.notif-list { max-height: 340px; overflow: auto; }
.notif { padding: 9px 10px; border-radius: 10px; font-size: 12.5px; }
.notif b { display: block; font-size: 13px; color: var(--ink); }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty > [data-lucide], .empty > svg { width: 38px; height: 38px; margin: 0 auto 10px; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; font-size: 16px; }

.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }

/* ---------------------------------------------------------------- POS register
   Desktop/tablet: products on the left, the order panel sticky on the right.
   Phones: products fill the screen; a cart bar opens the order as a bottom sheet. */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.pos-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pos-tools .search-pill { flex: 1 1 220px; }
.pos-tools .input.pill { height: 36px; }
.pos-tools select.input.pill { width: auto; max-width: 200px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 6px; border-radius: 18px; background: var(--pill); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 8px 14px; border-radius: 12px; background: var(--panel-strong);
  border: 0; cursor: pointer; font: inherit; font-size: 13px; color: var(--ink-2); white-space: nowrap;
}
.chip b { font-weight: 600; margin-left: 4px; color: var(--muted); font-size: 12px; }
.chip.active { background: var(--ink); color: var(--page); }
.chip.active b { color: inherit; opacity: .7; }
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.product-card {
  background: var(--panel-strong); border-radius: 16px; padding: 8px; cursor: pointer; border: 2px solid transparent;
  display: flex; flex-direction: column; gap: 5px; text-align: left; font: inherit; color: inherit;
  transition: transform .1s, border .1s; position: relative; -webkit-tap-highlight-color: transparent;
}
.product-card:active { transform: scale(.97); }
.product-card.in-cart { border-color: var(--lime-deep); }
.product-card.out { opacity: .45; }
.product-card .ph {
  aspect-ratio: 4/3; border-radius: 11px; display: grid; place-items: center; font-size: 24px; font-weight: 700;
  color: rgba(0, 0, 0, .35); overflow: hidden;
}
.product-card .ph img { width: 100%; height: 100%; object-fit: cover; }
.product-card .nm { font-size: 13px; color: var(--ink); line-height: 1.3; min-height: 34px; font-weight: 500;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card .sub { font-size: 11.5px; color: var(--muted); }
.product-card .price { font-weight: 600; font-size: 14px; }
.product-card .qty-pill { position: absolute; top: 12px; right: 12px; min-width: 26px; height: 26px; padding: 0 7px;
  border-radius: 999px; background: var(--ink); color: var(--page); font-size: 12.5px; font-weight: 700; display: grid; place-items: center; }

.order-panel { position: sticky; top: 0; background: var(--panel); backdrop-filter: blur(18px); border-radius: var(--radius);
  padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.order-panel > * { flex-shrink: 0; }  /* buttons and totals keep their size; only the cart list scrolls */
.order-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px; }
.order-head h3 { font-size: 16px; }
.cart { background: var(--panel-strong); border-radius: 16px; max-height: 42vh; min-height: 110px; overflow-y: auto; padding: 2px 12px; }
.cart-line { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-line:last-child { border-bottom: 0; }
.cart-line .thumb { width: 40px; height: 40px; }
.cart-line .nm { font-size: 13px; color: var(--ink); font-weight: 500; line-height: 1.25; }
.cart-line .sub { font-size: 11.5px; color: var(--muted); }
.cart-line .amt { font-weight: 600; font-size: 13.5px; text-align: right; }
.stepper { display: inline-flex; align-items: center; gap: 2px; margin-top: 5px; background: var(--thead); border-radius: 999px; padding: 2px; }
.stepper button { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--panel-strong); color: var(--ink); cursor: pointer; font-size: 16px; line-height: 1; display: grid; place-items: center; }
.stepper input { width: 42px; border: 0; background: none; text-align: center; font: inherit; font-weight: 600; color: var(--ink); -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.totals { background: var(--soft-purple); border-radius: 14px; padding: 12px 14px; font-size: 13px; }
.totals .line { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; color: var(--ink-2); }
.totals .grand { border-top: 1px solid var(--line-strong); margin-top: 6px; padding-top: 9px; font-weight: 700; color: var(--ink); font-size: 15px; }
.adjust-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.adjust-row .input { height: 38px; }
.pay-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; }
.pay-methods label { border: 1.5px solid var(--line-strong); border-radius: 14px; padding: 9px 6px; text-align: center; cursor: pointer; font-weight: 500; text-transform: capitalize; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pay-methods input { display: none; }
.pay-methods input:checked + label, .pay-methods label.checked { border-color: var(--ink); background: var(--lime); color: var(--lime-ink); }
.quick-cash { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 6px; }
.quick-cash .btn { width: 100%; padding: 0 6px; }  /* the shortcuts span the whole cash field */
.big-total { font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.customer-pick { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--panel-strong); border-radius: 12px; font-size: 13px; }
.customer-pick input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: inherit; color: var(--ink); }
.suggest { position: absolute; left: 0; right: 0; top: 100%; background: var(--panel-strong); border-radius: 12px; box-shadow: var(--shadow); z-index: 20; overflow: hidden; }
.suggest button { display: block; width: 100%; text-align: left; padding: 11px 12px; border: 0; background: none; font: inherit; cursor: pointer; color: var(--ink); }
.suggest button:hover { background: var(--pill-hover); }
.cart-bar { display: none; }
/* wide screens: the POS fills the window; products and the order scroll separately, so Charge is always in reach */
@media (min-width: 1101px) {
  .pos-page .main { overflow: hidden; padding-bottom: 20px; }
  .pos-page .pos { flex: 1; min-height: 0; align-items: stretch; }
  .pos > section { min-height: 0; }
  .pos .products-grid { flex: 1; min-height: 0; overflow-y: auto; align-content: start; padding: 2px 6px 16px 2px;
    overscroll-behavior: contain; }
  .pos .order-panel { position: static; min-height: 0; max-height: 100%; overflow-y: auto; overscroll-behavior: contain;
    }
  .pos .order-panel .cart { flex: 1 1 auto; max-height: none; min-height: 110px; }
  .pos .order-panel > * { flex-shrink: 0; }
  .pos .order-panel > .cart { flex-shrink: 1; }
}
.loc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.loc-card { min-height: 170px; display: flex; flex-direction: column; gap: 10px; }
.loc-card > .row { align-items: flex-start; }
.loc-card > .row .tile-icon { margin-top: 3px; }
.loc-card h3 { color: var(--ink-2); }
.loc-card .meta { margin-top: auto; color: var(--muted); font-size: 13px; line-height: 1.7; padding-right: 90px; }
.loc-card .meta b { color: var(--ink-2); font-weight: 500; }
.loc-card .corner { position: absolute; right: 10px; bottom: 22px; display: flex; gap: 2px; }
.loc-card .corner form { display: inline-flex; }
.loc-card .top-right { position: absolute; top: 14px; right: 14px; }
.queue { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.close-sheet { display: none; }
.done-icon { color: var(--green); display: grid; place-items: center; }
.done-icon svg, .done-icon [data-lucide] { width: 52px; height: 52px; }

/* ---------------------------------------------------------------- onboarding / auth */
/* full-page pixel-grid backdrop with the app's pastel blobs washed over it */
.auth-page {
  --auth-bg: url("../img/auth/auth-bg.png");
  --auth-veil: rgba(239, 239, 242, .8);
  position: relative; min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: linear-gradient(var(--auth-veil), var(--auth-veil)), var(--auth-bg) center / cover no-repeat fixed, var(--page);
  isolation: isolate;
}
:root[data-theme="dark"] .auth-page { --auth-bg: url("../img/auth/auth-bg-dark.png"); --auth-veil: rgba(14, 14, 17, .84); }
.auth-page::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; filter: blur(10px); background:
  radial-gradient(40% 35% at 15% 95%, var(--blob-1), transparent 70%),
  radial-gradient(35% 35% at 90% 85%, var(--blob-2), transparent 70%),
  radial-gradient(35% 30% at 85% 10%, var(--blob-3), transparent 70%); }

/* the card: a glass frame holding an image column and the form panel */
.auth-card {
  width: min(960px, 100%); display: flex; gap: 8px; padding: 8px; border-radius: 30px;
  background: var(--panel); backdrop-filter: blur(18px); border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 30px 70px -20px rgba(30, 30, 60, .22);
}
.auth-media { width: 44%; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; min-height: 560px; }
.auth-media > div { position: relative; border-radius: var(--radius); overflow: hidden; }
.auth-media img { width: 100%; height: 100%; object-fit: cover; }
.auth-media__top { flex: 1; min-height: 200px; }
.auth-media__bottom { height: 230px; flex-shrink: 0; }
.auth-media__bottom::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(14, 14, 17, .35) 0%, rgba(14, 14, 17, .82) 100%); }
.auth-media__copy { position: absolute; inset: auto 0 0 0; z-index: 1; padding: 20px 22px; color: #fff; }
.auth-media__copy h2 { font-size: 22px; line-height: 1.15; letter-spacing: -.02em; }
.auth-media__copy p { margin-top: 8px; font-size: 12.5px; color: rgba(255, 255, 255, .75); }
.auth-media__chip {
  position: absolute; left: 14px; top: 14px; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--lime); color: var(--lime-ink); box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
}
.auth-media__chip [data-lucide] { width: 14px; height: 14px; }

.auth-panel {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 28px; padding: 28px 36px 32px;
  border-radius: var(--radius); background: var(--panel-strong);
}
.auth-panel > .brand { align-self: flex-start; padding: 0; }
.auth-box { width: min(400px, 100%); margin: auto; display: flex; flex-direction: column; gap: 16px; }
.auth-box h1 { font-size: 26px; letter-spacing: -.02em; }
.auth-box .input { height: 44px; }
.auth-box .input:focus { border-color: var(--purple); }

.steps { display: flex; gap: 8px; align-items: center; }
.steps .s { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--pill); color: var(--muted); font-weight: 500; font-size: 13px; }
.steps .s i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; background: var(--panel-strong); font-size: 12px; }
.steps .s.on { color: var(--ink); }
.steps .s.on i { background: var(--lime); }
.steps .s.done i { background: var(--ink); color: var(--page); }
.onb { max-width: 1100px; margin: 0 auto; padding: 28px 20px 60px; display: flex; flex-direction: column; gap: 22px; }
.onb-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; }
/* single-form steps: heading and card share one centered column */
.onb-narrow { width: min(760px, 100%); margin: 12px auto 0; display: flex; flex-direction: column; gap: 22px; }
.onb-intro { text-align: center; }
.onb-intro p { margin-top: 6px; }

.feature-group h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.feature {
  position: relative; background: var(--panel-strong); border-radius: 18px; padding: 16px; border: 2px solid transparent;
  cursor: pointer; display: flex; flex-direction: column; gap: 8px; transition: border .15s, transform .15s;
}
.feature:hover { transform: translateY(-2px); }
.feature input { position: absolute; opacity: 0; pointer-events: none; }
.feature.selected, .feature:has(input:checked) { border-color: var(--ink); }
.feature.locked { cursor: default; background: var(--pill); }
.feature.highlight { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(154, 107, 255, .2); }
.feature .f-head { display: flex; gap: 12px; align-items: center; }
.feature .f-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--soft-purple); color: var(--purple-deep); }
.feature.core .f-icon { background: var(--lime); color: var(--lime-ink); }
.feature h4 { font-size: 15px; }
.feature p { font-size: 12.5px; color: var(--muted); }
.feature ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 5px; }
.feature li { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--thead); color: var(--ink-2); }
.feature .tick {
  position: absolute; top: 14px; right: 14px; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--line-strong); display: grid; place-items: center; color: transparent;
}
.feature:has(input:checked) .tick, .feature.locked .tick { background: var(--ink); border-color: var(--ink); color: var(--page); }
.feature .tick [data-lucide] { width: 14px; height: 14px; }

/* feature store cards */
.fcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.fcard { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 20px; background: var(--panel-strong);
  border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s; min-width: 0; }
.fcard:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(0, 0, 0, .04), 0 14px 34px rgba(30, 30, 60, .1); }
.fcard.highlight { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(154, 107, 255, .18); }
.fcard-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fcard-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--thead); color: var(--muted); }
.fcard-icon svg, .fcard-icon [data-lucide] { width: 21px; height: 21px; }
.fcard.is-on .fcard-icon { background: var(--soft-purple); color: var(--purple-deep); }
.fcard.is-core .fcard-icon { background: var(--lime); color: var(--lime-ink); }
.fcard-status { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 4px 10px;
  border-radius: 999px; background: var(--thead); color: var(--muted); white-space: nowrap; }
.fcard-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.fcard.is-on .fcard-status { background: var(--soft-green); color: var(--green); }
.fcard.is-core .fcard-status { background: var(--soft-yellow); color: var(--yellow); }
.fcard h4 { font-size: 15.5px; letter-spacing: -.01em; }
.fcard-needs { display: inline-block; margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.fcard p { font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.fcard ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 5px; }
.fcard li { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; background: var(--pill); border: 1px solid var(--line); color: var(--ink-2); }
.fcard-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fcard-foot .btn.block { width: 100%; }
@media (max-width: 640px) { .fcards { grid-template-columns: minmax(0, 1fr); } }

.launch { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.launch a { display: flex; flex-direction: column; gap: 10px; min-height: 160px; }
.launch a h3 { margin-top: auto; font-size: 17px; }

/* drop zone */
.dropzone {
  border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 36px 20px; text-align: center;
  background: var(--panel); cursor: pointer; transition: border .15s, background .15s;
}
.dropzone.drag { border-color: var(--purple); background: var(--soft-purple); }
.dropzone > [data-lucide], .dropzone > svg { width: 40px; height: 40px; margin: 0 auto 10px; color: var(--purple-deep); }
.dropzone input { display: none; }
.row-error td { background: rgba(229, 72, 77, .06); }

/* ---------------------------------------------------------------- branding & receipts */
.brand-page { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.brand-main, .brand-side { min-width: 0; }
.brand-page h3 { font-size: 16px; margin-bottom: 2px; }
.brand-side { position: sticky; top: 0; }
.logo-field { display: flex; align-items: center; gap: 16px; }
.logo-drop { width: 88px; height: 88px; flex-shrink: 0; border-radius: 20px; border: 2px dashed var(--line-strong); display: grid; place-items: center;
  background: var(--panel); cursor: pointer; overflow: hidden; transition: border-color .15s; }
.logo-drop:hover { border-color: var(--purple); }
.logo-drop.has-logo { border-style: solid; border-color: var(--line); background: #fff; }
.logo-drop img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.logo-empty { color: var(--muted); display: grid; place-items: center; }
.logo-empty svg, .logo-empty [data-lucide] { width: 26px; height: 26px; }
.color-field { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.color-swatch { width: 40px; height: 40px; border-radius: 12px; background: var(--c); cursor: pointer; flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); position: relative; overflow: hidden; }
.color-swatch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; border: 0; padding: 0; }
.color-field .input.mono { width: 110px; text-transform: uppercase; }
.color-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.color-presets button { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--panel-strong); background: var(--c); cursor: pointer;
  box-shadow: 0 0 0 1px var(--line-strong); transition: transform .12s; }
.color-presets button:hover { transform: scale(1.12); }
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon > svg, .input-icon > [data-lucide] { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 36px; }
.receipt-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.receipt-kinds input { position: absolute; opacity: 0; pointer-events: none; }
.receipt-kinds label { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 10px 12px; border-radius: 16px; cursor: pointer;
  border: 1.5px solid var(--line-strong); text-align: center; transition: border-color .15s, background .15s; }
.receipt-kinds label b { font-size: 13px; }
.receipt-kinds input:checked + label { border-color: var(--ink); background: var(--soft-yellow); box-shadow: 0 0 0 3px rgba(230, 247, 107, .5); }
.receipt-kinds input:focus-visible + label { outline: 2px solid var(--purple); outline-offset: 2px; }
.kind-art { display: block; margin-bottom: 6px; border-radius: 4px; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
  background-image: repeating-linear-gradient(to bottom, transparent 0 7px, #d9d9e0 7px 8px); background-clip: content-box; padding: 8px 6px; }
.kind-art.slip { width: 30px; height: 50px; }
.kind-art.page { width: 44px; height: 50px; border-top: 4px solid var(--ink); }
/* the preview: a paper slip with a torn edge, on a dotted backdrop tinted with the brand colour */
.receipt-preview-card { display: flex; flex-direction: column; gap: 12px; }
.receipt-stage { flex: 1; display: grid; place-items: center; padding: 26px 16px; border-radius: 16px; min-height: 280px;
  background-color: color-mix(in srgb, var(--brand, #1d1d21) 9%, var(--thead));
  background-image: radial-gradient(color-mix(in srgb, var(--brand, #1d1d21) 22%, transparent) 1px, transparent 1.4px);
  background-size: 14px 14px; transition: background-color .2s; }
.receipt-paper { width: min(250px, 100%); filter: drop-shadow(0 10px 18px rgba(20, 20, 40, .16)) drop-shadow(0 2px 3px rgba(20, 20, 40, .08)); }
.receipt-mini { background: #fff; color: #111; border-radius: 8px 8px 0 0; padding: 18px 14px 26px;
  font-family: ui-monospace, Consolas, monospace; font-size: 11px; line-height: 1.5; display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 2px;
  /* torn bottom edge */
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 12px 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 12px 100%; }
.receipt-mini img { width: 40px; height: 40px; object-fit: contain; margin-bottom: 4px; }
.receipt-mini .rm-name { font-size: 13px; color: var(--brand); font-family: var(--font); }
.receipt-mini i:empty, .receipt-mini .rm-social:empty { display: none; }
.receipt-mini .rm-meta { color: #666; }
.receipt-mini hr { width: 100%; border: 0; border-top: 1px dashed #bbb; margin: 8px 0; }
.receipt-mini .rm-line { width: 100%; display: flex; justify-content: space-between; }
.receipt-mini .rm-total { font-weight: 700; }
.receipt-mini .rm-foot, .receipt-mini .rm-social { color: #444; word-break: break-word; }
.brand-save { grid-column: 1 / -1; position: sticky; bottom: -16px; /* the scroll area keeps 28px of bottom padding; sit lower in it */
  z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px 10px 18px; border-radius: 18px; background: var(--panel-strong); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
body:has(#agentWidget) .brand-save { padding-right: 84px; }  /* keep Save clear of the agent bubble */
@media (max-width: 1100px) {
  .brand-page { grid-template-columns: minmax(0, 1fr); }
  .brand-side { position: static; }
}
@media (max-width: 900px) {
  .brand-save { bottom: calc(86px + env(safe-area-inset-bottom)); }  /* above the phone tab bar */
}
@media (max-width: 640px) {
  .logo-field { align-items: flex-start; }
  .logo-drop { width: 72px; height: 72px; }
  .brand-save .small { display: none; }
  .brand-save .btn { width: 100%; }
}

/* ---------------------------------------------------------------- business settings & my profile */
.settings-page { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: stretch; }
.settings-page .brand-side { position: static; }  /* both cards stretch to the same height */
.brand-page:not(.settings-page) { align-items: stretch; }
.brand-page:not(.settings-page) .brand-side { position: static; }
.brand-page:not(.settings-page) .brand-main > .card:last-child,
.brand-page:not(.settings-page) .brand-side > .card:last-child { flex: 1; }
.toggle-row { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px;
  border-radius: 14px; background: var(--pill); cursor: pointer; }
.toggle-row > span { display: flex; flex-direction: column; gap: 2px; }
.toggle-row b { font-size: 13.5px; font-weight: 600; }
.toggle-row input { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; flex-shrink: 0; border-radius: 999px;
  background: var(--line-strong); position: relative; cursor: pointer; transition: background .15s; }
.toggle-row input::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, .2); transition: transform .15s; }
.toggle-row input:checked { background: var(--green); }
.toggle-row input:checked::after { transform: translateX(18px); }
.toggle-row input:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
.profile-page { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; align-items: stretch; }
.profile-page h3 { font-size: 16px; }
.profile-id { display: flex; align-items: center; gap: 16px; }
.profile-id .badge svg, .profile-id .badge [data-lucide] { width: 12px; height: 12px; }
.info-rows { display: flex; flex-direction: column; }
.info-rows > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.info-rows > div:first-child { border-top: 0; }
.info-rows b { font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.profile-page > .card > p:last-child { margin-top: auto; }  /* with equal-height cards, the footnote sits at the bottom */
.role-allows { border-top: 1px solid var(--line); padding-top: 12px; }
.role-allows summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; }
.role-allows summary::-webkit-details-marker { display: none; }
.role-allows summary svg:last-child { margin-left: auto; color: var(--muted); transition: transform .2s; }
.role-allows[open] summary svg:last-child { transform: rotate(180deg); }
.role-allows .perm-chips { margin: 10px 0 8px; }
@media (max-width: 900px) { .profile-page, .settings-page { grid-template-columns: minmax(0, 1fr); } }

/* ---------------------------------------------------------------- bulk upload */
.upload-card { display: flex; flex-direction: column; gap: 16px; }
.upload-card h3 { font-size: 16px; margin-bottom: 2px; }
.upload-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 36px 18px;
  min-height: 250px; text-align: center; }
.upload-drop:hover { border-color: var(--purple); }
.upload-drop__icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 4px;
  background: var(--soft-purple); color: var(--purple-deep); }
.upload-drop__icon svg, .upload-drop__icon [data-lucide] { width: 26px; height: 26px; }
.upload-drop b { font-size: 15px; font-weight: 600; word-break: break-word; }
.upload-drop u { text-decoration-color: var(--purple); text-underline-offset: 3px; color: var(--purple-deep); }
.upload-formats { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.upload-formats span { font-size: 11px; font-weight: 600; letter-spacing: .03em; padding: 3px 9px; border-radius: 999px;
  background: var(--thead); color: var(--ink-2); }
.dropzone.has-file { border-style: solid; border-color: var(--green); background: var(--soft-green); }
.dropzone.has-file .upload-drop__icon { background: var(--panel-strong); color: var(--green); }
.upload-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.upload-foot p { display: flex; gap: 8px; align-items: flex-start; max-width: 48ch; line-height: 1.5; }
.upload-foot p svg, .upload-foot p [data-lucide] { width: 16px; height: 16px; margin-top: 1px; color: var(--green); }
.upload-foot .btn { flex-shrink: 0; }
.upload-steps { padding: 14px 16px; }
.upload-steps ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.upload-steps li { display: flex; flex-direction: column; gap: 2px; font-size: 12px; line-height: 1.35; }
.upload-steps li b { font-size: 13px; }
.step-num { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 4px;
  background: var(--lime); color: var(--lime-ink); font-weight: 700; font-size: 12px; }
.upload-template { display: flex; flex-direction: column; gap: 12px; }
.upload-template h3 { font-size: 15px; }
.upload-template .row { align-items: flex-start; }
.upload-template__btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.upload-cols summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  font-weight: 600; font-size: 15px; }
.upload-cols summary::-webkit-details-marker { display: none; }
.upload-cols summary svg, .upload-cols summary [data-lucide] { width: 18px; height: 18px; color: var(--muted); transition: transform .2s; }
.upload-cols[open] summary svg { transform: rotate(180deg); }
.col-list { margin-top: 10px; }
.col-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.col-row code { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.col-row .small { text-align: right; }
.upload-cols__note { margin-top: 10px; }
@media (max-width: 640px) {
  .upload-drop { min-height: 200px; padding: 28px 14px; }
  .upload-foot { flex-direction: column; align-items: stretch; }
  .upload-foot .btn { width: 100%; }
}
.err-list { color: var(--red); font-size: 12px; }

/* chat */
.chat { display: flex; flex-direction: column; height: calc(100vh - 250px); min-height: 460px; }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 6px 4px 16px; }
.msg { max-width: 78%; padding: 12px 16px; border-radius: 18px; font-size: 14px; line-height: 1.55; }
.msg.user { align-self: flex-end; background: var(--ink); color: var(--page); border-bottom-right-radius: 6px; }
.msg.assistant { align-self: flex-start; background: var(--panel-strong); border-bottom-left-radius: 6px; box-shadow: var(--shadow); }
.msg.assistant p + p, .msg.assistant ul, .msg.assistant ol { margin-top: 8px; }
.msg.assistant ul, .msg.assistant ol { padding-left: 20px; margin-bottom: 0; }
.msg.typing { color: var(--muted); }
.chat-form { display: flex; gap: 8px; padding: 8px; background: var(--panel-strong); border-radius: 999px; box-shadow: var(--shadow); }
.chat-form input { flex: 1; border: 0; background: transparent; padding: 0 14px; font: inherit; color: var(--ink); outline: none; }

/* receipt & print */
.receipt { width: 300px; margin: 0 auto; font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: #000; background: #fff; padding: 16px; }
.receipt hr { border: 0; border-top: 1px dashed #000; }
.receipt .line { display: flex; justify-content: space-between; gap: 8px; }
@media print {
  .no-print, .sidebar, .topbar, .bar, .toasts, .tabbar, .cart-bar, .agent-widget { display: none !important; }
  .print-only { display: block !important; }
  body { background: #fff; }
  .app { display: block; margin: 0; padding: 0; background: #fff; }
  .app::before { display: none; }
  .card { box-shadow: none; }
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; margin: 0; border-radius: 0; padding: 14px 16px 24px; min-height: 100vh; }
  .app > .brand { display: none; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 60; padding: 18px; background: var(--frame);
    transform: translateX(-105%); transition: transform .2s; overflow-y: auto; box-shadow: 0 0 40px rgba(0, 0, 0, .2);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .agent-widget, body.nav-open .cart-bar { display: none; }
  /* .app is its own stacking context, so the dimmer lives inside it (under the drawer, over the page) */
  body.nav-open .app::after { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .3); z-index: 55; }
  .menu-toggle { display: inline-grid; }
  .greeting h1 { font-size: 18px; }
  .greeting p { display: none; }
  .top-actions .hide-sm { display: none; }
  .grid-2, .grid-3, .grid.split { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .auth-media { display: none; }
  .auth-card { width: min(480px, 100%); border-radius: 26px; }
  .auth-panel { padding: 24px 20px 28px; }
  .bar { border-radius: 18px; }
  .msg { max-width: 92%; }
}

.actions form { display: inline-flex; }
.sidebar .brand { display: none; }
@media (max-width: 900px) { .sidebar .brand { display: flex; margin-bottom: 8px; } }
kbd { font-family: ui-monospace, Consolas, monospace; font-size: 11px; padding: 1px 6px; border-radius: 6px; background: var(--thead); }
/* a business's own logo takes the StockPilot mark's place: shown whole (never cropped) on a white tile, whatever its shape */
.brand-logo { width: 42px; height: 42px; flex-shrink: 0; padding: 5px; border-radius: 12px; object-fit: contain;
  background: #fff; box-shadow: 0 0 0 1px var(--line), 0 2px 6px rgba(20, 20, 40, .06); }
.brand:has(.brand-logo) span { min-width: 0; }
.brand:has(.brand-logo) small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-banner { background: var(--soft-yellow); gap: 10px; padding: 8px 14px; }
.profile-banner [data-lucide] { color: var(--yellow); }

/* ---------------------------------------------------------------- app shell: fixed sidebar, scrolling main
   The frame fills the viewport; the brand, top bar and sidebar stay put and only the main column scrolls. */
@media (min-width: 901px) {
  html:has(body > .app), body:has(> .app) { height: 100%; overflow: hidden; }
  /* no bottom padding on the frame: the sidebar and main column run to its rounded edge, so nothing is
     hidden behind an empty band; each scroll area carries its own bottom breathing room instead */
  .app { height: calc(100dvh - 40px); min-height: 0; padding-bottom: 0; }
  .sidebar { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding-bottom: 24px; }
  .sidebar::-webkit-scrollbar { display: none; }
  .main { min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    margin-right: -10px; padding-right: 10px; padding-bottom: 28px; scroll-padding-top: 12px; }
}
@media print {
  html, body { height: auto; overflow: visible; }
  .app { height: auto; }
  .main { overflow: visible; }
}

/* ---------------------------------------------------------------- list toolbars
   One glass card per list page: a header row (title, meta, actions) and a filters row
   (search + dropdowns in ONE form, so searching keeps the chosen filters and vice versa). */
.toolbar { display: flex; flex-direction: column; gap: 12px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--pill); backdrop-filter: blur(12px); }
.toolbar-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 38px; }
.toolbar-head h2 { font-size: 16px; padding-left: 4px; margin-right: 2px; }
.toolbar-meta { font-size: 12.5px; color: var(--muted); }
.toolbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.toolbar-filters > * { flex: 1 1 140px; min-width: 0; max-width: 250px; }
.toolbar-filters > .filter-search { flex: 2 1 200px; max-width: none; }
.toolbar-filters > .filter-date { flex: 0 1 160px; }
.toolbar-filters > .filter-range { flex: 1 1 280px; max-width: 330px; display: flex; align-items: center; gap: 6px; }
.filter-range .input { flex: 1; min-width: 0; }
.filter-range > span { color: var(--muted); font-size: 12px; }
.toolbar-filters > .filter-clear { flex: 0 0 auto; max-width: none; }
.toolbar-filters > .btn { flex: 0 0 auto; max-width: none; height: 38px; }
.toolbar-filters .input { height: 38px; border-radius: 999px; font-size: 13px; padding: 0 14px; background-color: var(--panel-strong); }
.toolbar-filters select.input { padding-right: 34px; text-overflow: ellipsis; }
.toolbar-filters input[type="date"].input { padding: 0 12px; }
.filter-search { position: relative; display: flex; align-items: center; }
.filter-search svg, .filter-search [data-lucide] { position: absolute; left: 13px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.toolbar-filters .filter-search .input { padding-left: 38px; width: 100%; }
.filter-clear { display: inline-flex; align-items: center; gap: 4px; height: 38px; padding: 0 10px; font-size: 12.5px; color: var(--muted); border-radius: 999px; }
.filter-clear:hover { color: var(--ink); background: var(--pill-hover); }
.filter-clear svg, .filter-clear [data-lucide] { width: 14px; height: 14px; }

/* compact bars (tabs + a control or two) get the same control sizing */
.bar { border-radius: 24px; }
.bar .input.pill { height: 36px; font-size: 13px; padding: 0 14px; background-color: var(--panel-strong); }
.bar select.input.pill { padding-right: 34px; }
.bar > form:not(.search-pill):not(.toolbar-filters) { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; min-width: 0; }
.bar .input.pill { width: auto; min-width: 0; }
.bar > form input.input.pill:not([type=date]):not([type=month]) { width: 220px; }

@media (max-width: 700px) {
  .toolbar-filters > * { flex: 1 1 calc(50% - 4px); max-width: none; }
  .toolbar-filters > .filter-search, .toolbar-filters > .filter-range { flex: 1 1 100%; max-width: none; }
  .toolbar-actions { margin-left: 0; width: 100%; }
  .toolbar-actions .btn { flex: 1; }
}

/* ---------------------------------------------------------------- shared modal, notices, loading */
dialog.modal.remote { --modal-w: 640px; max-height: calc(100dvh - 48px); overflow-y: auto; }
dialog.modal.wide, dialog.modal.remote:has(.split) { --modal-w: 960px; }
dialog.modal[open] { animation: pop .18s ease-out; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-body .form-grid { gap: 12px 14px; }
.modal-body .card { box-shadow: none; padding: 0; background: none; max-width: none !important; }  /* page forms cap their width; in a modal they fill it */
.notice { padding: 10px 12px; border-radius: 12px; font-size: 13px; background: var(--soft-cyan); }
.notice.error { background: var(--soft-pink); color: var(--red); }
.notice.success { background: var(--soft-green); color: var(--green); }
/* loading placeholder for modals (named so it can't collide with a button's "loading" state) */
.modal-loading { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--muted); padding: 40px 4px;
  justify-content: center; font-size: 13px; }
/* swirling loader: a stroke that grows, shrinks and spins */
.swirl { width: 34px; height: 34px; color: var(--purple); }
.swirl circle { transform-origin: center; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 50;
  animation: swirl-dash var(--duration, 1.5s) ease-in-out infinite alternate,
             swirl-spin calc(var(--duration, 1.5s) * 1.333333) linear infinite; }
@keyframes swirl-spin { to { transform: rotate(360deg); } }
@keyframes swirl-dash {
  0% { stroke-dasharray: 1, 800; stroke-dashoffset: 0; }
  50% { stroke-dasharray: 400, 400; stroke-dashoffset: -200px; }
  100% { stroke-dasharray: 800, 1; stroke-dashoffset: -800px; }
}
@media (prefers-reduced-motion: reduce) { .swirl circle { animation-duration: 3s, 4s; } }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.busy { opacity: .7; pointer-events: none; }
.btn.busy::after { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: spin .7s linear infinite; }
.transfer-grid { grid-template-columns: 1fr 1fr; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }

/* ---------------------------------------------------------------- team & roles */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.person { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 18px; background: var(--panel-strong); box-shadow: var(--shadow); }
.person .avatar { width: 42px; height: 42px; flex-shrink: 0; cursor: default; }
.person .avatar::after { display: none; }
.person.off { opacity: .6; }
.person b { display: block; }
.roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.role-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 18px; background: var(--panel-strong); box-shadow: var(--shadow); }
.role-card h4 { font-size: 15px; }
.perm-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.perm-chips span { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--thead); color: var(--ink-2); }
.perm-group { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.perm-group > b { display: block; margin-bottom: 6px; font-size: 13px; }
.perm { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); cursor: pointer; }
.perm:first-of-type { border-top: 0; }
.perm input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ink); flex-shrink: 0; }
.perm small { display: block; color: var(--muted); font-size: 12px; }
.perm.locked { opacity: .5; cursor: not-allowed; }

/* ---------------------------------------------------------------- phone navigation */
.tabbar { display: none; }

/* ---------------------------------------------------------------- tablets & phones */
@media (max-width: 1100px) {
  .pos { grid-template-columns: 1fr; }
  .pos .order-panel {
    position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 70; max-height: 90dvh; overflow-y: auto;
    border-radius: 26px 26px 0 0; background: var(--panel-strong); box-shadow: 0 -20px 60px rgba(0, 0, 0, .25);
    transform: translateY(105%); transition: transform .22s ease-out; padding: 10px 14px calc(14px + env(safe-area-inset-bottom));
  }
  .pos .order-panel::before { content: ""; width: 42px; height: 4px; border-radius: 4px; background: var(--line-strong); align-self: center; }
  body.cart-open .pos .order-panel { transform: none; }
  .pos .close-sheet { display: inline-grid; }
  body.cart-open .pos::after { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 65; }
  body.cart-open .tabbar, body.cart-open .cart-bar { display: none; }
  .pos .cart { max-height: 34dvh; }
  .cart-bar {
    display: flex; position: fixed; left: 12px; right: 12px; z-index: 62;
    bottom: calc(16px + env(safe-area-inset-bottom));
    align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 18px; border: 0; font: inherit; cursor: pointer;
    background: var(--ink); color: var(--page); box-shadow: 0 12px 30px rgba(0, 0, 0, .3); text-align: left;
  }
  .cart-bar .count { min-width: 28px; height: 28px; border-radius: 999px; background: var(--lime); color: var(--lime-ink); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
  .cart-bar .go { margin-left: auto; background: var(--lime); color: var(--lime-ink); padding: 9px 14px; border-radius: 12px; font-weight: 600; }
  .cart-bar.empty { opacity: .9; }
  .pos-page .main { padding-bottom: 160px; }
}
@media (max-width: 900px) {
  .app { padding-bottom: calc(92px + env(safe-area-inset-bottom)); gap: 12px; }
  .topbar { gap: 8px; }
  .greeting h1 { font-size: 19px; }
  .top-actions { padding: 4px 6px; gap: 2px; }
  .cart-bar { bottom: calc(88px + env(safe-area-inset-bottom)); }  /* tab bar: 10px off the edge + 66px tall, then a 12px gap */
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 10px; right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 54;  /* inside .app: under the dimmer (55) and the menu drawer (60) */ padding: 6px; border-radius: 22px;
    background: var(--panel-strong); backdrop-filter: blur(18px); box-shadow: 0 10px 40px rgba(20, 20, 40, .18);
  }
  .tabbar a, .tabbar button {
    display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 4px; border-radius: 16px; border: 0;
    background: none; font: inherit; font-size: 11px; font-weight: 500; color: var(--muted); cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .tabbar [data-lucide], .tabbar svg { width: 21px; height: 21px; }
  .tabbar a.active { background: var(--lime); color: var(--lime-ink); }
  .sidebar { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }  /* the drawer sits over the tab bar, so no extra room needed */
  .toasts { left: 12px; right: 12px; top: calc(10px + env(safe-area-inset-top)); width: auto; }
  .card { padding: 14px; border-radius: 18px; }
  .card.flush { padding: 4px; }
  .tile { padding: 14px 16px; border-radius: 18px; }
  .kpi .value { font-size: 22px; }
  .toolbar-actions .btn { flex: 1 1 auto; }
  .notif-menu { width: min(320px, calc(100vw - 24px)) !important; right: -60px; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .input, select.input, textarea.input { font-size: 16px; height: 44px; }  /* 16px stops iOS zooming into fields */
  textarea.input { height: auto; }
  .toolbar-filters .input { font-size: 15px; height: 42px; }
  .btn { height: 40px; }
  .btn.sm { height: 34px; }
  .btn.lg, .modal-foot .btn { height: 44px; font-size: 15px; }
  .pos-tools .input.pill { height: 42px; }
  .pay-methods label { padding: 12px 6px; }
  .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .grid-4 .kpi { gap: 8px; }
  .grid-4 .kpi .value { font-size: 18px; }
  .grid-4 .kpi .label { font-size: 12px; }
  /* modals slide up from the bottom like native sheets */
  dialog.modal, dialog.modal.remote, dialog.modal.wide, dialog.modal.remote:has(.split) {
    width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 24px 24px 0 0; max-height: 92dvh; overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom);
  }
  dialog.modal[open] { animation: sheet .22s ease-out; }
  @keyframes sheet { from { transform: translateY(40px); opacity: .4; } }
  .modal-body { padding: 18px 16px 20px; }
  .modal-foot { position: sticky; bottom: -20px; background: var(--panel-strong); padding: 10px 0 4px; margin-bottom: -4px; }
  .modal-foot .btn { flex: 1; }
  /* tables become stacked cards: each cell shows its column name */
  table.table.stackable thead { display: none; }
  table.table.stackable, table.table.stackable tbody, table.table.stackable tr, table.table.stackable td { display: block; width: 100%; }
  table.table.stackable tr { padding: 10px 12px; border-bottom: 1px solid var(--line); }
  table.table.stackable tbody tr:last-child { border-bottom: 0; }
  table.table.stackable tbody td { display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 3px 0 !important; border: 0; text-align: right; min-height: 26px; }
  table.table.stackable tbody td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 500; text-align: left; flex-shrink: 0; }
  table.table.stackable tbody td:first-child { text-align: left; }
  table.table.stackable tbody td:first-child::before { display: none; }
  table.table.stackable tbody td.actions { justify-content: flex-end; }
  table.table.stackable tbody td.actions::before { display: none; }
  table.table.stackable tbody td:empty { display: none; }
  table.table.stackable tfoot { display: block; }
  table.table.stackable tfoot tr { display: flex; justify-content: space-between; flex-wrap: wrap; }
  table.table.stackable tfoot td { display: inline-block; width: auto; padding: 6px 12px; }
  .table-wrap { overflow: visible; }
  .toolbar { padding: 10px; border-radius: 18px; }
  .bar { border-radius: 18px; }
  .bar > form input.input.pill:not([type=date]):not([type=month]) { width: 100%; }
  .pager a, .pager span { min-width: 34px; padding: 0 9px; }
  nav.row.mt { flex-wrap: wrap; justify-content: center; }
}

/* ---------------------------------------------------------------- marketing site */
.site { min-height: 100vh; background: #f3f2ee; }
:root[data-theme="dark"] .site { background: #0a0a0c; }
.site-wrap { width: min(1120px, calc(100% - 48px)); margin: 0 auto; }
.site-nav {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, #f3f2ee 84%, transparent);
  backdrop-filter: blur(18px);
}
:root[data-theme="dark"] .site-nav { background: color-mix(in srgb, #0a0a0c 84%, transparent); }
.site-nav__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.site-nav__links { display: flex; gap: 22px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.site-nav__links a:hover { color: var(--ink); }
.site-nav .btn { height: 36px; padding: 0 16px; font-size: 13.5px; }

.site-stage {
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  margin: 0 12px; padding: 56px 0 72px; border-radius: 32px;
  background: #0c0c0f; color: #f6f6f8;
  box-shadow: 0 30px 80px -36px rgba(20, 20, 30, .55);
}
.site-stage__glow {
  position: absolute; left: 0; right: 0; bottom: 0; height: 46%; pointer-events: none;
  background:
    radial-gradient(58% 90% at 50% 115%, rgba(230, 247, 107, .72), transparent 68%),
    radial-gradient(36% 70% at 72% 120%, rgba(154, 107, 255, .55), transparent 70%);
}
.site-stage__glow::after {
  content: ""; position: absolute; inset: 18% 0 0; 
  background-image: radial-gradient(circle, rgba(230, 247, 107, .85) 1.15px, transparent 1.25px);
  background-size: 8px 8px;
  -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 88%);
  mask-image: linear-gradient(to top, #000 10%, transparent 88%);
}
.site-stage__body { position: relative; z-index: 1; margin: 0 auto; padding: 8px 0 0; text-align: center; }
.site-mark {
  width: 72px; height: 72px; margin: 0 auto 22px; color: #fff;
  display: grid; place-items: center;
}
.site-mark svg { width: 72px; height: 72px; }
/* hero wordmark: one family (Bricolage Grotesque) in two roles, a tracked caps label over a heavy name */
.site-stage h1 { font-family: "Bricolage Grotesque", var(--font); font-optical-sizing: auto; }
.site-wordmark { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.site-wordmark__over { font-size: clamp(13px, 1.3vw, 16px); font-weight: 600; letter-spacing: .5em; text-transform: uppercase;
  line-height: 1; padding-left: .5em; /* balances the trailing tracking so it centres under the mark */ color: #e6f76b; }
.site-wordmark__name { font-size: clamp(56px, 8vw, 92px); font-weight: 800; line-height: .92; letter-spacing: -.045em; }
.site-stage .site-lead { max-width: 38ch; margin: 18px auto 26px; color: rgba(246, 246, 248, .72); font-size: 18px; line-height: 1.45; }
.site-stage__actions { justify-content: center; }
.site-btn-ghost { background: transparent; border-color: rgba(255, 255, 255, .22); color: #fff; }
.site-btn-ghost:hover { background: rgba(255, 255, 255, .08); }
.site-from { margin-top: 18px; color: rgba(246, 246, 248, .55); font-size: 13.5px; }

.site-section { padding: 84px 0 12px; scroll-margin-top: 76px; }
.site-section h2 { font-size: clamp(28px, 3vw, 40px); letter-spacing: -.035em; }
.site-section__head { margin-bottom: 22px; }
.site-section__head p { margin-top: 8px; color: var(--muted); font-size: 15px; }
.site-section__head--center { text-align: center; }
.site-lead { max-width: 42ch; margin: 14px 0 18px; font-size: 17px; line-height: 1.45; color: var(--ink-2); }
.site-features {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.site-features article { padding: 28px 22px 26px; border-right: 1px solid var(--line); text-align: center; }
.site-features article:last-child { border-right: 0; }
.site-icon { width: 88px; height: 88px; object-fit: cover; border-radius: 22px; margin: 0 auto 16px; display: block; }
.site-features h3 { font-size: 16px; margin-bottom: 4px; }
.site-features p { color: var(--muted); font-size: 13.5px; }

.site-billing {
  display: flex; justify-content: center; gap: 4px; width: fit-content; margin: 0 auto 28px; padding: 4px;
  border-radius: 999px; background: var(--pill); border: 1px solid var(--line);
}
.site-billing__opt { position: relative; }
.site-billing__opt input { position: absolute; opacity: 0; pointer-events: none; }
.site-billing__opt span {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); cursor: pointer;
}
.site-billing__opt span em {
  font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  background: var(--lime); color: var(--lime-ink);
}
.site-billing__opt input:checked + span { background: var(--ink); color: var(--page); }
.site-billing__opt input:focus-visible + span { outline: 2px solid var(--purple); outline-offset: 2px; }
.site-plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.site-plan {
  display: flex; flex-direction: column; gap: 8px; padding: 22px 18px 18px; border-radius: 24px;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow);
}
:root[data-theme="dark"] .site-plan { background: var(--panel-strong); }
.site-plan.featured {
  background: #121216; color: #f6f6f8; border-color: #121216;
  box-shadow: 0 18px 40px -24px rgba(20, 20, 30, .7);
}
.site-plan.featured .muted, .site-plan.featured .site-plan__price small, .site-plan.featured .site-bill { color: rgba(246, 246, 248, .62); }
.site-plan--custom { background: transparent; border-style: dashed; box-shadow: none; }
:root[data-theme="dark"] .site-plan--custom { background: transparent; }
.site-plan__tag {
  align-self: flex-start; padding: 3px 9px; border-radius: 999px; background: var(--lime);
  color: var(--lime-ink); font-size: 11px; font-weight: 700; letter-spacing: .02em;
}
.site-plan h3 { font-size: 18px; }
.site-plan__price { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 10px; }
.site-rate-line { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.site-plan__price .site-rate { font-size: 30px; font-weight: 600; letter-spacing: -.04em; line-height: 1.1; }
.site-plan__price small, .site-was, .site-bill { color: var(--muted); font-size: 12.5px; }
.site-was { text-decoration: line-through; }
.site-was[hidden], .site-bill[hidden] { display: none; }
.site-plan ul { margin: 10px 0 16px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.site-plan li { font-size: 13.5px; padding-left: 16px; position: relative; }
.site-plan li::before { content: ""; position: absolute; left: 0; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--lime-deep); }
.site-plan .btn { margin-top: auto; }

.site-mail { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.site-close { margin: 72px 12px 12px; scroll-margin-top: 76px; }
.site-talk {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 36px; align-items: start;
  padding: 40px; border-radius: 32px; background: #0c0c0f; color: #f6f6f8;
}
.site-talk__glow {
  position: absolute; inset: auto 0 0; height: 70%; pointer-events: none;
  background:
    radial-gradient(58% 90% at 50% 115%, rgba(230, 247, 107, .72), transparent 68%),
    radial-gradient(36% 70% at 72% 120%, rgba(154, 107, 255, .55), transparent 70%);
}
.site-talk__glow::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(230, 247, 107, .85) 1.15px, transparent 1.25px);
  background-size: 8px 8px;
  -webkit-mask-image: linear-gradient(to top, #000 18%, transparent 88%);
  mask-image: linear-gradient(to top, #000 18%, transparent 88%);
}
.site-talk > :not(.site-talk__glow) { position: relative; z-index: 1; }
.site-talk h2 { font-size: clamp(28px, 3vw, 40px); letter-spacing: -.035em; }
.site-talk .site-lead { color: rgba(246, 246, 248, .72); }
.site-talk .muted { color: rgba(246, 246, 248, .55); }
.site-talk .site-mail { color: var(--lime); }
.site-form { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 22px; background: #fff; color: var(--ink); }
:root[data-theme="dark"] .site-form { background: var(--panel-strong); color: var(--ink); }
.site-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.site-form .input { height: 42px; }
.site-form .muted { color: var(--muted); }
.site-foot { margin-top: 28px; border-top: 1px solid var(--line); }
.site-foot a { font-size: 13.5px; font-weight: 500; }
@media (max-width: 980px) {
  .site-features, .site-plans { grid-template-columns: 1fr 1fr; }
  .site-features article:nth-child(2) { border-right: 0; }
  .site-features article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .site-talk { grid-template-columns: 1fr; padding: 28px 20px; }
}
@media (max-width: 720px) {
  .site-nav__row { flex-wrap: wrap; min-height: 60px; padding: 8px 0; }
  .site-nav__links { order: 3; width: 100%; justify-content: space-between; gap: 8px; padding-bottom: 6px; font-size: 13px; }
  .site-stage { margin: 0 8px; border-radius: 24px; padding: 36px 0 48px; }
  .site-wordmark__name { font-size: 52px; }
  .site-wordmark { gap: 10px; }
  .site-section { padding-top: 56px; }
  .site-features, .site-plans, .site-form__row { grid-template-columns: 1fr; }
  .site-features article { border-right: 0; border-bottom: 1px solid var(--line); }
  .site-features article:last-child { border-bottom: 0; }
  .site-billing { width: 100%; }
  .site-billing__opt { flex: 1; }
  .site-billing__opt span { width: 100%; justify-content: center; height: auto; min-height: 36px; padding: 6px 8px; font-size: 12.5px; flex-wrap: wrap; }
  .site-close { margin: 48px 8px 8px; }
}

/* ---------------------------------------------------------------- page-to-page navigation
   Moving between pages is a full load, so without this the whole frame (sidebar included) blinks.
   With cross-document view transitions the shell stays perfectly still and only the page content fades. */
@view-transition { navigation: auto; }
.app > .brand { view-transition-name: shell-brand; }
.topbar { view-transition-name: shell-topbar; }
.tabbar { view-transition-name: shell-tabbar; }
@media (min-width: 901px) { .sidebar { view-transition-name: shell-sidebar; } }  /* on phones it's a drawer that closes */
::view-transition-old(shell-brand), ::view-transition-old(shell-sidebar), ::view-transition-old(shell-tabbar) { display: none; }
::view-transition-new(shell-brand), ::view-transition-new(shell-sidebar), ::view-transition-new(shell-tabbar) { animation: none; }
::view-transition-group(*) { animation-duration: .16s; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .16s; }
@media (prefers-reduced-motion: reduce) { ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } }

/* ---------------------------------------------------------------- top bar search
   The search button grows into a field right where it sits, instead of dropping a box below it. */
.top-search { display: flex; align-items: center; height: 36px; border-radius: 999px;
  transition: background-color .25s ease, box-shadow .25s ease; }
.top-search input { width: 0; min-width: 0; height: 36px; padding: 0; border: 0; outline: 0; opacity: 0;
  background: transparent; color: var(--ink); font: inherit; font-size: 13.5px;
  transition: width .32s cubic-bezier(.2, .8, .2, 1), padding .32s cubic-bezier(.2, .8, .2, 1), opacity .2s ease; }
.top-search input::placeholder { color: var(--muted); }
.top-search input::-webkit-search-cancel-button { display: none; }
.top-search .icon-btn { flex-shrink: 0; transition: background-color .2s, color .2s; }
.top-search.open { background: var(--panel-strong); box-shadow: inset 0 0 0 1px var(--line), 0 6px 18px rgba(20, 20, 40, .08); }
.top-search.open input { width: 250px; padding: 0 4px 0 16px; opacity: 1; transition-delay: 0s, 0s, .08s; }
.top-search.open .icon-btn { background: var(--ink); color: var(--page); }
.top-search.open .icon-btn:hover { background: var(--ink-2); }
@media (max-width: 1180px) { .top-search.open input { width: 190px; } }
@media (prefers-reduced-motion: reduce) { .top-search, .top-search input { transition: none; } }

/* ---------------------------------------------------------------- receipt preview: slip or A4 page */
.receipt-stage[data-kind="a4"] .receipt-paper, .receipt-stage:not([data-kind="a4"]) .a4-mini { display: none; }
.receipt-paper, .a4-mini { animation: paperIn .25s ease-out; }
@keyframes paperIn { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.a4-mini { width: min(290px, 100%); aspect-ratio: 1 / 1.414; display: flex; flex-direction: column; gap: 10px; padding: 18px 16px 14px;
  background: #fff; color: #111; border-radius: 4px; font-size: 7.5px; line-height: 1.45;
  box-shadow: 0 10px 22px rgba(20, 20, 40, .16), 0 2px 4px rgba(20, 20, 40, .08); }
.a4-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding-bottom: 8px; border-bottom: 2px solid var(--brand, #1d1d21); }
.a4-from { display: flex; gap: 6px; align-items: flex-start; min-width: 0; }
.a4-from > div { display: flex; flex-direction: column; min-width: 0; }
.a4-from img { width: 24px; height: 24px; object-fit: contain; border-radius: 4px; flex-shrink: 0; }
.a4-name { font-size: 9.5px; font-family: var(--font); }
.a4-from i { color: #666; }
.a4-from i:empty { display: none; }
.a4-meta { color: #555; margin-top: 2px; }
.a4-doc { display: flex; flex-direction: column; align-items: flex-end; text-align: right; color: #444; flex-shrink: 0; }
.a4-doc b { font-size: 12px; letter-spacing: .1em; color: var(--brand, #1d1d21); margin-bottom: 2px; }
.a4-table { display: flex; flex-direction: column; }
.a4-tr { display: grid; grid-template-columns: 1fr 26px 62px; gap: 6px; padding: 4px 5px; border-bottom: 1px solid #ececec; }
.a4-tr span:not(:first-child) { text-align: right; }
.a4-th { background: var(--brand, #1d1d21); color: #fff; font-weight: 600; border-bottom: 0; border-radius: 2px; }
.a4-totals { width: 58%; margin-left: auto; display: flex; flex-direction: column; gap: 2px; }
.a4-totals div { display: flex; justify-content: space-between; }
.a4-grand { border-top: 1.5px solid #111; padding-top: 3px; margin-top: 2px; font-weight: 700; font-size: 9px; }
.a4-foot { margin-top: auto; padding-top: 6px; border-top: 1px solid #ececec; color: #666; display: flex; flex-direction: column; gap: 1px; word-break: break-word; }
.a4-foot span:empty { display: none; }

/* ---------------------------------------------------------------- letterhead on printed documents */
.print-only { display: none; }
.letterhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 16px;
  margin-bottom: 6px; border-bottom: 3px solid var(--brand, #1d1d21); color: #111; }
.lh-from { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.lh-logo { width: 60px; height: 60px; flex-shrink: 0; object-fit: contain; border-radius: 10px; }
.lh-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lh-name { font-size: 18px; line-height: 1.2; }
.lh-tag { font-style: italic; color: #666; font-size: 12.5px; }
.lh-meta { color: #555; font-size: 12px; line-height: 1.5; }
.lh-doc { display: flex; flex-direction: column; align-items: flex-end; text-align: right; flex-shrink: 0; gap: 2px; }
.lh-doc b { font-size: 17px; letter-spacing: .1em; color: var(--brand, #1d1d21); }
.lh-doc span { color: #555; font-size: 12.5px; }
@media (max-width: 560px) { .letterhead { flex-direction: column; } .lh-doc { align-items: flex-start; text-align: left; } }

/* ---------------------------------------------------------------- guide (/guide) */
.site-guide-link { display: flex; justify-content: center; margin-top: 22px; }
.site-nav__links a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.guide-hero { padding: 56px 0 28px; }
.guide-kicker { font-size: 12px; font-weight: 700; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); }
.guide-hero h1 { max-width: 20ch; margin-top: 10px; font-family: "Bricolage Grotesque", var(--font); font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1.02; letter-spacing: -.04em; }
.guide-hero .site-lead { max-width: 56ch; }
.guide-jump { display: flex; flex-wrap: wrap; gap: 8px; }
.guide-jump a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 500;
  background: #fff; border: 1px solid var(--line); color: var(--ink-2); transition: border-color .15s, color .15s; }
:root[data-theme="dark"] .guide-jump a { background: var(--panel-strong); }
.guide-jump a:hover { border-color: var(--ink); color: var(--ink); }
.guide-jump [data-lucide], .guide-jump svg { width: 15px; height: 15px; }

.guide { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 48px; align-items: start; padding-bottom: 40px; }
.guide-toc { position: sticky; top: calc(var(--site-nav-h, 68px) + 16px); max-height: calc(100vh - var(--site-nav-h, 68px) - 36px); overflow-y: auto; scrollbar-width: none; }
.guide-toc summary { list-style: none; font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  padding: 4px 10px 10px; cursor: default; }
.guide-toc summary::-webkit-details-marker { display: none; }
.guide-toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.guide-toc a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; font-size: 13.5px; color: var(--ink-2);
  transition: background-color .15s, color .15s; }
.guide-toc a:hover { background: var(--pill); color: var(--ink); }
.guide-toc a.on { background: var(--lime); color: var(--lime-ink); font-weight: 600; }
.guide-toc [data-lucide], .guide-toc svg { width: 15px; height: 15px; flex-shrink: 0; }

.guide-body { min-width: 0; max-width: 820px; }
.guide-body > section { padding: 36px 0 34px; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--site-nav-h, 68px) + 12px); }
.guide-body > section:first-child { border-top: 0; padding-top: 4px; }
.guide-body h2 { display: flex; align-items: center; gap: 12px; font-size: clamp(24px, 2.6vw, 32px); letter-spacing: -.03em; margin-bottom: 12px; }
.guide-body h2 [data-lucide], .guide-body h2 svg { width: 22px; height: 22px; padding: 9px; box-sizing: content-box; border-radius: 12px;
  background: var(--lime); color: var(--lime-ink); flex-shrink: 0; }
.guide-body h3 { font-size: 17px; margin: 26px 0 8px; }
.guide-body p, .guide-body li, .guide-body dd { font-size: 15px; line-height: 1.65; color: var(--ink-2); }
.guide-body p + p { margin-top: 10px; }
.guide-body a:not(.btn) { text-decoration: underline; text-underline-offset: 3px; }
.guide-body kbd { font-size: 12px; }
.guide-steps { counter-reset: step; list-style: none; margin: 12px 0 18px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.guide-steps li { position: relative; padding-left: 40px; counter-increment: step; }
.guide-steps li::before { content: counter(step); position: absolute; left: 0; top: 1px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 700; background: var(--ink); color: var(--page); }
.guide-list { margin: 10px 0 18px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.guide-fig { margin: 18px 0 22px; }
.guide-fig a { display: block; border-radius: 18px; overflow: hidden; border: 1px solid var(--line);
  box-shadow: 0 24px 50px -30px rgba(20, 20, 40, .45); transition: transform .2s, box-shadow .2s; }
.guide-fig a:hover { transform: translateY(-2px); box-shadow: 0 30px 60px -30px rgba(20, 20, 40, .55); }
.guide-fig img { display: block; width: 100%; height: auto; }
.guide-fig figcaption, .guide-phone figcaption { margin-top: 9px; font-size: 13px; color: var(--muted); text-align: center; }
.guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.guide-grid .guide-fig { margin: 8px 0 14px; }
.guide-phones { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 18px 0 8px; }
.guide-phone { margin: 0; }
.guide-phone img { display: block; width: 100%; height: auto; border-radius: 26px; border: 6px solid #111;
  box-shadow: 0 24px 50px -28px rgba(20, 20, 40, .55); }
.guide-tip { display: flex; gap: 12px; align-items: flex-start; margin: 16px 0; padding: 14px 16px; border-radius: 16px;
  background: var(--soft-yellow, #fbf7d8); border: 1px solid color-mix(in srgb, var(--yellow, #eab308) 25%, transparent); }
.guide-tip > [data-lucide], .guide-tip > svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 3px; color: var(--ink); }
.guide-tip p { margin: 0 !important; font-size: 14px; }
.guide-who { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px !important; padding: 10px 14px; border-radius: 12px;
  background: var(--pill); font-size: 13.5px !important; }
.guide-who > [data-lucide], .guide-who > svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 3px; color: var(--muted); }
.guide-roles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 18px; }
.guide-roles div { padding: 12px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
:root[data-theme="dark"] .guide-roles div { background: var(--panel-strong); }
.guide-roles dt { font-weight: 700; font-size: 14px; }
.guide-roles dd { margin: 2px 0 0; font-size: 13.5px !important; line-height: 1.5 !important; }
.guide-end { text-align: center; }
.guide-end h2 { justify-content: center; }
.guide-end .row { justify-content: center; margin-top: 16px; }

@media (max-width: 900px) {
  .guide { grid-template-columns: 1fr; gap: 0; }
  .guide-toc { position: sticky; top: calc(var(--site-nav-h, 60px) + 6px); z-index: 5; max-height: none; overflow: visible; margin: 0 -4px 8px; }
  .guide-body > section { scroll-margin-top: calc(var(--site-nav-h, 60px) + 70px); }  /* below the header and the contents bar */
  .guide-toc details { background: color-mix(in srgb, #f3f2ee 92%, transparent); backdrop-filter: blur(14px); border: 1px solid var(--line);
    border-radius: 16px; padding: 4px 6px; }
  :root[data-theme="dark"] .guide-toc details { background: color-mix(in srgb, #0a0a0c 92%, transparent); }
  .guide-toc summary { cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 10px 8px; }
  .guide-toc summary::after { content: "▾"; font-size: 14px; }
  .guide-toc details[open] summary::after { content: "▴"; }
  .guide-toc ol { max-height: 60vh; overflow-y: auto; padding-bottom: 6px; }
  .guide-phones { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .guide-hero { padding-top: 32px; }
  .guide-grid, .guide-roles { grid-template-columns: 1fr; }
  .guide-body p, .guide-body li { font-size: 14.5px; }
  .guide-fig a { border-radius: 12px; }
  .guide-phone img { border-width: 4px; border-radius: 20px; }
}

/* ---------------------------------------------------------------- product form (add / edit) */
dialog.modal.remote:has(.pform) {
  --modal-w: 940px;
  display: flex; flex-direction: column;
  height: calc(100dvh - 48px);
  max-height: calc(100dvh - 48px);
  overflow: hidden;
}
/* the dialog's only child; without this it grows with the form and the dialog just clips it */
dialog.modal.remote:has(.pform) > .remote-body {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
}
.modal-body:has(.pform) { flex: 1 1 auto; min-height: 0; overflow: hidden; padding-bottom: 0; }
.modal-body .pform { flex: 1 1 auto; min-height: 0; overflow: hidden; }
.pform { display: flex; flex-direction: column; min-width: 0; }
.pform-scroll { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 18px 26px; align-items: start; min-width: 0; }
.modal-body .pform-scroll {
  flex: 1 1 auto; min-height: 0; overflow: hidden; align-items: stretch;
  grid-template-rows: minmax(0, 1fr);
}
.modal-body .pform-main {
  min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding-right: 18px; /* keep the scrollbar off the fields */
  scrollbar-width: thin; scrollbar-color: transparent transparent;
}
.modal-body .pform-main:hover { scrollbar-color: rgba(20, 20, 30, .12) transparent; }
:root[data-theme="dark"] .modal-body .pform-main:hover { scrollbar-color: rgba(255, 255, 255, .14) transparent; }
.modal-body .pform-main::-webkit-scrollbar { width: 10px; }
.modal-body .pform-main::-webkit-scrollbar-thumb {
  background-color: transparent; border: 3px solid transparent; border-radius: 99px; background-clip: padding-box;
}
.modal-body .pform-main:hover::-webkit-scrollbar-thumb { background-color: rgba(20, 20, 30, .12); }
:root[data-theme="dark"] .modal-body .pform-main:hover::-webkit-scrollbar-thumb { background-color: rgba(255, 255, 255, .14); }
.pform-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 0; }
.main .pform-main { background: var(--panel-strong); border-radius: var(--radius); padding: 22px; }
.pform .req { color: var(--red); }
.pform-basics { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 18px; align-items: stretch; padding-bottom: 12px; }
.pform-basics__fields { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pform-basics__fields .field .input + .input { margin-top: 8px; }
.pform-name { height: 48px; font-size: 16px; font-weight: 600; }
.pform-photo { position: relative; width: 100%; height: auto; align-self: stretch; min-height: 128px; padding: 0; border-radius: 20px; overflow: hidden; display: grid; place-items: center; }
.pform-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pform-photo__empty { display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; padding: 8px; }
.pform-photo__empty [data-lucide], .pform-photo__empty svg { width: 26px; height: 26px; color: var(--purple-deep); margin-bottom: 3px; }
.pform-photo__empty b { font-size: 13px; color: var(--ink); }
.pform-photo__empty small { font-size: 10.5px; color: var(--muted); line-height: 1.3; }
.pform-photo.has-photo { border-style: solid; }
.pform-photo.has-photo .pform-photo__empty { display: none; }
.pform-photo__change { position: absolute; left: 8px; right: 8px; bottom: 8px; display: none; align-items: center; justify-content: center; gap: 5px;
  padding: 5px 0; border-radius: 999px; background: rgba(20, 20, 26, .72); color: #fff; font-size: 11.5px; font-weight: 600; backdrop-filter: blur(6px); }
.pform-photo__change [data-lucide], .pform-photo__change svg { width: 12px; height: 12px; }
.pform-photo.has-photo .pform-photo__change { display: flex; }
.pform-sec { padding: 16px 0 14px; border-top: 1px solid var(--line); }
.pform-sec h4, .pform-more summary { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: .02em; margin-bottom: 12px; color: var(--ink); }
.pform-sec h4 [data-lucide], .pform-sec h4 svg { width: 16px; height: 16px; color: var(--muted); }
.pform .form-grid { gap: 12px 14px; }
.input-affix { position: relative; display: flex; align-items: center; }
.input-affix > span { position: absolute; left: 14px; font-weight: 600; color: var(--muted); pointer-events: none; }
.input-affix .input { padding-left: 34px; }
.pform-margin { display: inline-block; margin-top: 12px; padding: 7px 12px; border-radius: 10px; font-size: 12.5px; color: var(--ink-2); background: var(--pill); }
.pform-margin.good { background: var(--soft-green); color: var(--green); }
.pform-margin.thin { background: var(--soft-yellow); color: var(--ink-2); }
.pform-margin.bad { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.pform-margin b { font-weight: 700; margin-right: 2px; }
.pform-more { border-top: 1px solid var(--line); padding-top: 4px; }
.pform-more summary { list-style: none; cursor: pointer; margin: 0; padding: 12px 0; font-weight: 500; letter-spacing: 0; }
.pform-more summary::-webkit-details-marker { display: none; }
.pform-more summary > [data-lucide]:first-child, .pform-more summary > svg:first-child { width: 16px; height: 16px; color: var(--muted); }
.pform-more summary span { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.pform-more summary b { font-size: 13px; font-weight: 700; }
.pform-more summary small { font-size: 12px; color: var(--muted); font-weight: 400; }
.pform-more__chev { width: 16px !important; height: 16px !important; color: var(--muted); transition: transform .2s; }
.pform-more[open] .pform-more__chev { transform: rotate(180deg); }
.pform-more > .form-grid { padding: 4px 0 8px; }
.pform-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; min-height: 0; }
.modal-body .pform-side { position: sticky; top: 0; align-self: start; overflow: visible; max-height: 100%; }
.pform-preview { padding: 14px; border-radius: 20px; background: var(--thead); display: flex; flex-direction: column; gap: 10px; }
.pform-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pform-preview .product-card { cursor: default; background: var(--panel-strong); box-shadow: 0 10px 24px -16px rgba(20, 20, 40, .35); }
.pform-preview .product-card:active { transform: none; }
.pform-preview .product-card .ph { font-size: 28px; }
.pform-preview p { margin: 0; text-align: center; }
.pform-stock { padding: 14px; border-radius: 20px; background: var(--thead); }
.pform-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; flex-shrink: 0; padding-top: 14px; border-top: 1px solid var(--line); }
.pform-bulk { display: inline-flex; align-items: center; gap: 6px; }
.pform-bulk [data-lucide], .pform-bulk svg { width: 14px; height: 14px; }
.pform-bulk:hover { color: var(--ink); }
.pform-actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
/* pinned under the scrolling fields, so page or form scroll never moves the actions */
.modal-body .pform-foot { position: static; z-index: 2; margin: 0 -24px 0; padding: 14px 24px 18px; background: transparent; }
dialog.modal:focus, dialog.modal:focus-visible { outline: none; }  /* the dialog itself, not the fields inside it */
@media (max-width: 900px) {
  .pform-scroll { grid-template-columns: 1fr; }
  .modal-body .pform-scroll {
    overflow-y: auto; align-items: start; align-content: start;
    grid-template-rows: none; grid-auto-rows: max-content;
  }
  .modal-body .pform-main, .modal-body .pform-side { overflow: visible; position: static; max-height: none; }
  .modal-body .pform-main { padding-right: 4px; }
  .pform-preview { flex-direction: row; align-items: center; gap: 14px; }
  .pform-preview .product-card { width: 150px; flex-shrink: 0; }
  .pform-preview .pform-label { writing-mode: horizontal-tb; }
}
@media (max-width: 640px) {
  .pform-basics { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; }
  .pform-photo { min-height: 96px; border-radius: 16px; }
  .pform-photo__empty small { display: none; }
  .pform-preview { display: none; }  /* phones: the form itself is the preview */
  dialog.modal.remote:has(.pform) { height: 92dvh; max-height: 92dvh; overflow: hidden; }
  .modal-body .pform-foot { margin: 0 -16px 0; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); }
  .pform-bulk { display: none; }
  .pform-actions { width: 100%; margin: 0; }
  .pform-actions > * { flex: 1; }
  .pform-actions .btn.primary { flex-basis: 100%; order: -1; }
}
