/* ============================================================================
   Gassenfreitag — Kassensystem RT19
   Helles, flaches App-Design. Ein Blau-Akzent, hoher Kontrast, große Touch-Ziele.
   Deckt Verkaufsoberfläche (sell), Login und Admin ab.
   ============================================================================ */

:root {
  --blue-900: #0a3d62;   /* RT19-Vereinsblau (Brand) */
  --blue-700: #12557f;
  --blue-600: #1763a6;   /* interaktiv / aktiv */
  --blue-050: #eaf2f9;   /* Tint */
  --ink:      #12212e;
  --muted:    #5c6b78;
  --line:     #e2e8ee;
  --surface:  #ffffff;
  --surface-2:#f6f9fb;
  --bg:       #eef2f6;
  --green:    #16a34a;
  --green-d:  #12833c;
  --red:      #e0574c;
  --red-d:    #c6463c;
  --amber:    #b26a10;

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 9px;

  --shadow-1: 0 1px 2px rgba(16,33,46,.06), 0 6px 16px -8px rgba(16,33,46,.14);
  --shadow-2: 0 10px 30px -12px rgba(16,33,46,.28);

  --touch: 60px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; max-width: 100%; overflow-x: hidden; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--blue-600); outline-offset: 2px; border-radius: 4px; }

/* ---------------------------------------------------------------------
   Login (pin-card) — geteilt über login.html + admin_login.html
--------------------------------------------------------------------- */
.login-body {
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(120% 80% at 50% -10%, #163f5e 0%, rgba(22,63,94,0) 60%),
    linear-gradient(180deg, #0a3d62 0%, #0d2e46 100%);
}
.pin-card {
  width: min(360px, 100%);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  padding: 30px 26px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
}
.pin-card .brand-mark { width: 56px; height: 56px; margin: 0 auto 2px; color: var(--blue-900); }
.pin-card .brand-mark svg { width: 100%; height: 100%; display: block; }
.pin-card h1 { margin: 0; font-size: 1.5rem; letter-spacing: -.01em; color: var(--blue-900); }
.pin-card p { margin: 0; color: var(--muted); font-size: .95rem; }
.pin-input {
  width: 100%;
  min-height: var(--touch);
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 0 16px;
  font-size: 1.5rem;
  text-align: center;
  letter-spacing: .18em;
  color: var(--ink);
}
.pin-input:focus { border-color: var(--blue-600); background: #fff; outline: none; }
.err {
  background: rgba(224,87,76,.1);
  color: var(--red-d);
  border: 1px solid rgba(224,87,76,.35);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: .9rem;
}

/* Primär-/Sekundär-Buttons (Login, diverse Admin-Aktionen) */
.btn-primary {
  min-height: var(--touch);
  border: none;
  border-radius: var(--radius-md);
  background: var(--blue-900);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .1s ease, background .2s ease;
}
.btn-primary:hover { background: var(--blue-700); }
.btn-primary:active { transform: scale(.97); }
.btn-secondary {
  min-height: var(--touch);
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:disabled, .btn-secondary:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* =====================================================================
   Verkaufsoberfläche (sell)
===================================================================== */
.sell-body {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.app { display: contents; }

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { width: 38px; height: 38px; color: var(--blue-900); flex: 0 0 auto; }
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: -.01em;
  color: var(--ink);
  min-width: 0;
}
.brand-text small {
  font-weight: 600;
  font-size: .68rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.logout-link {
  flex: 0 0 auto;
  color: var(--blue-600);
  text-decoration: none;
  font-weight: 600;
  font-size: .92rem;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}
.logout-link:hover { background: var(--blue-050); }

.pos {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-rows: 1fr;
  grid-template-columns: minmax(0, 1fr); /* schrumpfbar -> kein horizontaler Überlauf */
}

.products {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  padding: 12px 14px 226px; /* mobil: Platz für angedocktes Bottom-Sheet (eingeklappt), damit der letzte Artikel scrollbar bleibt */
}

/* Kategorie-Reiter — mobil umbrechend (alle Kategorien sichtbar, kein Wegscrollen) */
.tabs {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 10px;
}
.tab {
  flex: 0 1 auto;
  min-height: 46px;
  padding: 0 16px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.tab.active {
  background: var(--blue-900);
  border-color: var(--blue-900);
  color: #fff;
}
.tab:active { transform: scale(.97); }

/* Artikel-Liste (scrollbar): je Getränk eine Varianten-Karte, Snacks als Zeile */
.tiles {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 2px 20px;
  -webkit-overflow-scrolling: touch;
}
.tiles-error { color: var(--muted); text-align: center; padding: 30px 10px; }

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.tile.in-cart {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 2px var(--blue-600) inset, var(--shadow-1);
}
/* Einzel-Artikel (Snacks) als Listen-Zeile: Icon + Name links, Preis rechts */
.tile.single { flex: 0 0 auto; }
.tile.single .tile-main {
  flex-direction: row;
  justify-content: flex-start;
  gap: 14px;
  min-height: 72px;
  padding: 12px 16px;
  text-align: left;
}
.tile.single .tile-name { flex: 1 1 auto; min-width: 0; }
.tile.single .tile-price { flex: 0 0 auto; text-align: right; }
.tile-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 118px;
  padding: 14px 10px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--ink);
  text-align: center;
}
.tile-main:active { transform: scale(.97); }
.tile-ic {
  width: 46px;
  height: 46px;
  color: var(--blue-700);
  fill: currentColor; /* Icons erben Markenfarbe (sonst Default-Schwarz) */
  flex: 0 0 auto;
}
.tile-name {
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.15;
}
.tile-price {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--blue-900);
  font-variant-numeric: tabular-nums;
}
.tile-price small {
  display: block;
  font-size: .68rem;
  font-weight: 600;
  color: var(--amber);
  margin-top: 1px;
}
/* Pfand-Getränk: Karte mit zwei Varianten (mit/ohne Pfand) nebeneinander.
   Spannt die volle Rasterbreite -> auf dem iPhone eine scrollbare Liste. */
.variant-pair {
  flex: 0 0 auto; /* nicht schrumpfen -> Liste scrollt statt Karten zu quetschen */
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.vp-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px 8px;
  min-width: 0;
}
.vp-head .tile-ic { width: 30px; height: 30px; }
.vp-name { font-weight: 800; font-size: 1.04rem; letter-spacing: -.01em; min-width: 0; }
.vp-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 10px 10px;
}
.vp-opt {
  position: relative;
  min-height: 82px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 8px 6px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  text-align: center;
}
.vp-opt:active { transform: scale(.97); }
.vp-label {
  font-size: .74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
}
.vp-price {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--blue-900);
  font-variant-numeric: tabular-nums;
}
.vp-sub { font-size: .68rem; font-weight: 600; }
.vp-opt.mit .vp-sub { color: var(--amber); }
.vp-opt.ohne .vp-sub { color: var(--muted); }
.vp-opt.active {
  border-color: var(--blue-600);
  background: var(--blue-050);
  box-shadow: 0 0 0 1.5px var(--blue-600) inset;
}
.vp-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--blue-900);
  color: #fff;
  font-size: .82rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(10,61,98,.4);
}
.tile-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--blue-900);
  color: #fff;
  font-size: .85rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(10,61,98,.4);
}

/* =====================================================================
   Warenkorb — mobil: Bottom-Sheet (Default); iPad: Seitenleiste (Media-Query)
===================================================================== */
.cart {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface);
  position: fixed;
  left: 0; right: 0; bottom: 0;
  max-height: 88dvh;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: 0 -10px 30px -12px rgba(16,33,46,.3);
  z-index: 40;
}
.sheet-grip {
  display: block;
  width: 42px; height: 5px;
  margin: 8px auto 2px;
  border-radius: 999px;
  background: var(--line);
  cursor: pointer;
}
.cart-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 16px 5px;
}
.cart-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -.01em;
}
.queue-status {
  font-size: .74rem;
  font-weight: 700;
  color: var(--amber);
  background: rgba(178,106,16,.12);
  padding: 3px 8px;
  border-radius: 999px;
}
.cart-toggle {
  display: grid;
  place-items: center;
  margin-left: auto;
  width: 40px; height: 40px;
  border: none; background: var(--surface-2);
  border-radius: 10px;
  font-size: 1.2rem; color: var(--muted); cursor: pointer;
}

.cart-lines {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 16px;
  max-height: 0;
  transition: max-height .26s ease, padding .26s ease;
  -webkit-overflow-scrolling: touch;
}
.cart.expanded .cart-lines { max-height: 44dvh; padding: 4px 16px; }
.cart-empty { color: var(--muted); font-size: .92rem; padding: 18px 4px; text-align: center; }

.cart-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "name price" "controls controls";
  gap: 4px 8px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.cart-line-name { grid-area: name; min-width: 0; font-weight: 700; font-size: .96rem; }
.nopfand-tag {
  display: inline-block;
  margin-left: 6px;
  font-size: .68rem;
  font-weight: 700;
  color: var(--amber);
  background: rgba(178,106,16,.12);
  padding: 1px 6px;
  border-radius: 999px;
  vertical-align: middle;
}
.cart-line-price {
  grid-area: price;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cart-line-controls { grid-area: controls; display: flex; align-items: center; gap: 8px; }
.stepper, .remove {
  /* Touch-Ziel auf Haus-Standard (--touch: 60px) statt 44px -- die Controls
     liegen in einer eigenen vollbreiten Zeile, also bleibt trotzdem Platz. */
  width: var(--touch); height: var(--touch);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 1.35rem;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
  display: grid; place-items: center;
}
.stepper:active, .remove:active { transform: scale(.94); }
.remove { color: var(--red); margin-left: auto; font-size: 1.5rem; }
.cart-line-qty {
  min-width: 30px;
  text-align: center;
  font-weight: 800;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.sums {
  flex: 0 0 auto;
  padding: 7px 16px 3px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.sum-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: .9rem;
  color: var(--muted);
  padding: 2px 0;
  font-variant-numeric: tabular-nums;
}
.sum-row span:last-child { font-weight: 700; color: var(--ink); }
.sum-row.grand {
  margin-top: 3px;
  padding-top: 6px;
  border-top: 2px solid var(--line);
  font-size: 1.25rem;
  color: var(--ink);
}
.sum-row.grand span { font-weight: 900; }
.sum-row.grand span:last-child { color: var(--blue-900); }

.cart-actions {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.7fr;
  gap: 10px;
  padding: 7px 16px calc(9px + env(safe-area-inset-bottom));
}
.btn-cancel, .btn-confirm {
  min-height: 56px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform .1s ease, background .2s ease, box-shadow .2s ease;
}
.btn-cancel { border: 2px solid var(--red); background: #fff; color: var(--red); }
.btn-cancel:active { transform: scale(.96); background: #fdecea; }
.btn-confirm {
  border: none;
  background: var(--green);
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(22,163,74,.6);
}
.btn-confirm:active { transform: scale(.98); background: var(--green-d); }
.btn-cancel:disabled, .btn-confirm:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }
.act-ic { width: 30px; height: 30px; }
.btn-confirm .act-ic { width: 34px; height: 34px; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  background: var(--ink);
  color: #fff;
  padding: 13px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: var(--shadow-2);
  opacity: 0;
  pointer-events: none;
  z-index: 60;
  transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Abrechnungs-Modal (Bar) ------------------------------------------------ */
.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
body.modal-open { overflow: hidden; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(16,33,46,.5); }
.modal-card {
  position: relative;
  width: 100%;
  max-width: 540px;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow-2);
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  max-height: 94dvh;
  overflow-y: auto;
}
.pay-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pay-top h2 { margin: 0; font-size: 1.4rem; letter-spacing: -.01em; }
.pay-due { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05; }
.pay-due span { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.pay-due strong { font-size: 1.85rem; font-weight: 900; color: var(--blue-900); font-variant-numeric: tabular-nums; }
.pay-hint { margin: 14px 0 10px; color: var(--muted); font-size: .9rem; }
.pay-denoms { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.denom {
  position: relative;
  min-height: 70px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}
.denom-val { font-size: 1.2rem; }
.denom:active { transform: scale(.96); }
.denom.active { border-color: var(--blue-600); background: var(--blue-050); }
.denom-count {
  position: absolute; top: 4px; right: 4px;
  min-width: 22px; height: 22px; padding: 0 5px;
  border-radius: 999px; background: var(--blue-900); color: #fff;
  font-size: .78rem; font-weight: 800; display: grid; place-items: center;
}
.pay-breakdown {
  min-height: 20px; margin: 8px 2px 0;
  color: var(--muted); font-size: .82rem; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pay-summary { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.pay-row { display: flex; justify-content: space-between; align-items: baseline; padding: 3px 0; font-variant-numeric: tabular-nums; }
.pay-row span:first-child { color: var(--muted); }
.pay-row span:last-child { font-weight: 800; }
.pay-row { font-size: 1.05rem; }
.pay-row.change { font-size: 1.65rem; margin-top: 3px; }
.pay-row.change span:last-child { color: var(--ink); }
.pay-row.change.ok span:last-child { color: var(--green-d); }
.pay-row.change.short span:last-child { color: var(--red-d); }
.pay-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.btn-pay {
  grid-column: 1 / -1;
  min-height: 66px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--green);
  color: #fff;
  font-weight: 800;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 6px 16px -6px rgba(22,163,74,.6);
}
.btn-pay:active { transform: scale(.98); background: var(--green-d); }
.btn-pay:disabled { opacity: .5; }
.btn-ghost {
  min-height: 52px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--muted);
  font-weight: 700;
  font-size: .98rem;
  cursor: pointer;
}
.btn-ghost:active { transform: scale(.97); background: var(--surface-2); }

/* iPad / Desktop: Modal mittig statt als Bottom-Sheet */
@media (min-width: 768px) {
  .modal { align-items: center; }
  .modal-card { border-radius: 20px; }
}

/* iPad / Desktop: zwei Spalten, Warenkorb als feste Seitenleiste */
@media (min-width: 768px) {
  .pos { grid-template-columns: minmax(0, 1fr) 372px; }
  .products { padding: 16px 18px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }

  .cart {
    position: static;
    max-height: none;
    border-radius: 0;
    border-left: 1px solid var(--line);
    box-shadow: none;
  }
  .sheet-grip, .cart-toggle { display: none; }
  .cart-head { padding: 14px 18px 8px; }
  .cart-lines { max-height: none !important; padding: 6px 18px; overflow-y: auto; }
}

/* =====================================================================
   Admin (admin_base / admin_home / admin_products / admin_stats)
===================================================================== */
.admin-body { min-height: 100%; background: var(--bg); color: var(--ink); }
.admin-shell { max-width: 1120px; margin: 0 auto; padding: 0 16px 40px; }
.admin-nav {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  background: var(--bg);
  z-index: 5;
}
.admin-nav .brand-text { color: var(--ink); }
.admin-links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav-link {
  color: var(--blue-700);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: .95rem;
}
.nav-link:hover { background: var(--blue-050); }
.nav-link.active { background: var(--blue-900); color: #fff; }
.admin-content { padding-top: 6px; }

.admin-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  padding: 20px 22px;
  margin-bottom: 18px;
}
.admin-card h1 { margin: 0 0 6px; font-size: 1.5rem; color: var(--blue-900); }
.admin-card h2 { margin: 0 0 14px; font-size: 1.15rem; }
.admin-lead { color: var(--muted); margin: 0 0 16px; }

.admin-home-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.admin-home-link {
  display: block;
  padding: 18px 22px;
  border-radius: var(--radius-md);
  background: var(--blue-050);
  color: var(--blue-900);
  text-decoration: none;
  font-weight: 700;
  border: 1px solid var(--line);
}
.admin-home-link:hover { background: #dfeaf5; }

/* Flash-Meldungen */
.flash-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.flash {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: .95rem;
}
.flash-success { background: rgba(22,163,74,.1); color: var(--green-d); border-color: rgba(22,163,74,.35); }
.flash-error { background: rgba(224,87,76,.1); color: var(--red-d); border-color: rgba(224,87,76,.35); }

/* "Tabellen" als CSS-Grid; jede Zeile ist ein <form> */
.table-scroll { overflow-x: auto; }
.table-grid {
  display: grid;
  grid-template-columns: 200px minmax(150px,1.4fr) minmax(120px,1fr) 90px 90px 70px 56px auto;
  gap: 6px 10px;
  min-width: 900px;
  align-items: center;
}
.table-grid > form,
.table-grid > .row-header {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: center;
}
.row-header {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  font-weight: 700;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.table-grid > form { padding: 8px 0; border-bottom: 1px solid var(--line); }
.table-grid input[type="text"],
.table-grid input[type="number"],
.table-grid select {
  min-height: 44px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 0 10px;
  font-size: .95rem;
  color: var(--ink);
  width: 100%;
}
.money-input, .num-input { font-variant-numeric: tabular-nums; }
.checkbox-cell { display: grid; place-items: center; }
.checkbox-cell input { width: 22px; height: 22px; }
.row-actions { display: flex; gap: 6px; }
.empty-row { color: var(--muted); padding: 10px 2px; }

/* Icon-Picker (ersetzt das alte Emoji-Textfeld) */
.icon-picker { display: flex; flex-wrap: wrap; gap: 6px; position: relative; }
.icon-picker input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.icon-opt {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  color: var(--blue-700);
}
.icon-opt svg { width: 26px; height: 26px; fill: currentColor; }
.icon-opt:hover { border-color: var(--blue-600); }
.icon-picker input:checked + .icon-opt {
  border-color: var(--blue-900);
  background: var(--blue-050);
  box-shadow: 0 0 0 2px var(--blue-900) inset;
}
/* In der kompakten Tabellenzeile: Icon-Picker als scrollbarer Streifen */
.table-grid .icon-picker { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
.table-grid .icon-opt { width: 38px; height: 38px; flex: 0 0 auto; }
.table-grid .icon-opt svg { width: 22px; height: 22px; }

.btn-sm {
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
}
.btn-save { background: var(--blue-900); color: #fff; }
.btn-save:hover { background: var(--blue-700); }
.btn-danger { background: #fff; color: var(--red); border: 1.5px solid var(--red); }
.btn-danger:hover { background: #fdecea; }

/* Neuer Artikel / Inline-Create-Formulare */
.new-product-form, .inline-create-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.new-product-form label, .inline-create-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: .8rem;
  font-weight: 700;
  color: var(--muted);
  flex: 1 1 150px;
}
.new-product-form input, .new-product-form select,
.inline-create-form input, .inline-create-form select {
  min-height: 46px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 0 12px;
  font-size: .98rem;
  color: var(--ink);
}
.new-product-form .icon-picker, .inline-create-form .icon-picker { flex-basis: 100%; }

/* Kategorien-Grid */
.categories-grid { display: grid; gap: 8px; }
.category {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.tag-inactive {
  font-size: .7rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 999px;
}
.products-grid { display: grid; gap: 4px; }

/* =====================================================================
   Admin — Tagesauswertung (admin_stats)
===================================================================== */
.stats-datebar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.stats-datebar input[type="date"] {
  min-height: 46px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-size: 1rem;
  background: #fff;
}
.export-bar { margin-left: auto; }

.stats-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  padding: 16px 18px;
}
.stat-tile-label {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.stat-tile-value {
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--blue-900);
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
.stat-tile-sub { font-size: .82rem; color: var(--muted); margin-top: 2px; }

.stats-table { width: 100%; border-collapse: collapse; }
.stats-table th, .stats-table td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  font-size: .95rem;
}
.stats-table th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.stats-table td.num, .stats-table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Stundenverlauf-Chart (inline SVG) */
.chart-scroll { overflow-x: auto; }
.hourly-chart { display: block; min-width: 520px; }
.hourly-chart .bar { fill: var(--blue-600); }
.hourly-chart .bar:hover { fill: var(--blue-900); }
.hourly-chart .grid-line { stroke: var(--line); stroke-width: 1; }
.hourly-chart .axis-label { fill: var(--muted); font-size: 10px; }
.hourly-chart .peak-label { fill: var(--blue-900); font-size: 10px; font-weight: 700; }

@media (min-width: 768px) {
  .table-grid .icon-picker { flex-wrap: wrap; overflow: visible; }
}
