:root { --blau:#16213a; --akzent:#f5a623; --gruen:#1e9e57; --rot:#d23c3c; --grau:#eef0f4; --text:#1b1f2a; --rand:#d4d8e1; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin:0; height:100%; font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; color:var(--text); background:var(--grau); font-size:17px; }
body { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); overscroll-behavior: none; }
h1 { font-size:1.25rem; margin:0; } h2 { font-size:1.1rem; margin:1rem 0 .5rem; }
.mitte { text-align:center; padding:2rem 1rem; }
header.kopf { background:var(--blau); color:#fff; padding:.6rem .8rem; display:flex; align-items:center; gap:.6rem; position:sticky; top:0; z-index:5; }
header.kopf h1 { flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
header.kopf button { background:rgba(255,255,255,.15); color:#fff; border:0; }
.sync { font-size:.8rem; padding:.2rem .5rem; border-radius:1rem; background:rgba(255,255,255,.15); white-space:nowrap; }
.sync.ok { background:var(--gruen); } .sync.offen { background:var(--akzent); color:#000; } .sync.fehler { background:var(--rot); }
main { padding:.8rem; max-width:1100px; margin:0 auto; }
button, .knopf { font:inherit; padding:.7rem 1rem; border-radius:.6rem; border:1px solid var(--rand); background:#fff; color:var(--text); cursor:pointer; min-height:2.8rem; }
button.haupt { background:var(--blau); color:#fff; border-color:var(--blau); font-weight:600; }
button.gruen { background:var(--gruen); color:#fff; border-color:var(--gruen); font-weight:600; }
button.rot { background:#fff; color:var(--rot); border-color:var(--rot); }
button.klein { padding:.35rem .6rem; min-height:2rem; font-size:.9rem; }
button:disabled { opacity:.45; }
input, select { font:inherit; padding:.7rem; border:1px solid var(--rand); border-radius:.6rem; width:100%; background:#fff; }
label { display:block; margin:.7rem 0 .25rem; font-size:.9rem; color:#555; }
.karte { background:#fff; border-radius:.8rem; padding:1rem; margin-bottom:.8rem; box-shadow:0 1px 2px rgba(0,0,0,.06); }
.liste button { display:flex; width:100%; text-align:left; margin-bottom:.5rem; align-items:center; gap:.6rem; }
.liste button span.r { margin-left:auto; font-size:.8rem; color:#666; }
.marke { font-size:.75rem; padding:.15rem .5rem; border-radius:1rem; background:var(--grau); white-space:nowrap; }
.marke.gruen { background:#d9f2e3; color:#0d5e30; } .marke.gelb { background:#fdecc8; color:#7a4b00; } .marke.rot { background:#f9d7d7; color:#8a1f1f; }
.reihe { display:flex; gap:.5rem; flex-wrap:wrap; align-items:center; }
.reihe > * { flex:1; } .reihe > .fest { flex:0 0 auto; }
.pinfeld { display:grid; grid-template-columns:repeat(3,1fr); gap:.5rem; max-width:20rem; margin:1rem auto; }
.pinfeld button { font-size:1.5rem; padding:1rem 0; }
.pinanzeige { text-align:center; font-size:2rem; letter-spacing:.5rem; min-height:2.6rem; }
/* Zählen */
.letzter { background:#fff; border-radius:.8rem; padding:1rem; min-height:9.5rem; border:4px solid transparent; transition:border-color .1s; }
.letzter.blitz-ok { border-color:var(--gruen); } .letzter.blitz-fehler { border-color:var(--rot); }
.letzter .name { font-size:1.25rem; font-weight:600; line-height:1.25; }
.letzter .nr { color:#666; font-size:.9rem; margin-top:.2rem; }
.letzter .menge { font-size:2.6rem; font-weight:700; color:var(--blau); margin-top:.3rem; }
.letzter .menge small { font-size:.9rem; font-weight:400; color:#666; }
.zaehlknoepfe { display:grid; grid-template-columns:1fr 1fr 1fr; gap:.5rem; margin:.7rem 0; }
.zaehlknoepfe button { padding:1rem .3rem; font-weight:600; }
.verlauf { background:#fff; border-radius:.8rem; overflow:hidden; }
.verlauf div { display:flex; gap:.6rem; padding:.55rem .8rem; border-bottom:1px solid var(--grau); font-size:.92rem; align-items:center; }
.verlauf div.storno { text-decoration:line-through; color:#999; }
.verlauf div b { margin-left:auto; white-space:nowrap; }
.verlauf div.unb span { color:var(--rot); }
/* Tabellen Verwaltung */
.tabs { display:flex; gap:.3rem; overflow-x:auto; margin-bottom:.8rem; }
.tabs button { flex:0 0 auto; } .tabs button.aktiv { background:var(--blau); color:#fff; border-color:var(--blau); }
.tw { overflow-x:auto; background:#fff; border-radius:.8rem; }
table { border-collapse:collapse; width:100%; font-size:.88rem; }
th, td { padding:.45rem .55rem; border-bottom:1px solid var(--grau); text-align:left; vertical-align:top; }
th { background:#f7f8fa; position:sticky; top:0; white-space:nowrap; }
td.z, th.z { text-align:right; white-space:nowrap; }
td.plus { color:var(--gruen); font-weight:600; } td.minus { color:var(--rot); font-weight:600; }
tr.klick { cursor:pointer; } td input[type=checkbox] { width:1.4rem; height:1.4rem; }
/* Dialoge */
#modal { position:fixed; inset:0; background:rgba(10,15,30,.55); z-index:20; display:flex; align-items:flex-end; justify-content:center; }
#modal[hidden] { display:none; }
#modal .box { background:#fff; width:100%; max-width:640px; max-height:92vh; overflow:auto; border-radius:1rem 1rem 0 0; padding:1rem 1rem calc(1rem + env(safe-area-inset-bottom)); }
@media (min-width:700px) { #modal { align-items:center; } #modal .box { border-radius:1rem; } }
#modal h2 { margin-top:0; }
#hinweis { position:fixed; left:50%; bottom:1.2rem; transform:translateX(-50%); background:#222; color:#fff; padding:.7rem 1rem; border-radius:.6rem; z-index:30; max-width:92vw; }
#hinweis.fehler { background:var(--rot); }
video#kamera { width:100%; max-height:45vh; background:#000; border-radius:.6rem; object-fit:cover; }
.klein-text { font-size:.85rem; color:#666; }
.treffer button { display:block; width:100%; text-align:left; margin-bottom:.4rem; }
.treffer small { color:#666; display:block; }
