/* Zählkasse – Optik angelehnt an die TanzDesk-Kasse (KassePos), aber eigenständig */
:root {
  --grund: #f8f9fb;
  --karte: #ffffff;
  --text: #062853;
  --leise: #6b7280;
  --linie: #e5e7eb;
  --kopf: #062853;
  --chip: #f3f4f6;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--grund); color: var(--text);
  display: flex; flex-direction: column; overflow: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
}
button, input, select { font: inherit; color: inherit; }
button { touch-action: manipulation; cursor: pointer; }
input, select { font-size: 16px; }
[hidden] { display: none !important; }

/* Kopfzeile wie an der Kasse */
.kopf {
  margin: 12px 12px 0; flex-shrink: 0; display: flex; align-items: center; gap: 12px; flex-wrap: nowrap;
  overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch;
  background: var(--kopf); color: #fff; border-radius: 16px; padding: 10px 16px; min-height: 64px;
}
.kopf-titel { font-size: 19px; font-weight: 800; }
.kopf-hinweis { font-size: 13px; font-weight: 700; color: #7fe0a6; }
.kopf-platz { flex: 1; }
.pille {
  height: 44px; padding: 0 14px; border: 1.5px solid rgba(255,255,255,.3); border-radius: 100px;
  background: transparent; color: #fff; font-size: 15px; font-weight: 700; flex-shrink: 0;
}
.pille.aktiv { background: #fff; color: var(--kopf); border-color: #fff; }
#abendTitel { background: rgba(255,255,255,.14); max-width: 260px; overflow: hidden; text-overflow: ellipsis; }

/* Kasse: zwei Spalten */
.kasse { flex: 1; min-height: 0; display: flex; gap: 12px; padding: 12px; }
.tastenbereich { flex: 1 1 340px; min-width: 280px; display: flex; flex-direction: column; min-height: 0; }
.leiste { display: flex; gap: 8px; margin-bottom: 10px; align-items: center; flex-wrap: wrap; }
.leiste select { height: 36px; padding: 0 10px; border: 1.5px solid #d5dce7; border-radius: 8px; background: #fff; font-size: 14px; font-weight: 700; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 7px 12px; border-radius: 8px; border: none; background: var(--chip); color: var(--leise); font-size: 13px; font-weight: 700; }
.chip.an { background: var(--kopf); color: #fff; }

.tasten { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; display: grid; gap: 8px; align-content: start;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); grid-auto-rows: minmax(70px, auto); padding-bottom: 12px; }
.taste {
  position: relative; border: none; border-radius: 12px; padding: 12px 8px; min-height: 70px; min-width: 0; width: 100%;
  background: var(--kopf); color: #fff; text-align: left; display: flex; flex-direction: column; justify-content: space-between; gap: 6px;
  user-select: none; -webkit-user-select: none; transition: transform .06s ease, filter .15s;
}
.taste:active { transform: scale(.96); }
.taste.blitz { filter: brightness(1.35); }
.taste-name { font-weight: 700; font-size: 13px; line-height: 1.2; overflow-wrap: anywhere; padding-right: 26px; }
.taste-preis { font-size: 14px; font-weight: 800; }
.taste-zahl {
  position: absolute; top: 6px; right: 6px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px;
  background: #7fe0a6; color: var(--kopf); font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
}
.leer { grid-column: 1 / -1; color: #9ca3af; font-size: 13px; }

.hinweis-balken { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #eff6ff; border: 1.5px solid #bfdbfe;
  border-radius: 12px; padding: 9px 12px; margin-bottom: 10px; font-size: 14px; }
.hinweis-balken span { flex: 1; min-width: 200px; }

/* Rechte Seite wie der Bon */
.bon { flex: 0 0 360px; background: var(--karte); border-radius: 16px; box-shadow: 0 1px 3px rgba(6,40,83,.08);
  display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.bon-kopf { display: flex; justify-content: space-between; align-items: baseline; padding: 14px; border-bottom: 1px solid #f3f4f6; font-weight: 800; font-size: 16px; }
.bon-zeilen { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 14px; }
.bon-leer { color: #cbd5e1; text-align: center; padding: 30px; font-size: 14px; }
.zeile { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #f3f4f6; }
.zeile-text { flex: 1; min-width: 0; }
.zeile-name { font-size: 14px; font-weight: 600; }
.zeile-preis { font-size: 11px; color: #9ca3af; }
.qbtn { width: 44px; height: 44px; border-radius: 10px; border: none; background: var(--chip); color: var(--text); font-size: 18px; font-weight: 700; }
.zeile-menge { min-width: 24px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.zeile-wert { min-width: 64px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.bon-fuss { padding: 12px 14px; border-top: 1px solid #f3f4f6; }
.bon-summe { display: flex; justify-content: space-between; font-size: 22px; font-weight: 800; margin-bottom: 2px; font-variant-numeric: tabular-nums; }
.bon-knoepfe { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 8px; }

.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px;
  border: 1.5px solid #d5dce7; background: #fff; color: var(--text); border-radius: 10px; padding: 0 12px; font-weight: 700; font-size: 14px; }
.knopf.haupt { background: var(--kopf); color: #fff; border-color: var(--kopf); }
.knopf.gefahr { color: #dc2626; }
.knopf.leise-knopf { border-color: transparent; background: transparent; color: var(--leise); }
.knopf.breit { width: 100%; }
.knopf:disabled { opacity: .4; }
.knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Seiten Artikel / Abende */
.seite { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px; }
.seite .karte { max-width: 900px; margin: 0 auto 12px; }
.karte { background: var(--karte); border-radius: 16px; padding: 16px; box-shadow: 0 1px 3px rgba(6,40,83,.08); }
.karte h2 { margin: 0 0 10px; font-size: 17px; }
.leise { color: var(--leise); }
.klein { font-size: 13px; }

.formular { display: grid; grid-template-columns: 2fr 1fr 1.3fr auto; gap: 10px; align-items: end; }
.formular label { display: flex; flex-direction: column; font-size: 13px; color: var(--leise); gap: 4px; font-weight: 600; }
.formular input { border: 1.5px solid #d5dce7; border-radius: 10px; padding: 10px; background: #fff; color: var(--text); min-width: 0; }
@media (max-width: 640px) { .formular { grid-template-columns: 1fr 1fr; } .formular label:first-child, .formular button { grid-column: 1 / -1; } }

.kat-titel { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--leise); margin: 14px 0 4px; }
.a-zeile { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid #f3f4f6; padding: 4px 0; }
.a-zeile input { border: 1.5px solid transparent; background: transparent; border-radius: 8px; padding: 8px; min-width: 0; color: var(--text); }
.a-zeile input:focus { border-color: #d5dce7; background: #fff; outline: none; }
.a-name { flex: 1; font-weight: 600; }
.a-preis { width: 84px; text-align: right; }
.a-kat { width: 130px; color: var(--leise); }
.mini { border: none; background: var(--chip); border-radius: 8px; width: 40px; height: 40px; font-size: 16px; color: var(--leise); flex-shrink: 0; }
@media (max-width: 640px) { .a-kat { display: none; } }

.abend-liste { list-style: none; margin: 0; padding: 0; }
.abend-liste li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid #f3f4f6; padding: 10px 0; }
.abend-liste .a-text { flex: 1; min-width: 180px; }
.abend-liste .a-text b { display: block; }
.abend-liste .a-text span { font-size: 13px; color: var(--leise); }
.marke { font-size: 12px; font-weight: 800; color: #166534; background: #dcfce7; border-radius: 6px; padding: 3px 8px; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--kopf); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 15px; z-index: 10; max-width: 90vw; text-align: center; }

/* Schmal (Handy, iPad hochkant klein): untereinander, ganze Seite scrollt */
@media (max-width: 760px) {
  body { overflow: auto; }
  .kasse { flex-direction: column; overflow: visible; }
  .tastenbereich { flex: 0 0 auto; min-width: 0; }
  .tasten { overflow: visible; }
  .bon { flex: 0 0 auto; }
  .bon-zeilen { max-height: none; }
  .kopf-hinweis { display: none; }
}

.druck { display: none; }
@media print {
  body { display: block; background: #fff; padding: 0; overflow: visible; }
  .kopf, .ansicht, .toast { display: none !important; }
  .druck { display: block; font-size: 12pt; color: #000; }
  .druck h1 { font-size: 16pt; margin: 0 0 4pt; }
  .druck p { margin: 0 0 12pt; color: #444; }
  .druck table { width: 100%; border-collapse: collapse; }
  .druck th, .druck td { border-bottom: 1px solid #ccc; padding: 4pt 2pt; text-align: left; }
}
