:root {
  --bg: #faf6f0;
  --surface: #ffffff;
  --ink: #2b1d14;
  --muted: #7c6a5c;
  --line: #eadfd2;
  --brand: #7a4a2a;
  --brand-ink: #ffffff;
  --accent: #c8873f;
  --ok: #2f7a4d;
  --warn: #a5541c;
  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); }
a { color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 24px; padding-bottom: 64px; min-height: 60vh; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 600; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.inline { display: inline; }

/* header */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { font: 700 22px/1 var(--display); text-decoration: none; color: var(--brand); white-space: nowrap; }
.brand span { color: var(--accent); font-weight: 500; }
.brand.small { font-size: 18px; }
.nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: flex-end; }
.nav a, .nav .link { text-decoration: none; font-weight: 500; color: var(--ink); }
.nav a:hover, .nav .link:hover { color: var(--brand); }
.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.badge { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 10px; background: var(--brand); color: var(--brand-ink); font-size: 12px; text-align: center; }

/* buttons, forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 999px;
  background: var(--brand); color: var(--brand-ink); border: 1px solid var(--brand); font: 600 14px var(--font); text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.wide { width: 100%; margin-top: 16px; }
.row { display: flex; gap: 10px; align-items: center; margin-top: 16px; }
.row.end { justify-content: flex-end; }
input, select { font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); width: 100%; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input.qty { width: 84px; }
.form label { display: block; font-weight: 600; font-size: 13px; margin: 12px 0 6px; }
.form .btn { margin-top: 18px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cols.three { grid-template-columns: repeat(3, 1fr); }
.cols.line { grid-template-columns: 1fr 100px; margin-bottom: 8px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); margin: 16px 0 0; padding: 12px 14px 6px; }
legend { font-weight: 600; font-size: 13px; padding: 0 6px; }
details.form summary { cursor: pointer; }
.narrow { max-width: 420px; margin: 24px auto; }

/* surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.card.empty { text-align: center; padding: 40px; }
.flash { margin-top: 16px; padding: 12px 16px; border-radius: 10px; border: 1px solid; }
.flash-ok { background: #edf6ef; border-color: #cfe6d6; color: var(--ok); }
.flash-warn { background: #fbf0e8; border-color: #f0d6c3; color: var(--warn); }
.page-title { font: 700 32px/1.15 var(--display); margin: 8px 0 12px; }
.section-title { font: 600 22px var(--display); margin: 36px 0 14px; }
.lead { font-size: 17px; color: #4c3a2e; }

/* storefront */
.hero { display: grid; grid-template-columns: 1.2fr .8fr; gap: 32px; align-items: center; padding: 32px 0 8px; }
.hero h1 { font: 700 46px/1.08 var(--display); margin: 8px 0 16px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 600; color: var(--accent); margin: 0; }
.actions { display: flex; gap: 12px; margin-top: 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; font-weight: 500; font-size: 14px; }
.chip:hover, .chip.on { border-color: var(--brand); color: var(--brand); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.product { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.product-link { text-decoration: none; flex: 1; }
.product-body { padding: 14px 16px 4px; }
.product h3 { font: 600 17px/1.3 var(--display); margin: 2px 0 8px; }
.product-add { padding: 8px 16px 16px; }
.price { font-weight: 600; font-size: 16px; }
.price.big { font-size: 26px; margin: 14px 0 4px; }
.product-page { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: start; }

/* drawn product tiles */
.art { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; }
.art svg { width: 44%; }
.art svg * { fill: currentColor; }
.art svg .line { fill: none; stroke: rgba(255,255,255,.75); stroke-width: 3; stroke-linecap: round; }
.art svg .hole { fill: rgba(0,0,0,.18); }
.art-xl { border-radius: 24px; }
.art-khv { background: linear-gradient(135deg, #e9d5c0, #d7b38c); color: #5a3420; }
.art-ogt { background: linear-gradient(135deg, #e5d9cc, #c9a988); color: #6b4128; }
.art-cay { background: linear-gradient(135deg, #e6efd9, #bfd3a3); color: #3f6b2e; }
.art-pyn { background: linear-gradient(135deg, #fbefc9, #efd58a); color: #9a6a12; }
.art-kht { background: linear-gradient(135deg, #f7dccf, #e7b39b); color: #9a4a2a; }
.art-ekp { background: linear-gradient(135deg, #dfe5ea, #b9c6d1); color: #3b4d5c; }

/* tables */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { border-top: 1px solid var(--line); border-bottom: 0; font-weight: 600; }
.table .num { text-align: right; white-space: nowrap; }
.table .warn { color: var(--warn); font-weight: 600; }
.table select { padding: 5px 8px; width: auto; }
.table tr.fresh td { animation: fresh 2.4s ease-out; }
@keyframes fresh { from { background: #fff2d6; } to { background: transparent; } }
.status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #f2ebe3; }
.s-prep { background: #fff1d6; color: #8a5a00; }
.s-ship { background: #e3eefb; color: #1d5a9a; }
.s-done { background: #e4f3e9; color: var(--ok); }
.s-cancel { background: #f6e3e3; color: #9a2d2d; }

/* back office */
.subnav { display: flex; align-items: center; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.subnav a:not(.btn) { padding: 7px 12px; border-radius: 10px; text-decoration: none; font-weight: 500; }
.subnav a.on { background: #f0e6da; color: var(--brand); }
.subnav .btn { margin-left: auto; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-value { font: 700 26px var(--display); margin-top: 4px; }

/* footer */
.footer { border-top: 1px solid var(--line); background: var(--surface); padding: 28px 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.footer p { max-width: 460px; margin: 6px 0 0; color: var(--muted); font-size: 13px; }

@media (max-width: 760px) {
  .hero, .product-page, .cols, .cols.three, .footer-inner { grid-template-columns: 1fr; display: grid; }
  .hero h1 { font-size: 34px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .card { overflow-x: auto; }
  .topbar-inner { height: auto; padding: 10px 16px; flex-wrap: wrap; }
}
