/* =========================================================================
   Counter POS — static demo
   Brand: charcoal #303030 (ink), coral #EA5959, white.
   No external CSS / fonts / CDNs: everything is served from this repo.
   ========================================================================= */

@font-face {
  font-family: 'Inter Var';
  src: url('../assets/fonts/inter-latin-var.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink-950: #1c1c1c; --ink-900: #303030; --ink-800: #3b3b3b; --ink-700: #4a4a4a;
  --ink-600: #5f5f63; --ink-500: #7a7a80; --ink-400: #a1a1a7; --ink-300: #cfcfd4;
  --ink-200: #e5e5e9; --ink-100: #f0f0f2; --ink-50: #f7f7f8;
  --coral-50: #fdf2f2; --coral-100: #fbe2e2; --coral-200: #f7c4c4; --coral-300: #f19a9a;
  --coral-400: #ec7474; --coral-500: #ea5959; --coral-600: #d43f3f; --coral-700: #b23131;
  --green-50: #ecfdf5; --green-100: #d1fae5; --green-500: #10b981; --green-600: #059669; --green-700: #047857; --green-800: #065f46;
  --amber-50: #fffbeb; --amber-200: #fde68a; --amber-800: #92400e; --amber-900: #78350f;
  --sky-50: #f0f9ff; --sky-700: #0369a1;
  --shadow-card: 0 1px 2px rgb(16 16 16 / .04), 0 1px 3px rgb(16 16 16 / .06);
  --shadow-pop: 0 10px 30px -10px rgb(16 16 16 / .25);
  --radius: 12px;
  --font: 'Inter Var', 'Myanmar Text', 'Padauk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5;
  background: var(--ink-50); color: var(--ink-900);
  -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01';
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--coral-500); outline-offset: 2px; }
svg.i { width: 20px; height: 20px; flex-shrink: 0; }
svg.i-sm { width: 16px; height: 16px; }
svg.i-xs { width: 14px; height: 14px; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-500); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------- Demo ribbon ---------------- */
.demo-bar {
  display: flex; align-items: center; justify-content: center; gap: 12px; white-space: nowrap;
  height: 33px; padding: 0 16px; overflow: hidden; background: var(--ink-950); color: var(--ink-300); font-size: 12px; text-align: center;
}
.demo-bar b { color: #fff; font-weight: 600; }
.demo-bar a { color: var(--coral-300); font-weight: 600; }
.demo-bar a:hover { text-decoration: underline; }
.demo-bar button { color: var(--ink-300); text-decoration: underline; text-underline-offset: 2px; font-size: 12px; }
.demo-bar button:hover { color: #fff; }
@media (max-width: 639px) { .demo-bar > span { display: none; } }

/* ---------------- Layout ---------------- */
.shell { display: flex; min-height: 100dvh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 50; width: 256px; display: flex; flex-direction: column;
  background: var(--ink-900); transform: translateX(-100%); transition: transform .2s ease;
}
.sidebar.open { transform: none; }
.sidebar-overlay { position: fixed; inset: 0; z-index: 40; background: rgb(28 28 28 / .6); }
.brand { display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 20px; flex-shrink: 0; }
.brand svg.logo { width: 36px; height: 36px; }
.brand-name { font-size: 15px; font-weight: 800; letter-spacing: .03em; color: #fff; line-height: 1.2; }
.brand-name span { color: var(--coral-400); }
.brand-sub { font-size: 12px; color: var(--ink-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 0 12px 24px; }
.nav-section { margin: 20px 0 4px; padding: 0 12px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-500); }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 8px; margin-bottom: 1px;
  font-size: 14px; font-weight: 500; color: var(--ink-300); transition: background .15s, color .15s;
}
.nav-link svg { width: 18px; height: 18px; color: var(--ink-400); }
.nav-link:hover { background: rgb(255 255 255 / .05); color: #fff; }
.nav-link.active { background: rgb(255 255 255 / .1); color: #fff; }
.nav-link.active svg { color: var(--coral-400); }
.nav-link .soon { margin-left: auto; font-size: 10px; font-weight: 600; color: var(--ink-500); border: 1px solid var(--ink-700); border-radius: 99px; padding: 0 6px; }
.sidebar-user { border-top: 1px solid rgb(255 255 255 / .1); padding: 12px; }
.sidebar-user > div { display: flex; align-items: center; gap: 12px; padding: 8px; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 99px; background: var(--coral-500); color: #fff; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.sidebar-user .name { font-size: 14px; font-weight: 600; color: #fff; }
.sidebar-user .role { font-size: 12px; color: var(--ink-400); }
.icon-btn { display: grid; place-items: center; padding: 8px; border-radius: 6px; color: var(--ink-400); }
.icon-btn:hover { background: rgb(255 255 255 / .06); color: #fff; }

.main { flex: 1; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 16px;
  border-bottom: 1px solid var(--ink-200); background: rgb(255 255 255 / .92); backdrop-filter: blur(8px);
}
.topbar h1 { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-btn { padding: 8px; margin-left: -4px; border-radius: 8px; color: var(--ink-600); }
.menu-btn:hover { background: var(--ink-100); }
.pill { display: none; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 99px; background: var(--ink-100); font-size: 12px; font-weight: 500; color: var(--ink-700); }
.content { max-width: 1280px; margin: 0 auto; padding: 24px 16px; }
.content.full { max-width: none; padding: 0; }

@media (min-width: 640px) { .topbar { padding: 0 24px; } .content { padding: 24px; } }
@media (min-width: 768px) { .pill { display: inline-flex; } }
@media (min-width: 1024px) {
  .sidebar { position: sticky; top: 0; height: 100dvh; transform: none; }
  .sidebar-overlay, .menu-btn, .topbar .mobile-logo, .sidebar .close-btn { display: none !important; }
  .content { padding: 32px 24px; }
}

/* ---------------- Primitives ---------------- */
.card { background: #fff; border: 1px solid var(--ink-200); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--ink-100); }
.card-title { font-size: 14px; font-weight: 600; }
.card-body { padding: 20px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 8px;
  font-size: 14px; font-weight: 600; white-space: nowrap; user-select: none; transition: background .15s, border-color .15s, color .15s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 20px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--coral-500); color: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.btn-primary:not(:disabled):hover { background: var(--coral-600); }
.btn-primary:not(:disabled):active { background: var(--coral-700); }
.btn-dark { background: var(--ink-900); color: #fff; }
.btn-dark:not(:disabled):hover { background: var(--ink-800); }
.btn-secondary { background: #fff; border: 1px solid var(--ink-200); color: var(--ink-800); }
.btn-secondary:not(:disabled):hover { background: var(--ink-50); }
.btn-ghost { color: var(--ink-600); }
.btn-ghost:hover { background: var(--ink-100); color: var(--ink-900); }
.btn-danger-outline { background: #fff; border: 1px solid #fecaca; color: #b91c1c; }
.btn-danger-outline:hover { background: #fef2f2; }

.label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; color: var(--ink-700); }
.input {
  display: block; width: 100%; padding: 10px 12px; border: 1px solid var(--ink-200); border-radius: 8px; background: #fff;
  font-size: 14px; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--ink-400); }
.input:focus { outline: none; border-color: var(--coral-400); box-shadow: 0 0 0 4px var(--coral-100); }
select.input { appearance: none; padding-right: 32px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a7a80' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px; }
.help { margin-top: 4px; font-size: 12px; color: var(--ink-500); }
.search-wrap { position: relative; }
.search-wrap > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-400); pointer-events: none; }
.search-wrap .input { padding-left: 40px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-gray { background: var(--ink-100); color: var(--ink-700); }
.badge-green { background: var(--green-50); color: var(--green-700); box-shadow: inset 0 0 0 1px rgb(5 150 105 / .15); }
.badge-red { background: var(--coral-50); color: var(--coral-700); box-shadow: inset 0 0 0 1px rgb(212 63 63 / .15); }
.badge-amber { background: var(--amber-50); color: var(--amber-800); box-shadow: inset 0 0 0 1px rgb(217 119 6 / .2); }
.badge-blue { background: var(--sky-50); color: var(--sky-700); box-shadow: inset 0 0 0 1px rgb(2 132 199 / .15); }

.tab { padding: 6px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--ink-600); border: 1px solid var(--ink-200); background: #fff; white-space: nowrap; flex-shrink: 0; }
.tab:hover { background: var(--ink-100); }
.tab.active { background: var(--ink-900); border-color: var(--ink-900); color: #fff; }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.link { font-weight: 500; color: var(--coral-600); }
.link:hover { color: var(--coral-700); text-decoration: underline; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
.table th { white-space: nowrap; border-bottom: 1px solid var(--ink-200); background: rgb(247 247 248 / .7); padding: 12px 16px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-500); }
.table td { border-bottom: 1px solid var(--ink-100); padding: 12px 16px; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: rgb(247 247 248 / .6); }
.table tr.clickable { cursor: pointer; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sub { font-size: 12px; color: var(--ink-500); }
@media (max-width: 639px) { .hide-sm { display: none; } }
@media (max-width: 1023px) { .hide-md { display: none; } }

/* ---------------- Page header & stats ---------------- */
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.page-subtitle { margin-top: 4px; font-size: 14px; color: var(--ink-500); }
@media (min-width: 640px) { .page-title { font-size: 24px; } }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.grid { display: grid; gap: 16px; }
.grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-2-1, .grid-3-2 { gap: 24px; }
@media (min-width: 1024px) {
  .grid-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid-2-1 { grid-template-columns: 2fr 1fr; }
  .grid-3-2 { grid-template-columns: 3fr 2fr; }
}
.mt-6 { margin-top: 24px; }
.mb-6 { margin-bottom: 24px; }

.stat { padding: 20px; position: relative; overflow: hidden; }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-label { font-size: 14px; font-weight: 500; color: var(--ink-500); }
.stat-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--ink-100); color: var(--ink-600); }
.stat.accent .stat-icon { background: var(--coral-50); color: var(--coral-600); }
.stat-value { margin-top: 12px; font-size: 22px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat-hint { margin-top: 4px; font-size: 12px; color: var(--ink-500); }
.stat-delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; color: var(--green-600); }
.stat-delta.down { color: var(--coral-600); }
@media (min-width: 640px) { .stat-value { font-size: 26px; } }

.breakdown { display: grid; grid-template-columns: repeat(2, 1fr); }
.breakdown > div { padding: 16px 20px; }
.breakdown p:first-child { font-size: 12px; font-weight: 500; color: var(--ink-500); }
.breakdown p:last-child { margin-top: 4px; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.neg { color: var(--coral-600); }
@media (min-width: 640px) { .breakdown { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .breakdown { grid-template-columns: repeat(6, 1fr); } .breakdown > div + div { border-left: 1px solid var(--ink-100); } }

.alert-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--amber-200); background: var(--amber-50); color: var(--amber-900); font-size: 14px; }
.alert-row span { flex: 1; font-weight: 500; }

/* Bar chart */
.chart { display: flex; align-items: flex-end; gap: 4px; height: 220px; padding-top: 8px; }
.chart .col { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; height: 100%; position: relative; }
.chart .bar { width: 100%; max-width: 14px; border-radius: 3px 3px 0 0; background: var(--ink-900); transition: opacity .15s; }
.chart .bar.b2 { background: var(--coral-500); }
.chart .col:hover .bar { opacity: .8; }
.chart .col .tip {
  position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); z-index: 2; display: none;
  padding: 6px 10px; border-radius: 8px; background: var(--ink-900); color: #fff; font-size: 11px; white-space: nowrap; box-shadow: var(--shadow-pop);
}
.chart .col:hover .tip { display: block; }
.chart-x { display: flex; gap: 4px; margin-top: 8px; font-size: 11px; color: var(--ink-400); }
.chart-x span { flex: 1; text-align: center; }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--ink-500); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; background: var(--ink-900); }
.legend i.c { background: var(--coral-500); }

.meter { height: 8px; border-radius: 99px; background: var(--ink-100); overflow: hidden; }
.meter > div { height: 100%; border-radius: 99px; background: var(--ink-700); }
.meter > div.c { background: var(--coral-500); }
.rank { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 99px; background: var(--ink-100); color: var(--ink-600); font-size: 12px; font-weight: 700; flex-shrink: 0; }
.rank.first { background: var(--coral-500); color: #fff; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; }
.list-row + .list-row { border-top: 1px solid var(--ink-100); }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grow { flex: 1; min-width: 0; }

.thumb { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; font-size: 13px; font-weight: 800; flex-shrink: 0; }
.empty { display: flex; flex-direction: column; align-items: center; padding: 48px 24px; text-align: center; color: var(--ink-500); }
.empty .ic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 99px; background: var(--ink-100); margin-bottom: 12px; }
.empty b { color: var(--ink-700); font-weight: 600; font-size: 14px; }
.empty p { margin-top: 4px; font-size: 12px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--ink-100); }
.toolbar .search-wrap { flex: 1; min-width: 200px; }
.toolbar select { width: auto; min-width: 150px; }

/* ---------------- POS ---------------- */
.pos { display: flex; flex-direction: column; height: calc(100dvh - 64px - 33px); }
.pos-catalog { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.pos-head { display: flex; flex-direction: column; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--ink-200); background: #fff; }
.pos-search { display: flex; gap: 8px; }
.pos-search .search-wrap { flex: 1; }
.pos-search .input { padding-top: 12px; padding-bottom: 12px; font-size: 16px; padding-right: 64px; }
.kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); display: none; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 6px; background: var(--ink-100); font-size: 11px; font-weight: 500; color: var(--ink-500); }
@media (min-width: 640px) { .kbd { display: inline-flex; } .pos-head { padding: 12px 20px; } }
.pos-grid-wrap { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; background: var(--ink-50); }
.pos-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .pos-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .pos-grid-wrap { padding: 20px; } }
@media (min-width: 1280px) { .pos-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1536px) { .pos-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.product {
  display: flex; flex-direction: column; overflow: hidden; text-align: left; background: #fff; border: 1px solid var(--ink-200);
  border-radius: 12px; box-shadow: var(--shadow-card); transition: transform .15s, border-color .15s, box-shadow .15s;
}
.product:hover { transform: translateY(-2px); border-color: var(--coral-300); box-shadow: 0 4px 12px rgb(0 0 0 / .08); }
.product:active { transform: none; }
.product.out { opacity: .6; }
.product .ph { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; font-size: 24px; font-weight: 800; letter-spacing: .04em; }
.product .ph svg { position: absolute; inset: auto 10px 10px auto; width: 26px; height: 26px; opacity: .35; }
.product .stock { position: absolute; top: 8px; right: 8px; padding: 2px 8px; border-radius: 99px; background: rgb(255 255 255 / .92); font-size: 11px; font-weight: 600; color: var(--ink-700); }
.product.out .stock { background: var(--coral-500); color: #fff; }
.product .info { display: flex; flex-direction: column; flex: 1; padding: 12px; }
.product .nm { font-size: 14px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product .sku { margin-top: 2px; font-size: 11px; color: var(--ink-400); }
.product .price { margin-top: auto; padding-top: 8px; font-size: 16px; font-weight: 700; color: var(--coral-600); font-variant-numeric: tabular-nums; }
.product .var { font-size: 11px; color: var(--ink-500); font-weight: 500; }

.cart {
  position: fixed; inset: 0; z-index: 45; display: none; flex-direction: column; background: #fff;
}
.cart.open { display: flex; }
.cart-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--ink-200); }
.cart-head h2 { font-size: 16px; font-weight: 700; }
.cart-cust { padding: 10px 16px; border-bottom: 1px solid var(--ink-100); }
.cart-cust button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 6px 8px; border-radius: 8px; text-align: left; }
.cart-cust button:hover { background: var(--ink-50); }
.cust-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 99px; background: var(--ink-100); color: var(--ink-600); }
.cart-lines { flex: 1; min-height: 0; overflow-y: auto; }
.cart-line { padding: 12px 16px; }
.cart-line + .cart-line { border-top: 1px solid var(--ink-100); }
.cart-line .top { display: flex; align-items: flex-start; gap: 12px; }
.cart-line .top button { flex: 1; min-width: 0; text-align: left; }
.cart-line .nm { font-size: 14px; font-weight: 600; line-height: 1.3; }
.cart-line .meta { margin-top: 2px; font-size: 12px; color: var(--ink-500); }
.cart-line .meta .d { margin-left: 4px; font-weight: 500; color: var(--coral-600); }
.cart-line .lt { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cart-line .ctl { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.stepper { display: flex; align-items: center; border: 1px solid var(--ink-200); border-radius: 8px; }
.stepper button { display: grid; place-items: center; width: 36px; height: 36px; color: var(--ink-600); }
.stepper button:hover { background: var(--ink-50); }
.stepper input { width: 52px; border: 0; border-left: 1px solid var(--ink-200); border-right: 1px solid var(--ink-200); padding: 6px 0; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper input:focus { outline: none; background: var(--coral-50); }
.del-btn { margin-left: auto; padding: 8px; border-radius: 8px; color: var(--ink-400); }
.del-btn:hover { background: var(--coral-50); color: var(--coral-600); }
.cart-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; padding: 32px; text-align: center; color: var(--ink-500); }
.cart-empty .ic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 99px; background: var(--ink-100); }
.cart-empty b { margin-top: 12px; font-size: 14px; font-weight: 500; color: var(--ink-700); }
.cart-empty p { margin-top: 4px; font-size: 12px; }
.totals { padding: 12px 16px 16px; border-top: 1px solid var(--ink-200); background: rgb(247 247 248 / .6); }
.totals dl > div { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-600); padding: 2px 0; }
.totals dl > div.total { padding-top: 8px; color: var(--ink-900); align-items: baseline; }
.totals .total dt { font-size: 16px; font-weight: 700; }
.totals .total dd { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.totals .bar { display: grid; grid-template-columns: 1fr 3fr; gap: 8px; margin-top: 12px; }
.totals .bar .btn-primary { justify-content: space-between; }
.shortcuts { margin-top: 8px; text-align: center; font-size: 11px; color: var(--ink-400); display: none; }
.cart-fab {
  position: fixed; right: 16px; bottom: 16px; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px 20px 12px 16px;
  border-radius: 99px; background: var(--ink-900); color: #fff; box-shadow: var(--shadow-pop); font-weight: 600;
}
.cart-fab b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 99px; background: var(--coral-500); font-size: 14px; }
@media (min-width: 1024px) {
  .pos { flex-direction: row; }
  .cart { position: static; display: flex; width: 400px; border-left: 1px solid var(--ink-200); z-index: auto; }
  .cart .back { display: none; }
  .cart-fab { display: none; }
  .shortcuts { display: block; }
}
@media (min-width: 1280px) { .cart { width: 440px; } }

/* ---------------- Modals ---------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center;
  background: rgb(28 28 28 / .5); animation: fade .15s ease;
}
.modal {
  width: 100%; max-width: 512px; max-height: 92dvh; display: flex; flex-direction: column; background: #fff;
  border-radius: 16px 16px 0 0; box-shadow: var(--shadow-pop); animation: rise .2s ease;
}
.modal.sm { max-width: 384px; }
.modal.md { max-width: 448px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--ink-100); }
.modal-head h3 { font-size: 17px; font-weight: 700; }
.modal-body { padding: 20px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 16px 24px; border-top: 1px solid var(--ink-100); }
@media (min-width: 640px) { .modal-backdrop { align-items: center; padding: 16px; } .modal { border-radius: 16px; } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }

.due { display: flex; align-items: flex-end; justify-content: space-between; padding: 16px 20px; border-radius: 12px; background: var(--ink-900); color: #fff; }
.due small { display: block; font-size: 12px; color: var(--ink-300); }
.due .amt { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.due .rem { font-size: 18px; font-weight: 700; color: var(--coral-300); text-align: right; }
.due .rem.ok { color: #6ee7b7; }
.methods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 640px) { .methods { grid-template-columns: repeat(4, 1fr); } }
.choice { padding: 10px 8px; border-radius: 12px; border: 2px solid var(--ink-200); font-size: 14px; font-weight: 600; color: var(--ink-700); transition: border-color .15s, background .15s; }
.choice:hover { border-color: var(--ink-300); }
.choice.active { border-color: var(--coral-500); background: var(--coral-50); color: var(--coral-700); }
.amount-input { padding: 12px; text-align: right; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.change { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-radius: 12px; background: var(--green-50); color: var(--green-800); }
.change span:first-child { font-weight: 600; }
.change span:last-child { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.paylist { border: 1px solid var(--ink-200); border-radius: 12px; }
.paylist li { display: flex; align-items: center; gap: 12px; padding: 10px 16px; font-size: 14px; }
.paylist li + li { border-top: 1px solid var(--ink-100); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.err { padding: 8px 12px; border-radius: 8px; background: var(--coral-50); color: var(--coral-700); font-size: 14px; font-weight: 500; }

.success { text-align: center; padding: 24px; }
.success .ok { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto; border-radius: 99px; background: var(--green-100); color: var(--green-600); }
.success .ok svg { width: 32px; height: 32px; }
.success h3 { margin-top: 16px; font-size: 20px; font-weight: 700; }
.success .tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; text-align: left; }
.success .tiles div { padding: 16px; border-radius: 12px; background: var(--ink-50); }
.success .tiles div.g { background: var(--green-50); }
.success .tiles small { font-size: 12px; color: var(--ink-500); }
.success .tiles div.g small { color: var(--green-700); }
.success .tiles p { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.success .tiles div.g p { color: var(--green-800); }
.eyebrow { margin: 20px 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-500); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pick-list li button { display: block; width: 100%; padding: 12px 24px; text-align: left; }
.pick-list li button:hover { background: var(--ink-50); }
.pick-list li + li { border-top: 1px solid var(--ink-100); }

/* Receipt preview */
.receipt { margin: 0 auto; width: 100%; max-width: 300px; padding: 20px 18px; background: #fff; border: 1px dashed var(--ink-300); border-radius: 4px; font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 12px; line-height: 1.5; color: #111; }
.receipt.w58 { max-width: 230px; font-size: 11px; }
.receipt.a4 { max-width: 460px; font-family: var(--font); font-size: 13px; }
.receipt .c { text-align: center; }
.receipt hr { border: 0; border-top: 1px dashed #999; margin: 8px 0; }
.receipt .r { display: flex; justify-content: space-between; gap: 8px; }
.receipt .big { font-size: 15px; font-weight: 700; }
.receipt svg.logo { width: 36px; height: 36px; display: block; margin: 0 auto 6px; }

/* Toasts */
.toasts { position: fixed; top: 16px; left: 0; right: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 16px; pointer-events: none; }
@media (min-width: 640px) { .toasts { top: 112px; align-items: flex-end; padding-right: 24px; } }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; width: 100%; max-width: 384px; padding: 12px 16px; border-radius: 12px; background: var(--ink-900); color: #fff; font-size: 14px; box-shadow: var(--shadow-pop); animation: rise .2s ease; }
.toast .dot { display: grid; place-items: center; width: 20px; height: 20px; margin-top: 1px; border-radius: 99px; background: var(--green-500); flex-shrink: 0; }
.toast.error { background: #fff; color: var(--ink-900); border: 1px solid var(--coral-200); }
.toast.error .dot { background: var(--coral-500); }

/* ---------------- Login ---------------- */
.auth { min-height: calc(100dvh - 33px); display: grid; }
@media (min-width: 1024px) { .auth { grid-template-columns: 1.05fr 1fr; } }
.auth-art { display: none; position: relative; overflow: hidden; background: var(--ink-900); color: #fff; padding: 48px; flex-direction: column; justify-content: space-between; }
@media (min-width: 1024px) { .auth-art { display: flex; } }
.auth-art::before { content: ''; position: absolute; width: 520px; height: 520px; right: -160px; top: -140px; border-radius: 50%; background: radial-gradient(circle, rgb(234 89 89 / .35), transparent 65%); }
.auth-art .mark { position: absolute; right: -60px; bottom: -40px; width: 420px; height: 420px; opacity: .07; }
.auth-art h2 { position: relative; font-size: 36px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; max-width: 460px; }
.auth-art h2 span { color: var(--coral-400); }
.auth-art p.lead { position: relative; margin-top: 16px; max-width: 440px; color: var(--ink-300); font-size: 15px; }
.auth-feats { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 480px; }
.auth-feats div { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; background: rgb(255 255 255 / .06); border: 1px solid rgb(255 255 255 / .08); font-size: 13px; color: var(--ink-200); }
.auth-feats svg { color: var(--coral-400); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.auth-form > div { width: 100%; max-width: 380px; }
.auth-form .brand { padding: 0; height: auto; margin-bottom: 32px; }
.auth-form .brand-name { color: var(--ink-900); font-size: 18px; }
.auth-form h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.auth-form form { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
.roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.roles .choice { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; font-size: 13px; }
.roles .choice small { font-size: 11px; font-weight: 500; color: var(--ink-500); }
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--ink-100); font-size: 12px; color: var(--ink-600); }

/* Detail drawer */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--ink-500); }
.kv dd { text-align: right; font-weight: 500; }
.items-table td, .items-table th { padding: 8px 0; }

@media print {
  .demo-bar, .sidebar, .topbar, .modal-head, .modal-foot, .toasts { display: none !important; }
}
