:root {
  --ink: #17241c;
  --ink-soft: #3d4f44;
  --muted: #6b7a70;
  --line: rgba(23, 36, 28, 0.10);
  --line-strong: rgba(23, 36, 28, 0.16);
  --surface: #fffcf6;
  --surface-solid: #ffffff;
  --paper: #f3efe6;
  --paper-2: #e7efe6;
  --leaf: #1b6b3a;
  --leaf-deep: #0e3d22;
  --leaf-mid: #2f8a4e;
  --leaf-soft: #e4f0e6;
  --tomato: #c23b22;
  --citrus: #c9892b;
  --sage: #5a8f6e;
  --success: #1b6b3a;
  --danger: #c23b22;
  --warning: #c9892b;
  --teal: #1b6b3a;
  --teal-deep: #0e3d22;
  --amber: #c9892b;
  --coral: #c23b22;
  --sky: #3d7a5c;
  --shadow: 0 1px 2px rgba(23, 36, 28, 0.04), 0 10px 28px rgba(23, 36, 28, 0.06);
  --shadow-lg: 0 18px 40px rgba(14, 61, 34, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --font-display: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --font-body: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --font-brand: "Fraunces", Georgia, serif;
  --sidebar-w: 248px;
  --sidebar-collapsed: 76px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% 0%, rgba(27, 107, 58, 0.07), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(201, 137, 43, 0.08), transparent 50%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  min-height: 100vh;
  line-height: 1.5;
  letter-spacing: -0.011em;
}

a { color: var(--leaf-deep); text-decoration: none; }
a:hover { color: var(--leaf); }

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.35em;
}

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  position: fixed;
  inset: 0 auto 0 0;
  background:
    linear-gradient(180deg, rgba(61, 154, 85, 0.08), transparent 28%),
    linear-gradient(180deg, #0b1f14 0%, #10281a 55%, #0c1c13 100%);
  color: #f4f7f4;
  padding: 1.1rem 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  z-index: 40;
  box-shadow: 8px 0 28px rgba(8, 22, 14, 0.22);
  overflow: hidden;
  transition: width .2s ease, padding .2s ease;
}
.brand-link { display: flex; gap: 0.7rem; align-items: center; color: inherit; }
.brand-logo {
  width: 40px; height: 40px;
  border-radius: 11px;
  display: block;
  flex: 0 0 40px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
  background: #0e3d22;
}
.brand-text strong {
  display: block;
  font-size: 1.02rem;
  font-family: var(--font-brand);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.brand-text small { color: rgba(243, 239, 230, 0.58); font-size: 0.7rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.side-nav { margin-top: 1.15rem; display: flex; flex-direction: column; gap: 0.12rem; flex: 1; overflow: auto; }
.nav-group { display: flex; flex-direction: column; gap: 0.12rem; margin-bottom: 0.85rem; }
.nav-group-label {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(243, 239, 230, 0.38);
  padding: 0.15rem 0.7rem 0.35rem;
}
.side-nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: rgba(243, 239, 230, 0.78);
  padding: 0.58rem 0.7rem;
  border-radius: 11px;
  font-size: 0.88rem;
  font-weight: 550;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.side-nav a svg { flex: 0 0 20px; opacity: .88; }
.nav-label { overflow: hidden; }
.side-nav a:hover { background: rgba(255,255,255,0.07); color: #fff; }
.side-nav a.is-active {
  background: linear-gradient(90deg, rgba(61, 154, 85, 0.28), rgba(27, 107, 58, 0.16));
  color: #fff;
  box-shadow: inset 3px 0 0 #3d9a55;
}
.side-foot { color: rgba(243, 239, 230, 0.32); font-size: 0.72rem; padding: 0.55rem 0.7rem 0; font-weight: 600; }
.nav-badge {
  margin-left: auto; background: #c23b22; color: #fff;
  border-radius: 999px; padding: 0 7px; font-size: .66rem; font-weight: 700;
}
.nav-soon {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: 0.58rem 0.7rem; color: rgba(255,255,255,.42); font-size: .88rem; cursor: default;
}
.nav-soon em {
  font-style: normal; font-size: .65rem; font-weight: 700;
  background: rgba(255,255,255,.12); color: rgba(255,255,255,.75);
  padding: 2px 7px; border-radius: 999px;
}
.sidebar-backdrop { display: none; }

.app-main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; }

@media (min-width: 861px) {
  body.pos-page .sidebar { width: var(--sidebar-collapsed); padding: 1.1rem 0.7rem; }
  body.pos-page .app-main { margin-left: var(--sidebar-collapsed); }
  body.pos-page .sidebar:hover,
  body.pos-page .sidebar:focus-within {
    width: var(--sidebar-w);
    padding: 1.1rem 0.85rem;
  }
  body.pos-page .sidebar:not(:hover):not(:focus-within) .brand-text,
  body.pos-page .sidebar:not(:hover):not(:focus-within) .nav-label,
  body.pos-page .sidebar:not(:hover):not(:focus-within) .nav-group-label,
  body.pos-page .sidebar:not(:hover):not(:focus-within) .side-foot {
    opacity: 0;
    width: 0;
    overflow: hidden;
    pointer-events: none;
  }
  body.pos-page .sidebar:not(:hover):not(:focus-within) .side-nav a,
  body.pos-page .sidebar:not(:hover):not(:focus-within) .brand-link {
    justify-content: center;
    padding-inline: 0.45rem;
  }
}

.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.5rem 0.85rem;
  position: sticky; top: 0; z-index: 20;
  background: rgba(243, 239, 230, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
}
.topbar-title h1 { font-size: 1.35rem; margin: 0; letter-spacing: -0.035em; }
.topbar-title p { margin: 0.12rem 0 0; color: var(--muted); font-size: 0.86rem; }
.topbar-meta { display: flex; gap: 0.45rem; align-items: center; margin-left: auto; }
.shop-chip, .date-chip, .user-chip {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.38rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.shop-chip { color: var(--leaf-deep); background: var(--leaf-soft); border-color: rgba(27, 107, 58, 0.12); }
.topbar-user { display: flex; gap: 0.55rem; align-items: center; }
.nav-toggle { display: none; }

.content { padding: 0.85rem 1.5rem 2.25rem; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.2rem;
}
.panel + .panel { margin-top: 1rem; }
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 { font-size: 1.05rem; margin: 0; letter-spacing: -0.025em; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.15rem;
}
.stat {
  padding: 1.05rem 1.1rem 1.1rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--leaf);
}
.stat.amber::before { background: var(--citrus); }
.stat.coral::before { background: var(--tomato); }
.stat.teal::before { background: var(--leaf-mid); }
.stat .label { color: var(--muted); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.stat .value { font-family: var(--font-display); font-size: 1.55rem; margin-top: 0.4rem; letter-spacing: -0.04em; font-weight: 750; }
.stat.amber .value { color: #8a6210; }
.stat.teal .value { color: var(--leaf-deep); }
.stat.coral .value { color: var(--tomato); }

.grid-2 { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  border: 0; cursor: pointer;
  padding: 0.62rem 1rem;
  border-radius: 11px;
  font-family: var(--font-body);
  font-weight: 650;
  font-size: 0.88rem;
  letter-spacing: -0.01em;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, filter .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--leaf);
  color: #fff;
  box-shadow: 0 8px 18px rgba(14, 61, 34, 0.22);
}
.btn-primary:hover { background: var(--leaf-deep); }
.btn-accent {
  background: var(--leaf-deep);
  color: #fff;
  box-shadow: 0 8px 18px rgba(14, 61, 34, 0.24);
}
.btn-danger { background: var(--tomato); color: #fff; }
.btn-ghost {
  background: #fff;
  border: 1px solid var(--line-strong);
  color: var(--ink);
}
.btn-sm { padding: 0.38rem 0.68rem; font-size: 0.78rem; border-radius: 9px; }
.btn-block { width: 100%; }

.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.85rem; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.85rem; }
.form-group { margin-bottom: 0.85rem; }
.form-group label {
  display: block; margin-bottom: 0.32rem;
  font-size: 0.78rem; font-weight: 700; color: var(--ink-soft);
}
.form-control, select.form-control, textarea.form-control {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 11px;
  padding: 0.68rem 0.82rem;
  font: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus {
  border-color: rgba(27, 107, 58, 0.55);
  box-shadow: 0 0 0 4px rgba(27, 107, 58, 0.12);
}
textarea.form-control { min-height: 96px; resize: vertical; }

.table-wrap { overflow: auto; border-radius: 12px; border: 1px solid var(--line); }
table.data {
  width: 100%; border-collapse: collapse; min-width: 640px;
}
table.data th, table.data td {
  text-align: left; padding: 0.72rem 0.8rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}
table.data th {
  color: var(--muted); font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.06em; font-weight: 700;
  background: #f7f4ec;
}
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: rgba(27, 107, 58, 0.035); }
.badge {
  display: inline-flex; align-items: center;
  padding: 0.18rem 0.52rem; border-radius: 999px;
  font-size: 0.7rem; font-weight: 700;
}
.badge-ok { background: var(--leaf-soft); color: var(--leaf-deep); }
.badge-warn { background: rgba(201, 137, 43, 0.16); color: #8a6210; }
.badge-danger { background: rgba(194, 59, 34, 0.12); color: var(--tomato); }
.badge-muted { background: rgba(107, 122, 112, 0.12); color: var(--ink-soft); }

.alert {
  padding: 0.8rem 1rem; border-radius: 12px; margin-bottom: 1rem;
  border: 1px solid transparent; font-size: 0.9rem;
}
.alert-success { background: var(--leaf-soft); border-color: rgba(27, 107, 58, 0.18); color: #145c3d; }
.alert-error { background: rgba(194, 59, 34, 0.08); border-color: rgba(194, 59, 34, 0.2); color: #8a241c; }
.alert-info { background: #eef4ef; border-color: rgba(27, 107, 58, 0.14); color: #1d4a30; }

.empty {
  text-align: center; padding: 2.4rem 1rem; color: var(--muted);
}
.empty strong { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: 0.3rem; }

.toolbar { display: flex; gap: 0.65rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar .form-control { max-width: 280px; }
.actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* Auth */
body.auth-body {
  background: var(--paper);
}
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr minmax(360px, 0.95fr);
}
.auth-hero {
  position: relative;
  padding: clamp(2.2rem, 5vw, 4.2rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #f6f1e6;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 55% at 12% 18%, rgba(61, 154, 85, 0.28), transparent 58%),
    radial-gradient(ellipse 55% 45% at 88% 82%, rgba(201, 137, 43, 0.16), transparent 52%),
    linear-gradient(160deg, #0b1f14 0%, #12301d 46%, #0e3d22 100%);
}
.auth-hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cpath fill='%23ffffff' fill-opacity='.045' d='M36 8c6 8 8 16 4 22s-14 8-20 2 0-16 8-20 6-6 8-4z'/%3E%3C/svg%3E");
  background-size: 72px 72px;
  opacity: 0.9;
  pointer-events: none;
}
.auth-hero-glow {
  position: absolute;
  width: 380px; height: 380px;
  left: -70px; top: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(61, 154, 85, 0.28), transparent 68%);
  pointer-events: none;
}
.auth-hero-inner {
  position: relative; z-index: 1;
  max-width: 520px;
}
.auth-logo-wrap { margin-bottom: 1.4rem; }
.auth-logo {
  width: 72px; height: 72px;
  border-radius: 18px;
  display: block;
  object-fit: cover;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
  background: #0e3d22;
}
.auth-brand {
  font-family: var(--font-brand);
  font-size: clamp(3rem, 6.4vw, 4.6rem);
  line-height: 0.94;
  letter-spacing: -0.035em;
  margin: 0 0 0.7rem;
  color: #f6f1e6;
  font-weight: 600;
}
.auth-tagline {
  margin: 0 0 0.75rem;
  font-size: 1.12rem;
  font-weight: 600;
  color: #d7e8d4;
  max-width: 28ch;
}
.auth-support {
  margin: 0 0 1.35rem;
  font-size: 0.98rem;
  color: rgba(246, 241, 230, 0.72);
  max-width: 36ch;
  line-height: 1.55;
}
.auth-pills {
  display: flex; flex-wrap: wrap; gap: 0.45rem;
}
.auth-pill {
  border: 1px solid rgba(246, 241, 230, 0.16);
  background: rgba(255,255,255,0.06);
  color: rgba(246, 241, 230, 0.86);
  border-radius: 999px;
  padding: 0.32rem 0.7rem;
  font-size: 0.76rem;
  font-weight: 650;
}
.auth-panel {
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background:
    radial-gradient(500px 280px at 80% 10%, rgba(27, 107, 58, 0.06), transparent 60%),
    var(--paper);
}
.auth-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.8rem 1.7rem 1.55rem;
  box-shadow: var(--shadow-lg);
}
.auth-card.has-error { border-color: rgba(194, 59, 34, 0.28); }
.auth-card-brand {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}
.auth-card-logo {
  width: 42px; height: 42px;
  border-radius: 12px;
  flex: 0 0 42px;
  box-shadow: 0 6px 14px rgba(14, 61, 34, 0.16);
}
.auth-card h2 {
  font-size: 1.45rem;
  margin: 0 0 0.15rem;
  line-height: 1.15;
}
.auth-card .sub {
  color: var(--muted);
  margin: 0;
  font-size: 0.88rem;
}
.auth-form { margin-top: 0.25rem; }
.auth-form .form-control.is-invalid {
  border-color: rgba(194, 59, 34, 0.45);
  background: #fff8f7;
}
.auth-submit {
  margin-top: 0.4rem;
  padding: 0.82rem 1rem;
  font-size: 0.95rem;
}
.auth-links {
  margin-top: 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
}

/* POS */
.pos-layout {
  display: grid;
  grid-template-columns: 1.4fr 0.95fr;
  gap: 1rem;
  min-height: calc(100vh - 118px);
}
.pos-search-bar { display: flex; gap: 0.55rem; margin-bottom: 0.8rem; }
.pos-search-bar .form-control { font-size: 1rem; padding: 0.82rem 0.95rem; }
.pos-search-split { flex-wrap: wrap; }
.pos-search-split #posBarcode { flex: 0 1 220px; background: #fff; }
.pos-search-split #posSearch { flex: 1 1 180px; }
.pos-cat-row { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .8rem; }
.pos-cat-chip {
  border: 1px solid var(--line-strong); background: #fff; border-radius: 999px;
  padding: .38rem .78rem; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer;
  color: var(--ink-soft);
}
.pos-cat-chip.is-active { background: var(--leaf); color: #fff; border-color: var(--leaf); }
.product-tile.is-expired { opacity: .5; cursor: not-allowed; }
.product-tile .tile-img { width: 100%; height: 72px; object-fit: cover; border-radius: 8px; margin-bottom: .4rem; }
.purchase-row { border: 1px solid var(--line); border-radius: 12px; padding: .75rem; margin-bottom: .75rem; background: #fff; }
.prod-suggest { display: flex; flex-direction: column; gap: .25rem; margin-top: .35rem; }
.suggest-item { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: .4rem .6rem; cursor: pointer; }
.bar-chart { display: flex; align-items: flex-end; gap: .45rem; min-height: 150px; overflow-x: auto; padding-top: .5rem; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: .35rem; min-width: 36px; }
.bar-col .bar { width: 18px; background: linear-gradient(180deg, var(--leaf-mid), var(--leaf-deep)); border-radius: 6px 6px 2px 2px; }
.bar-col span { font-size: .68rem; color: var(--muted); white-space: nowrap; }
.mix-track { height: 8px; background: rgba(23,36,28,.08); border-radius: 99px; margin: .2rem 0 .7rem; overflow: hidden; }
.mix-fill { height: 100%; border-radius: 99px; background: var(--leaf); }
.mix-fill.mix-credit { background: var(--citrus); }
.mix-fill.mix-card { background: var(--sage); }
.mix-fill.mix-mixed { background: var(--tomato); }
.receipt.receipt-58 { width: 58mm; }
.product-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 0.65rem;
  max-height: calc(100vh - 232px);
  overflow: auto;
  padding-right: 0.15rem;
}
.product-tile {
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 13px;
  padding: 0.8rem 0.8rem 0.75rem;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.product-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(27, 107, 58, 0.35);
  box-shadow: var(--shadow);
}
.product-tile .name { font-weight: 700; font-size: 0.86rem; margin-bottom: 0.3rem; letter-spacing: -0.015em; }
.product-tile .meta { color: var(--muted); font-size: 0.72rem; }
.product-tile .price { margin-top: 0.5rem; color: var(--leaf-deep); font-weight: 750; font-size: 1.02rem; letter-spacing: -0.03em; }
.product-tile .price small { font-weight: 650; color: var(--muted); font-size: .72rem; }
.product-tile.is-perishable { border-color: rgba(27, 107, 58, .22); background: linear-gradient(180deg, #fff, #f4faf5); }
.cart-panel {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 5.4rem;
  max-height: calc(100vh - 6.2rem);
  overflow: hidden;
}
.cart-list { flex: 0 1 auto; overflow: auto; max-height: 22vh; }
body.pos-page .cart-panel .form-group { margin-bottom: 0.55rem; }
body.pos-page .cart-panel .form-control { padding: 0.52rem 0.7rem; }
.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem 0.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}
.cart-item .qty-row { display: flex; align-items: center; gap: 0.35rem; }
.cart-item input.qty {
  width: 72px; text-align: center; padding: 0.35rem;
  border-radius: 8px; border: 1px solid var(--line-strong);
}
.qty-presets { display: flex; gap: .3rem; margin-top: .35rem; flex-wrap: wrap; }
.qty-presets .btn { padding: .15rem .45rem; font-size: .74rem; }
.cart-totals { margin-top: auto; padding-top: 0.75rem; border-top: 1px solid var(--line); overflow: auto; }
.total-row {
  display: flex; justify-content: space-between;
  margin-bottom: 0.38rem; color: var(--ink-soft); font-size: 0.9rem;
}
.total-row.grand {
  font-family: var(--font-display);
  font-size: 1.5rem; color: var(--ink); margin-top: 0.45rem;
  font-weight: 750; letter-spacing: -0.04em;
}
.kbd {
  display: inline-block; padding: 0.08rem 0.38rem;
  border-radius: 6px; border: 1px solid var(--line);
  background: #fff; font-size: 0.7rem; color: var(--muted); font-weight: 700;
}
.shortcuts { color: var(--muted); font-size: 0.76rem; margin-top: 0.55rem; }

.age-chip {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: var(--leaf-soft);
  color: var(--leaf-deep);
  font-size: 0.7rem;
  font-weight: 700;
}
.modal-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(11, 31, 20, 0.48);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-card {
  width: min(420px, 100%);
  background: var(--surface-solid);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 1.25rem 1.35rem;
}
.modal-card h3 { margin: 0 0 .35rem; }
.modal-card .sub { color: var(--muted); margin: 0 0 1rem; font-size: .9rem; }

.inline-add { display: flex; gap: .45rem; align-items: center; }
.inline-add .form-control { flex: 1; }
.inline-add .btn { flex: 0 0 auto; min-width: 2.5rem; }
.check-inline {
  display: flex; align-items: center; gap: .5rem;
  margin: .35rem 0 .65rem; font-size: .9rem; color: var(--ink-soft);
}
.pagination {
  display: flex; align-items: center; gap: .75rem;
  margin-top: 1rem; flex-wrap: wrap;
}
.pagination .page-meta { color: var(--muted); font-size: .85rem; }
.thumb {
  width: 36px; height: 36px; object-fit: cover;
  border-radius: 8px; background: var(--leaf-soft);
  display: block;
}
.thumb-lg { width: 96px; height: 96px; border-radius: 12px; }
.thumb-empty {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--leaf-soft); display: inline-block;
}
.addon-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.15rem;
  padding: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.addon-nav-link {
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--muted);
  text-decoration: none;
}
.addon-nav-link:hover { background: var(--leaf-soft); color: var(--ink); }
.addon-nav-link.is-active {
  background: var(--leaf);
  color: #fff;
}
.gift-banner { font-weight: 700; letter-spacing: .04em; margin: 6px 0; }

.receipt {
  width: 80mm; max-width: 100%;
  font-family: "Consolas", "Courier New", ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.35;
  padding: 12px;
  background: #fff;
  color: #111;
}
.receipt h2 { font-size: 16px; text-align: center; margin: 0 0 4px; }
.receipt .center { text-align: center; }
.receipt table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.receipt td { padding: 3px 0; vertical-align: top; word-break: break-word; }
.receipt .line { border-top: 1px dashed #999; margin: 8px 0; }
.receipt .total-row {
  display: flex; justify-content: space-between;
  font-family: inherit; font-size: 12px; padding: 2px 0;
  border: 0; background: transparent;
}
.receipt .total-row.grand { font-weight: 700; margin-top: 4px; }

@media print {
  @page { size: 80mm auto; margin: 2mm; }
  .receipt.receipt-58 { width: 54mm; max-width: 54mm; }
  html, body {
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 80mm;
  }
  body * { visibility: hidden !important; }
  .receipt, .receipt * { visibility: visible !important; }
  .no-print, .sidebar, .sidebar-backdrop, .topbar, .app-shell > aside,
  .flash-wrap, nav, .btn { display: none !important; }
  .app-main, .content, main, .app-shell { margin: 0 !important; padding: 0 !important; }
  .receipt {
    position: absolute; left: 0; top: 0;
    width: 76mm; max-width: 76mm;
    margin: 0; padding: 2mm;
    background: #fff !important; color: #000 !important;
    box-shadow: none !important; border: 0 !important;
    border-radius: 0 !important;
    font-size: 11px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .receipt h2 { font-size: 14px; }
  .receipt .line { border-top-color: #000; }
}

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .pos-layout { grid-template-columns: 1fr; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-hero {
    min-height: auto;
    justify-content: flex-end;
    padding: 2.25rem 1.5rem 1.75rem;
  }
  .auth-logo { width: 64px; height: 64px; border-radius: 16px; }
  .auth-brand { font-size: clamp(2.5rem, 10vw, 3.3rem); }
  .auth-support { max-width: 42ch; }
  .auth-panel { padding: 1.25rem 1rem 2rem; align-items: start; }
}

@media (max-width: 860px) {
  .sidebar {
    width: var(--sidebar-w);
    padding: 1.1rem 0.85rem;
    transform: translateX(-105%);
    transition: transform .22s ease;
  }
  .sidebar .brand-text,
  .sidebar .nav-label,
  .sidebar .nav-group-label,
  .sidebar .side-foot {
    opacity: 1;
    width: auto;
    pointer-events: auto;
  }
  .side-nav a, .brand-link { justify-content: flex-start; }
  .sidebar.is-open { transform: none; }
  .sidebar-backdrop.is-open {
    display: block; position: fixed; inset: 0;
    background: rgba(11, 31, 20, 0.48); z-index: 35;
  }
  .app-main { margin-left: 0; }
  .nav-toggle {
    display: inline-flex;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 10px; padding: 0.45rem 0.7rem; cursor: pointer;
  }
  .form-row, .form-row-3, .grid-3 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .topbar { padding-inline: 1rem; }
  .content { padding-inline: 1rem; }
  .user-chip, .date-chip { display: none; }
}
