/* DaheimGutschein Kasse - eine Hand, ein Daumen, grosse Flaechen */
:root {
  --navy: #1B2A49; --orange: #F26B21; --orange-2: #D95A14; --grau: #77808C; --grau-2: #C9CED6;
  --hell: #F4F6FA; --linie: #E3E6EB; --ok: #2E8B57; --fehler: #B42318; --akzent: #1B2A49;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { font-family: Montserrat, "Segoe UI", system-ui, sans-serif; background: var(--hell); color: var(--navy); line-height: 1.4; overscroll-behavior: none; }
#app { min-height: 100%; display: flex; flex-direction: column; }
button { font: inherit; }
h1 { font-size: 1.3rem; font-weight: 600; margin: 0 0 12px; }
h2 { font-size: 1rem; font-weight: 600; margin: 18px 0 8px; color: var(--grau); text-transform: uppercase; letter-spacing: .05em; }
.leise { color: var(--grau); font-size: .88rem; }
.fehler { color: var(--fehler); font-weight: 600; background: #FDECEA; padding: 10px 12px; border-radius: 10px; margin: 8px 0; }
.mono { font-family: ui-monospace, Consolas, monospace; }

/* Kopf */
.kopf { background: var(--akzent); color: #fff; padding: env(safe-area-inset-top) 0 0; }
.kopf .zeile { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 56px; }
.kopf .zurueck { background: none; border: 0; color: #fff; font-size: 1.6rem; line-height: 1; padding: 6px 8px; cursor: pointer; }
.kopf .titel { flex: 1; font-weight: 600; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kopf .titel small { display: block; font-weight: 400; font-size: .78rem; opacity: .8; }
.kopf .menue { background: rgba(255,255,255,.15); border: 0; color: #fff; padding: 8px 12px; border-radius: 8px; cursor: pointer; font-size: .85rem; font-weight: 600; }
.kopf img.marke { height: 28px; }

.inhalt { flex: 1; padding: 16px; max-width: 520px; width: 100%; margin: 0 auto; }
.fuss { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); max-width: 520px; width: 100%; margin: 0 auto; display: flex; gap: 10px; }
.fuss .knopf { flex: 1; }

/* Knoepfe */
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--orange); color: #fff; border: 0; border-radius: 12px; padding: 14px 18px; font-weight: 600; font-size: 1rem; cursor: pointer; text-decoration: none; min-height: 52px; }
.knopf:active { background: var(--orange-2); }
.knopf.gross { width: 100%; font-size: 1.1rem; min-height: 60px; }
.knopf.still { background: #fff; color: var(--navy); border: 1.5px solid var(--grau-2); }
.knopf.navy { background: var(--navy); }
.knopf.rot { background: var(--fehler); }
.knopf:disabled { opacity: .45; cursor: default; }
.knopf.klein { padding: 8px 12px; min-height: 40px; font-size: .88rem; border-radius: 9px; }

/* Anmeldung */
.anmeldung { padding: 40px 24px; max-width: 420px; margin: 0 auto; width: 100%; }
.anmeldung .logo { height: 44px; display: block; margin: 0 auto 32px; }
label { display: block; font-size: .85rem; font-weight: 600; color: var(--grau); margin: 12px 0 4px; }
input[type=text], input[type=password], input[type=tel] { width: 100%; font: inherit; font-size: 1.05rem; padding: 12px 14px; border: 1.5px solid var(--grau-2); border-radius: 10px; background: #fff; color: var(--navy); }
input:focus { outline: 2px solid var(--orange); border-color: var(--orange); }

/* Scanner */
.scanner { position: relative; background: #000; border-radius: 16px; overflow: hidden; aspect-ratio: 1 / 1; max-height: 52vh; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner .rahmen { position: absolute; inset: 14%; border: 3px solid rgba(255,255,255,.85); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); pointer-events: none; }
.scanner .status { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px; text-align: center; color: #fff; font-size: .85rem; background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.scanner.aus { background: var(--navy); display: flex; align-items: center; justify-content: center; color: #fff; text-align: center; padding: 24px; aspect-ratio: auto; min-height: 160px; }

/* Nummernblock */
.eingabe { background: #fff; border: 1.5px solid var(--grau-2); border-radius: 12px; padding: 14px; font-size: 1.7rem; font-weight: 600; text-align: center; letter-spacing: .06em; min-height: 66px; font-variant-numeric: tabular-nums; margin: 12px 0; }
.eingabe .hinweis { display: block; font-size: .8rem; font-weight: 500; color: var(--grau); letter-spacing: 0; }
.block { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.block button { background: #fff; border: 1.5px solid var(--linie); border-radius: 12px; font-size: 1.4rem; font-weight: 600; padding: 14px 0; color: var(--navy); cursor: pointer; min-height: 58px; }
.block button:active { background: var(--hell); }
.block button.leise { font-size: 1rem; color: var(--grau); }
.schnell { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.schnell button { flex: 1; background: #fff; border: 1.5px solid var(--grau-2); border-radius: 10px; padding: 10px 6px; font-weight: 600; color: var(--navy); cursor: pointer; min-width: 60px; }
.schnell button.orange { border-color: var(--orange); color: var(--orange); }

/* Kartenbild */
.karte-kopf { background: #fff; border-radius: 16px; padding: 18px; border: 1px solid var(--linie); }
.karte-kopf .nummer { font-family: ui-monospace, Consolas, monospace; color: var(--grau); font-size: .95rem; }
.karte-kopf .saldo { font-size: 2.6rem; font-weight: 600; letter-spacing: -.02em; margin: 2px 0; }
.karte-kopf .status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--hell); color: var(--grau); }
.karte-kopf .status.gesperrt, .karte-kopf .status.verbraucht { background: #FDECEA; color: var(--fehler); }
.aktion-knoepfe { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.aktion-knoepfe .knopf { min-height: 72px; font-size: 1.1rem; flex-direction: column; gap: 2px; }
.aktion-knoepfe .knopf small { font-weight: 500; font-size: .75rem; opacity: .85; }
.aktion-knoepfe .knopf.voll { grid-column: 1 / -1; }
.liste { background: #fff; border-radius: 14px; border: 1px solid var(--linie); }
.liste .eintrag { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--linie); font-size: .9rem; }
.liste .eintrag:last-child { border-bottom: 0; }
.liste .eintrag .wann { color: var(--grau); font-size: .8rem; }
.liste .eintrag .was { flex: 1; }
.liste .eintrag .betrag { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.liste .eintrag.plus .betrag { color: var(--ok); }
.liste .eintrag.storniert .betrag, .liste .eintrag.storniert .was { text-decoration: line-through; color: var(--grau); }
.liste .leer { padding: 14px; color: var(--grau); font-size: .9rem; }

/* Beleg */
.beleg { background: #fff; border-radius: 16px; padding: 22px 20px; border: 1px solid var(--linie); text-align: center; }
.beleg .haken { width: 64px; height: 64px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 2rem; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.beleg .haken.storno { background: var(--fehler); }
.beleg .betrag { font-size: 2.4rem; font-weight: 600; letter-spacing: -.02em; }
.beleg .art { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; color: var(--grau); font-weight: 600; }
.beleg dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; text-align: left; margin: 18px 0 0; font-size: .92rem; }
.beleg dt { color: var(--grau); } .beleg dd { margin: 0; font-weight: 600; text-align: right; }
.rest-hinweis { background: #FFF4E5; color: #8A4B08; border-radius: 12px; padding: 12px 14px; font-weight: 600; margin: 10px 0; }

/* Zusammenfassung */
.summen { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.summen div { background: #fff; border: 1px solid var(--linie); border-radius: 12px; padding: 12px 14px; }
.summen .titel { font-size: .75rem; color: var(--grau); text-transform: uppercase; letter-spacing: .05em; }
.summen .wert { font-size: 1.4rem; font-weight: 600; }

.wahl { display: grid; gap: 10px; margin: 12px 0; }
.wahl .knopf { justify-content: flex-start; text-align: left; }
.lade { text-align: center; padding: 30px; color: var(--grau); }

@media print {
  body { background: #fff; }
  .kopf, .fuss, .aktion-knoepfe, .knopf { display: none !important; }
  .beleg { border: 0; }
}

/* Scanner-Kasten ohne Kamera (PC mit Handscanner) */
.scanner.aus.klein { min-height: 0; aspect-ratio: auto; padding: 14px 16px; display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; text-align: left; font-size: .9rem; border-radius: 12px; }
.scanner .status .aus-schalter { background: rgba(255,255,255,.2); border: 0; color: #fff; padding: 3px 8px; border-radius: 6px; font-size: .78rem; cursor: pointer; }

/* Beleg als Bon */
.beleg .bon-kopf { border-bottom: 1px dashed var(--grau-2); padding-bottom: 12px; margin-bottom: 14px; }
.beleg .bon-marke { font-weight: 600; font-size: 1.05rem; }
.beleg .bon-kasse { color: var(--grau); font-size: .85rem; line-height: 1.35; }
.beleg dd.stark { font-size: 1.05rem; }
.beleg .bon-fuss { border-top: 1px dashed var(--grau-2); margin-top: 16px; padding-top: 12px; font-size: .85rem; }
.beleg .bon-fuss .leise { margin-top: 8px; font-size: .75rem; line-height: 1.4; }
.beleg.storno .betrag { color: var(--fehler); }

@media print {
  @page { size: 80mm auto; margin: 4mm; }
  html, body { background: #fff !important; }
  /* Der Inhalt liegt in .geraet (Karte am PC) - alles andere ausblenden, .geraet selbst ohne Rahmen */
  #app > *:not(.geraet) { display: none !important; }
  .geraet { display: block !important; width: auto !important; max-width: none !important; margin: 0 !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important; background: #fff !important; }
  .geraet > *:not(main) { display: none !important; }
  main.inhalt { padding: 0; max-width: none; overflow: visible !important; height: auto !important; }
  main.inhalt > *:not(.beleg) { display: none !important; }
  .beleg { border: 0; border-radius: 0; padding: 0; width: 72mm; font-size: 11pt; color: #000; }
  .beleg .haken { display: none; }
  .beleg .betrag { font-size: 20pt; }
  .beleg .bon-marke, .beleg dd, .beleg .betrag { color: #000; }
  .beleg dl { font-size: 10pt; gap: 3px 8px; }
  .beleg .bon-fuss { font-size: 9pt; }
  .beleg .bon-fuss .leise { font-size: 8pt; color: #000; }
}

/* Grosse Bildschirme: Logo und Marke ueber der Kasse, die Kasse selbst als Karte */
.oben { display: none; }
.geraet { display: contents; }
@media (min-width: 900px) {
  body { background: #E9EDF3; }
  #app { max-width: 560px; margin: 0 auto; padding: 26px 0 40px; min-height: 0; display: block; }
  .oben { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 6px 16px; }
  .oben img { height: 34px; }
  .oben span { font-size: .95rem; font-weight: 600; color: var(--navy); opacity: .75; }
  .geraet { display: flex; flex-direction: column; background: var(--hell); border-radius: 22px; overflow: hidden; box-shadow: 0 12px 40px rgba(27,42,73,.14), 0 1px 3px rgba(27,42,73,.08); min-height: 600px; }
  .geraet .inhalt { flex: 1; }
  .kopf { padding-top: 0; }
  .kopf img.marke { display: none; }
  .fuss { padding-bottom: 18px; }
  .scanner { max-height: 420px; }
}
@media print { .oben { display: none !important; } }

.oben img.herausgeber { height: 38px; max-width: 200px; object-fit: contain; }
