/* ==========================================================================
   Bestellapp – iOS-Design
   Systemschrift (SF Pro auf iPhone/iPad), gruppierte Listen, Großtitel,
   Segment-Schalter, Bottom-Sheets und iOS-Schalter – in den Vereinsfarben:
     Gold  #f5b419  = Hauptaktion (gefüllte Buttons, Avatar)
     Blau  #3987c6  = Navigation, Links, aktive Tabs, Info
     Rot   #b21a24  = Löschen, Fehler, Warnungen
   Wird nach style.css (und einkauf.css) geladen und überschreibt dort.
   ========================================================================== */

:root {
  --bg: #eeeef3;
  --surface: #ffffff;
  --surface-2: #e9e9ef;
  --border: #cdcdd5;
  --sep: rgba(60, 60, 67, 0.3);
  --card-edge: rgba(60, 60, 67, 0.16);
  --text: #111113;
  --text-muted: #4f4f57;
  --seg: rgba(118, 118, 128, 0.2);
  --seg-thumb: #ffffff;
  --glass: rgba(238, 238, 243, 0.86);
  --glass-bar: rgba(252, 252, 254, 0.92);
  --glass-solid: rgba(252, 252, 254, 0.97);
  --grabber: rgba(60, 60, 67, 0.36);
  --scrim: rgba(0, 0, 0, 0.42);

  --accent: #f5b419;
  --accent-strong: #e4a30d;
  --accent-contrast: #111113;
  --accent-soft: #ffecb8;
  --accent-ink: #5c3f00;

  --tint: #0f5a9e;
  --gold: #0f5a9e;            /* (Name historisch) = Blau für Infos/Links */
  --gold-soft: #dcebf8;

  --danger: #9c141d;
  --danger-fill: #b21a24;
  --danger-soft: #f8dcde;
  --success: #17692e;
  --success-strong: #23803c;
  --success-soft: #d5eedb;
  --switch-on: #34c759;

  --radius: 16px;
  --radius-sm: 12px;
  --shadow: none;
  --shadow-float: 0 8px 28px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.12);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --tabbar-h: 62px;
}

/* -------------------- Grundlagen -------------------- */
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, .display, .ek h1, .ek h2, .ek h3 { font-family: inherit; letter-spacing: -0.022em; }
button, input, select, textarea { font-family: inherit; letter-spacing: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--tint) 45%, transparent); outline-offset: 1px; border-radius: 8px; }
button { -webkit-touch-callout: none; }
::selection { background: var(--accent); color: #1c1c1e; }

/* -------------------- Kopfzeile -------------------- */
.topbar {
  gap: 8px;
  padding: calc(var(--safe-top) + 6px) 16px 6px;
  min-height: 52px;
  background: var(--bg);
  box-shadow: 0 0 0 0 transparent;
  transition: background 0.2s, box-shadow 0.2s;
}
#app.scrolled .topbar,
#app:not(.has-large) .topbar {
  background: var(--glass-bar);
  box-shadow: 0 0.5px 0 var(--sep);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
.topbar h1 { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; transition: opacity 0.18s; }
#app.has-large:not(.scrolled) .topbar h1 { opacity: 0; }
@media (max-width: 640px) { #app:not(.has-large) .topbar h1 { visibility: hidden; } }
.topbar-logo { width: 27px; height: 31px; }
.icon-btn { border-radius: 10px; color: var(--tint); }
.icon-btn:active { background: var(--seg); }

.back-btn { display: inline-flex; align-items: center; gap: 1px; margin-left: -8px; padding: 6px 10px 6px 2px; font-size: 17px; font-weight: 400; color: var(--tint); }
.back-btn svg { width: 26px; height: 26px; }
.back-btn:active { opacity: 0.5; background: transparent; }

.conn-dot { width: 8px; height: 8px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 22%, transparent); background: var(--switch-on); }
.conn-dot.offline { background: var(--danger-fill); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger-fill) 22%, transparent); }

.user-chip { background: var(--seg); border: none; color: var(--text); font-weight: 600; }
#eventChip { background: var(--seg); font-weight: 600; font-size: 13px; }
#eventChip svg { color: var(--tint); }
.avatar { background: var(--accent); color: #1c1c1e; width: 28px; height: 28px; font-weight: 700; letter-spacing: 0; }
@media (max-width: 640px) {
  .user-chip { background: transparent; padding: 0; }
  .avatar { width: 32px; height: 32px; font-size: 14px; }
}

/* -------------------- Tab-Leiste -------------------- */
.tabbar {
  background: var(--glass-bar);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  border-top: 0.5px solid var(--sep);
  padding: 6px 4px calc(var(--safe-bottom) + 2px);
  gap: 0;
}
.tab { font-size: 10px; font-weight: 500; letter-spacing: 0.005em; color: var(--text-muted); gap: 2px; padding: 4px 2px 3px; border-radius: 0; background: transparent; }
.tab:active { opacity: 0.55; }
.tab.active, .tab.active .tab-icon { color: var(--tint); background: transparent; }
.tab.active::before { content: none; }
.tab.active { font-weight: 600; }
.tab-icon { width: 25px; height: 25px; stroke-width: 1.7; }
.tab.active .tab-icon { stroke-width: 2; }

/* "Mehr"-Sheet wie die iOS-Einstellungen */
.more-list { display: flex; flex-direction: column; gap: 0; margin-top: 12px; background: var(--bg); border-radius: 14px; overflow: hidden; }
.more-item { display: flex; align-items: center; gap: 13px; padding: 11px 14px; border: none; border-radius: 0; background: var(--surface-2); font-size: 17px; font-weight: 400; position: relative; transition: background 0.1s; }
.more-item + .more-item::before { content: ""; position: absolute; top: 0; left: 57px; right: 0; height: 0.5px; background: var(--sep); }
.more-item::after { content: ""; width: 8px; height: 8px; margin-left: auto; border-top: 2px solid var(--text-muted); border-right: 2px solid var(--text-muted); transform: rotate(45deg); opacity: 0.55; flex-shrink: 0; }
.more-item:active { background: var(--seg); }
.more-item.active { background: var(--surface-2); font-weight: 600; }
.more-icon { width: 30px; height: 30px; padding: 5px; border-radius: 8px; color: #fff; background: var(--tint); flex-shrink: 0; }

/* -------------------- Ansichten, Großtitel -------------------- */
.view { padding: 4px 16px calc(96px + var(--safe-bottom)); animation: ios-in 0.28s var(--ease); }
@keyframes ios-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.section-heading {
  display: block;
  margin: 2px 2px 14px;
  font-size: 32px; line-height: 1.12; font-weight: 800; letter-spacing: -0.03em;
  text-transform: none; color: var(--text);
}
.section-heading svg { display: none; }

.hint {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--gold-soft); border: none; border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 14px; line-height: 1.45; color: var(--text); margin: 0 0 16px;
}
.hint svg { color: var(--gold); width: 19px; height: 19px; }

/* -------------------- Buttons -------------------- */
.btn {
  border-radius: 13px; padding: 12px 18px; min-height: 46px;
  font-size: 16px; font-weight: 600; letter-spacing: -0.012em;
  transition: transform 0.12s var(--ease), opacity 0.12s, background 0.18s;
}
.btn:active:not(:disabled) { transform: scale(0.97); opacity: 0.82; }
.btn.primary { background: var(--accent); color: #1c1c1e; }
.btn.primary:disabled { background: var(--seg); color: var(--text-muted); opacity: 1; }
.btn.secondary { background: var(--gold-soft); color: var(--tint); }
.btn.big { min-height: 52px; border-radius: 15px; font-size: 17px; padding: 14px 18px; }
.btn.small { min-height: 34px; padding: 6px 14px; font-size: 14px; border-radius: 10px; }
.btn.pay-btn { background: var(--accent-soft); color: var(--accent-ink); border: none; }
.btn.danger-outline { background: var(--danger-soft); color: var(--danger); border: none; padding: 9px 15px; min-height: 38px; font-size: 14.5px; }
.btn.ghost { background: var(--seg); color: var(--text); border: none; }
.btn.sending, .btn.sending:disabled { background: var(--seg); color: var(--text); }
.btn.sent, .btn.sent:disabled { background: var(--success-strong); color: #fff; }
.btn.failed { background: var(--danger-fill); color: #fff; }
.btn-count { background: rgba(0, 0, 0, 0.13); font-weight: 600; }

/* -------------------- Felder -------------------- */
.field-input, .printer-select, select.field-input {
  background: var(--surface-2); border: none; border-radius: 11px;
  padding: 12px 14px; font-size: 17px; color: var(--text); min-height: 46px;
  transition: box-shadow 0.15s;
}
.field-input::placeholder { color: color-mix(in srgb, var(--text-muted) 75%, transparent); }
.field-input:focus { outline: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--tint) 55%, transparent); }
select.field-input, .printer-select {
  -webkit-appearance: none; appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='18' viewBox='0 0 12 18' fill='none' stroke='%238e8e93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 6.5L6 3l3.5 3.5M2.5 11.5L6 15l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.printer-select { font-size: 15px; min-height: 42px; padding: 9px 30px 9px 12px; }
.auth-field label, .printer-card label, .ek-field label, .ek-label { font-size: 13px; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; padding-left: 2px; }

/* iOS-Schalter */
.mf-check { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 6px 0; }
.mf-check label { margin: 0 !important; font-size: 16px !important; color: var(--text) !important; flex: 1; }
.modal-sheet input[type="checkbox"], .ek-check input[type="checkbox"], .bill-check input[type="checkbox"] {
  -webkit-appearance: none; appearance: none; flex: none;
  width: 51px; height: 31px; margin: 0; border-radius: 999px; position: relative; cursor: pointer;
  background: rgba(120, 120, 128, 0.32); transition: background 0.22s;
}
.modal-sheet input[type="checkbox"]::after, .ek-check input[type="checkbox"]::after, .bill-check input[type="checkbox"]::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.16), 0 3px 1px rgba(0, 0, 0, 0.1);
  transition: transform 0.22s var(--ease);
}
.modal-sheet input[type="checkbox"]:checked, .ek-check input[type="checkbox"]:checked, .bill-check input[type="checkbox"]:checked { background: var(--switch-on); }
.modal-sheet input[type="checkbox"]:checked::after, .ek-check input[type="checkbox"]:checked::after, .bill-check input[type="checkbox"]:checked::after { transform: translateX(20px); }
.ek-check { display: flex; align-items: center; gap: 12px; font-size: 15px; }

/* -------------------- Karten & Listen -------------------- */
.card { border: none; border-radius: var(--radius); box-shadow: none; padding: 16px; margin-bottom: 14px; background: var(--surface); }
.history-summary { background: var(--surface); border: none; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.history-summary .hs-label { color: var(--text-muted); font-size: 14px; }
.history-summary .hs-value { font-size: 24px; font-weight: 700; letter-spacing: -0.025em; }
.history-title { font-size: 17px; font-weight: 700; }
.history-meta { font-size: 13px; }
.history-total { border-top: 0.5px solid var(--sep); }
.item-row, .user-row { border-top-color: var(--sep); border-top-width: 0.5px; }
.icon-x { color: var(--text-muted); border-radius: 50%; }
.icon-x:active { background: var(--seg); }
.empty-state { color: var(--text-muted); }
.empty-state svg { color: var(--text-muted); opacity: 0.35; }
.add-item-row .btn { min-width: 46px; }

/* -------------------- Tische -------------------- */
.tables-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.table-card {
  border: none; border-left: none; border-radius: 18px; box-shadow: none;
  background: var(--surface); padding: 15px 15px 13px; min-height: 100px;
  transition: transform 0.14s var(--ease), box-shadow 0.2s;
}
.table-card:active { transform: scale(0.96); }
.table-card .name { font-family: inherit; font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.table-card.open { background: var(--surface); border: none; }
.table-card.unprinted { border: none; box-shadow: inset 0 0 0 2px var(--tint); }
.table-card .amount { font-size: 15px; font-weight: 700; letter-spacing: -0.015em; }
.table-edit-btn { color: var(--text-muted); opacity: 0.6; top: 4px; right: 4px; padding: 6px 8px; line-height: 0; border-radius: 50%; }
.table-edit-btn svg { width: 20px; height: 20px; }

.status-pill { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.status-pill.free { background: var(--seg); color: var(--text-muted); }
.status-pill.new { background: var(--gold-soft); color: var(--tint); }
.status-pill.open { background: var(--accent-soft); color: var(--accent-ink); }
.status-pill.paid { background: var(--success-soft); color: var(--success); }

.fab {
  background: var(--accent); color: #1c1c1e; border-radius: 999px; padding: 14px 22px 14px 18px;
  font-size: 16px; font-weight: 600; letter-spacing: -0.012em;
  box-shadow: var(--shadow-float); bottom: calc(78px + var(--safe-bottom));
  transition: transform 0.14s var(--ease);
}
.fab:active { transform: scale(0.95); background: var(--accent); }
.fab svg { width: 20px; height: 20px; stroke-width: 2.4; }

/* -------------------- Bestellung -------------------- */
.order-view { padding-top: 2px; }
.order-table-name { font-family: inherit; font-size: 30px; font-weight: 800; letter-spacing: -0.03em; }
.order-total { font-size: 15px; font-weight: 500; }
.server-chip, .server-chip.set { background: var(--seg); border: none; color: var(--text); font-weight: 500; padding: 5px 12px; font-size: 13px; }
.order-stat { background: var(--surface); border: none; border-radius: var(--radius-sm); }

.category-tabs {
  position: static; z-index: auto; display: flex; gap: 0; overflow-x: auto; scrollbar-width: none;
  background: var(--seg); border-radius: 11px; padding: 2px; margin: 10px 0 12px;
}
.category-tabs::-webkit-scrollbar { display: none; }
.category-tab {
  flex: 1 0 auto; border: none; background: transparent; color: var(--text);
  padding: 7px 16px; border-radius: 9px; font-size: 14.5px; font-weight: 500; letter-spacing: -0.01em;
  transition: background 0.18s, box-shadow 0.18s;
}
.category-tab.active { background: var(--seg-thumb); color: var(--text); font-weight: 600; border: none; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04); }

.item-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.item-btn {
  position: relative; background: var(--surface); border: none; border-radius: 16px;
  padding: 14px; min-height: 80px; box-shadow: none;
  transition: transform 0.12s var(--ease), background 0.15s;
}
.item-btn:active { transform: scale(0.95); background: var(--accent-soft); border: none; }
.item-btn::after {
  content: "+"; position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: #1c1c1e;
  font-size: 18px; font-weight: 500; line-height: 1; padding-bottom: 2px;
}
.item-btn .iname { font-size: 15.5px; font-weight: 600; letter-spacing: -0.015em; padding-right: 26px; }
.item-btn .iprice { color: var(--text-muted); font-weight: 500; font-size: 14px; }

.order-cart { border: none; border-radius: var(--radius); background: var(--surface); padding: 4px 16px 2px; }
.cart-title { font-size: 12.5px; font-weight: 500; letter-spacing: 0.04em; color: var(--text-muted); }
.cart-row { border-bottom: 0.5px solid var(--sep); }
.cart-row .cname { font-size: 16.5px; font-weight: 500; letter-spacing: -0.015em; }

.qty-controls { gap: 0; background: var(--seg); border-radius: 10px; overflow: hidden; align-items: center; }
.qty-controls .qty-btn { width: 40px; height: 34px; border-radius: 0; background: transparent; color: var(--tint); font-size: 22px; font-weight: 400; border: none; }
.qty-controls .qty-btn:active { background: var(--seg); }
.qty-controls .qty-num { min-width: 28px; font-size: 16px; font-weight: 600; }
.qty-btn { background: var(--seg); border: none; color: var(--text); }
.pay-qty-stepper { background: var(--seg); border-radius: 10px; gap: 0; overflow: hidden; }
.pay-qty-stepper .qty-btn { background: transparent; border: none; border-radius: 0; color: var(--tint); width: 36px; height: 32px; }
.pay-qty-num { min-width: 44px; text-align: center; }

.pay-checkbox {
  -webkit-appearance: none; appearance: none; width: 26px; height: 26px; margin: 0; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid rgba(120, 120, 128, 0.55); background: transparent; display: grid; place-content: center; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.pay-checkbox:checked { background: var(--accent); border-color: var(--accent); }
.pay-checkbox:checked::after { content: ""; width: 6px; height: 11px; border: solid #1c1c1e; border-width: 0 2.5px 2.5px 0; transform: translate(0, -1px) rotate(45deg); }

.tag { font-size: 11.5px; font-weight: 600; padding: 2px 8px; }
.tag-new { background: var(--gold-soft); color: var(--tint); }

.order-actions {
  background: var(--glass-solid); border-top: 0.5px solid var(--sep);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
}
.print-result { border-radius: 13px; }

/* -------------------- Dialoge (Bottom-Sheets) -------------------- */
.modal-backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: ios-fade 0.2s ease; }
.modal-sheet {
  background: var(--surface); border-radius: 24px 24px 0 0; padding: 8px 20px calc(20px + var(--safe-bottom));
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18); animation: ios-sheet 0.34s var(--ease);
}
.modal-sheet::before { content: ""; display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--grabber); margin: 0 auto 14px; }
.modal-sheet h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.025em; margin-bottom: 8px; }
.modal-sheet label { font-weight: 500; }
.modal-actions { margin-top: 18px; gap: 10px; }
.modal-actions .btn { min-height: 50px; border-radius: 14px; font-size: 17px; }
.modal-actions .btn.secondary { background: var(--seg); color: var(--text); }
@keyframes ios-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ios-sheet { from { transform: translateY(100%); } to { transform: none; } }
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; padding: 20px; }
  .modal-sheet { border-radius: 20px; max-width: 440px; padding-top: 22px; animation: ios-pop 0.26s var(--ease); box-shadow: var(--shadow-float); }
  .modal-sheet::before { display: none; }
}
@keyframes ios-pop { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }

/* -------------------- Hinweise (Toast) -------------------- */
#toastHost { bottom: calc(150px + var(--safe-bottom)); }
.toast {
  background: rgba(44, 44, 46, 0.94); color: #fff; border-radius: 16px; padding: 12px 18px; font-size: 14.5px; font-weight: 500;
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: var(--shadow-float); animation: ios-pop 0.24s var(--ease);
}
.toast.err { background: var(--danger-fill); color: #fff; }
.toast.ok { background: var(--success-strong); color: #fff; }

/* -------------------- Anmeldung, Fest wählen -------------------- */
.auth-screen { background: var(--bg); }
.auth-logo { width: 88px; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.14)); }
.auth-brand h1 { font-family: inherit; font-size: 30px; font-weight: 800; letter-spacing: -0.03em; }
.auth-brand p { font-size: 16px; }
.auth-form { background: var(--surface); border: none; border-radius: 20px; box-shadow: none; padding: 22px 18px; }
.auth-form h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.auth-error { border-radius: 12px; }
.auth-switch button { color: var(--tint); }
.event-pick-list { gap: 0; background: var(--surface-2); border-radius: 14px; overflow: hidden; margin-bottom: 0; }
.event-pick-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; border: none; border-radius: 0; background: transparent; padding: 15px 16px; font-size: 17px; font-weight: 500; letter-spacing: -0.015em; position: relative; }
.event-pick-btn + .event-pick-btn::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 0.5px; background: var(--sep); }
.event-pick-btn::after { content: ""; width: 8px; height: 8px; border-top: 2px solid var(--text-muted); border-right: 2px solid var(--text-muted); transform: rotate(45deg); opacity: 0.55; }
.event-pick-btn:active { background: var(--seg); }
.event-pick-btn:hover { border-color: transparent; }
.server-row button.pick { background: var(--surface-2); border: none; border-radius: 12px; font-weight: 500; }
.server-row button.pick.active { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }

/* -------------------- Desktop -------------------- */
@media (min-width: 900px) {
  .section-heading { font-size: 34px; }
  .order-side .order-cart { border-radius: var(--radius); }
  .order-actions { background: transparent; border-top: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .item-btn:hover { background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface)); }
  .table-card:hover { transform: none; }
  @media (hover: hover) { .table-card:hover { transform: translateY(-2px); } }
}

/* ==========================================================================
   Einkauf (einkauf.html) – gleiche Sprache, etwas dichter
   ========================================================================== */
.ek-top {
  background: var(--glass-bar); box-shadow: 0 0.5px 0 var(--sep);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  padding: calc(var(--safe-top) + 8px) 18px 8px; flex-wrap: nowrap;
}
.ek-top h1 { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.ek-back { background: transparent; color: var(--tint); font-size: 17px; font-weight: 400; padding: 4px 6px 4px 0; margin-left: -6px; }
.ek-back:hover, .ek-back:active { background: transparent; opacity: 0.6; }
.ek-back svg { width: 26px; height: 26px; stroke-width: 2.4; }
.ek-user { font-weight: 500; }

.ek-nav a { border-radius: 11px; font-weight: 500; font-size: 15.5px; border-left: none; letter-spacing: -0.012em; }
.ek-nav a:hover { background: var(--seg); }
.ek-nav a.active { background: var(--gold-soft); color: var(--tint); border-left: none; font-weight: 600; }
.ek-nav .count { background: var(--seg); font-weight: 600; }
@media (max-width: 860px) {
  .ek-nav { gap: 4px; padding-bottom: 6px; }
  .ek-nav a { border-bottom: none; border-radius: 999px; padding: 8px 14px; font-size: 14.5px; background: var(--seg); color: var(--text); }
  .ek-nav a.active { background: var(--tint); color: #fff; }
  .ek-nav a svg { width: 17px; height: 17px; }
}

.ek-page-head h2, .ek .order-head h2 { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; }
.ek-page-head p { font-size: 15px; }
.ek .card { padding: 18px; border-radius: var(--radius); }
.ek .card > h3, .ek .chart-head h3 { font-size: 19px; font-weight: 700; letter-spacing: -0.022em; }
.kpi { border: none; border-radius: var(--radius); background: var(--surface); padding: 15px 16px; }
.kpi .k-label { font-weight: 500; }
.kpi .k-value { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; }
.ek-note { border: none; border-radius: var(--radius-sm); background: var(--gold-soft); }
.ek-note.warn { background: var(--danger-soft); }

.ek .btn { padding: 10px 18px; min-height: 42px; font-size: 15.5px; }
.ek .btn.small { min-height: 32px; padding: 5px 13px; font-size: 14px; }
.ek .btn.secondary { background: var(--gold-soft); color: var(--tint); }
.ek .btn.ghost { background: var(--seg); border: none; color: var(--text); }
.ek .btn.ghost:hover { background: var(--seg); opacity: 0.8; }
.ek .field-input { font-size: 16px; padding: 10px 12px; min-height: 42px; }
.ek-table th { font-weight: 600; border-bottom: 0.5px solid var(--sep); }
.ek-table td { border-bottom: 0.5px solid var(--sep); }
.ek-table tfoot td { border-top: 0.5px solid var(--sep); }
.ek-table .group-row td { background: var(--surface-2); }
.ek-table tbody tr.row-link:hover { background: var(--seg); }
.ek-table input.cell-input { background: var(--surface-2); border: none; border-radius: 9px; font-size: 15px; }
.ek-table input.cell-input:focus { outline: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--tint) 55%, transparent); }
.pill { font-weight: 600; background: var(--seg); }
.chip { border: none; background: var(--seg); font-weight: 500; padding: 8px 14px; }
.chip:has(input:checked) { background: var(--gold-soft); box-shadow: inset 0 0 0 1.5px var(--tint); color: var(--tint); font-weight: 600; }
.cards-grid .card { border-radius: var(--radius); }
.savebar { border: none; border-radius: 18px; background: var(--glass-bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: var(--shadow-float); }
.total-bar strong { font-family: inherit; font-weight: 700; letter-spacing: -0.025em; }
.chart .axis-text { font-family: inherit; }
.ek-tip { border-radius: 12px; background: rgba(44, 44, 46, 0.95); color: #fff; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.ek .modal-sheet { border-radius: 20px; padding: 22px; }
.ek .modal-sheet::before { display: none; }
@media (max-width: 560px) {
  .ek .modal-sheet { border-radius: 24px 24px 0 0; padding-top: 8px; }
  .ek .modal-sheet::before { display: block; }
  .ek-page-head h2, .ek .order-head h2 { font-size: 28px; }
  .kpi .k-value { font-size: 24px; }
  .ek-layout { padding-left: 16px; padding-right: 16px; }
  .ek-nav { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
}

/* -------------------- Feinschliff -------------------- */
.category-name-input { font-family: inherit; font-weight: 700; font-size: 17px; letter-spacing: -0.015em; }
.ek a.ek-back:not(.btn), .ek a.ek-back:not(.btn):hover { text-decoration: none; }
@media (max-width: 480px) {
  .item-row { gap: 6px; }
  .item-row .price-input { width: 78px; }
  .item-row .field-input { padding-left: 11px; padding-right: 11px; }
}
.pr-note { color: var(--text-muted); font-size: 12.5px; }

/* -------------------- Mehr Kontrast -------------------- */
.card, .table-card, .item-btn, .order-cart, .history-summary, .kpi, .auth-form, .order-stat { border: 1px solid var(--card-edge); }
.table-card.unprinted { box-shadow: inset 0 0 0 1.5px var(--tint); border-color: var(--tint); }
.field-input, .printer-select { box-shadow: inset 0 0 0 1px var(--card-edge); }
.field-input:focus { box-shadow: inset 0 0 0 1px var(--tint), 0 0 0 3px color-mix(in srgb, var(--tint) 35%, transparent); }
.field-input::placeholder { color: var(--text-muted); opacity: 0.75; }
.btn.secondary { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tint) 28%, transparent); }
.btn.danger-outline { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 30%, transparent); }
.status-pill, .tag { font-weight: 700; }
.history-meta, .cart-row .cprice, .order-total, .hs-label, .ek-user, .ek-page-head p, .kpi .k-label, .kpi .k-delta { color: var(--text-muted); }
.category-tab { color: var(--text); font-weight: 600; }
.category-tab.active { box-shadow: 0 0 0 1px var(--card-edge), 0 3px 8px rgba(0, 0, 0, 0.14); }
.item-btn .iprice { color: var(--text-muted); font-weight: 600; }
.cart-title, .section-heading + .hint, .ek-table th { color: var(--text-muted); }
.icon-x, .table-edit-btn { color: var(--text-muted); opacity: 1; }
.hint { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tint) 22%, transparent); }

/* -------------------- Menüleiste unten: klar und immer da -------------------- */
.tabbar {
  justify-content: center; gap: 2px; border-top: 1px solid var(--sep);
  padding: 6px 8px calc(var(--safe-bottom) + 4px); min-height: var(--tabbar-h);
}
.tab {
  flex: 1 1 0; max-width: 116px; position: relative; font-size: 11px; font-weight: 600;
  color: var(--text-muted); gap: 3px; padding: 6px 4px 5px; border-radius: 14px;
}
.tab > * { position: relative; z-index: 1; }
.tab.active { color: var(--tint); font-weight: 700; }
.tab.active::before { content: ""; display: block; position: absolute; inset: 0 4px; border-radius: 14px; background: var(--gold-soft); z-index: 0; top: 0; left: 4px; right: 4px; height: auto; }
.tab-icon { width: 24px; height: 24px; stroke-width: 1.8; }
.tab.active .tab-icon { stroke-width: 2.1; }

/* Einkauf: gleiche Menüleiste, fest am unteren Rand */
body.ek { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 6px); }
body.ek .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; }
body.ek .savebar { bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 8px); }
body.ek #toastHost { bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 70px); }
.ek a.tab:not(.btn), .ek a.more-item:not(.btn) { text-decoration: none; }
.ek a.tab:not(.btn) { color: var(--text-muted); }
.ek a.tab.active:not(.btn) { color: var(--tint); }
a.more-item { color: var(--text); }

/* -------------------- Farbige Symbole in der Menüleiste -------------------- */
/* --tc = Symbolfarbe (kontrastreich), --tc-fill/--tc-on = Farbfläche im "Mehr"-Menü */
[data-view="tables"]   { --tc: #b27800; --tc-fill: #f5b419; --tc-on: #1c1c1e; }
[data-view="history"]  { --tc: #1d6fb4; --tc-fill: #3987c6; --tc-on: #fff; }
[data-view="menu"]     { --tc: #1f7a38; --tc-fill: #2a8f47; --tc-on: #fff; }
[data-view="printers"] { --tc: #5a6475; --tc-fill: #6b7585; --tc-on: #fff; }
[data-view="events"]   { --tc: #b27800; --tc-fill: #f5b419; --tc-on: #1c1c1e; }
[data-view="personal"] { --tc: #1d6fb4; --tc-fill: #3987c6; --tc-on: #fff; }
[data-view="einkauf"]  { --tc: #b21a24; --tc-fill: #b21a24; --tc-on: #fff; }
[data-view="more"]     { --tc: #5a6475; --tc-fill: #6b7585; --tc-on: #fff; }
.tab .tab-icon, .ek a.tab .tab-icon { color: var(--tc); }
.tab.active, .ek a.tab.active:not(.btn) { color: var(--text); }
.tab.active::before { background: color-mix(in srgb, var(--tc) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc) 28%, transparent); }
.tab:not(.active) .tab-icon { opacity: 0.92; }
.tab.active .tab-icon { stroke-width: 2.2; }
.more-item .more-icon { background: var(--tc-fill); color: var(--tc-on); }
.tab.active .tab-icon, .ek a.tab.active:not(.btn) .tab-icon { color: var(--tc); }
.ek a.tab:not(.btn) { color: var(--text-muted); }

/* -------------------- Übersicht "Neue Bestellung" ganz oben -------------------- */
.draft-card { background: var(--surface); border: 1px solid var(--card-edge); border-radius: var(--radius); padding: 12px 14px; margin: 10px 0 4px; display: flex; flex-direction: column; gap: 8px; }
.draft-card.has-items { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.draft-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.draft-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--tint); color: #fff; font-size: 12.5px; font-weight: 700; padding: 4px 11px 4px 9px; border-radius: 999px; letter-spacing: -0.005em; }
.draft-badge svg { width: 14px; height: 14px; }
.draft-sum { font-size: 14.5px; color: var(--text-muted); }
.draft-sum b { color: var(--text); font-size: 16px; font-weight: 700; letter-spacing: -0.015em; }
.draft-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.draft-chip { background: var(--surface); border: 1px solid var(--card-edge); border-radius: 999px; padding: 4px 11px; font-size: 14px; font-weight: 500; }
.draft-chip b { font-weight: 800; }
.draft-chip.more { color: var(--text-muted); }
.draft-note { font-size: 13px; color: var(--text-muted); line-height: 1.35; }
.draft-prev { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--text-muted); border-top: 0.5px solid var(--sep); padding-top: 8px; margin-top: 2px; }
.draft-prev span:last-child { font-weight: 600; color: var(--text); }

/* -------------------- Tische: Zuweisung an Bedienungen -------------------- */
.table-filter { margin: 0 0 14px; max-width: 420px; }
.table-card-top { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.table-assignee { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); min-width: 0; }
.table-assignee svg { width: 13px; height: 13px; flex-shrink: 0; }
.table-assignee.mine { color: var(--tint); }
.modal-actions { flex-wrap: wrap; }
.modal-actions .btn { min-width: 0; flex: 1 1 0; }
.modal-actions > .btn.danger-outline:first-child:not(:last-child) { flex: 1 0 100%; }

/* ---- Serviert-Haken (zum Gast gebracht) ---- */
.serve-check {
  flex: 0 0 auto; width: 30px; height: 30px; padding: 0; border-radius: 50%;
  border: 2px solid var(--text-faint, #9a9484); background: transparent; color: transparent;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.serve-check svg { width: 16px; height: 16px; stroke-width: 3.4; }
.serve-check:active:not(:disabled) { transform: scale(.9); }
.serve-check.on { background: var(--success); border-color: var(--success); color: #fff; }
.serve-check:disabled { opacity: .35; cursor: not-allowed; }
.cart-row.served .cname { color: var(--text-muted); }
.table-unserved { display: flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 12.5px; font-weight: 700; color: var(--gold, #a8740a); }
.table-unserved svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ---- Versionsanzeige ---- */
.app-version { text-align: center; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-top: 16px; letter-spacing: 0.01em; }
.modal-sheet .app-version { margin-top: 14px; }
.event-einkauf { margin-top: 14px; width: 100%; text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 8px; }
.event-einkauf svg { width: 20px; height: 20px; }
.ek-version { text-align: center; font-size: 12px; font-weight: 600; color: var(--text-muted); padding: 22px 0 6px; }

/* ---- Einkauf-Menü: einfach, gruppiert, mit farbigen Symbolen ---- */
.ek-nav { gap: 2px; }
.ek-nav-group { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); padding: 16px 12px 5px; }
.ek-nav-group:first-child { padding-top: 0; }
.ek-nav a { display: flex; align-items: center; gap: 11px; padding: 6px 10px; border-radius: 12px; background: transparent; color: var(--text); font-size: 15.5px; font-weight: 500; }
@media (hover: hover) { .ek-nav a:hover { background: var(--seg); } }
.ek-nav a.active { background: var(--seg); color: var(--text); font-weight: 700; }
.ek-nav-ic { width: 30px; height: 30px; border-radius: 8px; background: var(--ic); color: var(--ic-on); display: grid; place-items: center; flex: none; }
.ek-nav .ek-nav-ic svg { width: 18px; height: 18px; stroke-width: 2; }
.ek-nav-label { min-width: 0; white-space: nowrap; }
@media (max-width: 860px) {
  .ek-nav { gap: 2px; padding: 2px 16px 8px; scroll-snap-type: x proximity; }
  .ek-nav-group { display: none; }
  .ek-nav a { flex-direction: column; gap: 5px; padding: 8px 4px 7px; min-width: 78px; border-radius: 14px; background: transparent; color: var(--text-muted); font-size: 11.5px; font-weight: 600; justify-content: flex-start; scroll-snap-align: center; }
  .ek-nav a.active { background: var(--seg); color: var(--text); font-weight: 700; }
  .ek-nav-ic { width: 38px; height: 38px; border-radius: 11px; }
  .ek-nav .ek-nav-ic svg { width: 22px; height: 22px; }
}

/* Verlauf: Umsatz je Bedienung */
.history-servers { background: var(--surface); border: 1px solid var(--card-edge, var(--border)); border-radius: var(--radius); padding: 6px 16px 4px; margin-bottom: 14px; }
.history-servers .hsv-title { font-size: 13px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--text-muted); padding: 10px 0 4px; }
.history-servers .hsv-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.history-servers .hsv-title + .hsv-row { border-top: none; }
.history-servers .hsv-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.history-servers .hsv-sub { display: block; font-size: 12.5px; font-weight: 400; color: var(--text-muted); }
.history-servers .hsv-sum { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.history-servers .hsv-total { border-top: 2px solid var(--border); }
.history-servers .hsv-total .hsv-name, .history-servers .hsv-total .hsv-sum { font-size: 16px; }

/* Version neben dem Benutzernamen */
.user-chip .chip-version { font-size: 11px; font-weight: 700; letter-spacing: .02em; color: var(--text-muted); background: var(--surface-2, rgba(120,120,128,.14)); border-radius: 999px; padding: 2px 7px; line-height: 1.3; }
@media (max-width: 640px) { .user-chip .chip-version { display: inline-block !important; margin-left: 5px; } .user-chip { display: inline-flex; align-items: center; padding-right: 6px; } }
.ek-user .ek-user-version { font-size: 11px; font-weight: 700; color: var(--text-muted); background: rgba(120,120,128,.14); border-radius: 999px; padding: 2px 7px; margin-left: 4px; }

/* Bar (Kasse) */
.table-card.bar { background: var(--surface); border: 1.5px solid var(--gold, #f5b419); }
.table-card.bar.open { background: var(--accent-soft); }
.table-card .bar-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--text-muted); margin-top: 4px; }
.table-card .bar-tag svg { width: 15px; height: 15px; }
.table-card .bar-sales { font-size: 12.5px; color: var(--text-muted); }
.table-card .bar-sales b { color: var(--text); }
.bar-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: #7a5200; background: rgba(245,180,25,.22); border-radius: 999px; padding: 2px 8px; vertical-align: middle; margin-left: 6px; }
.bar-badge svg { width: 13px; height: 13px; }
.history-summary .hs-sub { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.card > .btn.danger-outline.small { margin: 8px 14px 14px; }

/* Bar: mehrere offene Verkaufs-Vorgänge */
.bar-carts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 6px; }
.bar-cart-chip { display: inline-flex; align-items: baseline; gap: 8px; min-height: 44px; padding: 8px 14px; border-radius: 22px; border: 1.5px solid var(--border, #d6d6dc); background: var(--surface, #fff); color: var(--text, #111); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.bar-cart-chip .bc-sum { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-muted, #666); }
.bar-cart-chip .bc-who { font-size: 12px; font-weight: 600; color: var(--text-muted, #666); }
.bar-cart-chip.active { background: var(--accent, #f5b51b); border-color: var(--accent, #f5b51b); color: var(--accent-contrast); }
.bar-cart-chip.active .bc-sum { color: var(--accent-contrast); }
.bar-cart-chip.add { border-style: dashed; color: var(--accent-ink); }
.bar-cart-chip:disabled { opacity: .45; cursor: default; }
.bar-cart-discard { margin-left: auto; min-height: 32px; padding: 8px 10px; border: 0; background: none; color: var(--danger, #c4262e); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }

/* Tisch: einzeln abrechnen (mehrere Gäste, eine Bestellung) */
.split-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; margin: 0 0 10px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-size: 14px; }
.split-bar .split-text { flex: 1 1 200px; font-weight: 600; }
.split-bar button { min-height: 40px; padding: 6px 12px; border-radius: 10px; border: 1.5px solid var(--accent-ink); background: transparent; color: var(--accent-ink); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.table-card .bar-foot { flex-direction: column; align-items: flex-start; gap: 2px; }
.table-card .bar-open { font-size: 15px; font-weight: 700; color: var(--accent-ink); }

/* Zwei-Faktor-Anmeldung */
.mfa-code { font-size: 24px; letter-spacing: .18em; text-align: center; font-variant-numeric: tabular-nums; }
.mfa-remember { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; font-size: 14.5px; color: var(--text); }
.mfa-remember input { width: 20px; height: 20px; flex: none; }
.mfa-links { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 12px; }
.mfa-link { background: none; border: 0; padding: 8px 6px; min-height: 40px; font: inherit; font-size: 14.5px; font-weight: 600; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.mfa-choice { display: block; width: 100%; text-align: left; padding: 14px 16px; margin: 0 0 10px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.mfa-choice b { display: block; font-size: 16.5px; margin-bottom: 2px; }
.mfa-choice span { display: block; font-size: 13.5px; color: var(--text-muted); line-height: 1.4; }
.mfa-choice:active { background: var(--accent-soft); border-color: var(--accent); }
.mfa-qr { width: 220px; max-width: 70%; margin: 0 auto 12px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: #fff; }
.mfa-qr svg { display: block; width: 100%; height: auto; }
.mfa-manual { margin: 0 0 14px; font-size: 13.5px; color: var(--text-muted); }
.mfa-manual summary { cursor: pointer; padding: 6px 0; }
.mfa-secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; letter-spacing: .06em; padding: 10px 12px; margin: 6px 0; background: var(--surface-2); border-radius: 10px; color: var(--text); word-break: break-all; user-select: all; }
.mfa-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 14px; }
.mfa-codes code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 16px; font-weight: 700; letter-spacing: .04em; text-align: center; padding: 10px 6px; background: var(--surface-2); border-radius: 10px; color: var(--text); user-select: all; }
.mfa-badge { font-weight: 600; }
.mfa-badge.on { color: var(--success, #1b6b36); }
.mfa-badge.off { color: var(--danger); }
.sms-card { margin-top: 18px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--card-edge, var(--border)); background: var(--surface); }
.sms-title { font-weight: 700; font-size: 15.5px; margin-bottom: 4px; }
.sms-state { font-size: 13.5px; color: var(--text-muted); margin-bottom: 10px; line-height: 1.45; }
.sms-state.ok { color: var(--success, #1b6b36); font-weight: 600; }
.sms-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Zugang anfragen */
.request-hint { font-size: 13.5px; color: var(--text-muted); }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
textarea.field-input { resize: vertical; min-height: 84px; font: inherit; }

/* Ordner "Feste erledigt" */
.event-folder { margin: 14px 0; border-radius: 14px; border: 1px solid var(--card-edge, var(--border)); background: var(--surface); overflow: hidden; }
.event-folder > summary { display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; font-weight: 700; font-size: 16px; list-style: none; min-height: 48px; }
.event-folder > summary::-webkit-details-marker { display: none; }
.event-folder > summary svg { width: 22px; height: 22px; flex: none; color: var(--text-muted); }
.event-folder > summary .folder-count { margin-left: auto; font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-muted); }
.event-folder > summary::after { content: '▾'; color: var(--text-muted); transition: transform .15s; }
.event-folder[open] > summary::after { transform: rotate(180deg); }
.event-folder .user-row { border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; margin: 0; }

/* ==========================================================================
   Version 28 – moderner iPhone-Look
   Schwebende Tab-Leiste, größere Tippflächen, weichere Karten
   ========================================================================== */
html { -webkit-text-size-adjust: 100%; }
button, .btn, .tab, .item-btn, .table-card, .category-tab, .more-item, .qty-btn { touch-action: manipulation; }
input, select, textarea { font-size: max(16px, 1em); }      /* iOS zoomt bei < 16px in Felder hinein */

/* Primäre Buttons: Daumen-freundlich */
.btn { min-height: 48px; border-radius: 14px; }
.btn.small, .btn.sm { min-height: 40px; }

/* Artikel-Tasten: größer, klarer, mit großem Plus */
.item-grid { gap: 12px; }
.item-btn {
  min-height: 96px; padding: 14px 14px 12px; border-radius: 20px;
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; text-align: left;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 0.5px var(--card-edge);
}
.item-btn::after {
  top: 10px; right: 10px; width: 32px; height: 32px; font-size: 22px; padding-bottom: 3px;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--accent) 50%, transparent);
}
.item-btn .iname { font-size: 16px; line-height: 1.22; padding-right: 36px; }
.item-btn .iprice { font-size: 15px; margin-top: 8px; }
.item-btn:active { transform: scale(0.96); }

/* Mengen-Schalter */
.qty-controls .qty-btn { width: 46px; height: 40px; font-size: 24px; }
.qty-controls .qty-num { min-width: 32px; font-size: 17px; }
.qty-controls, .pay-qty-stepper { border-radius: 12px; }
.pay-qty-stepper .qty-btn { width: 42px; height: 38px; }

/* Karten & Tische weicher */
.card, .order-cart, .history-summary, .kpi, .order-stat { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 0 0 0.5px var(--card-edge); }
.table-card { border-radius: 20px; min-height: 104px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 0.5px var(--card-edge); }
.table-card:active { transform: scale(0.97); }
.order-table-name { font-size: 32px; }
.category-tabs { border-radius: 13px; padding: 3px; }
.category-tab { padding: 9px 16px; border-radius: 10px; font-size: 15px; }
.modal-sheet { border-radius: 28px 28px 0 0; }
.modal-actions .btn { min-height: 52px; border-radius: 16px; }

/* Kopfzeile: mehr Luft, größeres Wappen */
.topbar-logo { width: 32px; height: 36px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2)); }
.fab { padding: 16px 24px 16px 20px; font-size: 17px; }

/* Anmeldung */
.auth-form { border-radius: 24px; padding: 24px 20px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 0.5px var(--card-edge); }

@media (max-width: 640px) {
  /* Schwebende Tab-Leiste (Pille mit Glas-Effekt) */
  .tabbar, body.ek .tabbar {
    margin: 0 14px calc(var(--safe-bottom) + 10px);
    padding: 6px; min-height: 0; max-width: none;
    border: none; border-radius: 30px;
    background: var(--glass-bar);
    -webkit-backdrop-filter: saturate(180%) blur(26px); backdrop-filter: saturate(180%) blur(26px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16), 0 0 0 0.5px var(--card-edge);
    bottom: 0;
  }
  body.ek .tabbar { position: fixed; left: 0; right: 0; bottom: 0; }
  .tab { border-radius: 24px; padding: 7px 4px 6px; max-width: none; }
  .tab.active::before { inset: 0; left: 0; right: 0; border-radius: 24px; background: var(--gold-soft); }
  .tab-icon { width: 25px; height: 25px; }
  .view { padding-bottom: calc(110px + var(--safe-bottom)); }
  .fab { bottom: calc(96px + var(--safe-bottom)); right: 16px; }
  #toastHost, body.ek #toastHost { bottom: calc(160px + var(--safe-bottom)); }
  body.ek { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 24px); }
  body.ek .savebar { bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 24px); }
  .order-actions { margin-bottom: 4px; }
}
@media (prefers-reduced-motion: reduce) { .item-btn, .table-card, .fab { transition: none; } }

/* ==========================================================================
   Version 31 – Menü-Knopf statt Tab-Leiste
   Unten links schwebt nur noch ein Knopf "Menü"; er öffnet ein Fenster mit allen Bereichen.
   ========================================================================== */
.tabbar, body.ek .tabbar {
  position: fixed; left: 16px; right: auto; bottom: calc(var(--safe-bottom) + 16px); top: auto;
  display: block; width: auto; margin: 0; padding: 0; min-height: 0; max-width: none;
  background: transparent; border: none; border-radius: 0; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none; z-index: 30;
}
.tabbar.hidden { display: none; }
.menu-fab {
  display: inline-flex; align-items: center; gap: 9px; height: 54px; padding: 0 22px 0 18px;
  border: none; border-radius: 27px; cursor: pointer;
  background: var(--glass-bar); color: var(--text); font: inherit; font-size: 17px; font-weight: 600; letter-spacing: -0.012em;
  -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.18), 0 0 0 0.5px var(--card-edge);
  transition: transform 0.14s var(--ease);
}
.menu-fab svg { width: 24px; height: 24px; color: var(--tint); flex-shrink: 0; }
.menu-fab:active { transform: scale(0.95); }
.menu-fab:focus-visible { outline: 3px solid var(--tint); outline-offset: 3px; }

/* Rest der Oberfläche an die fehlende Leiste anpassen */
.fab { bottom: calc(var(--safe-bottom) + 16px); right: 16px; }
#toastHost, body.ek #toastHost { bottom: calc(var(--safe-bottom) + 86px); }
.view { padding-bottom: calc(100px + var(--safe-bottom)); }
body.ek { padding-bottom: calc(86px + var(--safe-bottom)); }
body.ek .savebar { bottom: calc(var(--safe-bottom) + 84px); }
@media (max-width: 640px) {
  .tabbar, body.ek .tabbar { margin: 0; bottom: calc(var(--safe-bottom) + 16px); }
  .view { padding-bottom: calc(100px + var(--safe-bottom)); }
  .fab { bottom: calc(var(--safe-bottom) + 16px); right: 16px; }
  #toastHost, body.ek #toastHost { bottom: calc(var(--safe-bottom) + 86px); }
  body.ek { padding-bottom: calc(86px + var(--safe-bottom)); }
}

/* ==========================================================================
   Version 32 – Übersicht "Tische offen"
   ========================================================================== */
.tables-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap;
  background: var(--surface); border-radius: 20px; padding: 14px 16px; margin: 4px 0 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 0.5px var(--card-edge);
}
.tables-summary.hidden { display: none; }
.ts-main { display: flex; align-items: center; gap: 12px; }
.ts-num {
  min-width: 52px; height: 52px; padding: 0 12px; display: grid; place-items: center; border-radius: 16px;
  background: var(--accent); color: #1c1c1e; font-size: 30px; font-weight: 800; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.ts-label { display: flex; flex-direction: column; font-size: 17px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.2; }
.ts-label small { font-size: 13.5px; font-weight: 500; color: var(--text-muted); letter-spacing: 0; margin-top: 2px; }
.ts-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ts-chip { font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: var(--seg); color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ts-chip b { font-weight: 800; }
.ts-chip.paid { background: var(--success-soft); color: var(--success); }
.ts-chip.serve { background: var(--gold-soft); color: var(--tint); }
.ts-chip.money { background: var(--accent-soft); color: var(--accent-ink); }

/* Tische: noch nicht abgerechnet */
.tables-summary { flex-direction: column; align-items: stretch; gap: 12px; }
.ts-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ts-name {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; min-height: 48px; padding: 7px 14px; border: none; border-radius: 14px;
  background: var(--danger-soft); color: var(--danger); font: inherit; font-size: 15.5px; font-weight: 700; letter-spacing: -0.012em; cursor: pointer;
}
.ts-name small { font-size: 12.5px; font-weight: 600; opacity: 0.9; font-variant-numeric: tabular-nums; }
.ts-name.partial { background: var(--accent-soft); color: var(--accent-ink); }
.ts-name:active { transform: scale(0.96); }
.ts-label { flex: 1; }

/* ==========================================================================
   Version 37 – kleiner Statuspunkt am Tisch (rot = nicht abgerechnet, grün = abgerechnet)
   ========================================================================== */
:root { --alarm: #e0101f; --done: #1fa84a; }
.settle-dot {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; flex-shrink: 0;
}
.settle-dot.open { background: var(--alarm); box-shadow: 0 0 0 3px rgba(224, 16, 31, 0.2); }
.settle-dot.done { background: var(--done); box-shadow: 0 0 0 3px rgba(31, 168, 74, 0.2); }
.ts-num { background: var(--alarm); color: #fff; box-shadow: 0 4px 12px rgba(224, 16, 31, 0.35); }
.ts-name, .ts-name.partial { background: var(--alarm); color: #fff; box-shadow: 0 3px 8px rgba(224, 16, 31, 0.3); }
.ts-name small { opacity: 0.95; }

/* ==========================================================================
   Version 40 – Kasse (ohne Bon) und Tische grafisch getrennt
   ========================================================================== */
.group-label { display: flex; align-items: baseline; gap: 10px; margin: 6px 4px 10px; }
.group-label span { font-size: 22px; font-weight: 800; letter-spacing: -0.025em; }
.group-label small { font-size: 13.5px; font-weight: 500; color: var(--text-muted); }
.group-label.hidden, .bar-section.hidden { display: none; }
.bar-section {
  margin: 4px 0 26px; padding: 12px 12px 14px; border-radius: 26px;
  background: color-mix(in srgb, var(--accent) 16%, var(--bg));
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 45%, transparent);
}
.bar-section .group-label { margin: 2px 4px 10px; }
.bar-section .group-label span { font-size: 19px; }
.tables-label { margin-top: 4px; }

/* Tischkarten ohne Status-Wort: kompakter */
#tablesGrid .table-card { min-height: 84px; justify-content: space-between; }

/* Hinweis-Fenster nach "Bestellung senden" */
.send-note-hint { margin: 0 0 12px; font-size: 14px; color: var(--text-muted); }
.send-note-sheet .field-input { width: 100%; min-height: 50px; font-size: 17px; }
.send-note-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.send-note-chip { border: none; font: inherit; font-size: 15px; font-weight: 600; min-height: 40px; padding: 8px 14px; border-radius: 999px; background: var(--seg); color: var(--text); cursor: pointer; }
.send-note-chip:active { background: var(--accent-soft); }

/* ==========================================================================
   Version 43 – Frühere Bestellungen je Tisch
   ========================================================================== */
.prev-orders-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: 4px 0 12px; padding: 0 16px 0 12px;
  border: none; border-radius: 14px; background: var(--seg); color: var(--tint); font: inherit; font-size: 15.5px; font-weight: 600; cursor: pointer;
}
.prev-orders-btn svg { width: 21px; height: 21px; }
.prev-orders-btn:active { opacity: 0.6; }
.prev-orders-btn.hidden { display: none; }

.orders-sheet { max-height: 88vh; display: flex; flex-direction: column; }
.orders-sheet h2 { margin-bottom: 2px; }
.orders-sub { margin: 0 0 12px; color: var(--text-muted); font-size: 15px; font-weight: 600; }
.orders-list { overflow-y: auto; flex: 1 1 auto; display: flex; flex-direction: column; gap: 12px; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.orders-empty { margin: 8px 0 16px; color: var(--text-muted); font-size: 15px; }
.orders-card { background: var(--surface-2); border-radius: 16px; padding: 12px 14px; }
.oc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.oc-when { font-size: 15.5px; font-weight: 700; letter-spacing: -0.012em; }
.oc-who { font-size: 13px; color: var(--text-muted); margin-top: 1px; }
.oc-rows { display: flex; flex-direction: column; border-top: 0.5px solid var(--sep); }
.oc-row { display: grid; grid-template-columns: auto 1fr auto auto; align-items: baseline; gap: 8px; padding: 7px 0; border-bottom: 0.5px solid var(--sep); font-size: 15px; }
.oc-qty { font-weight: 700; font-variant-numeric: tabular-nums; }
.oc-name small { display: block; font-size: 12.5px; color: var(--text-muted); }
.oc-sum { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; min-width: 64px; }
.oc-row.cancelled .oc-name, .oc-row.cancelled .oc-sum, .oc-row.cancelled .oc-qty { text-decoration: line-through; color: var(--text-muted); }
.oc-tag { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.oc-tag.paid { background: var(--success-soft); color: var(--success); }
.oc-tag.open { background: var(--accent-soft); color: var(--accent-ink); }
.oc-tag.new { background: var(--gold-soft); color: var(--tint); }
.oc-tag.cancelled { background: var(--seg); color: var(--text-muted); }
.oc-total { display: flex; justify-content: space-between; padding-top: 9px; font-size: 16px; }

/* Version 44 – "Alles abrechnen" mit einem Klick */
.btn.payall-btn { background: var(--success-strong); color: #fff; border: none; }
.btn.payall-btn .btn-count { background: rgba(255, 255, 255, 0.24); color: #fff; }
.btn.payall-btn:active { filter: brightness(0.92); }
.btn.payall-btn.hidden { display: none; }

/* Version 47 – Trinkgeld, Rechnung teilen, Nochmal dasselbe, Ausverkauft */
.tip-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tip-chip { border: none; border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 600; background: var(--accent-soft); color: var(--accent-ink); cursor: pointer; }
.tip-chip.ghost { background: var(--seg); color: var(--text-muted); }
.tip-chip:active { transform: scale(0.96); }
#splitBtn.hidden, #repeatBtn.hidden { display: none; }
#splitBtn, #repeatBtn { margin-top: 8px; }
.item-btn.sold-out { opacity: 0.55; background: var(--surface-2); }
.item-btn.sold-out .iname { text-decoration: line-through; }
.item-btn { position: relative; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.sold-badge { position: absolute; right: 8px; bottom: 8px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--danger-soft); color: var(--danger); }
.soldout-view .field-input { margin: 10px 0 4px; }
.soldout-summary { background: var(--danger-soft); color: var(--danger); font-weight: 600; font-size: 14px; padding: 10px 12px; border-radius: 12px; margin: 8px 0; }
.soldout-list { display: flex; flex-direction: column; gap: 0; }
.soldout-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface); border-bottom: 0.5px solid var(--sep); cursor: pointer; }
.soldout-row .so-name { flex: 1; font-size: 16px; font-weight: 500; }
.soldout-row .so-state { font-size: 13px; color: var(--success); font-weight: 600; }
.soldout-row.on .so-name { text-decoration: line-through; color: var(--text-muted); }
.soldout-row.on .so-state { color: var(--danger); }
.soldout-row input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--danger-fill); }
.item-btn.sold-out::after { display: none; }

/* Version 48 – Bestand, Live-Übersicht, Kassensturz */
.soldout-row .so-name small { display: block; font-size: 12.5px; font-weight: 600; color: var(--success); margin-top: 1px; }
.soldout-row.on .so-name small { color: var(--danger); }
.so-stock-btn { border: none; background: var(--seg); color: var(--text); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.sold-badge.low { background: var(--accent-soft); color: var(--accent-ink); }
.stock-alert { background: var(--accent-soft); color: var(--accent-ink); border-radius: 14px; padding: 10px 14px; margin: 0 0 12px; font-size: 14px; display: flex; flex-direction: column; gap: 3px; }

.ov-body { display: flex; flex-direction: column; gap: 12px; }
.ov-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ov-kpi { background: var(--surface); border: 1px solid var(--card-edge); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.ov-kpi.big { grid-column: 1 / -1; background: var(--accent); border-color: var(--accent-strong); }
.ov-kpi span { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.ov-kpi.big span { color: var(--accent-ink); }
.ov-kpi b { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ov-kpi.big b { font-size: 34px; color: var(--accent-contrast); }
.ov-kpi small { font-size: 12px; color: var(--text-muted); }
.ov-warn { border-radius: 14px; padding: 10px 14px; font-size: 14px; }
.ov-warn.out { background: var(--danger-soft); color: var(--danger); }
.ov-warn.low { background: var(--accent-soft); color: var(--accent-ink); }
.ov-card { background: var(--surface); border: 1px solid var(--card-edge); border-radius: 18px; padding: 14px; }
.ov-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 10px; }
.ov-bars { display: flex; align-items: flex-end; gap: 4px; height: 150px; overflow-x: auto; padding-top: 6px; }
.ov-bar-col { flex: 1 0 22px; max-width: 46px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; }
.ov-bar { width: 100%; background: var(--accent); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.ov-bar-val { font-size: 10.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; height: 13px; }
.ov-bar-lbl { font-size: 11px; font-weight: 600; color: var(--text-muted); height: 14px; }
.ov-row { padding: 7px 0; border-bottom: 0.5px solid var(--sep); }
.ov-row:last-child { border-bottom: none; }
.ov-row-main { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.ov-row-main b { font-variant-numeric: tabular-nums; }
.ov-meter { height: 6px; background: var(--seg); border-radius: 999px; margin: 5px 0 3px; overflow: hidden; }
.ov-meter i { display: block; height: 100%; background: var(--accent-strong); border-radius: 999px; }
.ov-row small { font-size: 12.5px; color: var(--text-muted); }
.ov-empty { color: var(--text-muted); font-size: 14px; padding: 10px 0; }
.ov-foot { text-align: center; font-size: 12px; color: var(--text-muted); padding: 4px 0 12px; }

.cash-tip-opt { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin: 10px 0 12px; }
.cash-tip-opt input { margin-top: 3px; width: 18px; height: 18px; }
.cash-card { margin-bottom: 12px; }
.cash-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.cash-head b { font-size: 16px; }
.cash-soll { font-size: 13.5px; color: var(--text-muted); font-weight: 600; }
.cash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cash-grid label { font-size: 12.5px; color: var(--text-muted); display: flex; flex-direction: column; gap: 4px; }
.cash-diff { margin-top: 10px; font-size: 15px; font-weight: 700; color: var(--text-muted); }
.cash-diff.ok { color: var(--success); }
.cash-diff.bad { color: var(--danger); }
.cash-actions { display: flex; gap: 10px; margin: 14px 0 20px; }
.cash-actions .btn { flex: 1; }

/* Version 49 – Druckerstatus, nicht gedruckte Bons, Sicherung */
.print-chip { display: inline-flex; align-items: center; gap: 4px; border: none; background: var(--danger-fill); color: #fff; border-radius: 999px; padding: 5px 9px; font-size: 13px; font-weight: 700; cursor: pointer; flex-shrink: 0; }
.print-chip.hidden { display: none; }
.print-chip svg { width: 16px; height: 16px; }
.print-alert { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: none; background: var(--danger-soft); color: var(--danger); border-radius: 14px; padding: 11px 14px; margin: 0 0 12px; font-size: 15px; cursor: pointer; }
.print-alert svg { width: 22px; height: 22px; flex-shrink: 0; }
.print-alert b { display: block; }
.print-alert small { display: block; font-size: 12.5px; font-weight: 500; opacity: 0.9; }
.pi-ok { color: var(--success); font-weight: 600; margin: 4px 0 14px; }
.pi-down { background: var(--danger-soft); color: var(--danger); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; font-size: 15px; }
.pi-down small { display: block; font-size: 12.5px; margin-top: 2px; }
.pi-job { background: var(--surface-2); border-radius: 14px; padding: 12px; margin-bottom: 10px; }
.pi-job-head { display: flex; justify-content: space-between; gap: 8px; font-size: 15.5px; }
.pi-job-head span { color: var(--text-muted); font-size: 13.5px; }
.pi-job-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.pi-job-err { font-size: 13px; color: var(--danger); margin-top: 6px; }
.pi-job-actions { display: flex; gap: 8px; margin-top: 10px; }
.pi-job-actions .btn { margin-top: 0; flex: 1; }
.bk-list { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.bk-list a { font-size: 13.5px; color: var(--tint); text-decoration: none; }
.bk-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bk-restore { border: none; background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); font: inherit; font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 999px; cursor: pointer; flex: none; }

/* Version 49 – Offline-Puffer */
.offline-bar { padding: 8px 16px; font-size: 13px; font-weight: 600; line-height: 1.35; background: var(--accent-soft); color: var(--accent-ink); text-align: center; flex-shrink: 0; }
.offline-bar.offline-on { background: var(--danger-fill); color: #fff; }
.offline-bar.hidden { display: none; }
.tag.tag-queued { background: var(--accent-soft); color: var(--accent-ink); }

/* Version 50 – Warteliste */
.bar-wait { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.bar-wait.has { color: var(--accent-ink); background: var(--accent-soft); border-radius: 999px; padding: 2px 8px; align-self: flex-start; }
.wait-alert { display: block; width: 100%; text-align: left; border: none; background: var(--accent-soft); color: var(--accent-ink); border-radius: 14px; padding: 11px 14px; margin: 0 0 12px; font-size: 15px; cursor: pointer; }
.wait-alert small { display: block; font-size: 12.5px; font-weight: 500; opacity: 0.9; margin-top: 1px; }
.wait-list { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 18px; }
.wait-card { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: start; background: var(--surface); border: 1px solid var(--card-edge); border-radius: 16px; padding: 12px; }
.wait-no { min-width: 46px; height: 46px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); font-size: 24px; font-weight: 800; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.wait-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; font-size: 16px; }
.wait-age { font-size: 12.5px; color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.wait-age.late { color: var(--danger); }
.wait-items { font-size: 14.5px; margin-top: 4px; line-height: 1.4; }
.wait-items em { color: var(--text-muted); font-style: normal; }
.wait-foot { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.wait-done { grid-column: 1 / -1; margin-top: 4px; }
.wait-done-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--card-edge); font-size: 14.5px; color: var(--text-muted); }

.bar-cart-chip.wait-btn.has { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.wait-count.has { font-weight: 800; }
.wait-sheet { max-height: 88vh; overflow-y: auto; }
.bar-cart-chip.wait-btn.has .bc-sum { color: var(--accent-ink); }

/* Version 52 – Ausverkauft-Haken in der Speisekarte */
.item-row { flex-wrap: wrap; }
.item-row .item-so-row { flex: 0 0 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.item-row .item-so { flex: 1 1 auto; display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--text-muted); cursor: pointer; padding-top: 2px; }
.item-row .item-so input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--danger-fill); flex: none; }
.item-row .item-so.on { color: var(--danger); }
.item-row .so-stock-btn { flex: none; }

/* Version 55 – Schnell zu einem Tisch springen */
.table-jump { margin: 0 0 14px; }
.table-jump.hidden { display: none; }
.table-jump-row { display: flex; gap: 8px; }
.table-jump-row .field-input { flex: 1; min-width: 0; }
.table-jump-row .btn { margin-top: 0; flex: none; }
.jump-sugg { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.jump-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border-radius: 20px; border: 1.5px solid var(--border, #d6d6dc); background: var(--surface, #fff); color: var(--text, #111); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.jump-chip.first { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.jump-none { font-size: 13px; color: var(--text-muted); align-self: center; }

/* Version 57 – Tisch-Übersicht zum Antippen */
.picker-sheet { max-height: 88vh; overflow-y: auto; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; margin: 6px 0 14px; }
.pick-btn { min-height: 48px; border-radius: 14px; border: 1.5px solid var(--border, #d6d6dc); background: var(--surface-2, #f2f2f7); color: var(--text, #111); font: inherit; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; padding: 4px 6px; }
.pick-btn.wide { grid-column: span 2; font-size: 14.5px; }
.pick-btn.open { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.pick-btn.bar { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); grid-column: span 2; font-size: 14.5px; }
.table-jump-row .btn { width: auto; flex: none; white-space: nowrap; }
.table-jump-row .jump-all { width: 48px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.table-jump-row .jump-all svg { width: 22px; height: 22px; }

/* Version 58 – Bereich Kasse */
.kasse-tabs { margin-bottom: 14px; }

/* Version 59 – Startbild */
.splash { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; background: var(--bg, #f2f2f7); color: var(--text, #111); transition: opacity .4s ease; }
.splash.out { opacity: 0; pointer-events: none; }
.splash-inner { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 24px; }
.splash-logo { width: 120px; height: auto; margin-bottom: 18px; }
.splash h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }
.splash p { margin: 4px 0 28px; color: var(--text-muted, #666); font-size: 15px; }
.splash-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3.5px solid var(--accent-soft, #fbe7b0); border-top-color: var(--accent, #f5b419); animation: splash-spin .9s linear infinite; }
.splash-text { margin-top: 12px; font-size: 13.5px; font-weight: 600; color: var(--text-muted, #666); }
@keyframes splash-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .splash-spinner { animation-duration: 3s; } .splash { transition: none; } }

/* Version 60 – farbiges Symbol für „Kasse" */
[data-view="kasse"] { --tc: #4a45b8; --tc-fill: #5b57d1; --tc-on: #fff; }

/* Version 61 – Menü-Knopf nur mit drei Strichen, Tisch anlegen im Menü */
.menu-fab { width: 54px; padding: 0; justify-content: center; gap: 0; }
[data-view="newtable"] { --tc: #12707d; --tc-fill: #1b8a9a; --tc-on: #fff; }

/* Version 62 – nur noch der Knopf „Tisch auswählen" */
.table-jump .jump-all { width: 100%; height: 48px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-size: 16px; font-weight: 600; margin-top: 0; }
.table-jump .jump-all svg { width: 22px; height: 22px; }

/* Version 64 – Menüpunkt „Daten sichern" */
[data-view="backup"] { --tc: #8a4b12; --tc-fill: #c76f1b; --tc-on: #fff; }

/* Version 65 – kleiner Tisch-Knopf über dem Menü-Knopf */
body:not(.ek) .tabbar { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.tables-fab {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: 5px; padding: 0;
  border: none; border-radius: 22px; cursor: pointer; color: var(--tint);
  background: var(--glass-bar);
  -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16), 0 0 0 0.5px var(--card-edge);
  transition: transform 0.14s var(--ease);
}
.tables-fab svg { width: 22px; height: 22px; }
.tables-fab:active { transform: scale(0.94); }
.tables-fab:focus-visible { outline: 3px solid var(--tint); outline-offset: 3px; }

/* V66: Zwei-Faktor-Freigabe */
.mfa-badge.exempt { color: #9a5b00; }

/* V66b: Speicher-Anzeige für Admins */
.storage-chip { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; background: var(--seg); border: none; color: var(--text-muted); font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 999px; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.storage-chip svg { width: 13px; height: 13px; }
.storage-chip.warn { color: var(--danger); }
.storage-chip.hidden { display: none; }
@media (max-width: 640px) {
  .topbar:has(#backBtn:not(.hidden)) .user-chip .chip-version { display: none !important; }
}

/* V68: alle Tisch-Felder gleich groß - egal ob ein Betrag darunter steht */
#tablesGrid, #barGrid { grid-auto-rows: 1fr; }
#tablesGrid .table-card { min-height: 98px; }
.tables-grid .table-card-wrap { height: 100%; }
.tables-grid .table-card { height: 100%; box-sizing: border-box; justify-content: space-between; }

/* V70: feste Kopfzeile + bessere Anpassung ans Handy */
html, body { overflow: hidden; overscroll-behavior: none; }
#app { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
main#content { overscroll-behavior-y: contain; }
/* Kopfzeile: immer eine Zeile, immer gleich hoch, immer als eigener Streifen sichtbar */
.topbar, #app.has-large:not(.scrolled) .topbar {
  flex: 0 0 auto; flex-wrap: nowrap; position: relative; z-index: 30;
  background: var(--glass-bar);
  box-shadow: 0 0.5px 0 var(--sep);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
.topbar > * { flex: 0 0 auto; }
.topbar > h1 { flex: 1 1 0; min-width: 0; }
#eventChip { display: inline-flex; align-items: center; gap: 6px; flex: 0 1 auto; min-width: 0; max-width: 44vw; }
#eventChip svg { flex: 0 0 auto; }
#eventChip .chip-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip, .storage-chip, .print-chip { position: relative; }
.user-chip::after, .storage-chip::after, .print-chip::after { content: ''; position: absolute; inset: -7px -3px; }
@media (max-width: 350px) {
  .user-chip .chip-version { display: none !important; }
  .storage-chip svg { display: none; }
  #eventChip { max-width: 38vw; }
}
/* Letzte Zeilen nicht hinter den schwebenden Knöpfen verstecken */
@media (max-width: 640px) {
  #app:has(#tabbar:not(.hidden)) main#content { padding-bottom: calc(var(--safe-bottom, 0px) + 150px); }
  select, textarea, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]) { font-size: max(16px, 1em); }
}
/* Größere Tipp-Flächen */
.table-edit-btn { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; top: 0; right: 0; }
.icon-x { min-width: 40px; min-height: 40px; }
button, .table-card, .item-btn, .tab, .more-item, .pick-btn { -webkit-user-select: none; user-select: none; }
/* Querformat: Kopfzeile flacher, damit mehr Platz zum Bestellen bleibt */
@media (orientation: landscape) and (max-height: 500px) {
  .topbar { min-height: 44px; padding-top: calc(var(--safe-top) + 3px); padding-bottom: 3px; }
}
.printer-select, select.printer-select { font-size: 16px; }

/* V71: modernere Ladeanimation im Startbild */
.splash { background: radial-gradient(110% 60% at 50% 40%, color-mix(in srgb, var(--accent, #f5b419) 16%, var(--bg, #f2f2f7)) 0%, var(--bg, #f2f2f7) 62%); overflow: hidden; }
.splash-logo-wrap { position: relative; display: grid; place-items: center; margin-bottom: 22px; animation: splash-pop .75s cubic-bezier(.2, .9, .25, 1.15) both; }
.splash-logo-wrap .splash-logo { position: relative; margin: 0; filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .22)); animation: splash-float 3.2s ease-in-out .8s infinite; }
.splash-glow { position: absolute; width: 190px; height: 190px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent, #f5b419) 55%, transparent) 0%, transparent 68%); animation: splash-glow 2.4s ease-in-out infinite; }
.splash h1 { animation: splash-rise .6s ease .25s both; }
.splash-text { margin-top: 14px; animation: splash-rise .6s ease .6s both; }
.splash-text i { font-style: normal; opacity: .25; animation: splash-dot 1.2s ease-in-out infinite; }
.splash-text i:nth-child(2) { animation-delay: .2s; }
.splash-text i:nth-child(3) { animation-delay: .4s; }
@keyframes splash-pop { from { opacity: 0; transform: scale(.7) translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes splash-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes splash-glow { 0%, 100% { transform: scale(.85); opacity: .55; } 50% { transform: scale(1.12); opacity: 1; } }
@keyframes splash-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes splash-dot { 0%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .splash-logo-wrap, .splash-logo-wrap .splash-logo, .splash-glow, .splash h1, .splash-text, .splash-text i { animation: none; }
  .splash-ring { display: none; }
  .splash-eq span { animation: none; transform: scaleY(.55); background: var(--accent, #f5b419); }
}

/* V72: Kopfzeile wieder klar und deckend (kein durchscheinender Weichzeichner mehr) */
:root { --topbar-solid: #fcfcfe; }
.topbar, #app.has-large:not(.scrolled) .topbar, #app.scrolled .topbar, #app:not(.has-large) .topbar {
  background: var(--topbar-solid);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  box-shadow: 0 1px 0 var(--sep), 0 2px 8px rgba(0, 0, 0, 0.04);
}
/* Auf dem Handy ist in der Kopfzeile kein Platz für den Titel (er steht groß im Inhalt) - sonst blitzt nur ein halber Buchstabe auf */
@media (max-width: 640px) { .topbar > h1 { visibility: hidden !important; } }

/* V73: Server-Seite (Admin) */
.srv-status { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.srv-status b { font-size: 17px; }
.srv-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--switch-on, #34c759); box-shadow: 0 0 0 4px color-mix(in srgb, var(--switch-on, #34c759) 25%, transparent); }
.srv-sub { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.srv-status .srv-sub { margin: 0; }
.srv-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 6px 0 4px; }
.srv-grid > div { background: var(--seg); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.srv-grid span { font-size: 12.5px; color: var(--text-muted); }
.srv-grid b { font-size: 20px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.srv-grid b.warn { color: var(--danger); }
.srv-meter { height: 10px; border-radius: 999px; background: var(--seg); overflow: hidden; margin-top: 8px; }
.srv-meter span { display: block; height: 100%; border-radius: inherit; background: var(--tint); transition: width .4s ease; }
.srv-meter span.warn { background: var(--danger); }
.srv-log { margin: 12px 0 0; padding: 10px 12px; max-height: 260px; overflow: auto; background: var(--seg); border-radius: 12px; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-word; color: var(--text); -webkit-user-select: text; user-select: text; }
[data-view="server"] { --tc: #0d7d86; --tc-fill: #138e98; --tc-on: #fff; }

/* V74: die App füllt den ganzen Handy-Bildschirm (auch im Vollbild vom Home-Bildschirm und im Querformat) */
html { background: var(--bg); min-height: 100%; }
html, body { width: 100%; height: 100%; margin: 0; }
#app { position: fixed; top: 0; right: 0; bottom: 0; left: 0; width: auto; height: auto; }
@media (orientation: landscape) and (max-height: 500px) {
  .view, .view:not(.order-view) { max-width: none; }
}

/* V75: Die Einkauf-Seiten scrollen als ganze Seite (Korrektur zu V70/V74) */
html:has(> body.ek) { overflow-y: auto; height: auto; min-height: 100%; }
body.ek { overflow: visible; height: auto; min-height: 100%; overscroll-behavior-y: auto; }

/* V76: nichts mehr abgeschnitten - Notch/Dynamic Island, Home-Balken, Querformat und Tastatur */
#app { padding-left: 0; padding-right: 0; }
.topbar { padding-left: max(16px, calc(env(safe-area-inset-left) + 6px)); padding-right: max(16px, calc(env(safe-area-inset-right) + 6px)); }
.view { padding-left: max(16px, calc(env(safe-area-inset-left) + 6px)); padding-right: max(16px, calc(env(safe-area-inset-right) + 6px)); }
@media (min-width: 900px) { .view { padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); } }
.tabbar, body.ek .tabbar { left: max(16px, calc(env(safe-area-inset-left) + 8px)); }
.fab { right: max(16px, calc(env(safe-area-inset-right) + 8px)); }
.auth-screen { padding: calc(var(--safe-top) + 24px) max(18px, calc(env(safe-area-inset-left) + 8px)) calc(var(--safe-bottom) + 24px); }
.modal-backdrop { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.modal-sheet { max-height: min(86vh, calc(100dvh - var(--safe-top) - 12px)); }
#toastHost { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
/* Tastatur offen: Dialoge passen sich dem sichtbaren Bereich an und rutschen über die Tastatur */
html.kb-open .modal-backdrop { top: var(--vvtop, 0px); bottom: auto; height: var(--vvh, 100%); }
html.kb-open .modal-sheet { max-height: calc(var(--vvh, 100vh) - 12px); padding-bottom: 16px; }
html.kb-open .tabbar, html.kb-open .tables-fab, html.kb-open .menu-fab { display: none !important; }
/* Querformat / kleine Höhe: Menü in zwei Spalten, damit nichts unten abgeschnitten wird */
@media (max-height: 520px) {
  .modal-backdrop:has(.more-list) .modal-sheet { max-width: min(640px, calc(100vw - 40px)); max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 16px); padding-top: 4px; }
  .more-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1px; margin-top: 6px; }
  .more-item { padding: 8px 12px; font-size: 16px; }
  .more-item + .more-item::before { display: none; }
  .more-item { box-shadow: 0 0.5px 0 var(--sep); }
  .modal-sheet h2 { margin-bottom: 4px; font-size: 20px; }
}

/* V77: Notch/Dynamic Island einbauen + weniger Leerraum unten */
/* Die Statusleiste des iPhones hat weiße Schrift: der Streifen hinter der Notch ist deshalb schwarz (verschmilzt mit der Notch) und die Kopfzeile beginnt darunter */
.topbar, #app.has-large:not(.scrolled) .topbar, #app.scrolled .topbar, #app:not(.has-large) .topbar {
  background: linear-gradient(to bottom, #000 0, #000 var(--safe-top), var(--topbar-solid) var(--safe-top));
  box-shadow: 0 1px 0 var(--sep);
}
/* Untere Leisten rücken näher an den Rand (der Home-Balken darf in den Polsterbereich ragen) */
main#content:has(> .order-view) { padding-bottom: 0; }
.order-actions { padding-bottom: max(10px, calc(var(--safe-bottom) - 8px)); }
.tabbar, body.ek .tabbar { bottom: max(12px, calc(var(--safe-bottom) - 8px)); }
.fab { bottom: max(12px, calc(var(--safe-bottom) - 8px)); }
.modal-sheet { padding-bottom: max(16px, calc(var(--safe-bottom) - 6px)); }

/* V78: Bestell-Ansicht - die Leiste „Bestellung senden" sitzt ganz unten (vorher schwebte sie ~130px darüber) */
.view.order-view, .order-view { padding-bottom: 0 !important; }
.order-actions { position: sticky; bottom: 0; }

/* V79: iPhone - schwarzer Streifen hinter der Dynamic Island als eigenes Element, App-Fläche = ganzer Bildschirm */
body::before {
  content: ""; position: fixed; top: 0; left: 0; right: 0; height: var(--safe-top); background: #000; z-index: 500; pointer-events: none;
}
.topbar, #app.has-large:not(.scrolled) .topbar, #app.scrolled .topbar, #app:not(.has-large) .topbar {
  background: var(--topbar-solid); box-shadow: 0 1px 0 var(--sep);
}
/* V82: Meldet iOS die Fensterhöhe zu klein (Lücke unten), wird die ganze Seite auf die echte Bildschirmhöhe (--app-h) gesetzt.
   Alles wird dann normal in die Seite gezeichnet (nichts mehr "fixed" - fixierte Flächen endeten auf dem iPhone an der zu kleinen Fensterhöhe).
   Die Seite selbst scrollt nie (siehe Skript in index.html). Mit offener Tastatur gelten wieder die normalen Regeln. */
html.fit-screen, html.fit-screen body:not(.ek) { height: var(--app-h); overflow: hidden; overscroll-behavior: none; }
html.fit-screen body:not(.ek) { position: relative; }
html.fit-screen body:not(.ek)::before { position: absolute; }
html.fit-screen #app { position: absolute; top: 0; left: 0; right: 0; bottom: auto; height: var(--app-h); }
html.fit-screen .tabbar, html.fit-screen .fab { position: absolute; bottom: max(12px, calc(var(--safe-bottom) - 8px)); }
html.fit-screen #toastHost { position: absolute; bottom: calc(80px + var(--safe-bottom)); }
html.fit-screen .modal-backdrop, html.fit-screen .auth-screen, html.fit-screen .splash { position: absolute; top: 0; left: 0; right: 0; bottom: auto; height: var(--app-h); }
html.fit-screen.kb-open .modal-backdrop { position: fixed; top: var(--vvtop, 0px); height: var(--vvh, 100%); }
/* V82: die Bestell-Leiste sitzt bündig am unteren Rand (vorher blieb ein 4px-Streifen) */
.order-actions { margin-bottom: 0 !important; }

/* V84: Server-Wächter */
.storage-chip { position: relative; }
.storage-chip .chip-alert { font-style: normal; display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; line-height: 1; }
.srv-alerts { display: flex; flex-direction: column; gap: 10px; }
.srv-alert { border-radius: 14px; padding: 12px 14px; background: color-mix(in srgb, var(--warn, #ff9f0a) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn, #ff9f0a) 40%, transparent); }
.srv-alert.crit { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.srv-alert-t { font-weight: 700; font-size: 15px; }
.srv-alert.crit .srv-alert-t { color: var(--danger); }
.srv-alert-d { margin-top: 4px; font-size: 13.5px; color: var(--text); }
.srv-alert-m { margin-top: 6px; font-size: 12px; color: var(--text-muted); }

/* V84: Offline-Streifen antippbar + Übersicht „Offline-Speicher“ */
.offline-bar { cursor: pointer; }
.offline-bar.offline-failed { background: var(--danger-fill); color: #fff; }
.outbox-state { margin: 0 0 12px; font-size: 14px; color: var(--text-muted); }
.outbox-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; max-height: 46vh; overflow: auto; }
.outbox-row { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--seg); font-size: 14px; }
.outbox-row b { font-size: 14.5px; }
.outbox-row span { color: var(--text-muted); font-size: 13px; word-break: break-word; }
.outbox-row.failed { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); }
.outbox-row.failed b { color: var(--danger); }

/* V85: Nicht gesendete Bestellungen (Tische-Ansicht) */
.unsent-card { margin: 0 0 12px; border-radius: 16px; font-size: 14px; }
.unsent-card.ok { display: flex; align-items: center; gap: 8px; padding: 9px 14px; background: color-mix(in srgb, var(--switch-on, #34c759) 14%, var(--surface)); color: var(--text); font-weight: 600; }
.unsent-card.ok svg { width: 16px; height: 16px; color: var(--switch-on, #34c759); flex-shrink: 0; }
.unsent-card.bad { padding: 14px; background: color-mix(in srgb, var(--danger) 11%, var(--surface)); border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); }
.us-head { display: flex; align-items: center; gap: 10px; }
.us-head svg { width: 26px; height: 26px; flex-shrink: 0; padding: 4px; border-radius: 50%; background: var(--danger); color: #fff; }
.us-head b { display: block; font-size: 16px; color: var(--danger); }
.us-head small { display: block; font-size: 12.5px; color: var(--text-muted); }
.us-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.us-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface); }
.us-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.us-main b { font-size: 15px; }
.us-meta { font-size: 12.5px; color: var(--text-muted); }
.us-reason { font-size: 12.5px; color: var(--danger); font-weight: 600; word-break: break-word; }
.us-btns { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.us-btns .btn { margin-top: 0; white-space: nowrap; }
.us-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.us-actions .btn { margin-top: 0; }
.table-card.has-unsent { box-shadow: inset 0 0 0 2px var(--danger); }
.table-card.has-unsent { position: relative; }
.unsent-tag { position: absolute; right: 12px; bottom: 14px; padding: 3px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 800; color: #fff; background: var(--danger); line-height: 1.2; }

/* V86: Auslagen (Kasse) + Rollen & Rechte */
.exp-sum { border-radius: 18px; padding: 16px 18px; margin: 0 0 12px; background: var(--surface); border: 1px solid var(--card-edge, var(--border)); display: flex; flex-direction: column; gap: 2px; }
.exp-sum small { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.exp-sum b { font-size: 32px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.exp-sum span { font-size: 13px; color: var(--text-muted); }
.exp-sum.open b { color: var(--danger); }
.exp-sum.clear b { color: var(--success, #3f6142); }
.exp-bar { display: flex; gap: 8px; margin-bottom: 10px; }
.exp-bar .btn { flex: 1; }
.exp-bar .btn.secondary { flex: 0 0 76px; }
.exp-filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.exp-filters select { flex: 1 1 130px; min-width: 0; }
.exp-people { margin-bottom: 14px; }
.exp-person { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; padding: 11px 14px; margin-bottom: 6px; border: 1px solid var(--card-edge, var(--border)); border-radius: 14px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.exp-person .ep-name { display: flex; flex-direction: column; min-width: 0; font-weight: 700; font-size: 15px; }
.exp-person .ep-name small { font-weight: 500; font-size: 12.5px; color: var(--text-muted); }
.exp-person .ep-open { flex-shrink: 0; font-variant-numeric: tabular-nums; font-weight: 800; font-size: 15px; color: var(--success, #3f6142); }
.exp-person.open .ep-open { color: var(--danger); }
.exp-list { display: flex; flex-direction: column; gap: 10px; }
.exp-card { border-radius: 16px; padding: 13px 14px; background: var(--surface); border: 1px solid var(--card-edge, var(--border)); }
.exp-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.exp-desc { font-weight: 700; font-size: 15.5px; min-width: 0; overflow-wrap: anywhere; }
.exp-amt { font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.exp-meta { margin-top: 2px; font-size: 12.5px; color: var(--text-muted); }
.exp-note { margin-top: 4px; font-size: 13px; color: var(--text); overflow-wrap: anywhere; }
.exp-status { display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 10px; font-size: 12.5px; font-weight: 800; }
.exp-status.open { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, var(--surface)); }
.exp-status.partial { color: #8a5a00; background: color-mix(in srgb, #f5b419 22%, var(--surface)); }
.exp-status.paid { color: var(--success, #3f6142); background: color-mix(in srgb, var(--success, #3f6142) 14%, var(--surface)); }
.exp-pays { display: flex; flex-direction: column; gap: 1px; margin-top: 6px; font-size: 12.5px; color: var(--text-muted); }
.exp-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.exp-actions .btn { margin-top: 0; }
.rights-sheet { max-height: 86vh; overflow-y: auto; }
.rights-intro { margin: 0 0 12px; font-size: 13.5px; color: var(--text-muted); }
.rights-role { border: 1px solid var(--card-edge, var(--border)); border-radius: 14px; padding: 10px 14px; margin-bottom: 8px; background: var(--surface); }
.rights-role.owner { display: flex; flex-direction: column; gap: 2px; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.rights-role.owner span { font-size: 12.5px; color: var(--text-muted); }
.rights-role summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.rights-role summary::-webkit-details-marker { display: none; }
.rights-role summary span { font-size: 12.5px; color: var(--text-muted); }
.rights-hint { margin: 8px 0 4px; font-size: 12.5px; color: var(--text-muted); }
.rights-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-top: 1px solid var(--sep, var(--border)); font-size: 14.5px; font-weight: 600; }
.rights-row input { width: 22px; height: 22px; margin: 1px 0 0; flex-shrink: 0; }
.rights-row small { display: block; font-weight: 400; font-size: 12.5px; color: var(--text-muted); }
.role-badge { white-space: nowrap; }
.exp-actions .btn { width: auto; flex: 1 1 auto; min-width: 0; }

/* V87: Belege (Foto/PDF) an Auslagen */
.exp-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.exp-file { position: relative; }
.exp-file a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 84px; height: 84px; padding: 4px; border-radius: 12px; overflow: hidden; background: var(--seg, var(--surface-2)); border: 1px solid var(--card-edge, var(--border)); color: var(--text); text-decoration: none; }
.exp-file img { width: 100%; height: 62px; object-fit: cover; border-radius: 8px; }
.exp-file i { font-style: normal; font-weight: 800; font-size: 15px; color: var(--accent-strong); }
.exp-file span { max-width: 100%; font-size: 10.5px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exp-file-x { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 0; background: var(--danger); color: #fff; font-size: 16px; line-height: 24px; text-align: center; cursor: pointer; }
.file-input { padding: 9px; }

/* V88: Rechte in Gruppen */
.rights-group { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 2px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.rights-group small { font-weight: 600; text-transform: none; letter-spacing: 0; }
.rights-all, .rights-reset { border: 0; background: none; color: var(--tint); font: inherit; font-size: 13px; font-weight: 700; text-transform: none; letter-spacing: 0; padding: 4px 0; cursor: pointer; }
.rights-reset { display: block; margin: 12px 0 2px; }

/* V90: eigene Rollen */
.rights-newrole { width: 100%; margin: 4px 0 12px; }
.rights-custom-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.rights-reset.danger { color: var(--danger); }

/* ===== V93: Startmenü nach dem Ladebild ===== */
.hub-screen { position: fixed; inset: 0; z-index: 30; overflow-y: auto; -webkit-overflow-scrolling: touch; background: var(--bg); padding: calc(var(--safe-top) + 14px) 16px calc(var(--safe-bottom) + 24px); }
.hub-inner { max-width: 560px; margin: 0 auto; }
.hub-head { display: flex; align-items: center; gap: 12px; padding: 6px 2px 16px; }
.hub-logo { width: 46px; height: 52px; object-fit: contain; flex-shrink: 0; }
.hub-title { min-width: 0; flex: 1; }
.hub-title h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.hub-title p { margin: 2px 0 0; color: var(--text-muted); font-size: 15px; font-weight: 600; }
.hub-account { width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--surface); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow); flex-shrink: 0; }
.hub-account svg { width: 22px; height: 22px; }
.hub-label { margin: 6px 4px 10px; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; font-family: inherit; }
.hub-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hub-tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-align: left; padding: 15px 14px 14px; min-height: 118px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text); cursor: pointer; box-shadow: var(--shadow); font: inherit; }
.hub-tile:active { transform: scale(0.98); background: var(--surface-2); }
.hub-tile.main { grid-column: 1 / -1; flex-direction: row; align-items: center; min-height: 0; gap: 14px; padding: 16px; }
.hub-tile.main .hub-ico { width: 52px; height: 52px; border-radius: 16px; }
.hub-tile.main .hub-ico svg { width: 28px; height: 28px; }
.hub-tile.main b { font-size: 19px; }
.hub-ico { width: 42px; height: 42px; border-radius: 13px; background: var(--accent-soft); color: var(--text); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hub-ico svg { width: 24px; height: 24px; }
.hub-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hub-txt b { font-size: 16.5px; font-weight: 700; }
.hub-txt small { color: var(--text-muted); font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.hub-badge { position: absolute; top: 10px; right: 10px; background: var(--accent); color: var(--accent-contrast); font-size: 12px; font-weight: 800; border-radius: 999px; padding: 3px 9px; }
.hub-badge.hidden { display: none; }
.hub-screen .app-version { margin-top: 22px; text-align: center; }
@media (prefers-reduced-motion: reduce) { .hub-tile:active { transform: none; } }

/* V94: Vereinswappen = Weg ins Startmenü */
.logo-home { cursor: pointer; display: inline-flex; flex-shrink: 0; border-radius: 8px; -webkit-touch-callout: none; }
.logo-home:active { opacity: 0.6; }
.ek-top a.logo-home, .ek-top .logo-home { text-decoration: none; }

/* V96: Extras (Toppings) */
.item-btn .x-tag { display: inline-block; margin-top: 6px; font-size: 11.5px; font-weight: 700; color: var(--accent-contrast); background: var(--accent-soft); border-radius: 999px; padding: 2px 8px; }
.cart-row .cextras { display: flex; flex-direction: column; gap: 1px; font-size: 12.5px; color: var(--text-muted); }
.cart-row .cextras i { font-style: normal; opacity: 0.8; }
.topping-sheet .top-list { display: flex; flex-direction: column; margin: 6px 0 14px; }
.topping-sheet .top-row { display: flex; align-items: center; gap: 12px; padding: 13px 2px; border-bottom: 0.5px solid var(--sep); cursor: pointer; font-size: 16px; }
.topping-sheet .top-row:last-child { border-bottom: none; }
.topping-sheet .top-name { flex: 1 1 auto; font-weight: 600; }
.topping-sheet .top-price { color: var(--text-muted); font-variant-numeric: tabular-nums; font-weight: 500; }
.topping-sheet .top-edit { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.topping-sheet .top-edit-row { display: flex; gap: 8px; align-items: center; }
.topping-sheet .top-edit-row .field-input { min-width: 0; flex: 1 1 auto; }
.topping-sheet .top-edit-row .price-input { flex: 0 0 84px; width: 84px; }
.topping-sheet .top-copy { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--text-muted); }
.item-row .item-x-btn { flex: 0 0 auto; width: auto; min-width: 0; margin-left: auto; padding-left: 14px; padding-right: 14px; }
.draft-chip small { color: var(--text-muted); font-weight: 500; margin-left: 4px; }

/* V96: farbige Bereichs-Symbole (Menü und Startmenü) – Farbkachel mit weißem Symbol */
.nic { --g1: #6b7585; --g2: #4a5365; display: inline-flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(150deg, var(--g1), var(--g2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), inset 0 -1px 0 rgba(0, 0, 0, 0.14), 0 1px 3px rgba(0, 0, 0, 0.22); }
.nic svg { width: 21px; height: 21px; display: block; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.16)); }
.nic[data-ic="hub"]      { --g1: #d9a05b; --g2: #9a622b; }
.nic[data-ic="start"]    { --g1: #58a6ff; --g2: #0a64e6; }
.nic[data-ic="tables"]   { --g1: #ffbe3d; --g2: #ee8800; }
.nic[data-ic="newtable"] { --g1: #34d6c2; --g2: #0e98a6; }
.nic[data-ic="history"]  { --g1: #62b3ff; --g2: #2d6fdf; }
.nic[data-ic="kasse"]    { --g1: #8480fa; --g2: #4943d6; }
.nic[data-ic="menu"]     { --g1: #51d57f; --g2: #1d9a4a; }
.nic[data-ic="backup"]   { --g1: #ffa85f; --g2: #de5f0d; }
.nic[data-ic="howto"] { --g1: #5fd6a0; --g2: #1b9a68; }
.nic[data-ic="funktionen"] { --g1: #6fb4ff; --g2: #2a6fd6; }
.nic[data-ic="printers"] { --g1: #95a1b4; --g2: #596376; }
.nic[data-ic="events"]   { --g1: #ff7580; --g2: #dd2839; }
.nic[data-ic="cloud"]    { --g1: #5aa8ff; --g2: #1f6fd6; }
.nic[data-ic="bring"]    { --g1: #f58aa8; --g2: #c93a67; }
.nic[data-ic="strich"]   { --g1: #f6b84a; --g2: #cc7a0a; }
.nic[data-ic="fest"]      { --g1: #ffb23e; --g2: #e0561a; }
.nic[data-ic="bonkasse"] { --g1: #4fb8ff; --g2: #1769d1; }
.nic[data-ic="kueche"]   { --g1: #ff7a59; --g2: #d6401f; }
.nic[data-ic="gutscheine"] { --g1: #34c8a0; --g2: #0f8f72; }
.nic[data-ic="helfer"]   { --g1: #35c4cf; --g2: #0a7f93; }
.nic[data-ic="personal"] { --g1: #55bcff; --g2: #1b84d4; }
.nic[data-ic="server"]   { --g1: #44d6dc; --g2: #0d8b95; }
.nic[data-ic="einkauf"]  { --g1: #ff6e62; --g2: #c71f2b; }
.nic[data-ic="k"]        { --g1: #7a7cf0; --g2: #3d3fb8; }
.more-item .more-ic { width: 34px; height: 34px; }
.more-item + .more-item::before { left: 61px; }
.hub-ico.nic { width: 46px; height: 46px; border-radius: 14px; background: linear-gradient(150deg, var(--g1), var(--g2)); }
.hub-ico.nic svg { width: 26px; height: 26px; }
.hub-tile.main .hub-ico.nic { width: 56px; height: 56px; border-radius: 17px; }
.hub-tile.main .hub-ico.nic svg { width: 31px; height: 31px; }

/* V98: Fest-Auswahl als Fenster über dem Startmenü */
.fest-sheet .fest-list { margin: 10px 0 14px; }
.fest-sheet .event-pick-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; }
.fest-sheet .event-pick-btn small { font-size: 12px; font-weight: 700; color: var(--accent-contrast); background: var(--accent-soft); border-radius: 999px; padding: 2px 9px; }
.fest-sheet .event-pick-btn.current { font-weight: 700; }
.fest-sheet .fest-newform { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 14px; font-size: 13.5px; color: var(--text-muted); }
.fest-sheet .fest-newrow { display: flex; gap: 8px; }
.fest-sheet .fest-newrow .field-input { min-width: 0; flex: 1 1 auto; }

/* V99: Einkauf-Untermenü im gleichen Stil wie das Hauptmenü */
.nic[data-ic="uebersicht"]   { --g1: #62b3ff; --g2: #2d6fdf; }
.nic[data-ic="bedarf"]       { --g1: #ffbe3d; --g2: #ee8800; }
.nic[data-ic="festpreise"]   { --g1: #51d57f; --g2: #1d9a4a; }
.nic[data-ic="verbrauch"]    { --g1: #bb76f5; --g2: #7733d4; }
.nic[data-ic="bestellungen"] { --g1: #ff6e62; --g2: #c71f2b; }
.nic[data-ic="anfragen"]     { --g1: #34d6c2; --g2: #0e98a6; }
.nic[data-ic="preise"]       { --g1: #55bcff; --g2: #1b84d4; }
.nic[data-ic="lieferanten"]  { --g1: #ffa85f; --g2: #de5f0d; }
.nic[data-ic="artikel"]      { --g1: #8480fa; --g2: #4943d6; }
.nic[data-ic="adressen"]     { --g1: #ff7580; --g2: #dd2839; }
.nic[data-ic="daten"]        { --g1: #95a1b4; --g2: #596376; }
.ek-nav .ek-nav-nic { width: 32px; height: 32px; border-radius: 9px; }
.ek-nav .ek-nav-nic svg { width: 20px; height: 20px; }
@media (max-width: 860px) {
  .ek-nav .ek-nav-nic { width: 40px; height: 40px; border-radius: 12px; }
  .ek-nav .ek-nav-nic svg { width: 24px; height: 24px; }
}

/* V134: Startbild – Wellen-Animation statt Ladebalken: ein Pegel aus 17 Balken läuft als Welle durch und leuchtet nacheinander auf;
   vom Wappen gehen Schallringe aus, der Titel bekommt einen Lichtstreif. Dauer passend zu den 3 Sekunden Anzeigezeit. */
.splash h1 { margin-bottom: 26px; background: linear-gradient(100deg, var(--text, #111) 0%, var(--text, #111) 38%, var(--accent, #f5b419) 50%, var(--text, #111) 62%, var(--text, #111) 100%); background-size: 280% 100%; background-position: 100% 0; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; animation: splash-rise .6s ease .25s both, splash-shine 1.6s cubic-bezier(.4, .1, .2, 1) .7s forwards; }
.splash-logo-wrap .splash-logo { animation: splash-float 3.2s ease-in-out .8s infinite, splash-beat .6s ease-in-out .8s infinite; }
.splash-ring { position: absolute; width: 130px; height: 130px; border-radius: 50%; border: 3px solid var(--accent, #f5b419); opacity: 0; animation: splash-ring 1.5s cubic-bezier(.2, .6, .3, 1) .5s infinite; }
.splash-ring.r2 { animation-delay: 1.25s; border-width: 2px; }
.splash-eq { display: flex; align-items: center; justify-content: center; gap: 4px; height: 46px; margin: 0 0 6px; }
.splash-eq span { display: block; width: 5px; height: 100%; border-radius: 3px; background: color-mix(in srgb, var(--text, #111) 14%, transparent); transform-origin: center; transform: scaleY(.12);
  animation: splash-eq-in .5s ease calc(.3s + var(--i) * .035s) both, splash-eq-wave .9s ease-in-out calc(.8s + var(--i) * .07s) infinite alternate, splash-eq-lit .25s ease calc(.4s + var(--i) * .14s) forwards; }
@keyframes splash-eq-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes splash-eq-wave { from { transform: scaleY(.18); } 50% { transform: scaleY(1); } to { transform: scaleY(.3); } }
@keyframes splash-eq-lit { to { background: linear-gradient(180deg, color-mix(in srgb, var(--accent, #f5b419) 60%, #fff), var(--accent, #f5b419)); box-shadow: 0 0 10px color-mix(in srgb, var(--accent, #f5b419) 70%, transparent); } }
@keyframes splash-ring { 0% { transform: scale(.7); opacity: .85; } 100% { transform: scale(2); opacity: 0; } }
@keyframes splash-beat { 0%, 100% { scale: 1; } 50% { scale: 1.045; } }
@keyframes splash-shine { to { background-position: 0 0; } }
@keyframes splash-pop { from { opacity: 0; transform: scale(.4) rotate(-12deg) translateY(14px); } 60% { transform: scale(1.08) rotate(2deg); } to { opacity: 1; transform: none; } }
