/* ============================================================
   Standkassa — Tablet-Oberfläche
   Design: Bebas Neue / Barlow, Catch-Me-Farben, große Touch-Flächen
   ============================================================ */
@font-face { font-family: 'Bebas Neue'; src: url('/assets/fonts/BebasNeue-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Barlow'; font-weight: 300; src: url('/assets/fonts/Barlow-Light.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Barlow'; font-weight: 400; src: url('/assets/fonts/Barlow-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Barlow'; font-weight: 600; src: url('/assets/fonts/Barlow-SemiBold.ttf') format('truetype'); font-display: swap; }

:root {
  --red: #e8232a; --red-d: #c01c22;
  --dark: #0d0d0d; --mid: #1a1a1a; --mid2: #242424;
  --light: #f2ede8; --muted: #888;
  --line: #2e2e2e;
  --ok: #3aa55a; --warn: #e8a020;
  --kopf-h: 60px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--dark); color: var(--light); font-family: 'Barlow', sans-serif; font-weight: 400; font-size: 16px; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; overscroll-behavior: none; }
input { user-select: text; -webkit-user-select: text; }
button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; touch-action: manipulation; }
button:disabled { opacity: .35; cursor: default; }
[hidden] { display: none !important; }

.bebas { font-family: 'Bebas Neue', sans-serif; letter-spacing: .04em; }
.sk-laden { display: flex; align-items: center; justify-content: center; height: 100vh; color: var(--muted); }

/* ── Training ── */
#training-bar { position: fixed; top: 0; left: 0; right: 0; height: 34px; z-index: 900; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; font-family: 'Bebas Neue', sans-serif; font-size: 22px; letter-spacing: .25em; }
body.training #app { padding-top: 34px; }
body.training { box-shadow: inset 0 0 0 6px var(--red); }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 0 22px; font-family: 'Bebas Neue', sans-serif; font-size: 24px; letter-spacing: .08em; clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); transition: filter .1s, transform .05s; }
.btn:active:not(:disabled) { transform: scale(.98); filter: brightness(1.15); }
.btn-rot { background: var(--red); color: #fff; }
.btn-hell { background: var(--light); color: var(--dark); }
.btn-dunkel { background: var(--mid2); color: var(--light); }
.btn-gruen { background: var(--ok); color: #fff; }
.btn-umriss { background: transparent; color: var(--light); box-shadow: inset 0 0 0 2px rgba(242,237,232,.3); clip-path: none; border-radius: 4px; }
.btn-gross { min-height: 76px; font-size: 32px; }
.btn-voll { width: 100%; }
.btn-klein { min-height: 44px; font-size: 19px; padding: 0 14px; }

/* ── Kopfzeile ── */
.kopf { height: var(--kopf-h); display: flex; align-items: center; gap: 12px; padding: 0 14px; background: var(--mid); border-bottom: 1px solid var(--line); }
.kopf-titel { font-family: 'Bebas Neue', sans-serif; font-size: 26px; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kopf-sub { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
.kopf-links { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.1; }
.kopf-btn { min-height: 44px; padding: 0 14px; border-radius: 4px; background: var(--mid2); font-family: 'Bebas Neue', sans-serif; font-size: 20px; letter-spacing: .06em; }
.kopf-btn.aktiv { background: var(--warn); color: var(--dark); }
.sync { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px; font-size: 14px; font-weight: 600; background: var(--mid2); white-space: nowrap; }
.sync::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
.sync.wartet::before { background: var(--warn); }
.sync.offline::before { background: var(--muted); }
.sync.fehler { background: #3a1414; color: #ff9b9b; }
.sync.fehler::before { background: var(--red); }

/* ── Login / Öffnen ── */
.zentriert { min-height: calc(100vh - var(--kopf-h)); display: flex; align-items: flex-start; justify-content: center; padding: 40px 20px; }
.panel { width: 100%; max-width: 560px; background: var(--mid); border: 1px solid var(--line); padding: 28px; }
.panel h1 { font-family: 'Bebas Neue', sans-serif; font-size: 44px; letter-spacing: .06em; line-height: 1; margin-bottom: 6px; }
.panel h1 span { color: var(--red); }
.panel p.sub { color: var(--muted); margin-bottom: 22px; }
.feld { margin-bottom: 18px; }
.feld label { display: block; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 6px; }
.feld input { width: 100%; height: 58px; padding: 0 16px; background: var(--dark); border: 1px solid var(--line); color: var(--light); font-size: 22px; font-family: 'Barlow', sans-serif; border-radius: 0; }
.feld input:focus { outline: none; border-color: var(--red); }
.feld .hinweis { font-size: 13px; color: var(--muted); margin-top: 6px; font-weight: 300; }
.fehlertext { background: #3a1414; color: #ffb3b3; padding: 12px 14px; margin-bottom: 16px; border-left: 3px solid var(--red); }
.infotext { background: #1a2633; color: #a8c8e8; padding: 12px 14px; margin-bottom: 16px; border-left: 3px solid #3b82f6; }
.va-liste { display: grid; gap: 10px; margin-bottom: 20px; }
.va-btn { text-align: left; padding: 16px 18px; background: var(--dark); border: 2px solid var(--line); }
.va-btn.gewaehlt { border-color: var(--red); background: rgba(232,35,42,.08); }
.va-btn b { display: block; font-family: 'Bebas Neue', sans-serif; font-size: 26px; letter-spacing: .05em; font-weight: 400; }
.va-btn small { color: var(--muted); }

/* ── Verkaufsbildschirm ── */
.verkauf { display: grid; grid-template-columns: 1fr 390px; height: calc(100vh - var(--kopf-h)); height: calc(100dvh - var(--kopf-h)); }
body.training .verkauf { height: calc(100vh - var(--kopf-h) - 34px); height: calc(100dvh - var(--kopf-h) - 34px); }
.raster-wrap { overflow-y: auto; padding: 12px 12px 24px; -webkit-overflow-scrolling: touch; }
.kat-titel { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 10px 2px 8px; display: flex; align-items: center; gap: 8px; }
.kat-titel::before { content: ''; width: 10px; height: 10px; background: var(--kat, #666); }
.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kachel { position: relative; min-height: 104px; padding: 12px 12px 10px; text-align: left; background: var(--mid); border-left: 6px solid var(--kat, #666); display: flex; flex-direction: column; justify-content: space-between; transition: background .08s; }
.kachel:active { background: var(--mid2); }
.kachel .name { font-weight: 600; font-size: 18px; line-height: 1.15; word-break: break-word; }
.kachel .preis { font-family: 'Bebas Neue', sans-serif; font-size: 28px; letter-spacing: .03em; line-height: 1; margin-top: 8px; }
.kachel .pfand { font-size: 12px; color: var(--muted); font-weight: 600; }
.kachel .menge { position: absolute; top: -6px; right: -6px; min-width: 34px; height: 34px; border-radius: 17px; background: var(--red); color: #fff; font-family: 'Bebas Neue', sans-serif; font-size: 22px; display: flex; align-items: center; justify-content: center; padding: 0 8px; box-shadow: 0 0 0 3px var(--dark); }
.kachel.aus { opacity: .38; }
.kachel.aus .name { text-decoration: line-through; }
.kachel.aus::after { content: 'AUSVERKAUFT'; position: absolute; right: 8px; top: 6px; font-family: 'Bebas Neue', sans-serif; font-size: 16px; letter-spacing: .1em; color: var(--red); }
.raster-wrap.aus-modus .kachel { outline: 2px dashed var(--warn); outline-offset: -2px; }
.aus-banner { background: var(--warn); color: var(--dark); padding: 10px 14px; font-weight: 600; margin-bottom: 8px; }
.leer-hinweis { color: var(--muted); padding: 40px 10px; text-align: center; }

.korb { display: flex; flex-direction: column; background: var(--mid); border-left: 1px solid var(--line); min-height: 0; }
.korb-liste { flex: 1; overflow-y: auto; padding: 8px 12px; min-height: 0; }
.korb-leer { color: var(--muted); text-align: center; padding: 30px 10px; font-weight: 300; }
.zeile { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.zeile .zn { font-weight: 600; font-size: 17px; line-height: 1.2; }
.zeile .zd { font-size: 13px; color: var(--muted); }
.zeile .zb { font-family: 'Bebas Neue', sans-serif; font-size: 24px; text-align: right; }
.zeile .zk { display: flex; gap: 6px; justify-content: flex-end; margin-top: 4px; }
.zeile.pfandzeile .zn { font-weight: 400; color: var(--muted); font-size: 15px; }
.zeile.pfandzeile .zb { color: var(--muted); font-size: 20px; }
.zeile.zurueck .zn, .zeile.zurueck .zb { color: var(--warn); }
.rund { width: 44px; height: 44px; border-radius: 50%; background: var(--mid2); font-size: 26px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.korb-fuss { padding: 10px 12px 12px; border-top: 1px solid var(--line); background: #151515; }
.pfand-btns { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.pfand-btns .btn { flex: 1; min-height: 50px; font-size: 21px; background: #2a2210; color: var(--warn); box-shadow: inset 0 0 0 2px rgba(232,160,32,.5); clip-path: none; border-radius: 4px; }
.summe { display: flex; justify-content: space-between; align-items: baseline; margin: 4px 2px 10px; }
.summe .l { font-family: 'Bebas Neue', sans-serif; font-size: 26px; letter-spacing: .1em; color: var(--muted); }
.summe .w { font-family: 'Bebas Neue', sans-serif; font-size: 64px; line-height: .95; letter-spacing: .02em; }
.summe .w.neg { color: var(--warn); }
.zahl-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.neben-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ── Modal ── */
#modal { position: fixed; inset: 0; z-index: 800; background: rgba(0,0,0,.78); display: flex; align-items: center; justify-content: center; padding: 16px; }
.dlg { width: 100%; max-width: 620px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--mid); border: 1px solid var(--line); border-top: 4px solid var(--red); padding: 22px; }
.dlg.breit { max-width: 900px; }
.dlg h2 { font-family: 'Bebas Neue', sans-serif; font-size: 34px; letter-spacing: .06em; margin-bottom: 14px; line-height: 1; }
.dlg .aktionen { display: flex; gap: 10px; margin-top: 18px; }
.dlg .aktionen .btn { flex: 1; }
.riesig { font-family: 'Bebas Neue', sans-serif; font-size: 112px; line-height: 1; text-align: center; letter-spacing: .02em; margin: 10px 0 6px; }
.riesig-sub { text-align: center; color: var(--muted); font-size: 18px; margin-bottom: 8px; }

.bar-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.anzeige { background: var(--dark); border: 1px solid var(--line); padding: 10px 14px; margin-bottom: 10px; }
.anzeige .l { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.anzeige .w { font-family: 'Bebas Neue', sans-serif; font-size: 46px; line-height: 1.05; }
.anzeige.rueck { border-color: var(--ok); }
.anzeige.rueck .w { color: var(--ok); font-size: 64px; }
.anzeige.fehlt { border-color: var(--red); }
.anzeige.fehlt .w { color: var(--red); }
.schnell { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 10px; }
.schnell button, .tasten button { min-height: 58px; background: var(--mid2); font-family: 'Bebas Neue', sans-serif; font-size: 28px; letter-spacing: .04em; border-radius: 4px; }
.schnell button:active, .tasten button:active { background: #333; }
.schnell .passend { font-size: 20px; background: #20301f; color: #9fdcae; }
.tasten { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { padding: 10px 14px; background: var(--mid2); border-radius: 20px; font-weight: 600; }

/* ── Listen / Tabellen ── */
.vk-liste { display: grid; gap: 8px; }
.vk { background: var(--dark); border: 1px solid var(--line); padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.vk.storniert { opacity: .5; }
.vk .kopfz { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.vk .zeit { font-weight: 600; }
.vk .pos { font-size: 14px; color: var(--muted); margin-top: 4px; }
.vk .betr { font-family: 'Bebas Neue', sans-serif; font-size: 30px; text-align: right; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; background: var(--mid2); }
.badge.bar { background: #20301f; color: #9fdcae; }
.badge.karte { background: #1a2633; color: #a8c8e8; }
.badge.eigen { background: #2a2210; color: var(--warn); }
.badge.storno { background: #3a1414; color: #ff9b9b; }
.badge.wartet { background: #2a2210; color: var(--warn); }
.badge.fehler { background: var(--red); color: #fff; }

.tabelle { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.tabelle td { padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 18px; }
.tabelle td:last-child { text-align: right; font-family: 'Bebas Neue', sans-serif; font-size: 26px; letter-spacing: .03em; white-space: nowrap; }
.tabelle tr.abschnitt td { padding-top: 16px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); border-bottom: none; }
.tabelle tr.abschnitt td:last-child { font-family: 'Barlow', sans-serif; font-size: 13px; }
.tabelle tr.soll td { background: rgba(232,35,42,.08); font-weight: 600; }
.tabelle tr.soll td:last-child { color: #fff; font-size: 32px; }
.diff { font-family: 'Bebas Neue', sans-serif; font-size: 34px; }
.diff.null { color: var(--ok); }
.diff.plus { color: var(--warn); }
.diff.minus { color: var(--red); }

.seite { max-width: 820px; margin: 0 auto; padding: 22px 16px 60px; }
.seite h1 { font-family: 'Bebas Neue', sans-serif; font-size: 44px; letter-spacing: .05em; margin-bottom: 4px; }
.seite .sub { color: var(--muted); margin-bottom: 18px; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.menue { display: grid; gap: 10px; }
.menue .btn { justify-content: flex-start; clip-path: none; border-radius: 4px; }

#toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 950; background: var(--light); color: var(--dark); padding: 14px 24px; font-weight: 600; font-size: 19px; box-shadow: 0 8px 30px rgba(0,0,0,.5); max-width: 90vw; text-align: center; }
#toast.fehler { background: var(--red); color: #fff; }

@media (max-width: 860px) {
  .verkauf { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .korb { border-left: none; border-top: 1px solid var(--line); max-height: 56vh; }
  .summe .w { font-size: 48px; }
  .bar-grid, .zwei { grid-template-columns: 1fr; }
  .riesig { font-size: 76px; }
  .kopf-sub { display: none; }
}
@media (max-width: 600px) {
  .kopf { gap: 6px; padding: 0 8px; }
  .kopf-links { display: none; }
  .kopf-btn { font-size: 16px; padding: 0 9px; min-height: 40px; }
  .sync { font-size: 12px; padding: 4px 8px; margin-right: auto; }
  .raster { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}
