/* Kassensystem — Festkasse PWA — CI theme */

:root {
  --accent:      #4a4ae0;
  --accent-dark: #3535b0;
  --bg:          #f4f4f8;
  --surface:     #ffffff;
  --header-bg:   #1e1e2e;
  --header-fg:   #e8e8f0;
  --text:        #1a1a2e;
  --muted:       #6b6b8a;
  --danger:      #d62828;
  --success:     #2d9c5e;
  --border:      #d0d0e0;
  --radius:      6px;
  --shadow:      0 2px 8px rgba(0,0,0,.12);

  /* POS article-tile sizing — adjustable via Admin → Einstellungen (settings.js
     persists the chosen size per device and overrides these on :root). */
  --art-min-h:   56px;
  --art-col-min: 120px;
  --art-font:    .85rem;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* Klassen-Regeln wie `.overlay { display:flex }` schlagen sonst das UA-`[hidden]`, und ein
   `position:fixed` Overlay bleibt unsichtbar-aber-klickfangend ueber dem Kiosk liegen. */
[hidden] { display: none !important; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
}

/* Header */
header {
  background: var(--header-bg);
  color: var(--header-fg);
  padding: .75rem 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  box-shadow: var(--shadow);
}

header h1 { font-size: 1.1rem; font-weight: 600; letter-spacing: .02em; }

/* Touch-safe buttons */
button {
  min-height: 56px;
  padding: .5rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}
button:hover  { background: var(--accent-dark); }
button:active { opacity: .85; }
button.danger { background: var(--danger); }
button.ghost  { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }

/* Layout grid */
.grid {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  height: calc(100dvh - 56px);
  overflow: hidden;
}

.grid .catalog {
  flex: 1 1 60%;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .75rem;
  align-content: start;
}

/* Cart sidebar */
.cart {
  flex: 0 0 300px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.cart .cart-items { flex: 1; overflow-y: auto; padding: .75rem; }
.cart .cart-footer { padding: .75rem; border-top: 1px solid var(--border); }

/* Boot splash */
.boot {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--muted);
}

/* Login view */
.login {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem 1rem;
  max-width: 340px;
  margin: auto;
}

.login h1 { font-size: 1.4rem; font-weight: 600; }

.login-input {
  display: block;
  width: 100%;
  padding: .5rem .75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  margin-top: .25rem;
}

.pin-display {
  width: 100%;
  min-height: 48px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: .3em;
  font-size: 1.4rem;
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
  width: 100%;
}

.pin-key {
  min-height: 56px;
  font-size: 1.2rem;
  font-weight: 600;
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .12s;
}

.pin-key:hover  { background: var(--bg); }
.pin-key:active { opacity: .8; }
.pin-ok         { background: var(--accent); color: #fff; border-color: var(--accent); }
.pin-ok:hover   { background: var(--accent-dark); }

.login-error {
  color: var(--danger);
  font-size: .9rem;
  min-height: 1.2em;
}

/* ── Article Grid (kasse-article-grid) ─────────────────────────────── */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .375rem;
  padding: .5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.tab {
  min-height: 40px;
  padding: .25rem .875rem;
  font-size: .9rem;
  background: var(--bg);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
}

.tab:hover  { background: var(--border); }
.tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.art-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--art-col-min, 120px), 1fr));
  gap: .625rem;
  padding: .625rem;
  overflow-y: auto;
  align-content: start;
}

.art {
  min-height: var(--art-min-h, 56px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .2rem;
  padding: .375rem .5rem;
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--art-font, .85rem);
  line-height: 1.2;
  text-align: center;
  word-break: break-word;
}

.art:hover  { border-color: var(--accent); }
.art.fav    { background: #fffbea; border-color: #e8b400; }
.art.fav:hover { background: #fff3c0; }

.art-name   { font-weight: 500; }
.art-price  { font-size: .8rem; color: var(--muted); }

/* Sold-out articles: greyed out, name struck through, not-allowed cursor */
.art.sold-out {
  opacity: .45;
  cursor: not-allowed;
  border-color: var(--border);
  background: var(--bg);
}
.art.sold-out .art-name { text-decoration: line-through; }
.art.sold-out:hover { border-color: var(--border); background: var(--bg); }

/* ── Cart Panel (kasse-cart) ────────────────────────────────────────── */

.cart-line {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .375rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}

.cart-line > span:first-child { flex: 1; }

.cart-del {
  min-height: 32px;
  padding: 0 .5rem;
  font-size: 1rem;
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  line-height: 1;
}

.cart-del:hover { background: #ffeaea; border-color: var(--danger); }

/* Cart quantity stepper */
.cart-qty {
  display: flex;
  gap: .25rem;
}

.cart-qty-btn {
  min-height: 36px;
  min-width: 36px;
  padding: 0 .4rem;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  background: var(--bg);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
}

.cart-qty-btn:hover { background: var(--border); }

.cart-line-name  { flex: 1; }
.cart-line-price { white-space: nowrap; }

.cart-total {
  display: flex;
  justify-content: space-between;
  padding: .625rem .75rem;
  font-weight: 600;
  border-top: 2px solid var(--border);
  font-size: 1rem;
}

.pay-btn {
  width: 100%;
  min-height: 52px;
  margin-top: .5rem;
  font-size: 1.05rem;
  font-weight: 600;
  background: var(--success);
  color: #fff;
  border-radius: var(--radius);
}

.pay-btn:hover    { background: #228a50; }
.pay-btn:disabled { background: var(--muted); cursor: not-allowed; opacity: .7; }

/* ── Pay Dialog (kasse-pay-dialog) ──────────────────────────────────── */

.pay-dialog {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  padding: 1.25rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 320px;
  margin: auto;
}

.pay-dialog h2 { font-size: 1.2rem; font-weight: 600; }

.pay-method {
  min-height: 56px;
  font-size: 1rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
}

.pay-method:hover  { background: var(--accent-dark); }

.pay-cancel {
  min-height: 48px;
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
  font-size: .95rem;
}

.pay-cancel:hover { background: var(--bg); }

/* ── Festkasse orchestrator (kasse-festkasse) ───────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem 1rem;
  background: var(--header-bg);
  color: var(--header-fg);
  box-shadow: var(--shadow);
}

.topbar .brand { font-weight: 600; font-size: 1rem; flex: 1; }
.topbar .who   { font-size: .9rem; color: var(--muted); }

.topbar .logout-btn {
  min-height: 38px;
  padding: .25rem .875rem;
  font-size: .9rem;
  background: transparent;
  color: var(--header-fg);
  border: 1px solid var(--header-fg);
  border-radius: var(--radius);
}

.topbar .logout-btn:hover { background: rgba(255,255,255,.1); }

.festkasse-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0;
  height: calc(100dvh - 54px);
  overflow: hidden;
}

.festkasse-layout kasse-article-grid {
  overflow-y: auto;
  background: var(--bg);
}

.festkasse-layout kasse-cart {
  border-left: 1px solid var(--border);
  overflow-y: auto;
  background: var(--surface);
}

/* Toast (green, bottom-center) */
.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--success);
  color: #fff;
  padding: .6rem 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: .95rem;
  font-weight: 500;
  pointer-events: none;
  z-index: 900;
}

/* Error banner (red, top) */
.error-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--danger);
  color: #fff;
  padding: .6rem 1rem;
  font-size: .95rem;
  font-weight: 500;
  text-align: center;
  z-index: 901;
  box-shadow: var(--shadow);
}

/* ── Admin shell (kasse-admin) ───────────────────────────────────────── */

.admin-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

.admin-topbar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem 1rem;
  background: var(--header-bg);
  color: var(--header-fg);
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

.admin-brand { font-weight: 600; font-size: 1rem; flex: 1; }
.admin-who   { font-size: .9rem; color: var(--muted); }

.admin-logout-btn {
  min-height: 38px;
  padding: .25rem .875rem;
  font-size: .9rem;
  background: transparent;
  color: var(--header-fg);
  border: 1px solid var(--header-fg);
  border-radius: var(--radius);
}
.admin-logout-btn:hover { background: rgba(255,255,255,.1); }

/* Layout: nav + content */
.admin-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.admin-nav {
  flex: 0 0 160px;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: .75rem .5rem;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.admin-nav-btn {
  min-height: 44px;
  padding: .4rem .75rem;
  font-size: .95rem;
  font-weight: 500;
  background: transparent;
  color: var(--text);
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.admin-nav-btn:hover  { background: var(--bg); border-color: var(--border); }
.admin-nav-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Content area */
.admin-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  background: var(--bg);
}

.admin-content h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}

.admin-loading { color: var(--muted); font-size: .95rem; }
.admin-error   { color: var(--danger); font-size: .95rem; }
.admin-stub    { color: var(--muted); font-style: italic; font-size: .95rem; }

/* Admin table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.admin-table th {
  text-align: left;
  padding: .5rem .75rem;
  background: var(--header-bg);
  color: var(--header-fg);
  font-weight: 600;
  font-size: .85rem;
  white-space: nowrap;
}

.admin-table td {
  padding: .45rem .75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg); }

/* Inline price input */
.admin-price-input {
  width: 90px;
  padding: .3rem .5rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  margin-right: .375rem;
}

.btn-small {
  min-height: 34px;
  padding: .25rem .75rem;
  font-size: .85rem;
}

/* Inline message */
.admin-inline-msg       { font-size: .82rem; margin-left: .375rem; }
.admin-inline-msg.ok    { color: var(--success); }
.admin-inline-msg.error { color: var(--danger); }

/* New artikel form */
.admin-form-details {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .75rem 1rem;
}

.admin-form-details summary {
  font-weight: 600;
  cursor: pointer;
  font-size: .95rem;
  padding: .25rem 0;
}

/* Generic stacked form */
.admin-form {
  display: flex;
  flex-direction: column;
  gap: .625rem;
  max-width: 380px;
  margin-top: .75rem;
}

.admin-form-group {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.admin-form-group label  { font-size: .85rem; font-weight: 500; color: var(--muted); }

.admin-form-group input,
.admin-form-group select {
  padding: .4rem .6rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
  background: var(--surface);
  color: var(--text);
}

.admin-form-group input:focus,
.admin-form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

.admin-form-check {
  flex-direction: row;
  align-items: center;
  gap: .5rem;
}

.admin-form-check label { color: var(--text); font-weight: 400; font-size: .9rem; }

/* Stammdaten grid: card layout */
.admin-stammdaten-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.admin-stamp-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .875rem 1rem 1rem;
}

.admin-stamp-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: .5rem;
  color: var(--text);
}

/* Rollen checkboxes */
.admin-rollen-checks {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .875rem;
}

.admin-rollen-checks label {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: .9rem;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
}

/* ── Import section ──────────────────────────────────────────────────────── */

.admin-import-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem;
  max-width: 560px;
}

.admin-import-file-input {
  margin-top: .25rem;
  font-size: .9rem;
}

.admin-import-summary {
  margin-top: 1rem;
  padding: .875rem 1rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
}

.admin-import-counts {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .75rem;
}

.count-badge {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
}
.count-badge.ok   { background: #d4f0e4; color: var(--success); }
.count-badge.warn { background: #fef6e0; color: #a07800; }
.count-badge.error { background: #fde4e4; color: var(--danger); }

.admin-import-issues { margin: .5rem 0; font-size: .88rem; }
.admin-import-issues ul { margin: .25rem 0 0 1.25rem; }
.admin-import-issues li { margin-bottom: .15rem; }
.issues-error { color: var(--danger); }
.issues-warn  { color: #a07800; }

/* ── Mitglieder: generated-PIN banner (shown once) ───────────────────────── */

.admin-pin-result {
  margin: .5rem 0;
  padding: .75rem 1rem;
  background: #eef6ff;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  font-size: .92rem;
}
.admin-pin-big { margin: .35rem 0 .25rem; font-size: 1.1rem; font-weight: 600; }
.admin-pin-code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-weight: 700;
  letter-spacing: .08em;
}
.admin-pin-table { margin-top: .35rem; }

/* ── Berichte section ────────────────────────────────────────────────────── */

.admin-report-card {
  max-width: 560px;
}

.admin-zbon-result {
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
  font-size: .9rem;
}

.zbon-number { font-size: 1rem; margin-bottom: .5rem; }

.admin-dl-row {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.admin-dl-btn {
  min-height: 36px;
  padding: .3rem .9rem;
  font-size: .88rem;
  font-weight: 500;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .12s;
}
.admin-dl-btn:hover    { background: var(--accent-dark); }
.admin-dl-btn:disabled { opacity: .6; cursor: not-allowed; }

/* ── Lizenz section ──────────────────────────────────────────────────────── */

.admin-license {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem;
  max-width: 420px;
}

.admin-license dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .4rem 1.25rem;
  align-items: baseline;
  font-size: .93rem;
}

.admin-license dt {
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.admin-license dd {
  color: var(--text);
}

/* ── POS mode tabs (kasse-pos-shell) ─────────────────────────────────────── */

.pos-tabs {
  display: flex;
  gap: .375rem;
  padding: .4rem .75rem;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}

.pos-tab {
  min-height: 40px;
  padding: .3rem 1.1rem;
  font-size: .95rem;
  font-weight: 600;
  background: transparent;
  color: var(--header-fg);
  border: 1.5px solid rgba(255,255,255,.25);
  border-radius: var(--radius);
}
.pos-tab:hover  { background: rgba(255,255,255,.1); }
.pos-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Gastro: Tischplan (kasse-gastro) ────────────────────────────────────── */

.tischplan-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem .25rem;
}
.tischplan-title { font-size: 1.15rem; font-weight: 600; flex: 1; }
.btn-refresh { min-height: 40px; padding: .25rem .9rem; font-size: .9rem; }

.tisch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .75rem;
  padding: .75rem 1rem 1.25rem;
  align-content: start;
}

.tisch-tile {
  min-height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  padding: .75rem;
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.tisch-tile:hover { border-color: var(--accent); }

.tisch-nummer  { font-size: 1.05rem; font-weight: 700; }
.tisch-sektion { font-size: .8rem; color: var(--muted); }
.tisch-plaetze { font-size: .8rem; color: var(--muted); }

/* Occupied table: distinct color + running total */
.tisch-tile.belegt {
  background: #fff3c0;
  border-color: #e8b400;
}
.tisch-tile.belegt:hover { background: #ffeca0; border-color: #c99a00; }
/* Idle-table reminder: occupied table with no new order for a while pulses. */
@keyframes kasse-tisch-blink {
  0%, 100% { background: #ffe79a; border-color: #c99a00; }
  50%      { background: #ff9d9d; border-color: #d23b3b; }
}
.tisch-tile.belegt.blinkt { animation: kasse-tisch-blink 1s ease-in-out infinite; }
.settings-inline { display: flex; align-items: center; gap: .6rem; font-weight: 500; }
.settings-num { width: 6rem; padding: .35rem .5rem; font-size: 1rem; }
/* Artikel-Liste: deaktivierte (inaktive) Zeilen ausgrauen + optional ausblenden */
.admin-table tr.inactive > td { opacity: .5; }
.admin-table.hide-inactive tr.inactive { display: none; }
.admin-filter-row { display: inline-flex; align-items: center; gap: .4rem; margin: 0 0 .6rem; font-size: .9rem; color: var(--muted, #6b6b8a); cursor: pointer; }
.tisch-summe { font-size: 1rem; font-weight: 700; color: var(--accent-dark); }

.tisch-empty, .tab-empty, .modifier-empty {
  color: var(--muted);
  font-size: .95rem;
  padding: .5rem 0;
}

/* ── Gastro: running tab (Screen 2) ──────────────────────────────────────── */

.bon-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.btn-back   { min-height: 40px; padding: .25rem .9rem; font-size: .9rem; }
.bon-tisch  { font-size: 1.05rem; font-weight: 700; flex: 1; }
.bon-summe  { font-size: 1.15rem; font-weight: 700; color: var(--accent-dark); }

.gastro-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  height: calc(100dvh - 54px - 49px);
  overflow: hidden;
}
.gastro-layout kasse-article-grid {
  overflow-y: auto;
  background: var(--bg);
}

.tab-side {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}

.tab-positions {
  flex: 1;
  overflow-y: auto;
  padding: .75rem;
}

.tab-line {
  padding: .4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}
.tab-line-head {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.tab-line-name  { flex: 1; }
.tab-line-price { white-space: nowrap; font-variant-numeric: tabular-nums; }

.tab-line-storno {
  min-height: 30px;
  min-width: 30px;
  padding: 0 .45rem;
  font-size: 1rem;
  line-height: 1;
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.tab-line-storno:hover { background: #ffeaea; border-color: var(--danger); }

.tab-line-mod {
  font-size: .8rem;
  color: var(--muted);
  padding-left: .75rem;
}

.tab-line-badge {
  font-size: .75rem;
  color: var(--success);
  font-weight: 600;
  margin-top: .15rem;
}

/* Sent lines: subtle green tint; storno'd lines dimmed + struck */
.tab-line.sent     { background: #f1faf4; }
.tab-line.storniert {
  opacity: .5;
}
.tab-line.storniert .tab-line-name { text-decoration: line-through; }

.tab-actions {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: .75rem;
  border-top: 2px solid var(--border);
}

.btn-fire {
  min-height: 50px;
  font-size: 1rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
}
.btn-fire:hover { background: var(--accent-dark); }
.btn-split { min-height: 46px; font-size: .95rem; }

/* ── Modal backdrop (modifier + split) ───────────────────────────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 950;
  padding: 1rem;
}

.modifier-dialog, .split-panel {
  width: 100%;
  max-width: 420px;
  max-height: 85dvh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.modifier-title { font-size: 1.2rem; font-weight: 600; }
.modifier-gruppe-name { font-size: .95rem; color: var(--text); }
.modifier-hint { font-size: .82rem; color: var(--muted); margin-left: .375rem; }

.modifier-opts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .5rem;
}

.modifier-opt {
  min-height: 52px;
  padding: .5rem;
  font-size: .9rem;
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
}
.modifier-opt:hover    { border-color: var(--accent); }
.modifier-opt.selected { background: var(--accent); color: #fff; border-color: var(--accent); }

.modifier-actions, .split-actions {
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
}
.modifier-confirm, .split-confirm {
  min-height: 48px;
  font-size: 1rem;
  font-weight: 600;
  background: var(--success);
  color: #fff;
  border-radius: var(--radius);
}
.modifier-confirm:hover    { background: #228a50; }
.modifier-confirm:disabled { background: var(--muted); cursor: not-allowed; opacity: .7; }

/* ── Split panel ─────────────────────────────────────────────────────────── */

.split-panel h2 { font-size: 1.2rem; font-weight: 600; }
.split-hint { font-size: .9rem; color: var(--muted); }

.split-list {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.split-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem .5rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  cursor: pointer;
}
.split-row:hover { border-color: var(--accent); }
.split-row > span:nth-child(2) { flex: 1; }
.split-price { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); }
.split-cb { min-height: auto; width: 18px; height: 18px; }

/* ── Shop (kasse-shop) ───────────────────────────────────────────────────── */

.scan-bar {
  display: flex;
  padding: .6rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.scan-input {
  flex: 1;
  min-height: 48px;
  padding: .5rem .875rem;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
.scan-input:focus { outline: none; border-color: var(--accent-dark); box-shadow: 0 0 0 3px rgba(74,74,224,.15); }

/* shop layout leaves room for the scan bar (54px topbar + ~62px scan bar) */
.shop-layout { height: calc(100dvh - 116px - 64px); }

.shop-actions {
  display: flex;
  gap: .5rem;
  padding: .6rem 1rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.shop-action {
  min-height: 48px;
  padding: .5rem 1rem;
  font-size: .95rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
}
.shop-action:hover { background: var(--accent-dark); }
.shop-action.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.shop-action.ghost:hover { background: var(--bg); }

/* Gutschein "read the code to the customer" dialog */
.gutschein-panel {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  text-align: center;
}
.gutschein-panel h2 { font-size: 1.2rem; font-weight: 600; }
.gutschein-hint { font-size: .9rem; color: var(--muted); }
.gutschein-code {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: .15em;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: var(--accent-dark);
  background: var(--bg);
  padding: .75rem;
  border-radius: var(--radius);
  user-select: all;
  word-break: break-all;
}
.gutschein-ok {
  min-height: 48px;
  font-size: 1rem;
  font-weight: 600;
  background: var(--success);
  color: #fff;
  border-radius: var(--radius);
}
.gutschein-ok:hover { background: #228a50; }

/* ── Admin: Lager card ───────────────────────────────────────────────────── */

.admin-lager-card .lager-row input { font-variant-numeric: tabular-nums; }
.nachbestellung h4 { color: var(--danger); }
.nachbestellung .warn td { background: #fde4e4; color: var(--danger); }
.nachbestellung .warn td strong { color: var(--danger); }

/* ── Admin shell polish ──────────────────────────────────────────────────── */

.admin-topbar { background: linear-gradient(90deg, var(--accent-dark) 0%, var(--header-bg) 55%); }

.admin-brand-wrap { display: flex; align-items: center; gap: .6rem; flex: 1; }

.admin-brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; min-width: 30px;
  border-radius: 8px;
  background: var(--accent); color: #fff;
  font-weight: 800; font-size: 1rem; line-height: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
}

.admin-brand { line-height: 1.15; }
.admin-brand-sub {
  display: block; margin-top: 1px;
  font-size: .68rem; font-weight: 400; letter-spacing: .04em;
  color: rgba(255,255,255,.55);
}

.admin-nav { flex-basis: 200px; gap: .15rem; padding: .85rem .6rem; }

.admin-nav-group-label {
  font-size: .67rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted);
  padding: .7rem .65rem .2rem;
}
.admin-nav-group-label:first-child { padding-top: .15rem; }

.admin-nav-btn { display: flex; align-items: center; gap: .55rem; }
.admin-nav-btn .nav-ico { font-size: 1.05rem; width: 1.4rem; text-align: center; flex-shrink: 0; }

.admin-section-intro {
  color: var(--muted); font-size: .9rem;
  margin: -.6rem 0 1.1rem; max-width: 64ch; line-height: 1.45;
}

.admin-stamp-card { transition: border-color .12s, box-shadow .12s; }
.admin-stamp-card:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(74,74,224,.14); }

/* ── Admin: Einstellungen section ────────────────────────────────────────── */

.settings-card { max-width: 660px; }
.settings-label { font-weight: 600; font-size: 1.02rem; margin-bottom: .2rem; }
.settings-desc  { color: var(--muted); font-size: .85rem; line-height: 1.45; margin-bottom: .9rem; }

.btnsize-presets { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.1rem; }

.btnsize-chip {
  min-height: 44px; padding: .4rem 1.15rem;
  font-size: .95rem; font-weight: 600;
  background: var(--surface); color: var(--text);
  border: 2px solid var(--border); border-radius: 999px;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.btnsize-chip:hover  { border-color: var(--accent); }
.btnsize-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.btnsize-preview {
  border: 1.5px dashed var(--border); border-radius: var(--radius);
  background: var(--bg); padding: 1rem;
}
.btnsize-preview-label {
  font-size: .72rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .07em; margin-bottom: .6rem;
}
.btnsize-preview .art-grid { padding: 0; }

/* ── Row-click editing (Artikel / Tische / Lager) ─────────────────────────── */

.admin-table tr.row-edit { cursor: pointer; }
.admin-table tr.row-edit:hover td { background: #eef0ff; }
.admin-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table td.row-actions { text-align: right; white-space: nowrap; }

.admin-edit-dialog {
  width: 100%;
  max-width: 460px;
  max-height: 88dvh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}
.admin-edit-dialog h2 { font-size: 1.15rem; font-weight: 600; margin-bottom: .75rem; }
.admin-edit-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: .25rem; }

/* ── Selbstbedienung (member kiosk, <kasse-selfservice>) ──────────────── */

/* Screen 1: login — centered, big touch targets (reuses .login-input/.pin-*). */
.selfservice-login {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  padding: 2rem 1rem;
  max-width: 420px;
  margin: auto;
}
.selfservice-login .ss-title { font-size: 1.9rem; font-weight: 700; }
.selfservice-login .ss-label { width: 100%; font-size: 1rem; font-weight: 500; }
.selfservice-login .login-input { font-size: 1.3rem; padding: .65rem .85rem; }
.selfservice-login .pin-display { min-height: 56px; font-size: 1.7rem; }
.selfservice-login .pin-key { min-height: 64px; font-size: 1.35rem; }

/* Selbstbedienung login: Benutzer-Nr + PIN both filled via the on-screen pad */
.ss-login-hint { color: var(--muted); font-size: .9rem; text-align: center; margin: -.5rem 0 0; }
.ss-fields { display: flex; flex-direction: column; gap: .6rem; width: 100%; }
.ss-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  width: 100%;
  min-height: 60px;
  padding: .5rem 1rem;
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
}
.ss-field:hover { border-color: var(--accent); }
.ss-field.active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74, 74, 224, .15); }
.ss-field-label { font-size: .85rem; color: var(--muted); font-weight: 500; }
.ss-field-val {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: .18em;
  min-height: 1.4em;
  font-variant-numeric: tabular-nums;
}

.ss-exit {
  position: absolute;
  top: .5rem;
  left: .5rem;
  min-height: 38px;
  padding: .25rem .875rem;
  font-size: .9rem;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
.ss-exit:hover { background: var(--bg); }

/* "Selbstbedienung" entry button on the staff login screen. */
.ss-enter-btn {
  width: 100%;
  min-height: 56px;
  font-size: 1.15rem;
  font-weight: 600;
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  margin-top: .5rem;
}
.ss-enter-btn:hover { filter: brightness(1.05); }

/* Screen 2: buchen — reuses .topbar/.festkasse-layout/.art-grid/.cart. */
.selfservice-buchen .topbar .brand { font-size: 1.15rem; }
.selfservice-buchen .topbar .who { color: var(--header-fg); font-weight: 600; font-size: 1rem; }

.ss-cart-wrap {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}
.ss-cart-wrap kasse-cart { flex: 1; overflow-y: auto; }

.ss-buchen-btn {
  min-height: 72px;
  font-size: 1.4rem;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  border: none;
  border-top: 1px solid var(--accent-dark);
  cursor: pointer;
}
.ss-buchen-btn:hover  { background: var(--accent-dark); }
.ss-buchen-btn:active { opacity: .9; }

/* Guthaben-Self-Load per Karte */
.ss-aufladen-btn {
  min-height: 56px;
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--surface);
  color: var(--accent);
  border: 2px solid var(--accent);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.ss-aufladen-btn:hover  { background: var(--accent); color: #fff; }
.ss-aufladen-btn:active { opacity: .9; }

.ss-aufladen-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .55);
}
.ss-aufladen-box {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  align-items: center;
  text-align: center;
  padding: 1.5rem;
  min-width: 300px;
  max-width: 92vw;
  background: var(--surface);
  border-radius: var(--radius);
}
.ss-aufladen-box h2 { font-size: 1.2rem; font-weight: 600; }
.ss-aufladen-qr { width: 220px; height: 220px; }
.ss-aufladen-url { word-break: break-all; font-size: .9rem; }
.ss-aufladen-status { min-height: 1.3em; font-weight: 600; }
.ss-aufladen-status.error { color: var(--danger); }
.ss-aufladen-abort {
  min-height: 48px;
  padding: 0 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}

/* ── Saalplan editor + visual gastro plan ────────────────────────────────── */

.saal-toolbar {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  padding: .5rem 0 .75rem;
}
.saal-toolbar .btn-small { min-height: 40px; }
.saal-hint { color: var(--muted); font-size: .85rem; }

.saal-canvas-wrap {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: auto;          /* scroll when the plan is larger than the viewport */
  max-width: 100%;
  max-height: 70vh;
  padding: 4px;
}

.saal-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 39px, #eef0f6 39px, #eef0f6 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, #eef0f6 39px, #eef0f6 40px);
  touch-action: none;      /* let pointer drag work on touch without scrolling */
}

.saal-tisch { cursor: move; }
.saal-tisch.plan { cursor: pointer; }
.saal-tisch-shape {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 2;
}
.saal-tisch:hover .saal-tisch-shape { fill: #eef0ff; }
.saal-tisch-label {
  font-size: 18px;
  font-weight: 700;
  fill: var(--text);
  pointer-events: none;
}
.saal-tisch-seats {
  font-size: 11px;
  fill: var(--muted);
  pointer-events: none;
}
.saal-tisch-summe {
  font-size: 13px;
  font-weight: 700;
  fill: var(--accent-dark);
  pointer-events: none;
}

/* Occupied table on the gastro plan: amber, mirrors .tisch-tile.belegt */
.saal-tisch.belegt .saal-tisch-shape {
  fill: #fff3c0;
  stroke: #e8b400;
}
.saal-tisch.belegt:hover .saal-tisch-shape { fill: #ffeca0; stroke: #c99a00; }
@keyframes kasse-shape-blink {
  0%, 100% { fill: #ffe79a; stroke: #c99a00; }
  50%      { fill: #ff9d9d; stroke: #d23b3b; }
}
.saal-tisch.belegt.blinkt .saal-tisch-shape { animation: kasse-shape-blink 1s ease-in-out infinite; }

.saal-edit-backdrop .admin-edit-dialog { max-width: 360px; }

/* ── Free annotation elements (shapes / text / doors / windows) ───────────── */
/* Base: draggable in the editor, light wall stroke, transparent fill. */
.saal-elem { cursor: move; }
.saal-elem rect:not(.saal-elem-hit),
.saal-elem ellipse,
.saal-elem line,
.saal-elem path {
  fill: none;
  stroke: #555;
  stroke-width: 3;
}
.saal-elem:hover rect:not(.saal-elem-hit),
.saal-elem:hover ellipse,
.saal-elem:hover line,
.saal-elem:hover path { stroke: var(--accent); }

/* Walls (rectangle/line) read a touch heavier. */
.saal-elem.rechteck rect:not(.saal-elem-hit) { fill: rgba(120, 120, 120, .06); }
.saal-elem.linie line { stroke-width: 6; stroke-linecap: round; }

/* Text labels. */
.saal-elem.text text {
  font-size: 16px;
  font-weight: 600;
  fill: #333;
  stroke: none;
}

/* Transparent grab/click area covering each element's bounding box (editor only). */
.saal-elem-hit { fill: transparent; stroke: none; }

/* Door: solid leaf (open position) + dashed quarter-circle swing arc. */
.saal-elem.tuer .saal-elem-door-leaf { stroke: #555; stroke-width: 6; stroke-linecap: round; fill: none; }
.saal-elem.tuer .saal-elem-door-arc { stroke: #999; stroke-width: 2; stroke-dasharray: 4 3; fill: none; }

/* Window: wall frame with a light-blue glass fill + double glazing line. */
.saal-elem.fenster .saal-elem-window-frame {
  fill: rgba(120, 190, 235, .35);
  stroke: #3a86b5;
  stroke-width: 3;
}
.saal-elem.fenster .saal-elem-window-glass { stroke: #3a86b5; stroke-width: 1.5; }

/* In the gastro plan the whole annotation layer is non-interactive. */
.saal-elem-layer, .saal-elem-layer * { pointer-events: none; }
.saal-elem-layer .saal-elem { cursor: default; }

.saal-elem-tools {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
  padding-left: .25rem;
  border-left: 1px solid var(--border);
}
.saal-elem-label { color: var(--muted); font-size: .85rem; font-weight: 600; }

.admin-saal-editor-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .75rem;
}

.toast.toast-error { background: var(--danger); }

/* ── Bank & Buchhaltung section ──────────────────────────────────────────── */
.bank-subtabs {
  display: flex;
  gap: .4rem;
  margin: .25rem 0 1rem;
  flex-wrap: wrap;
}
.bank-tab {
  padding: .4rem .9rem;
  min-height: 0;                 /* override global button min-height:56px → compact pill */
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);            /* global `button` sets color:#fff → invisible on a light pill; force readable */
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.bank-tab:hover {
  background: var(--bg);
  color: var(--accent);
  border-color: var(--accent);
}
.bank-tab.active,
.bank-tab.active:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.admin-table td.bank-credit { color: var(--success); font-weight: 600; }
.admin-table td.bank-debit  { color: var(--muted, #888); }
.admin-table td.konto-saldo.guthaben,
.konto-saldo.guthaben { color: var(--success); }
.admin-bank-summary { margin: 0 0 .75rem; }

.admin-toast-host {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: .4rem;
  z-index: 1000;
  pointer-events: none;
}
.admin-toast {
  background: var(--success);
  color: #fff;
  padding: .6rem 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: .95rem;
  font-weight: 500;
  opacity: 1;
  transition: opacity .35s ease;
}
.admin-toast.error { background: var(--danger); }
.admin-toast.leaving { opacity: 0; }

/* ── Stammdaten: tabbed editable lists ───────────────────────────────────── */
/* Sub-tab pills reuse .bank-subtabs/.bank-tab; .admin-subtabs is an alias so the
   markup reads intent-fully. The list table + "+ Neu anlegen" <details> reuse the
   existing .admin-table / .admin-form-details styles — only spacing is added. */
.admin-subtabs { margin-bottom: 1rem; }
.stamm-panel > .admin-table { margin-bottom: 1rem; }
.stamm-panel .admin-form-details { margin-top: .25rem; }
/* keep per-row action buttons from touching when a row has several */
.admin-table td.row-actions > * + * { margin-left: .4rem; }

/* ── Reservierungen ──────────────────────────────────────────────────────────── */
/* Status pill reuses .count-badge tones (ok/warn/error); res-badge just tightens it. */
.res-badge { white-space: nowrap; }

/* Reserved table on the gastro grid: a distinct violet corner mark + small label.
   Independent of .belegt so an occupied-AND-reserved tile shows both signals. */
.tisch-tile.reserviert {
  border-color: #7c5cff;
  box-shadow: inset 0 0 0 1px #7c5cff;
  position: relative;
}
.tisch-tile.reserviert::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #7c5cff;
}
.tisch-reserviert {
  font-size: .72rem;
  font-weight: 700;
  color: #7c5cff;
  text-transform: uppercase;
  letter-spacing: .02em;
}

/* Reserved table on the SVG saal plan: a violet outline + the corner dot. */
.saal-tisch.reserviert .saal-tisch-shape { stroke: #7c5cff; stroke-width: 3; }
.saal-tisch-reserviert-dot { fill: #7c5cff; stroke: #fff; stroke-width: 1.5; }
