@font-face {
  font-family: Montserrat;
  src: url("fonts/Montserrat-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Montserrat;
  src: url("fonts/Montserrat-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: light;
  --bg: #F4F5F7;
  --ink: #2D3E50;
  --muted: #5C6B7A;
  --paper: #FFFFFF;
  --line: #D5D8DE;
  --accent: #FF7A00;
  --accent-ink: #2D3E50;
  --clay: #5CE1E6;
  --cyan: #5CE1E6;
  --danger: #8d2e2e;
  --type-sm: 0.8rem;
  --type-body: 1rem;
  --type-md: 1.25rem;
  --type-lg: 1.5625rem;
  --shadow: 0 1px 0 rgba(45, 62, 80, 0.06);
  font-family: Montserrat, "Segoe UI", sans-serif;
  font-size: var(--type-body);
  line-height: 1.45;
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
h1 { font-size: var(--type-lg); font-weight: 700; line-height: 1.2; margin: 0.2rem 0 0.8rem; }
h2, .cat-name, .due { font-size: var(--type-md); font-weight: 700; line-height: 1.2; }
h2 { margin: 0; }
.muted, .field span { font-size: var(--type-sm); }
p { line-height: 1.45; }

.wrap { width: min(1080px, calc(100% - 1.5rem)); margin: 0 auto; padding-bottom: 3rem; }
.top { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: space-between; padding: 0.9rem 0 0.4rem; }
.logo { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); }
.logo img { display: block; height: 40px; width: auto; }
.logo-lockup { display: flex; flex-direction: column; line-height: 1.05; }
.logo-wordmark { font-weight: 700; font-size: 1.15rem; letter-spacing: -0.03em; }
.logo-tag { font-weight: 700; font-size: 0.58rem; letter-spacing: 0.14em; }
.logo-hero { align-items: center; margin: 0 0 0.75rem; }
.logo-hero img { height: 56px; width: auto; }
.logo-hero .logo-wordmark { font-size: 1.75rem; }
.logo-hero .logo-tag { font-size: 0.72rem; }
.company { font-weight: 700; font-size: var(--type-md); }
.menu-btn, .nav-toggle { display: none; }
.nav { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.nav a, .btn, button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0.45rem 0.8rem; border-radius: 8px;
  border: 1px solid transparent; text-decoration: none; background: var(--accent); color: var(--accent-ink); cursor: pointer;
}
.nav a { background: transparent; color: var(--ink); border-color: transparent; }
.nav a[aria-current="page"] { background: var(--paper); border-color: transparent; box-shadow: inset 0 -3px 0 var(--clay); }
.btn.secondary, button.secondary { background: var(--paper); color: var(--ink); border-color: var(--line); }
button.danger { background: var(--danger); color: #FFFFFF; }
.signout { margin: 0; }
.loc-form { display: flex; gap: 0.4rem; align-items: end; }
.loc-form select { min-height: 44px; }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; box-shadow: var(--shadow); }
.stack { display: grid; gap: 0.75rem; }
.narrow { max-width: 28rem; }
.center { max-width: 32rem; margin: 0 auto; }
.field { display: grid; gap: 0.3rem; }
.field span, .muted { color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="time"], input[type="date"], input[type="search"], select {
  width: 100%; min-height: 44px; padding: 0.55rem 0.7rem; border: 1px solid var(--line); border-radius: 8px; background: white;
}
.actions { display: grid; gap: 0.5rem; }
.points { margin: 1rem 0 0; padding-left: 1.1rem; }
.points li { margin: 0.35rem 0; }
.notice { background: #e7f3ee; border: 1px solid #b7d9cb; border-radius: 8px; padding: 0.7rem 0.8rem; }
.error { background: #f8ebe6; border: 1px solid #e4c2b4; border-radius: 8px; padding: 0.7rem 0.8rem; }
.stats { display: grid; gap: 0.7rem; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 0.8rem; }
.stat b { display: block; font-size: var(--type-lg); color: var(--accent); }
.head-row, .split { display: flex; justify-content: space-between; gap: 0.75rem; align-items: center; }
.list { display: grid; }
.person, .row, .item {
  display: grid; gap: 0.2rem; padding: 0.85rem 0; border-bottom: 1px solid var(--line); align-items: center;
}
.price, .num { font-variant-numeric: tabular-nums; text-align: right; }
.filters { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.filters a { text-decoration: none; color: var(--ink); border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 0.45rem 0.75rem; min-height: 44px; display: inline-flex; align-items: center; }
.filters a.on { background: var(--clay); color: var(--ink); border-color: var(--clay); }
.toolbar { display: grid; gap: 0.5rem; }
.scan video { width: 100%; max-height: 220px; background: black; border-radius: 8px; }
.ticket-bar { display: flex; justify-content: space-between; gap: 0.75rem; align-items: center; margin-top: 0.8rem; text-decoration: none; color: var(--ink); background: var(--clay); border-radius: 12px; padding: 0.85rem 1rem; }
.ticket-bar b { color: var(--ink); }
.ticket-column { display: none; }
.totals { display: grid; gap: 0.3rem; margin-top: 0.8rem; }
.totals div { display: flex; justify-content: space-between; }
.due { color: var(--accent); }
.choice { display: flex; gap: 0.55rem; align-items: center; min-height: 44px; }
.check { display: flex; gap: 0.55rem; align-items: center; }
.inline { display: grid; gap: 0.45rem; }
.sticker { display: inline-grid; justify-items: center; gap: 0.25rem; width: 11rem; margin: 0.35rem; padding: 0.6rem; border: 1px dashed var(--line); break-inside: avoid; }
.sticker svg { width: 160px; height: auto; }
.cat-name { margin: 0.85rem 0 0.25rem; }
.cat-group { margin-top: 0.35rem; }
.cat-group .cat-group { margin-left: 1rem; padding-left: 0.8rem; border-left: 3px solid var(--clay); }
.cat-tree { display: grid; gap: 0.55rem; }
.cat-branch { display: grid; gap: 0.45rem; }
.cat-children { margin-left: 1.15rem; padding-left: 0.75rem; border-left: 3px solid var(--clay); display: grid; gap: 0.45rem; }
.cat-children[hidden] { display: none !important; }
.cat-row {
  display: flex; flex-direction: column; align-items: stretch; gap: 0.55rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 0.55rem 0.7rem;
}
.cat-row.cat-head { flex-direction: row; flex-wrap: wrap; align-items: center; }
.cat-edit, .cat-add { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: end; width: 100%; }
.cat-edit .field, .cat-add .field { flex: 1 1 12rem; }
.cat-edit input, .cat-edit select, .cat-add input { min-width: 8rem; width: 100%; }
.cat-toggle, .cat-leaf { width: 44px; min-height: 44px; flex: 0 0 44px; }
.cat-toggle {
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  padding: 0;
}
.cat-leaf { display: inline-block; }
.cat-mark { display: inline-flex; align-items: center; gap: 0.35rem; }
.cat-icon { display: inline-flex; width: 28px; height: 28px; flex: 0 0 28px; align-items: center; justify-content: center; }
.cat-icon svg { width: 28px; height: 28px; display: block; }
.cat-icon-text { width: auto; min-width: 28px; font-weight: 700; }
.brand-preview { display: block; height: 40px; width: auto; background: var(--paper); }
.scheme { display: flex; gap: 0.45rem; }
.swatch { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); display: inline-block; }
.swatch-bg { background: var(--bg); }
.swatch-ink { background: var(--ink); }
.swatch-paper { background: var(--paper); }
.swatch-accent { background: var(--accent); }
.swatch-clay { background: var(--clay); }
button.ticket-row { width: 100%; justify-content: space-between; margin-top: 0.45rem; }
.ticket-stack { display: grid; gap: 0.45rem; margin-top: 0.7rem; }
.ticket-open { border: 1px solid var(--line); border-radius: 12px; padding: 0.35rem 0.7rem 0.7rem; background: var(--paper); }
.ticket-open summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.ticket-open[open] summary { margin-bottom: 0.6rem; }
.cat-head { align-items: center; }
.cat-total { margin-left: auto; font-weight: 700; }
.qty-step { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 0.35rem; align-items: stretch; }
.qty-step button { min-width: 44px; padding: 0; font-size: 1.25rem; font-weight: 700; line-height: 1; }
.qty-step input { text-align: center; }
.default-submit { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); }
.cat-name { display: flex; align-items: center; gap: 0.45rem; }
.stickers { display: flex; flex-wrap: wrap; }
code { font-family: Consolas, "Courier New", monospace; }

@media (min-width: 960px) {
  .actions.pair { grid-template-columns: max-content max-content; }
  .stats.three { grid-template-columns: repeat(3, 1fr); }
  .person, .row { grid-template-columns: 1.2fr 1.4fr auto; }
  .row.stock-row { grid-template-columns: 1.4fr auto auto auto; }
  .row.insight { grid-template-columns: 1.4fr repeat(7, max-content); }
  .item { grid-template-columns: 1fr auto auto; }
  .toolbar.sell { grid-template-columns: 1fr 1fr auto; }
  .inline.two { grid-template-columns: 1fr 1fr auto; align-items: end; }
  .sell-layout { display: grid; grid-template-columns: minmax(0, 1fr) 24rem; gap: 1rem; align-items: start; }
  .ticket-bar { display: none; }
  .ticket-column { display: block; position: sticky; top: 0.75rem; }
}

@media (max-width: 959px) {
  .menu-btn { display: inline-flex; background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
  .nav { display: none; width: 100%; }
  .nav-toggle:checked ~ .nav { display: grid; }
  .nav a, .signout { width: 100%; }
  .totals-pin { position: sticky; bottom: 0; background: var(--paper); border-top: 1px solid var(--line); padding-top: 0.7rem; }
}

.receipt {
  width: 20rem;
  max-width: 100%;
  margin: 0 auto 1rem;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem 1rem 1.4rem;
}
.receipt-logo { display: block; height: 36px; width: auto; margin: 0 auto 0.75rem; }
.receipt-company { margin: 0; text-align: center; font-size: var(--type-md); font-weight: 700; }
.receipt-meta { margin: 0.2rem 0 0; text-align: center; font-size: var(--type-sm); color: var(--muted); }
.receipt-rule { border: 0; border-top: 2px solid var(--clay); margin: 0.75rem 0; }
.receipt-lines { display: grid; grid-template-columns: 1fr auto auto; column-gap: 0.7rem; row-gap: 0.28rem; align-items: baseline; }
.receipt-lines > .receipt-rule { grid-column: 1 / -1; margin: 0.45rem 0; }
.receipt-head { font-size: var(--type-sm); color: var(--muted); }
.receipt-label { grid-column: 1 / 3; }
.receipt-item { display: flex; flex-direction: column; min-width: 0; }
.receipt-variant, .receipt-ref { font-size: var(--type-sm); color: var(--muted); }
.receipt-ref { grid-column: 1 / -1; }
.receipt-actions { display: flex; gap: 0.75rem; justify-content: center; align-items: center; }
.outbox-card { margin: 0 auto 1.5rem; max-width: 22rem; }
.board-ticket { margin-bottom: 0.75rem; }
.board-ticket summary { display: flex; flex-wrap: wrap; gap: 0.35rem 0.8rem; align-items: baseline; cursor: pointer; }
.board-ticket summary span { font-weight: 400; }
.board-line {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(8rem, 1fr) 5rem minmax(14rem, 1.15fr);
  column-gap: 0.75rem;
  align-items: center;
  margin-top: 0.7rem;
}
.board-line > span:nth-child(3) { text-align: right; }
.board-head { margin-top: 0.85rem; font-size: var(--type-sm); color: var(--muted); }
.board-action { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; justify-content: flex-end; }
.chart-card { margin: 1rem 0; }
.chart-card svg { width: 100%; height: auto; display: block; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.chart-card figcaption { font-weight: 700; margin-bottom: 0.4rem; }
.chart-bar { fill: var(--accent); }
.chart-bar-alt { fill: var(--clay); }
.chart-label { fill: var(--ink); font-size: 12px; font-family: Montserrat, "Segoe UI", sans-serif; }
.customer-pop {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  padding: 1rem;
  width: min(24rem, calc(100% - 2rem));
}
.customer-pop::backdrop { background: rgba(28, 25, 21, 0.45); }
.customer-pop .error:not(:empty) { display: block; }
.customer-pop .error:empty { display: none; }

textarea { width: 100%; min-height: 8rem; font: inherit; color: inherit; padding: 0.55rem 0.7rem; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
body.sales-page { background: #2D3E50; color: #F4F5F7; }
body.sales-page a { color: #5CE1E6; }
body.sales-page .logo,
body.sales-page .logo-wordmark { color: #FFFFFF; }
body.sales-page .logo-tag { color: #5CE1E6; }
body.sales-page .logo img { background: #FFFFFF; border-radius: 50%; }
body.sales-page .btn { background: #FF7A00; color: #2D3E50; }
.sales-top { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; padding: 1rem 0 1.25rem; border-bottom: 2px solid #5CE1E6; }
.sales-nav { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.sales-nav a:not(.btn) { color: #F4F5F7; text-decoration: none; font-weight: 700; font-size: var(--type-sm); }
.sales-hero { display: grid; gap: 0.85rem; justify-items: start; padding: 2.25rem 0 0.5rem; max-width: 40rem; }
.sales-hero h1 { margin: 0; color: #FFFFFF; }
.sales-section { padding: 2rem 0; border-top: 1px solid rgba(92, 225, 230, 0.35); }
.sales-section h2,
.sales-footer h2,
.sales-card h3,
.package-card h3 { color: #FFFFFF; }
.sales-grid, .package-grid, .quote-grid { display: grid; gap: 1.25rem 1.5rem; }
.sales-card,
.package-card { background: transparent; border: 0; border-radius: 0; padding: 0; box-shadow: none; }
.package-card .price { margin: 0.2rem 0 0.6rem; font-size: var(--type-lg); font-weight: 700; color: #FF7A00; }
.package-card ul { margin: 0; padding-left: 1.1rem; }
.sales-footer { border-top: 3px solid #5CE1E6; margin-top: 0.5rem; padding: 1.4rem 0 2rem; }
.quote-grid blockquote { margin: 0; }
.quote-grid footer { color: #5CE1E6; font-size: var(--type-sm); }
.sales-shots { display: grid; gap: 1.75rem; }
.sales-shot { margin: 0; }
.sales-shot img {
  display: block;
  width: 100%;
  height: auto;
  background: #F4F5F7;
  border: 2px solid #5CE1E6;
  border-radius: 12px;
}
.sales-shot[data-shot="receipt"] img { width: min(20rem, 100%); }
.sales-shot figcaption { margin: 0.7rem 0 0; color: #FFFFFF; font-weight: 700; font-size: var(--type-md); }
.sales-shot figcaption span { display: block; margin-top: 0.25rem; color: #F4F5F7; font-weight: 400; font-size: var(--type-body); }
@media (min-width: 800px) {
  .sales-grid, .quote-grid { grid-template-columns: 1fr 1fr; }
  .package-grid { grid-template-columns: repeat(3, 1fr); }
}

@media print {
  @page { size: 80mm auto; margin: 6mm; }
  body { background: white; }
  .top, h1, .no-print, .menu-btn, .nav, .signout, .notice, .outbox-note, .customer-pop { display: none !important; }
  .wrap { width: auto; margin: 0; }
  .receipt { width: 68mm; border: none; border-radius: 0; margin: 0; padding: 0; }
  .sticker { border: none; }
  .panel { border: none; box-shadow: none; }
}
