/* HSV-Kasse – Farben wie hsv-groebern (Gelb/Schwarz) */
:root {
  --gelb: #fdf935; --gelb-hell: #fffbd0; --schwarz: #0b0b0b; --schwarz-2: #1a1a1a;
  --bg: #f3f3ef; --karte: #ffffff; --linie: #e2e2dc; --text: #121212; --text-2: #5c5c58;
  --gruen: #e3f6e8; --gruen-text: #17663a; --rot: #b3261e; --rot-hell: #fde8e7; --blau-hell: #eef3ff;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text);
  line-height: 1.45; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, .display { font-family: "Barlow Condensed", Inter, system-ui, sans-serif; text-transform: uppercase; letter-spacing: .02em; line-height: 1.05; margin: 0; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.05rem; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
.muted { color: var(--text-2); }
.klein { font-size: .9rem; }

/* Kopfzeile */
.kopf { display: flex; align-items: center; gap: 12px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--schwarz); color: #fff; position: sticky; top: 0; z-index: 20; }
.kopf img { width: 40px; height: 40px; flex: none; }
.kopf .titel { flex: 1; min-width: 0; }
.kopf .titel b { display: block; font-family: "Barlow Condensed", Inter, sans-serif; font-size: 1.25rem; text-transform: uppercase; letter-spacing: .03em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kopf .titel small { display: block; color: #bdbdb5; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kopf .aktionen { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.kopf a { text-decoration: none; }

/* Knöpfe */
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 12px;
  border: 2px solid var(--schwarz); background: var(--karte); color: var(--schwarz); font-weight: 700; cursor: pointer; text-decoration: none;
  touch-action: manipulation; user-select: none; }
.knopf:active:not(:disabled) { transform: scale(.97); }
.knopf:disabled { opacity: .4; cursor: default; }
.knopf.gelb { background: var(--gelb); }
.knopf.schwarz { background: var(--schwarz); color: var(--gelb); }
.knopf.rot { border-color: var(--rot); color: var(--rot); }
.knopf.klein { min-height: 36px; padding: 0 12px; font-size: .9rem; border-radius: 10px; }
.knopf.dunkel { background: transparent; border-color: #555; color: #fff; }
.knopf.dunkel.an { background: var(--gelb); color: var(--schwarz); border-color: var(--gelb); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: #d7d7cf; white-space: nowrap; }
.status i { width: 10px; height: 10px; border-radius: 50%; background: #3ecf6e; display: inline-block; }
.status.offline i { background: #ff8a3d; }

.box { background: var(--karte); border-radius: var(--radius); padding: 16px; box-shadow: 0 1px 0 var(--linie); }
.hinweis { background: var(--gelb-hell); border-left: 4px solid var(--gelb); border-radius: 10px; padding: 12px 14px; }
.hinweis.warn { background: var(--rot-hell); border-left-color: var(--rot); }
.leer { max-width: 560px; margin: 40px auto; padding: 0 16px; text-align: center; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--schwarz); color: var(--gelb);
  padding: 12px 20px; border-radius: 99px; font-weight: 700; opacity: 0; pointer-events: none; transition: .2s; z-index: 100; max-width: calc(100% - 32px); text-align: center; }
#toast.zeigen { opacity: 1; transform: translateX(-50%); }

/* PIN */
.pin { max-width: 340px; margin: 32px auto; padding: 0 16px; text-align: center; }
.pin img { width: 96px; height: 96px; }
.pin-punkte { display: flex; justify-content: center; gap: 14px; margin: 22px 0; min-height: 22px; }
.pin-punkte span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--schwarz); }
.pin-punkte span.voll { background: var(--schwarz); }
.pin-punkte.falsch { animation: wackeln .35s; }
.pin-punkte.falsch span { border-color: var(--rot); }
@keyframes wackeln { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.pin-tasten { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pin-tasten .knopf { min-height: 68px; font-size: 1.6rem; border-radius: 18px; }
.pin-meldung { min-height: 1.5em; color: var(--rot); font-weight: 600; margin-top: 12px; }

/* Kasse */
.ka { display: grid; grid-template-columns: 1fr minmax(320px, 380px); gap: 16px; padding: 14px 16px 24px; align-items: start; }
.ka-artikel h3 { margin: 4px 0 8px; color: var(--text-2); letter-spacing: .06em; }
.ka-kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.ka-kachel { position: relative; min-height: 100px; border: 0; border-radius: var(--radius); background: var(--karte); color: var(--schwarz); cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 14px 12px 12px; text-align: left;
  box-shadow: 0 1px 0 var(--linie), 0 2px 6px rgba(0,0,0,.04); touch-action: manipulation; user-select: none; }
.ka-kachel span { font-weight: 700; font-size: 1.08rem; line-height: 1.2; }
.ka-kachel b { font-size: 1rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.ka-kachel:active:not(:disabled) { transform: scale(.97); background: var(--gelb-hell); }
.ka-kachel.minus { background: var(--blau-hell); }
.ka-kachel.drin { box-shadow: inset 0 0 0 3px var(--schwarz); }
.ka-kachel i { position: absolute; top: -6px; right: -6px; font-style: normal; background: var(--schwarz); color: var(--gelb); border-radius: 99px;
  min-width: 30px; padding: 3px 8px; font-weight: 800; text-align: center; }
.ka-kachel.weg { opacity: .45; background: #e9e9e4; }
.ka-kachel.weg b { text-decoration: line-through; }
.ka-kachel em { font-style: normal; font-size: .75rem; font-weight: 800; text-transform: uppercase; color: var(--rot); letter-spacing: .04em; }
.ka-kachel:disabled { cursor: default; }
.ka.modus-weg .ka-kachel { outline: 2px dashed var(--text-2); outline-offset: -2px; }
.ka-modus { margin-bottom: 12px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

.ka-bon { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 92px); overflow-y: auto; }
.ka-kopf { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 1.1rem; }
.ka-bon-liste { display: flex; flex-direction: column; gap: 6px; }
.ka-zeile { display: grid; grid-template-columns: 44px 30px 44px 1fr auto; align-items: center; gap: 6px; }
.ka-zeile b { text-align: center; font-size: 1.1rem; }
.ka-pm { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--schwarz); background: var(--karte); font-size: 1.4rem; font-weight: 800;
  cursor: pointer; touch-action: manipulation; display: grid; place-items: center; padding: 0; }
.ka-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ka-betrag { font-variant-numeric: tabular-nums; }
.ka-summe, .ka-gegeben { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ka-summe { border-top: 2px solid var(--schwarz); padding-top: 10px; }
.ka-summe b { font-size: 2.3rem; font-variant-numeric: tabular-nums; }
.ka-gegeben b { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.ka-zahlarten { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.ka-gross { min-height: 64px; font-size: 1.2rem; }
.ka-schnell { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ka-tasten { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ka-tasten .knopf, .ka-schnell .knopf { min-height: 52px; font-size: 1.2rem; padding: 0 4px; white-space: nowrap; }
.ka-rueck { border-radius: 14px; padding: 12px 14px; background: #ececE6; text-align: center; }
.ka-rueck span { display: block; font-weight: 700; }
.ka-rueck b { display: block; font-size: 2.2rem; font-variant-numeric: tabular-nums; }
.ka-rueck small { display: block; color: var(--text-2); font-size: .95rem; }
.ka-rueck.ok { background: var(--gruen); }
.ka-rueck.ok b { color: var(--gruen-text); }
.ka-qr { background: #fff; border-radius: 14px; border: 2px solid var(--linie); padding: 8px; display: grid; place-items: center; min-height: 200px; }
.ka-qr svg { width: 100%; max-width: 300px; height: auto; display: block; }
.ka-unten { display: none; }
.nur-schmal { display: none !important; }

/* Smartphone: Bon als Leiste unten, öffnet sich als eigene Ansicht */
@media (max-width: 760px) {
  .ka { grid-template-columns: 1fr; padding: 12px 12px 110px; }
  .ka-kacheln { grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 8px; }
  .ka-kachel { min-height: 92px; padding: 12px 10px 10px; }
  .ka-kachel span { font-size: 1rem; }
  .ka-bon { display: none; }
  .ka.bon-offen .ka-bon { display: flex; position: fixed; inset: 0; z-index: 30; max-height: none; border-radius: 0; padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top)); padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .ka-unten { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; gap: 10px; align-items: center; padding: 10px 12px;
    padding-bottom: max(10px, env(safe-area-inset-bottom)); background: var(--schwarz); color: #fff; }
  .ka-unten .summe { flex: 1; }
  .ka-unten .summe small { display: block; color: #bdbdb5; }
  .ka-unten .summe b { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
  .ka-unten .knopf { min-height: 56px; }
  .nur-schmal { display: inline-flex !important; }
  .kopf { flex-wrap: wrap; gap: 8px 12px; }
  .kopf .titel { flex: 1 1 calc(100% - 60px); }
  .kopf .aktionen { width: 100%; justify-content: flex-start; }
  .kopf .aktionen .breit { display: none; }
}

/* Einstellungen */
.seite { max-width: 1100px; margin: 0 auto; padding: 16px 16px 120px; display: grid; gap: 16px; }
.reihe { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.reihe.zwischen { justify-content: space-between; }
.feld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.feld label { font-size: .85rem; font-weight: 600; color: var(--text-2); }
.feld input, .feld select, .ae input { min-height: 44px; border: 2px solid var(--linie); border-radius: 10px; padding: 8px 10px; background: #fff; width: 100%; }
.feld input:focus, .feld select:focus, .ae input:focus { outline: none; border-color: var(--schwarz); }
.felder { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.v-liste { display: grid; gap: 8px; }
.v-eintrag { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--linie); background: #fff; cursor: pointer; text-align: left; width: 100%; }
.v-eintrag.gewaehlt { border-color: var(--schwarz); }
.v-eintrag .n { flex: 1; min-width: 0; }
.v-eintrag .n b { display: block; }
.marke { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; background: var(--linie); }
.marke.aktiv { background: var(--gelb); color: var(--schwarz); }
.ae { display: grid; gap: 8px; }
.ae-kopf, .ae-zeile { display: grid; grid-template-columns: minmax(150px, 1fr) 90px 140px 112px 132px; gap: 8px; align-items: center; }
.ae-kopf { font-size: .8rem; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.ae-zeile .weg-check { display: flex; align-items: center; gap: 6px; font-size: .9rem; }
.ae-zeile .weg-check input { width: 22px; height: 22px; min-height: 0; }
.ae-zeile .knoepfe { display: flex; gap: 4px; justify-content: flex-end; }
.ae-zeile .knoepfe .knopf { width: 40px; padding: 0; }
.ae-zeile input.fehler { border-color: var(--rot); background: var(--rot-hell); }
.speicherleiste { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--schwarz); color: #fff; padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom)); display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; }
.speicherleiste[hidden] { display: none; }
.kacheln-zahl { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kacheln-zahl div { background: var(--bg); border-radius: 12px; padding: 12px; }
.kacheln-zahl small { display: block; color: var(--text-2); font-weight: 600; }
.kacheln-zahl b { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.kacheln-zahl .gesamt { background: var(--gelb); }
table.liste { width: 100%; border-collapse: collapse; }
table.liste th, table.liste td { padding: 8px 6px; border-bottom: 1px solid var(--linie); text-align: left; }
table.liste td.z, table.liste th.z { text-align: right; font-variant-numeric: tabular-nums; }
.neu-form { display: grid; gap: 12px; background: var(--bg); border-radius: 12px; padding: 14px; }
.zwei-spalten { display: grid; grid-template-columns: minmax(220px, 280px) 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .zwei-spalten { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .ae-kopf { display: none; }
  .ae-zeile { grid-template-columns: 1fr 1fr; background: var(--bg); padding: 10px; border-radius: 12px; }
  .ae-zeile .name { grid-column: 1 / -1; }
  .ae-zeile .knoepfe { justify-content: flex-start; }
}

/* Kundenansicht */
.angebot { padding: 24px clamp(16px, 4vw, 56px); min-height: 100vh; background: var(--schwarz); color: #fff; }
.angebot-kopf { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.angebot-kopf img { width: clamp(64px, 9vw, 120px); height: auto; }
.angebot-kopf h1 { font-size: clamp(2rem, 5vw, 4rem); color: var(--gelb); }
.angebot-kopf p { margin: 4px 0 0; color: #bdbdb5; font-size: clamp(1rem, 1.8vw, 1.5rem); }
.angebot-gruppen { columns: 2 380px; column-gap: 48px; }
.angebot-gruppe { break-inside: avoid; margin-bottom: 28px; }
.angebot-gruppe h2 { color: var(--gelb); font-size: clamp(1.5rem, 3vw, 2.4rem); border-bottom: 3px solid var(--gelb); padding-bottom: 6px; margin-bottom: 8px; }
.angebot-zeile { display: flex; justify-content: space-between; gap: 16px; font-size: clamp(1.3rem, 2.6vw, 2.2rem); padding: 6px 0; font-weight: 600; }
.angebot-zeile b { font-variant-numeric: tabular-nums; }
.angebot-zeile.weg { opacity: .45; }
.angebot-zeile.weg span::after { content: " · ausverkauft"; font-size: .6em; color: #ff8a80; text-transform: uppercase; }
.angebot-zeile.weg b { text-decoration: line-through; }
.angebot-fuss { margin-top: 12px; border-top: 1px solid #333; padding-top: 16px; color: #d7d7cf; font-size: clamp(1rem, 1.8vw, 1.5rem); display: flex; gap: 24px; flex-wrap: wrap; }
