@font-face { font-family: "Bricolage"; src: url("fonts/bricolage.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/plexmono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/plexmono-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --bg: #E6E9EC;
  --surface: #F3F4F6;
  --ink: #1B1D21;
  --muted: #59606A;
  --line: #C8CDD3;
  --paper: #FDFCF8;
  --paper-ink: #24221E;
  --paper-muted: #706B62;
  --paper-rule: #CFC9BD;
  --mustard: #F2B01E;
  --mustard-hover: #E3A10C;
  --on-mustard: #1B1D21;
  --ketchup: #BE2F1E;
  --pickle: #3A6A30;
  --tape: #2B2D31;
  --on-tape: #F1F2F3;
  --paypal: #FFC439;
  --focus: #2F6FDB;
  --font: "Bricolage", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r-s: 6px;
  --r: 10px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171A;
    --surface: #1E2125;
    --ink: #ECEEF1;
    --muted: #9AA1AB;
    --line: #31363C;
    --ketchup: #E5604B;
    --pickle: #79B266;
    --tape: #3A3D42;
    --focus: #7FA8F0;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 64px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--font); font-variant-numeric: tabular-nums; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border: 0; border-radius: var(--r);
  font-weight: 650; text-decoration: none; line-height: 1.2;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--mustard); color: var(--on-mustard); }
.btn-primary:not(:disabled):hover { background: var(--mustard-hover); }
.btn-paypal { background: var(--paypal); color: #10213F; }
.btn-paypal:hover { filter: brightness(.96); }
.btn-ghost { background: transparent; border: 1.5px solid currentColor; }
.btn-danger { background: var(--ketchup); color: #fff; }
.btn-whatsapp { background: #1E8A4C; color: #fff; }
.btn-whatsapp:not(:disabled):hover { background: #187440; }
.btn-block { width: 100%; }
.btn-small { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: var(--r); background: transparent; }
.icon-btn:hover { background: color-mix(in srgb, currentColor 10%, transparent); }

/* ---------- Kopf ---------- */
.masthead { padding-top: 36px; padding-bottom: 28px; }
.tape {
  display: inline-block; margin-bottom: 14px; padding: 5px 14px 6px;
  background: var(--tape); color: var(--on-tape); font-weight: 600; font-size: 15px;
  transform: rotate(-1.4deg); border-radius: 2px;
  clip-path: polygon(0 4%, 2% 0, 98% 3%, 100% 0, 99% 100%, 1% 96%);
}
.masthead h1 { font-size: clamp(2.5rem, 9vw, 4.75rem); font-weight: 800; letter-spacing: -.035em; line-height: .95; max-width: 14ch; }
.masthead .info { margin-top: 14px; max-width: 60ch; color: var(--muted); font-size: 17px; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; padding-bottom: 120px; }
.layout > main { min-width: 0; }
@media (min-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; padding-bottom: 64px; }
}

/* ---------- Kategorien ---------- */
.cats {
  position: sticky; top: 0; z-index: 5; display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none;
  margin: 0 -16px; padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.cats::-webkit-scrollbar { display: none; }
.cats { scroll-behavior: smooth; }
.cats a { flex: none; padding: 4px 0; font-weight: 600; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; }
.cats a:hover, .cats a.active { color: var(--ink); border-bottom-color: var(--mustard); }

.cat { padding-top: 32px; }
.cat h2 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.cat-note { margin-top: 4px; color: var(--muted); }
.items { list-style: none; margin: 12px 0 0; padding: 0; }
.item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "text price add" "text count add";
  column-gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line);
}
.item:last-child { border-bottom: 1px solid var(--line); }
.item-text { grid-area: text; }
.item h3 { font-size: 17px; font-weight: 650; }
.item p { margin-top: 2px; color: var(--muted); font-size: 14.5px; line-height: 1.4; }
.item-price { grid-area: price; font-weight: 600; white-space: nowrap; align-self: end; }
.item-count { grid-area: count; justify-self: end; align-self: start; font: 600 13px/1.3 var(--mono); color: var(--pickle); }
.item:not(.in-cart) .item-price { grid-row: 1 / span 2; align-self: center; }
.add {
  grid-area: add; display: grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: var(--r); background: var(--mustard); color: var(--on-mustard);
}
.add:not(:disabled):hover { background: var(--mustard-hover); }
.add:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }

.notice { margin-top: 8px; padding: 14px 16px; border-radius: var(--r); background: var(--surface); border-left: 5px solid var(--ketchup); font-weight: 600; }

/* ---------- Eigene Bestellungen ---------- */
.mine { margin-bottom: 28px; padding: 18px; border-radius: var(--r); background: var(--surface); border: 1.5px solid var(--line); }
.mine h2 { font-size: 20px; font-weight: 750; margin-bottom: 6px; }
.mine-order { padding: 12px 0; border-top: 1px dashed var(--line); }
.mine-order:first-of-type { border-top: 0; padding-top: 4px; }
.mine-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.mine-items { margin-top: 4px; color: var(--muted); font-size: 14.5px; }
.mine-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.mine-foot strong { margin-right: auto; }
.status-open { color: var(--ketchup); font-weight: 650; font-size: 14px; }
.status-paid { color: var(--pickle); font-weight: 650; font-size: 14px; }

/* ---------- Bon ---------- */
.bon-wrap { position: relative; }
@media (min-width: 900px) {
  .bon-wrap { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 4px 4px 24px; margin: -4px; }
}
.bon {
  position: relative; padding: 22px 20px 26px; background: var(--paper); color: var(--paper-ink);
  font-family: var(--mono); font-size: 14.5px; line-height: 1.45;
  box-shadow: 0 1px 2px rgba(20, 20, 20, .08), 0 10px 22px -8px rgba(20, 20, 20, .22);
}
.bon::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -9px; height: 10px;
  background:
    linear-gradient(135deg, var(--paper) 50%, transparent 50%) 0 0 / 14px 10px repeat-x,
    linear-gradient(225deg, var(--paper) 50%, transparent 50%) 0 0 / 14px 10px repeat-x;
}
.bon-top { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; border-bottom: 1.5px dashed var(--paper-rule); }
.bon-top h2 { font: 600 17px/1.2 var(--mono); }
.bon-close { display: none; width: 40px; height: 40px; border: 0; background: transparent; color: var(--paper-ink); border-radius: var(--r-s); }
.bon-field { display: grid; gap: 2px; margin-top: 14px; }
.bon-field span { font-size: 13px; color: var(--paper-muted); }
.bon-field input, .bon-field textarea {
  width: 100%; padding: 6px 0; border: 0; border-bottom: 1.5px solid var(--paper-ink); border-radius: 0;
  background: transparent; color: var(--paper-ink); font: 600 16px/1.4 var(--mono); resize: vertical;
}
.bon-field textarea { font-weight: 400; font-size: 15px; }
.bon-field input::placeholder, .bon-field textarea::placeholder { color: var(--paper-muted); opacity: .7; font-weight: 400; }
.bon-field input:focus, .bon-field textarea:focus { outline: none; border-bottom-color: var(--focus); box-shadow: 0 1.5px 0 var(--focus); }
.bon-field input.invalid { border-bottom-color: var(--ketchup); box-shadow: 0 1.5px 0 var(--ketchup); }
.bon-lines { list-style: none; margin: 16px 0 0; padding: 0; }
.bon-lines li { padding: 8px 0; border-bottom: 1px dotted var(--paper-rule); }
.bon-lines li:last-child { border-bottom: 0; }
.bon-line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: baseline; }
.bon-qty { font-weight: 600; }
.bon-name { font-weight: 600; }
.bon-price { white-space: nowrap; }
.bon-opts { margin: 2px 0 0 0; padding-left: 30px; color: var(--paper-muted); font-size: 13px; }
.bon-ctrl { display: flex; gap: 6px; margin-top: 6px; padding-left: 30px; }
.bon-ctrl button {
  width: 32px; height: 28px; border: 1.5px solid var(--paper-rule); border-radius: var(--r-s);
  background: transparent; color: var(--paper-ink); font: 600 16px/1 var(--mono);
}
.bon-ctrl button:hover { border-color: var(--paper-ink); }
.bon-empty { margin-top: 18px; color: var(--paper-muted); }
.bon-sum { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; padding-top: 10px; border-top: 3px double var(--paper-ink); font-size: 17px; }
.bon-sum strong { font-size: 20px; }
.bon-note { margin-top: 18px; }
.bon-error { min-height: 1.4em; margin: 10px 0 6px; color: var(--ketchup); font-family: var(--font); font-weight: 600; font-size: 14.5px; }
.bon .btn { font-family: var(--font); }
.bon .btn-ghost { margin-top: 10px; color: var(--paper-ink); }
.bon-meta { margin-top: 14px; font-weight: 600; }
.bon-hint { margin-top: 10px; color: var(--paper-muted); font-size: 13px; }
.bon .btn-paypal { margin-top: 18px; }
.paid-tag { margin-top: 16px; color: var(--pickle); font-weight: 600; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.stamp {
  position: absolute; top: 70px; right: 16px; padding: 6px 12px; border: 3px solid var(--pickle); border-radius: 6px;
  color: var(--pickle); font: 800 22px/1 var(--font); letter-spacing: .02em; transform: rotate(-9deg);
  opacity: .88; animation: stamp .38s cubic-bezier(.2, 1.4, .4, 1) both;
}
@keyframes stamp { from { transform: rotate(-9deg) scale(1.9); opacity: 0; } to { transform: rotate(-9deg) scale(1); opacity: .88; } }
@media (prefers-color-scheme: dark) { .stamp, .bon .paid-tag { --pickle: #3A6A30; } }

/* ---------- Handy: Bon als Sheet ---------- */
.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, transparent); }
.bar .btn { width: 100%; justify-content: space-between; min-height: 52px; font-size: 16px; }
.bar .btn span:last-child { font-weight: 600; }
.pulse { animation: pulse .32s ease-out; }
@keyframes pulse { 50% { transform: scale(1.03); } }
.scrim { position: fixed; inset: 0; z-index: 25; background: rgba(10, 12, 14, .5); }

@media (max-width: 899.98px) {
  .bon-wrap {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; max-height: 92vh; overflow-y: auto;
    padding: 0 10px 24px; transform: translateY(105%); transition: transform .28s ease; visibility: hidden;
  }
  body.bon-open .bon-wrap { transform: none; visibility: visible; }
  body.bon-open { overflow: hidden; }
  .bon { border-radius: 14px 14px 0 0; padding-bottom: calc(26px + env(safe-area-inset-bottom)); }
  .bon::after { display: none; }
  .bon-close { display: grid; place-items: center; }
  .bon-wrap .bon { max-height: none; }
}
@media (min-width: 900px) { .bar, .scrim { display: none !important; } }
body.bon-open .bar { display: none; }

/* ---------- Auswahl-Dialog ---------- */
.opt {
  width: min(520px, calc(100vw - 20px)); max-height: min(88vh, 760px); padding: 0; border: 0; border-radius: 14px;
  background: var(--surface); color: var(--ink);
}
.opt::backdrop { background: rgba(10, 12, 14, .55); }
.opt form { display: flex; flex-direction: column; max-height: inherit; }
.opt-head { display: flex; justify-content: space-between; gap: 12px; padding: 18px 18px 12px; border-bottom: 1px solid var(--line); }
.opt-head h2 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.opt-head p { margin-top: 4px; color: var(--muted); font-size: 14.5px; }
.opt-groups { overflow-y: auto; padding: 4px 18px 8px; }
.opt-group { margin: 14px 0 0; padding: 0; border: 0; }
.opt-group legend { padding: 0; margin-bottom: 8px; font-weight: 700; }
.opt-group legend small { color: var(--muted); font-weight: 500; font-size: 14px; margin-left: 4px; }
.opt-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.opt-choice {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 44px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: var(--r); cursor: pointer; font-size: 15px;
}
.opt-choice input { position: absolute; opacity: 0; pointer-events: none; }
.opt-choice em { font-style: normal; color: var(--muted); font-size: 13.5px; white-space: nowrap; }
.opt-choice:hover { border-color: var(--muted); }
.opt-choice:has(input:checked) { border-color: var(--ink); background: color-mix(in srgb, var(--mustard) 28%, transparent); font-weight: 600; }
.opt-choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.opt-foot { display: flex; gap: 12px; padding: 12px 18px 0; border-top: 1px solid var(--line); }
.opt-foot .btn { flex: 1; }
.opt .bon-error { padding: 0 18px 8px; margin-top: 6px; }
.stepper { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: var(--r); }
.stepper button { width: 42px; height: 44px; border: 0; background: transparent; font-size: 20px; font-weight: 600; }
.stepper output { min-width: 24px; text-align: center; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ============================================================
   Admin
   ============================================================ */
.admin-page .masthead { padding-bottom: 8px; }
.admin-page .masthead h1 { font-size: clamp(2rem, 6vw, 3rem); max-width: none; }
.admin-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; }
.tabs { display: flex; gap: 24px; margin-top: 20px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 10px 0; font-weight: 650; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--mustard); }
.admin-main { padding-top: 24px; padding-bottom: 80px; }
.panel { margin-top: 28px; }
.panel:first-child { margin-top: 0; }
.panel > h2 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 4px; }
.panel > .lead { color: var(--muted); margin-bottom: 14px; }
.flash { margin-bottom: 18px; padding: 12px 16px; border-radius: var(--r); background: var(--surface); border-left: 5px solid var(--pickle); font-weight: 600; }
.flash.is-error { border-left-color: var(--ketchup); }

.status-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 14px 16px; border-radius: var(--r); background: var(--surface); border: 1.5px solid var(--line); }
.status-strip .state { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ketchup); }
.dot.on { background: var(--pickle); }
.status-strip form { margin-left: auto; }
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0; margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.figures div { padding: 12px 16px; box-shadow: 0 0 0 .5px var(--line); }
.figures dt { color: var(--muted); font-size: 14px; }
.figures dd { margin: 2px 0 0; font-size: 22px; font-weight: 750; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.actions form { display: contents; }
.wa-note { margin-top: 10px; color: var(--muted); font-size: 14.5px; }
.wa-hint { margin-top: 14px; padding: 12px 16px; border-radius: var(--r); background: var(--surface); border-left: 5px solid #1E8A4C; font-weight: 600; }
.wa-hint a { white-space: nowrap; }

.collect { list-style: none; margin: 0; padding: 0; font-family: var(--mono); font-size: 15px; }
.collect li { display: grid; grid-template-columns: 3.2em minmax(0, 1fr); padding: 8px 0; border-bottom: 1px dotted var(--line); }
.collect li.cat-row { display: block; padding: 16px 0 4px; border-bottom: 0; font-family: var(--font); font-weight: 750; color: var(--muted); }
.collect b { font-weight: 600; }
.collect small { display: block; color: var(--muted); font-size: 13px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { font-size: 13.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
td .sub { display: block; color: var(--muted); font-size: 13.5px; }
.paid-toggle { min-height: 34px; padding: 4px 10px; border-radius: var(--r-s); border: 1.5px solid var(--ketchup); background: transparent; color: var(--ketchup); font-weight: 650; font-size: 14px; white-space: nowrap; }
.paid-toggle.is-paid { border-color: var(--pickle); background: var(--pickle); color: #fff; }
.link-danger { border: 0; background: none; padding: 4px; color: var(--ketchup); font-weight: 600; font-size: 14px; text-decoration: underline; }
@media (max-width: 700px) {
  .orders-table thead { display: none; }
  .orders-table, .orders-table tbody { display: block; }
  .orders-table tr {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 14px; padding: 14px;
    grid-template-areas: "nr name sum" "nr items items" "nr paid del"; border-bottom: 1px solid var(--line);
  }
  .orders-table tr:last-child { border-bottom: 0; }
  .orders-table td { padding: 0; border: 0; }
  .orders-table td:nth-child(1) { grid-area: nr; }
  .orders-table td:nth-child(2) { grid-area: name; }
  .orders-table td:nth-child(3) { grid-area: items; }
  .orders-table td:nth-child(4) { grid-area: sum; }
  .orders-table td:nth-child(5) { grid-area: paid; }
  .orders-table td:nth-child(6) { grid-area: del; justify-self: end; align-self: center; }
}
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }

.form-grid { display: grid; gap: 16px; max-width: 640px; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 650; }
.field small { color: var(--muted); }
.field input, .field textarea, .field select, .menu-table input, .menu-table select, .menu-table textarea {
  width: 100%; min-height: 42px; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: var(--r-s);
  background: var(--bg); color: var(--ink);
}
.field input:focus, .field textarea:focus, .menu-table input:focus, .menu-table textarea:focus, .menu-table select:focus { outline: none; border-color: var(--focus); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; white-space: nowrap; }
.check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--pickle); }

.menu-table td { padding: 8px; }
.menu-table input.price { width: 92px; text-align: right; }
.menu-table textarea { min-height: 42px; resize: vertical; font-size: 14px; }
.menu-table .row-inactive input:not([type=checkbox]), .menu-table .row-inactive textarea { opacity: .55; }
.menu-table .groups { display: grid; gap: 4px; }
.cat-block { margin-top: 32px; }
.cat-block > form.cat-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto; gap: 8px; align-items: end; margin-bottom: 10px; }
@media (max-width: 700px) { .cat-block > form.cat-head { grid-template-columns: 1fr; } }

.login { max-width: 380px; margin: 10vh auto; padding: 0 16px; }
.login h1 { font-size: 32px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 18px; }
.gate .tape { margin-bottom: 14px; }
.gate h1 { font-size: clamp(2.2rem, 9vw, 3rem); line-height: .98; }
.gate-text { margin: -6px 0 20px; color: var(--muted); }

@media print {
  body { background: #fff; color: #000; }
  .tabs, .actions, .status-strip, .no-print, .admin-top a { display: none !important; }
  .table-wrap { border: 0; }
}
