:root {
  --bg: #14120f;
  --fg: #ece6d8;
  --muted: #9a917f;
  --card: #1e1b16;
  --line: #3a3428;
  --gold: #d7b15a;
  --err: #c45c4a;
  --ok: #7aa36b;
  --sans: "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.4 var(--sans); }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
main { max-width: 1180px; margin: 0 auto; padding: 20px 16px 64px; }
h1 { font-size: 1.4rem; font-weight: 600; margin: 0 0 16px; }
h2 { font-size: 1rem; margin: 0 0 8px; font-weight: 600; }

.top {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: #100e0c; position: sticky; top: 0; z-index: 5;
}
.logo { font-weight: 700; letter-spacing: .12em; color: var(--fg); }
.cats { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.cats a { padding: 6px 10px; color: var(--muted); border-radius: 4px; }
.cats a.on, .cats a:hover { color: var(--fg); background: var(--card); text-decoration: none; }
.right { display: flex; gap: 14px; align-items: center; }
.cart-link b { background: var(--gold); color: #1a1508; padding: 0 6px; border-radius: 8px; }

.toolbar, .bulk, .checkout, .login, .admin-bar, .add, .qty, .row-edit {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin: 0 0 18px;
}
.admin-bar { align-items: center; }
.admin-bar h1 { margin: 0; flex: 1; }
input, select, textarea, button {
  font: inherit; color: var(--fg); background: var(--card);
  border: 1px solid var(--line); border-radius: 4px; padding: 7px 9px;
}
input[type=number] { width: 72px; }
button { cursor: pointer; background: #2a261f; }
button.primary { background: var(--gold); color: #1a1508; border-color: var(--gold); font-weight: 600; }
button.ghost { background: transparent; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.check { flex-direction: row; align-items: center; color: var(--fg); font-size: 14px; }
.muted { color: var(--muted); }
.or { color: var(--muted); align-self: center; font-size: 12px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.banner { padding: 10px 12px; border: 1px solid var(--line); background: var(--card); }
.banner.ok { border-color: var(--ok); }
.banner.err { border-color: var(--err); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, 168px); gap: 10px; justify-content: start; }
.card { background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; width: 168px; }
.pic {
  display: flex; align-items: center; justify-content: center;
  height: 150px; background: #2a261f; cursor: zoom-in;
}
.pic img { max-width: 150px; max-height: 150px; width: auto; height: auto; }
a.pic { color: inherit; text-decoration: none; }
a.pic:hover { text-decoration: none; }
dialog.zoom {
  padding: 0; border: 1px solid var(--line); background: #100e0c;
  max-width: 96vw; max-height: 96vh;
}
dialog.zoom::backdrop { background: #000000b3; }
dialog.zoom img { display: block; max-width: 92vw; max-height: 92vh; }
.meta { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.brand { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.card h2 { font-size: 14px; font-weight: 500; margin: 0; flex: 1; }
.stock { font-size: 12px; color: var(--muted); }
.price b { font-size: 18px; }
.price span { color: var(--muted); font-size: 12px; }
.add { margin: 8px 0 0; }
.add button { flex: 1; }

.tbl { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.tbl th, .tbl td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; }
.tbl.tight td { vertical-align: middle; }
.name { font-weight: 500; }
.qty, .row-edit { margin: 0; }
.row-edit input { width: 88px; }
.checkout { max-width: 360px; flex-direction: column; align-items: stretch; }
.pages { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }

.order { border: 1px solid var(--line); padding: 12px; margin-bottom: 12px; background: var(--card); }
.order.done, .order.archived { opacity: .55; }
.order header .acts { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.tbl tr.off { opacity: .55; }
.stats {
  display: flex; flex-wrap: wrap; gap: 18px;
  margin: 0 0 22px; padding: 12px; background: var(--card); border: 1px solid var(--line);
}
.buy { margin-bottom: 28px; }
.buy .admin-bar { margin-bottom: 8px; }
.order header { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.order ul { margin: 8px 0 0; padding-left: 18px; }
.comment { color: var(--muted); margin: 8px 0 0; }

footer { padding: 20px 16px 40px; color: var(--muted); font-size: 12px; text-align: center; }
code { color: var(--gold); }
