/* Comeback Kassensystem – Oberfläche ohne externe Abhängigkeiten (läuft auch bei schlechtem Netz) */
:root {
    --bg: #0c1430;
    --bg-2: #111c3f;
    --surface: #17244d;
    --surface-2: #1e2d5c;
    --line: rgba(255, 255, 255, .10);
    --line-strong: rgba(255, 255, 255, .22);
    --text: #f4f6fb;
    --muted: #9ba7c8;
    --gold: #e6bd4f;
    --gold-2: #f5d77d;
    --gold-ink: #1b1606;
    --green: #2fbf71;
    --green-ink: #04210f;
    --red: #ef5350;
    --orange: #f29b38;
    --blue: #5b9bff;
    --radius: 14px;
    --radius-sm: 10px;
    --tap: 52px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: env(safe-area-inset-top, 0px);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
    margin: 0; min-height: 100dvh;
    font: 16px/1.4 var(--font);
    color: var(--text);
    background: radial-gradient(120% 80% at 50% -10%, #1b2a5e 0%, var(--bg) 60%) fixed, var(--bg);
    touch-action: manipulation;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--gold-2); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Kopfzeile ---------- */
.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: .6rem;
    padding: calc(.55rem + var(--safe-t)) max(.9rem, env(safe-area-inset-right)) .55rem max(.9rem, env(safe-area-inset-left));
    background: rgba(12, 20, 48, .92);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(230, 189, 79, .35);
}
.topbar .spacer { flex: 1; }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: var(--gold); display: flex; align-items: center; gap: .4rem; white-space: nowrap; }
.brand-lg { font-size: 1.9rem; justify-content: center; }
.brand-sub { font-family: var(--font); font-weight: 400; font-size: .85rem; }
.brand-icon { font-family: var(--font); }
.station-title { font-weight: 700; font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    min-height: 44px; padding: .55rem 1rem;
    border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
    background: var(--surface-2); color: var(--text);
    font-weight: 600; text-decoration: none; user-select: none; -webkit-user-select: none;
    transition: transform .08s ease, background .15s ease, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn-sm { min-height: 38px; padding: .35rem .75rem; font-size: .9rem; }
.btn-lg { min-height: 60px; font-size: 1.15rem; border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: var(--gold-ink); border-color: transparent; }
.btn-green { background: var(--green); color: var(--green-ink); border-color: transparent; }
.btn-red { background: transparent; color: #ff8a87; border-color: rgba(239, 83, 80, .55); }
.btn-ghost { background: transparent; border-color: var(--line-strong); }
.btn-icon { width: 44px; padding: 0; font-size: 1.2rem; }

.input, .select {
    width: 100%; min-height: 46px; padding: .55rem .8rem;
    border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
    background: rgba(0, 0, 0, .25); color: var(--text); font-size: 1rem;
}
.input:focus, .select:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.label { display: block; font-weight: 600; margin-bottom: .35rem; }
.row-inline { display: flex; gap: .6rem; align-items: center; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.alert { border-radius: var(--radius-sm); padding: .7rem .9rem; margin: .8rem 0; font-weight: 600; }
.alert-danger { background: rgba(239, 83, 80, .15); border: 1px solid rgba(239, 83, 80, .5); color: #ffb3b1; }
.alert-warn { background: rgba(242, 155, 56, .15); border: 1px solid rgba(242, 155, 56, .5); color: #ffd3a1; }

.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .65rem; border-radius: 999px; font-size: .82rem; font-weight: 700; border: 1px solid var(--line-strong); white-space: nowrap; }
.pill::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: currentColor; }
.pill-ok { color: var(--green); }
.pill-warn { color: var(--orange); }
.pill-bad { color: var(--red); }

/* ---------- Login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 1.2rem; }
.login-card { width: min(360px, 100%); text-align: center; }
.pin-input { width: 100%; text-align: center; font-size: 2rem; letter-spacing: .5rem; padding: .6rem; border-radius: var(--radius); border: 1px solid var(--line-strong); background: rgba(0, 0, 0, .3); color: var(--text); margin: .6rem 0; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-top: .6rem; }
.key { min-height: 66px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface); font-size: 1.6rem; font-weight: 600; }
.key:active { background: var(--surface-2); transform: scale(.97); }
.key-muted { color: var(--muted); }
.key-go { background: var(--gold); color: var(--gold-ink); border-color: transparent; }

/* ---------- Start ---------- */
.start { max-width: 900px; margin: 0 auto; padding: 1.2rem 1rem calc(2rem + var(--safe-b)); }
.start-title { font-family: var(--font-display); color: var(--gold); font-size: 1.6rem; margin: .4rem 0 1rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .8rem; }
.tile { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .9rem; align-items: center; padding: 1.1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; min-height: 96px; }
.tile:active { transform: scale(.98); }
.tile-icon { grid-row: span 2; font-size: 2.2rem; }
.tile-name { font-weight: 700; font-size: 1.15rem; }
.tile-desc { color: var(--muted); font-size: .88rem; }
.tile-food { border-color: rgba(230, 189, 79, .55); }
.tile-drinks { border-color: rgba(91, 155, 255, .55); }
.tile-kitchen { border-color: rgba(242, 155, 56, .55); }
.tile-locked { opacity: .75; }
.device-panel { margin-top: 1.2rem; }
.today { margin: .4rem 0 1.1rem; }
.today .summary { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
@media (max-width: 640px) { .today .summary { grid-template-columns: repeat(2, 1fr); } }
.log-tools { display: grid; grid-template-columns: 170px 1fr auto auto; gap: .5rem; }
.log-filter { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.log-filter .chip { min-height: 38px; padding: .3rem .8rem; font-size: .9rem; }
.loglist { display: grid; gap: .4rem; margin-top: .8rem; }
.log-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.log-row summary { display: grid; grid-template-columns: 4.6rem 1.6rem 1fr; gap: .1rem .4rem; align-items: start; padding: .55rem .7rem; cursor: pointer; list-style: none; }
.log-row summary::-webkit-details-marker { display: none; }
.log-time { color: var(--muted); font-size: .88rem; padding-top: .05rem; }
.log-text { line-height: 1.35; overflow-wrap: anywhere; }
.log-meta { grid-column: 3; color: var(--muted); font-size: .78rem; }
.log-row[open] { border-color: var(--line-strong); }
.log-row pre { margin: 0; padding: .7rem; max-height: 320px; overflow: auto; background: rgba(0, 0, 0, .3); border-top: 1px solid var(--line); font-size: .78rem; white-space: pre-wrap; word-break: break-word; border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
#logStats { grid-template-columns: repeat(auto-fit, minmax(95px, 1fr)); gap: .4rem; }
#logStats .kpi { padding: .4rem .3rem; }
#logStats .kpi b { font-size: 1.02rem; }
#logStats .kpi span { font-size: .68rem; }
.log-warn { border-color: rgba(239, 83, 80, .45); }
.log-products, .log-event { border-left: 3px solid var(--gold); }
@media (max-width: 640px) {
    .log-tools { grid-template-columns: 1fr auto auto; }
    .log-tools #logSearch { grid-column: 1 / -1; grid-row: 2; }
}
.today-event { font-family: var(--font); font-size: 1rem; }
.action-row { display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding: .4rem 0; }
.action-row + .action-row { border-top: 1px solid var(--line); padding-top: .9rem; margin-top: .5rem; }
.action-row p { margin: .3rem 0 0; }
.action-row .btn { flex: 0 0 auto; min-width: 130px; }
@media (max-width: 560px) { .action-row { flex-direction: column; align-items: stretch; } }
.today-head { font-family: var(--font-display); color: var(--gold); font-size: 1.3rem; margin-bottom: .6rem; }
.device-panel p { margin: .5rem 0 0; }

/* ---------- Kasse ---------- */
.chips { display: flex; gap: .5rem; overflow-x: auto; padding: .6rem .9rem; margin: 0 -.9rem; scrollbar-width: none; position: sticky; top: var(--topbar-h, 58px); z-index: 20; background: linear-gradient(var(--bg) 70%, transparent); }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; min-height: 44px; padding: .45rem 1rem; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; white-space: nowrap; }
.chip.active { background: var(--gold); color: var(--gold-ink); border-color: transparent; }

.pos { display: grid; grid-template-columns: 1fr; }
.products { padding: 0 .9rem calc(110px + var(--safe-b)); min-width: 0; }
.cat-title { margin: .9rem 0 .5rem; font-size: .95rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.cat-title:first-child { margin-top: .2rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; }
.prod {
    position: relative; min-height: 92px; padding: .7rem .6rem; border-radius: var(--radius);
    border: 1.5px solid rgba(230, 189, 79, .35); background: linear-gradient(160deg, var(--surface-2), var(--surface));
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; text-align: center;
    user-select: none; -webkit-user-select: none;
}
.prod:active { transform: scale(.96); background: var(--surface-2); }
.prod-name { font-weight: 650; line-height: 1.2; font-size: .98rem; }
.prod-price { color: var(--gold); font-weight: 800; font-size: 1.08rem; }
.prod-badge { position: absolute; top: -7px; right: -7px; min-width: 28px; height: 28px; padding: 0 .4rem; border-radius: 999px; background: var(--gold); color: var(--gold-ink); font-weight: 800; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
.prod-plus { color: var(--green); font-weight: 700; font-size: .78rem; }
.prod.soldout { opacity: .4; border-style: dashed; pointer-events: none; }
.prod.soldout .prod-price::after { content: " · aus"; color: var(--red); }
.prod.bump { animation: bump .25s ease; }
@keyframes bump { 50% { transform: scale(1.05); border-color: var(--gold); } }
.station-getraenke .prod { border-color: rgba(91, 155, 255, .4); }

/* Warenkorb: Handy = Sheet von unten, Tablet quer/Desktop = Spalte rechts */
.cart { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: var(--bg-2); transform: translateY(105%); transition: transform .25s ease; padding-bottom: var(--safe-b); }
.cart.open { transform: none; }
.cart-head { display: flex; align-items: center; gap: .5rem; padding: calc(.7rem + var(--safe-t)) .9rem .7rem; border-bottom: 1px solid var(--line); }
.cart-head h2 { margin: 0; font-size: 1.15rem; flex: 1; }
.cart-lines { flex: 1; overflow-y: auto; padding: .6rem .9rem; overscroll-behavior: contain; }
.cart-empty { color: var(--muted); text-align: center; padding: 2rem 0; }
.line { display: grid; grid-template-columns: 1fr auto; gap: .2rem .6rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.line-name { font-weight: 650; }
.line-tops { color: var(--green); font-size: .88rem; grid-column: 1; }
.line-price { text-align: right; font-weight: 700; color: var(--gold); }
.stepper { display: flex; align-items: center; gap: .3rem; grid-column: 2; justify-self: end; }
.stepper button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface-2); font-size: 1.3rem; font-weight: 700; line-height: 1; }
.stepper span { min-width: 1.8rem; text-align: center; font-weight: 800; }
.cart-foot { border-top: 1px solid var(--line); padding: .7rem .9rem .9rem; background: var(--bg-2); }
.total-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.5rem; font-weight: 800; }
.total-row .num { color: var(--gold); }
.pay { margin-top: .6rem; }
.pay-row { display: flex; gap: .5rem; align-items: center; }
.pay-row .input { font-size: 1.2rem; font-weight: 700; text-align: right; }
.cash { display: grid; grid-template-columns: repeat(6, 1fr); gap: .4rem; margin-top: .5rem; }
.cash button { min-height: 46px; border-radius: var(--radius-sm); border: 1px solid rgba(230, 189, 79, .5); background: rgba(230, 189, 79, .1); color: var(--gold-2); font-weight: 700; }
.cash button:active { background: var(--gold); color: var(--gold-ink); }
.change { margin-top: .6rem; padding: .6rem; border-radius: var(--radius-sm); background: rgba(0, 0, 0, .3); text-align: center; font-size: 1.45rem; font-weight: 800; color: var(--green); min-height: 3rem; }
.change.short { color: var(--red); }
.change.idle { color: var(--muted); font-size: 1rem; font-weight: 600; display: grid; place-items: center; }
.book { margin-top: .7rem; }

.cartbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: .6rem .9rem calc(.6rem + var(--safe-b)); background: rgba(12, 20, 48, .96); border-top: 1px solid rgba(230, 189, 79, .45); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.cartbar .btn { width: 100%; justify-content: space-between; }
.cartbar-count { background: rgba(0, 0, 0, .25); border-radius: 999px; padding: .1rem .6rem; }

@media (min-width: 900px) {
    .pos { grid-template-columns: 1fr minmax(340px, 30%); align-items: start; }
    .products { padding-bottom: 2rem; }
    .cart { position: sticky; top: var(--topbar-h, 58px); inset: auto; transform: none; height: calc(100dvh - var(--topbar-h, 58px)); border-left: 1px solid var(--line); z-index: 10; }
    .cart-head { padding-top: .7rem; }
    .cart-close, .cartbar { display: none !important; }
}

/* ---------- Sheets & Overlays ---------- */
.backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .55); opacity: 0; pointer-events: none; transition: opacity .2s; }
.backdrop.show { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; max-height: 88dvh; display: flex; flex-direction: column; background: var(--bg-2); border-radius: 18px 18px 0 0; border-top: 1px solid rgba(230, 189, 79, .5); transform: translateY(105%); transition: transform .25s ease; padding-bottom: var(--safe-b); }
.sheet.open { transform: none; }
.sheet-head { display: flex; align-items: center; gap: .5rem; padding: .9rem; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font-size: 1.15rem; flex: 1; }
.sheet-body { overflow-y: auto; padding: .9rem; overscroll-behavior: contain; }
.sheet-foot { padding: .7rem .9rem .9rem; border-top: 1px solid var(--line); }
@media (min-width: 700px) {
    .sheet { left: 50%; right: auto; bottom: 50%; width: min(620px, 94vw); border-radius: 18px; border: 1px solid rgba(230, 189, 79, .5); transform: translate(-50%, 60%) scale(.98); opacity: 0; pointer-events: none; transition: transform .2s ease, opacity .2s; }
    .sheet.open { transform: translate(-50%, 50%); opacity: 1; pointer-events: auto; }
}
.toppings { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.topping { min-height: 56px; border-radius: var(--radius-sm); border: 1.5px solid rgba(47, 191, 113, .5); background: rgba(47, 191, 113, .1); font-weight: 650; padding: .4rem .6rem; }
.topping small { display: block; color: var(--muted); font-weight: 500; }
.topping.on { background: var(--green); color: var(--green-ink); border-color: transparent; }
.topping.on small { color: var(--green-ink); }
.qty-big { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1rem; }
.qty-big button { width: 54px; height: 54px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface-2); font-size: 1.6rem; font-weight: 700; }
.qty-big span { font-size: 1.8rem; font-weight: 800; min-width: 2.5rem; text-align: center; }

.done-overlay { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(5, 10, 25, .97); padding: 1.5rem; text-align: center; }
.done-overlay .alert-warn { background: #3a2a14; }
.done-box { width: min(440px, 100%); }
.done-check { font-size: 3.4rem; }
.done-label { color: var(--muted); margin-top: .4rem; }
.done-number { font-family: var(--font-display); font-weight: 800; font-size: clamp(4.5rem, 22vw, 7.5rem); line-height: 1; color: var(--gold); margin: .2rem 0 .4rem; }
.done-change { font-size: 1.7rem; font-weight: 800; color: var(--green); }
.done-note { margin-top: 1rem; }
.done-hint { margin-top: 1.3rem; color: var(--muted); font-size: .9rem; }

.toasts { position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%); z-index: 100; display: grid; gap: .5rem; width: min(520px, 92vw); }
.toast { display: flex; align-items: center; gap: .7rem; padding: .75rem .9rem; border-radius: var(--radius-sm); background: #24335f; border: 1px solid var(--line-strong); box-shadow: 0 6px 24px rgba(0, 0, 0, .45); font-weight: 600; animation: toastIn .2s ease; }
.toast span { flex: 1; }
.toast-err { background: #4a1f28; border-color: rgba(239, 83, 80, .6); }
.toast-ok { background: #173d2c; border-color: rgba(47, 191, 113, .6); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* Bestellliste (Kasse) */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .5rem; margin-bottom: .8rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem; text-align: center; }
.kpi b { display: block; font-size: 1.2rem; color: var(--gold); }
.kpi span { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.olist { display: grid; gap: .5rem; }
.orow { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .65rem .75rem; }
.orow-head { display: flex; align-items: center; gap: .5rem; }
.orow-no { font-weight: 800; font-size: 1.15rem; color: var(--gold); min-width: 3.2rem; }
.orow-time { color: var(--muted); font-size: .85rem; }
.orow-total { margin-left: auto; font-weight: 800; }
.orow-items { font-size: .9rem; margin: .35rem 0; color: #d7ddef; }
.orow-actions { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.orow.cancelled { opacity: .55; }
.orow.cancelled .orow-total { text-decoration: line-through; }
.orow.queued { border-color: var(--orange); }
.badge { display: inline-block; padding: .12rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 800; }
.b-open { background: rgba(242, 155, 56, .2); color: var(--orange); }
.b-done { background: rgba(47, 191, 113, .18); color: var(--green); }
.b-cancel { background: rgba(239, 83, 80, .18); color: #ff8a87; }
.b-queue { background: rgba(242, 155, 56, .25); color: #ffd3a1; }

/* ---------- Küche ---------- */
.page-kitchen .topbar { border-bottom-color: rgba(242, 155, 56, .7); }
.k-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: .8rem; padding: .9rem; padding-bottom: calc(2rem + var(--safe-b)); }
.k-card { display: flex; flex-direction: column; background: linear-gradient(160deg, var(--surface-2), var(--surface)); border: 2px solid rgba(242, 155, 56, .55); border-radius: var(--radius); padding: .8rem; transition: opacity .25s, transform .25s; }
.k-card.new { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(230, 189, 79, .3), 0 0 24px rgba(230, 189, 79, .25); }
.k-card.late { border-color: var(--red); }
.k-card.leaving { opacity: 0; transform: scale(.94); }
.k-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); margin-bottom: .5rem; }
.k-no { font-family: var(--font-display); font-weight: 800; font-size: 2.6rem; line-height: 1; color: var(--gold); }
.k-time { color: var(--muted); font-size: .85rem; margin-top: .2rem; }
.k-age { padding: .25rem .6rem; border-radius: 999px; background: rgba(242, 155, 56, .2); color: var(--orange); font-weight: 800; font-size: .9rem; white-space: nowrap; }
.k-card.late .k-age { background: var(--red); color: #fff; }
.k-items { flex: 1; display: grid; gap: .4rem; margin-bottom: .7rem; }
.k-item { display: flex; gap: .6rem; align-items: flex-start; background: rgba(0, 0, 0, .25); border-radius: var(--radius-sm); padding: .55rem .6rem; }
.k-qty { min-width: 40px; height: 40px; border-radius: 9px; background: var(--gold); color: var(--gold-ink); font-weight: 900; font-size: 1.35rem; display: grid; place-items: center; }
.k-name { font-weight: 700; font-size: 1.15rem; line-height: 1.2; }
.k-cat { color: var(--muted); font-size: .8rem; }
.k-tops { color: var(--green); font-weight: 700; margin-top: .15rem; }
.k-item.other { opacity: .5; }
.k-empty { grid-column: 1/-1; text-align: center; padding: 4rem 1rem; color: var(--muted); }
.k-empty b { display: block; font-family: var(--font-display); color: var(--gold); font-size: 1.8rem; margin: .5rem 0; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line-strong); }
.seg-btn { min-height: 40px; padding: .3rem .9rem; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 700; white-space: nowrap; }
.seg-btn b { display: inline-block; min-width: 1.6rem; margin-left: .3rem; padding: 0 .35rem; border-radius: 999px; background: rgba(255, 255, 255, .12); font-size: .85rem; }
.seg-btn.active { background: var(--orange); color: #1d1204; }
.seg-btn.active b { background: rgba(0, 0, 0, .18); }
#tabDone.active { background: var(--green); color: var(--green-ink); }
.k-info { margin: .8rem .9rem 0; padding: .6rem .8rem; border-radius: var(--radius-sm); background: rgba(47, 191, 113, .12); border: 1px solid rgba(47, 191, 113, .45); color: #bdf0d3; font-size: .9rem; }
.k-card.is-done { border-color: rgba(47, 191, 113, .45); background: var(--surface); }
.k-card.is-done .k-no { color: var(--green); }
.k-card.is-done .k-age { background: rgba(47, 191, 113, .18); color: var(--green); }
.k-card.is-done .k-qty { background: rgba(255, 255, 255, .15); color: var(--text); }
.k-reopen { align-self: flex-end; color: var(--muted); }
.start-overlay { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; background: rgba(5, 10, 25, .92); text-align: center; padding: 1.5rem; }
.start-overlay button { font-size: 1.3rem; }
.clock { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); }

/* ---------- Verwaltung ---------- */
.admin { max-width: 1100px; margin: 0 auto; padding: 1rem .9rem calc(6rem + var(--safe-b)); }
.admin h2 { font-family: var(--font-display); color: var(--gold); margin: 1.4rem 0 .7rem; }
.tabs { display: flex; gap: .5rem; margin-bottom: .5rem; }
.cat-panel { margin-bottom: .9rem; }
.cat-fields { display: grid; grid-template-columns: 70px 1fr 170px; gap: .5rem; align-items: center; }
.cat-flags { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; margin-top: .6rem; }
.cat-tools { display: flex; gap: .35rem; margin-left: auto; }
.check { display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; font-weight: 600; }
.check input { width: 22px; height: 22px; accent-color: var(--gold); }
.p-list { display: grid; gap: .5rem; margin-top: .8rem; }
.p-row { background: rgba(0, 0, 0, .2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .55rem; }
.p-main { display: grid; grid-template-columns: 1fr 110px auto; gap: .45rem; align-items: center; }
.p-tools { display: flex; gap: .3rem; align-items: center; }
.p-sub { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; margin-top: .35rem; }
.t-list { display: grid; gap: .4rem; margin-top: .5rem; padding-left: .8rem; border-left: 2px solid rgba(47, 191, 113, .5); }
.t-row { display: grid; grid-template-columns: 1fr 100px 44px; gap: .4rem; }
.savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; gap: .6rem; align-items: center; justify-content: flex-end; padding: .7rem .9rem calc(.7rem + var(--safe-b)); background: rgba(12, 20, 48, .97); border-top: 1px solid rgba(230, 189, 79, .5); transform: translateY(110%); transition: transform .2s; }
.savebar.show { transform: none; }
.savebar span { margin-right: auto; font-weight: 600; color: var(--gold-2); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.table .r { text-align: right; }
@media (max-width: 640px) {
    .cat-fields { grid-template-columns: 60px 1fr; }
    .cat-fields .select { grid-column: 1 / -1; }
    .p-main { grid-template-columns: 1fr 92px; }
    .p-main .p-tools { grid-column: 1 / -1; justify-content: flex-end; }
    .cash { grid-template-columns: repeat(3, 1fr); }
    .hide-sm { display: none; }
}

/* ---------- Auswertung (hell, druckfreundlich) ---------- */
.page-report { background: #eef1f6; color: #1d2433; font-size: 15px; }
.page-report a { color: #1f5fd1; }
.report-bar { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; padding: .7rem 1rem; background: #1d2a52; color: #fff; }
.report-bar label { font-size: .75rem; display: grid; gap: .2rem; color: #c9d3ee; }
.report-bar select { min-height: 40px; border-radius: 8px; border: 0; padding: 0 .5rem; color: #1d2433; background: #fff; }
.report-bar .btn { min-height: 40px; }
.report { max-width: 1000px; margin: 1rem auto; background: #fff; padding: 1.6rem 1.8rem; border-radius: 10px; box-shadow: 0 2px 10px rgba(0, 0, 0, .06); }
.r-head { text-align: center; border-bottom: 3px solid #1d2a52; padding-bottom: .9rem; margin-bottom: 1rem; }
.r-title { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; color: #1d2a52; }
.r-sub { color: #5b6478; }
.r-meta { color: #8a93a6; font-size: .85rem; margin-top: .3rem; }
.r-sec { font-size: 1.15rem; font-weight: 700; color: #1d2a52; margin: 1.5rem 0 .6rem; padding-bottom: .35rem; border-bottom: 2px solid #c9d6f2; }
.r-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem; }
.r-kpi { border: 1px solid #dfe4ee; border-radius: 8px; padding: .7rem; text-align: center; background: #f8f9fc; }
.r-kpi b { display: block; font-size: 1.35rem; color: #1d2a52; font-variant-numeric: tabular-nums; }
.r-kpi span { font-size: .72rem; color: #6b7487; text-transform: uppercase; letter-spacing: .05em; }
.r-table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: .3rem 0 .6rem; }
.r-table th { background: #1d2a52; color: #fff; text-align: left; padding: .45rem .6rem; font-weight: 600; font-size: .82rem; }
.r-table td { padding: .4rem .6rem; border-bottom: 1px solid #e6e9f0; font-variant-numeric: tabular-nums; }
.r-table .r { text-align: right; }
.r-table tr.cat td { background: #eef3fc; font-weight: 700; border-top: 2px solid #9db8ea; }
.r-table tr.var td:first-child { padding-left: 1.5rem; }
.r-table tr.peak td { background: #e5f6ec; }
.r-table tr.sum td { font-weight: 700; border-top: 2px solid #1d2a52; }
.r-bar { height: 10px; min-width: 2px; background: #3b6fd8; border-radius: 0 4px 4px 0; }
.r-barcell { width: 32%; }
.r-day { break-before: page; page-break-before: always; }
.r-day-title { background: #1d2a52; color: #fff; padding: .6rem .9rem; border-radius: 6px; font-weight: 700; font-size: 1.1rem; margin-top: 1.6rem; }
.r-two { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.r-note { color: #6b7487; font-size: .82rem; }
.r-empty { text-align: center; padding: 3rem 1rem; color: #6b7487; }
@media (max-width: 760px) { .r-two { grid-template-columns: 1fr; } .report { padding: 1rem; border-radius: 0; margin: 0; } }
@media print {
    @page { size: A4; margin: 12mm; }
    .page-report { background: #fff; font-size: 10pt; }
    .report-bar { display: none !important; }
    .report { box-shadow: none; margin: 0; padding: 0; max-width: none; }
    .r-table tr { break-inside: avoid; }
    .r-sec { break-after: avoid; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 420px) {
    .page-kitchen .topbar { gap: .35rem; }
    .seg-btn { padding: .3rem .5rem; font-size: .9rem; }
    .seg-btn b { margin-left: .2rem; min-width: 1.3rem; }
}
