/* © 2026 Nexennium Soft – https://nexenniumsoft.com – Alle Rechte vorbehalten. Nutzung nur im Rahmen einer Lizenzvereinbarung; Weitergabe, Vervielfältigung und Veränderung ohne schriftliche Zustimmung sind untersagt (siehe LICENSE). */
:root {
  --ink: #14202B; --ink-2: #4A5A68; --paper: #EDF1F3; --bon: #FFFFFF; --line: #D3DBE0;
  --primary: #1F5FBF; --primary-ink: #FFFFFF;
  --open-bg: #FFF0D6; --open-ink: #8A4A00; --ok: #2D7A4D; --danger: #B3261E; --danger-bg: #FCE8E6;
  --r: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--paper);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--paper); -webkit-text-size-adjust: 100%; }
body { padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }

/* Kopfzeile */
.top { position: sticky; top: 0; z-index: 5; background: var(--ink); color: #fff; display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 6px 12px; }
.top h1 { font-size: 1.15rem; margin: 0; flex: 1; font-weight: 650; }
.top .icon-btn { color: #fff; min-width: 44px; min-height: 44px; border-radius: 10px; font-size: 1rem; }
.top .icon-btn:active { background: rgba(255,255,255,.15); }
.warn { background: var(--danger); color: #fff; padding: 10px 14px; font-weight: 600; line-height: 1.35; }
.warn small { display: block; font-weight: 400; opacity: .95; }
.page { padding: 12px 12px calc(110px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; }

/* Buttons */
.btn { min-height: 52px; padding: 0 20px; border-radius: var(--r); font-weight: 650; background: var(--bon); border: 2px solid var(--ink); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; }
.btn:active { transform: translateY(1px); }

/* Login */
.login { max-width: 380px; margin: 0 auto; padding: 18vh 20px 20px; }
.login h1 { font-size: 1.6rem; margin: 0 0 20px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea, .field select { width: 100%; min-height: 52px; padding: 10px 14px; border: 2px solid var(--line); border-radius: var(--r); background: var(--bon); }
.field input:focus, .field textarea:focus { border-color: var(--primary); outline: none; }
.err { color: var(--danger); font-weight: 600; margin: 0 0 12px; }

/* Tischübersicht */
.tables { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tbl { min-height: 96px; border-radius: var(--r); background: var(--bon); border: 2px solid var(--line); padding: 10px 8px; text-align: left; display: flex; flex-direction: column; justify-content: space-between; }
.tbl b { font-size: 1.7rem; line-height: 1; }
.tbl small { font-size: .85rem; color: var(--ink-2); font-weight: 600; }
.tbl.open { background: var(--open-bg); border-color: #E3A24A; }
.tbl.open small { color: var(--open-ink); }

/* Bon (Tischdetail & Warenkorb) – sieht aus wie ein Bonstreifen */
.bon { background: var(--bon); border-radius: 6px 6px 0 0; padding: 16px 16px 22px; margin: 4px 0 16px; position: relative;
  box-shadow: 0 1px 0 var(--line), 0 6px 14px rgba(20,32,43,.08);
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%; mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%; }
.bon h2 { font-size: 1rem; margin: 0 0 10px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.line { display: grid; grid-template-columns: 2.2em 1fr auto; gap: 4px 8px; padding: 10px 0; border-top: 1px dashed var(--line); }
.line:first-of-type { border-top: 0; }
.line .q { font-weight: 700; }
.line .nm { font-weight: 650; }
.line .opt { grid-column: 2 / 3; color: var(--ink-2); font-size: .92rem; }
.line .pr { text-align: right; font-weight: 650; }
.line .acts { grid-column: 2 / 4; display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 2px solid var(--line); font-weight: 600; font-size: .92rem; background: var(--bon); }
.chip.on { border-color: var(--primary); color: var(--primary); }
.chip.danger { border-color: var(--danger-bg); color: var(--danger); background: var(--danger-bg); }
.line.cancelled { opacity: .5; text-decoration: line-through; }
.sum { display: flex; justify-content: space-between; padding-top: 12px; margin-top: 6px; border-top: 2px solid var(--ink); font-size: 1.25rem; font-weight: 750; }
.guests { margin-top: 10px; color: var(--ink-2); }
.guests div { display: flex; justify-content: space-between; padding: 3px 0; }
.hint { color: var(--ink-2); font-size: .9rem; margin: 8px 2px; line-height: 1.4; }
.empty { text-align: center; color: var(--ink-2); padding: 28px 8px; }
.stack { display: grid; gap: 10px; }

/* Speisekarte */
.cats { position: sticky; top: 56px; z-index: 4; display: flex; gap: 8px; overflow-x: auto; padding: 10px 12px; background: var(--paper); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats .chip { flex: none; }
.items { display: grid; gap: 8px; }
.item { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px; background: var(--bon); border: 2px solid var(--line); border-radius: var(--r); text-align: left; width: 100%; font-weight: 650; }
.item span:last-child { color: var(--ink-2); font-weight: 600; }

/* Optionen-Blatt */
.scrim { position: fixed; inset: 0; background: rgba(20,32,43,.5); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--paper); width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); animation: up .18s ease-out; }
@keyframes up { from { transform: translateY(24px); opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } .btn:active { transform: none; } }
.sheet h2 { margin: 0 0 4px; font-size: 1.3rem; }
.grp { margin: 14px 0; border: 0; padding: 0; }
.grp legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.grp legend small { font-weight: 500; color: var(--ink-2); }
.opt-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; margin-bottom: 6px; border: 2px solid var(--line); border-radius: var(--r); background: var(--bon); }
.opt-row input { width: 22px; height: 22px; accent-color: var(--primary); }
.opt-row span { flex: 1; font-weight: 600; }
.opt-row em { font-style: normal; color: var(--ink-2); }
.opt-row:has(input:checked) { border-color: var(--primary); background: #EAF1FC; }
.qty { display: flex; align-items: center; gap: 14px; }
.qty button { width: 52px; height: 52px; border-radius: var(--r); border: 2px solid var(--ink); font-size: 1.5rem; font-weight: 700; background: var(--bon); }
.qty b { min-width: 2ch; text-align: center; font-size: 1.4rem; }
.row2 { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 14px 0; }

/* Warenkorb-Leiste */
.cartbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line); }
.cartbar .btn { max-width: 616px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom)); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 600; z-index: 30; max-width: 90vw; text-align: center; }
.toast.bad { background: var(--danger); }
@media (min-width: 520px) { .tables { grid-template-columns: repeat(4, 1fr); } }

/* Tischkachel mit Druckproblem */
.tbl.problem { border-color: var(--danger); }
.tbl .warnline { color: var(--danger); font-weight: 700; }

/* Verwaltung */
.page.wide { max-width: 900px; }
.sub { font-size: 1.05rem; margin: 18px 0 6px; }
.acat { background: var(--bon); border: 2px solid var(--line); border-radius: var(--r); padding: 12px; margin: 12px 0; }
.acat > header, .agroup > header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.acat header small, .agroup header small, .arow small { display: block; color: var(--ink-2); font-size: .88rem; margin-top: 2px; }
.btns { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.btns .chip { min-width: 44px; }
.item.off, .arow.off, .aopt.off { opacity: .55; }
.badge { font-style: normal; font-size: .75rem; font-weight: 700; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--line); color: var(--ink-2); }
.arow { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 60px; padding: 10px 14px; background: var(--bon); border: 2px solid var(--line); border-radius: var(--r); }
.arow.job.failed { border-color: var(--danger); background: var(--danger-bg); }
.arow.job.done small { color: var(--ok); }
.agroup { border: 2px solid var(--line); border-radius: var(--r); padding: 10px; margin: 10px 0; background: var(--bon); }
.aopt { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px dashed var(--line); }
.aopt > span:first-child { flex: 1; font-weight: 600; }
.statusbox { padding: 12px 14px; border-radius: var(--r); font-weight: 650; margin-bottom: 8px; }
.statusbox.good { background: #E4F3EA; color: var(--ok); }
.statusbox.bad { background: var(--danger-bg); color: var(--danger); }
.field small.hint { display: block; margin: 6px 2px 0; }
select { appearance: auto; }

.warntext { color: var(--danger) !important; font-weight: 600; }

/* Verwaltung: Filter, Protokoll */
.filters { display: grid; gap: 8px; grid-template-columns: 1fr; margin: 8px 0 12px; }
@media (min-width: 640px) { .filters { grid-template-columns: 2fr 1fr 1fr; } }
.filters input, .filters select, .field textarea, .field select { min-height: 48px; padding: 8px 12px; border: 2px solid var(--line); border-radius: var(--r); background: var(--bon); width: 100%; }
.arow small.detail { color: var(--ink); opacity: .8; }

/* Tische: Streifen offener Tische, bezahlt, Gang wartet */
.strip { display: flex; align-items: center; gap: 8px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip .chip { flex: none; }
.striplabel { flex: none; font-weight: 700; color: var(--ink-2); font-size: .9rem; }
.tbl.paid { background: #E4F3EA; border-color: #8CC5A2; }
.tbl.paid small { color: var(--ok); }
.tbl .gangline { color: #6A3FB5; font-weight: 700; }

/* Bon-Zeilen: Gänge, Marken, Zwischensummen */
.course { margin: 14px 0 2px; font-size: .95rem; padding-top: 10px; border-top: 2px solid var(--ink); }
.course:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.tags { grid-column: 2 / 4; display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-style: normal; font-size: .78rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #EAF1FC; color: var(--primary); margin-left: 6px; }
.tags .tag { margin-left: 0; }
.subsum { display: flex; justify-content: space-between; padding-top: 6px; color: var(--ink-2); font-weight: 600; }
.subsum.strong { color: var(--ink); font-weight: 750; }
.guests .grow { align-items: center; gap: 8px; }
.bon.pending { border: 2px dashed var(--danger); }
.acts-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* Bestellen: Suche, Notizen, Gänge */
.searchbar { position: sticky; top: 56px; z-index: 4; padding: 8px 12px 0; background: var(--paper); }
.searchbar input { width: 100%; min-height: 48px; padding: 8px 14px; border: 2px solid var(--line); border-radius: var(--r); background: var(--bon); }
.searchbar + .cats { top: 112px; }
.catname { display: block; color: var(--ink-2); font-weight: 500; font-size: .8rem; }
.notes { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 8px; }
.warn-btn { display: block; width: 100%; text-align: left; border: 0; font: inherit; }

/* Küchenmonitor */
body.kitchen-mode { background: #0F1A23; }
body.kitchen-mode .top { background: #0A1218; }
body.kitchen-mode .cats { background: #0F1A23; border-color: #223545; }
body.kitchen-mode .cats .chip { background: #172633; color: #E7EEF3; border-color: #2B4256; }
body.kitchen-mode .cats .chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.page.kitchen { max-width: none; }
.kgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.kgrid.small { opacity: .8; }
.kcard { background: #fff; color: var(--ink); border-radius: 14px; border: 4px solid #fff; display: flex; flex-direction: column; overflow: hidden; }
.kcard.warn { border-color: #E3A24A; }
.kcard.late { border-color: #E5574D; }
.kcard.cancelled-card { border-color: var(--danger); background: var(--danger-bg); }
.kcard header { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--ink); color: #fff; }
.kcard.warn header { background: #8A4A00; }
.kcard.late header { background: #B3261E; }
.kcard.done header { background: #4A5A68; }
.ktable { font-size: 1.6rem; flex: 1; }
.kbadge { font-weight: 800; padding: 3px 10px; border-radius: 999px; background: #6A3FB5; color: #fff; font-size: .9rem; font-style: normal; }
.kbadge.storno { background: var(--danger); margin-left: 8px; }
.kwait { font-weight: 700; font-size: 1.05rem; }
.kcard ul { list-style: none; margin: 0; padding: 10px 14px; display: grid; gap: 10px; flex: 1; }
.kcard li { display: grid; gap: 2px; }
.kitem { font-size: 1.45rem; font-weight: 800; line-height: 1.2; }
.kopt { font-size: 1.15rem; font-weight: 700; color: #1F5FBF; }
.knote { font-size: 1.15rem; font-weight: 800; color: #B3261E; }
.kcard li.cancelled .kitem { text-decoration: line-through; opacity: .7; }
.kcard footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px 14px; }
.kwaiter { color: var(--ink-2); font-weight: 600; }
.kcard footer .btn { min-height: 56px; min-width: 140px; font-size: 1.15rem; }
.kempty { color: #9DB0BF; font-size: 1.4rem; padding: 60px 8px; }
.kdone-h { color: #9DB0BF; }

.brand { text-align: center; margin: 28px 0 0; font-size: 14px; color: #6a7179; }
.brand a { color: inherit; font-weight: 600; }
