:root {
  --bg: #F6F7F4; --surface: #FFFFFF; --text: #1B1F1A; --muted: #5A6157; --line: #DADDD5; --line-soft: #ECEDE9;
  --input-line: #B9BEB3; --accent: #2F6B3A; --accent-dark: #1F4A28; --accent-soft: #EEF5EE; --ok-bg: #DCEBDD; --ok-fg: #1F4A28;
  --warn-bg: #FFE7B3; --warn-fg: #5C3B00; --err-bg: #FBE3E0; --err-fg: #7A1B12; --err-line: #A3261B; --neutral-bg: #ECEDE9; --head-bg: #E9EDE6;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px; }
a { color: var(--accent); } a:hover { color: var(--accent-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
h1 { font-size: 24px; margin: 0; } h2 { font-size: 18px; margin: 0; } h3 { font-size: 16px; margin: 0; }
.muted { color: var(--muted); font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Navigation */
.topnav { background: var(--accent); color: #fff; }
.topnav .in { max-width: 1440px; margin: 0 auto; padding: 0 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 22px; min-height: 56px; }
.topnav .brand { font-weight: 700; font-size: 17px; margin-right: 10px; display: flex; align-items: center; gap: 10px; }
.logo { width: 40px; height: 40px; border-radius: 50%; background: #fff; object-fit: contain; padding: 2px; flex: none; }
.logo.lg { width: 72px; height: 72px; padding: 3px; }
.topnav a { color: #fff; text-decoration: none; padding: 16px 0; border-bottom: 3px solid transparent; }
.topnav a.on { font-weight: 700; border-bottom-color: #fff; }
.topnav .right { margin-left: auto; display: flex; gap: 14px; align-items: center; font-size: 14px; }
.topnav .right button { background: transparent; border: 1px solid #fff; color: #fff; height: 34px; padding: 0 12px; }
.subnav { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.subnav a { padding: 10px 14px; color: var(--text); text-decoration: none; border-bottom: 3px solid transparent; }
.subnav a.on { font-weight: 700; border-bottom-color: var(--accent); }

.page { max-width: 1440px; margin: 0 auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.between { justify-content: space-between; }
.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.grow { flex: 999 1 560px; min-width: 0; }
.side { flex: 1 1 340px; max-width: 420px; }
.card { background: var(--surface); border: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.span2 { grid-column: span 2; } .full { grid-column: 1 / -1; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.kpi .v { font-size: 26px; font-weight: 700; }

/* Formulare */
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
label.f input, label.f select, label.f textarea, input.i, select.i { height: 40px; padding: 0 10px; font-size: 15px; border: 1px solid var(--input-line); background: #fff; font-weight: 400; min-width: 0; width: 100%; }
label.f textarea { height: auto; padding: 8px 10px; }
label.chk { display: flex; align-items: center; gap: 8px; min-height: 40px; font-size: 15px; }
label.chk input { width: 20px; height: 20px; }
input.bad, select.bad { border-color: #C2410C; }
input:disabled, select:disabled { background: #F1F2EE; }
.btn { height: 40px; padding: 0 16px; font-weight: 600; background: #fff; border: 1px solid var(--input-line); display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; color: var(--text); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.outline { color: var(--accent); border-color: var(--accent); }
.btn.danger { color: var(--err-line); border-color: var(--err-line); }
.btn.lg { height: 52px; font-size: 17px; }
.seg { display: flex; } .seg button { flex: 1; height: 44px; font-weight: 600; border: 1px solid var(--accent); background: #fff; color: var(--accent); }
.seg button.on { background: var(--accent); color: #fff; }

/* Tabellen */
.tablebox { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { background: var(--head-bg); text-align: left; padding: 9px 10px; white-space: nowrap; }
table.t td { padding: 8px 10px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
table.t td.r, table.t th.r { text-align: right; }
table.t tr.sel td { background: var(--accent-soft); }
table.t tr.foot td { border-top: 2px solid var(--text); font-weight: 700; }
table.t a.rowlink { display: inline-flex; align-items: center; min-height: 32px; font-weight: 600; }

.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 8px; background: var(--neutral-bg); color: #3F453D; }
.badge.ok { background: var(--ok-bg); color: var(--ok-fg); } .badge.warn { background: var(--warn-bg); color: var(--warn-fg); } .badge.err { background: var(--err-bg); color: var(--err-fg); }
.alert { padding: 10px 12px; background: var(--err-bg); color: var(--err-fg); font-size: 14px; }
.info { padding: 10px 12px; background: var(--accent-soft); color: var(--ok-fg); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; padding-left: 10px; background: var(--neutral-bg); font-size: 14px; }
.chip button { width: 32px; height: 32px; border: 0; background: transparent; }

/* Toast */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; }
#toast div { padding: 12px 16px; background: var(--text); color: #fff; font-size: 15px; max-width: 90vw; }
#toast div.err { background: var(--err-fg); }

/* Login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login form { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--line); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.login .head { background: var(--accent); color: #fff; margin: -28px -28px 6px; padding: 20px 28px; display: flex; align-items: center; gap: 16px; }
.login .head p { margin: 4px 0 0; font-size: 14px; }

/* Kasse (Tablet) */
.kasse { height: 100vh; display: flex; flex-direction: column; }
.kasse header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 18px; background: var(--accent); color: #fff; flex-wrap: wrap; }
.kasse header select { height: 36px; border: 0; padding: 0 8px; background: #fff; color: var(--text); }
.kasse header .stock span { font-size: 13px; padding: 5px 9px; background: rgba(255,255,255,.16); margin-left: 6px; }
.kasse header .stock span.low { background: var(--warn-bg); color: var(--warn-fg); }
.kasse header a, .kasse header button { color: #fff; }
.kasse .body { flex: 1; min-height: 0; display: grid; grid-template-columns: 340px minmax(0, 1fr); }
.kasse aside { display: flex; flex-direction: column; min-height: 0; background: #fff; border-right: 1px solid var(--line); }
.kasse aside .list { flex: 1; overflow-y: auto; padding: 0 10px; display: flex; flex-direction: column; gap: 6px; }
.slot { text-align: left; border: 2px solid transparent; background: #fff; padding: 9px 10px; display: grid; grid-template-columns: 50px minmax(0,1fr) auto; gap: 8px; align-items: center; min-height: 60px; border-bottom-color: var(--line-soft); }
.slot.on { border-color: var(--accent); background: var(--accent-soft); }
.slot.paid { background: #F1F2EE; color: var(--muted); }
.kasse main { display: flex; flex-direction: column; min-height: 0; padding: 14px 24px 16px; gap: 10px; overflow-y: auto; }
.pos { display: grid; grid-template-columns: minmax(0,1fr) 280px 120px; gap: 14px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.pos .name { font-size: 17px; font-weight: 600; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 60px; height: 54px; font-size: 26px; background: #fff; border: 1px solid var(--input-line); }
.stepper input { width: 128px; height: 54px; font-size: 24px; font-weight: 600; text-align: center; border: 1px solid var(--input-line); }
.pay { margin-top: auto; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 22px; align-items: end; padding-top: 12px; border-top: 2px solid var(--text); }
.pay .big { font-size: 32px; font-weight: 700; }
.pay input.given { height: 58px; font-size: 28px; font-weight: 600; text-align: right; padding: 0 14px; border: 1px solid var(--input-line); width: 100%; }
.quick { display: flex; gap: 8px; } .quick button { flex: 1; height: 50px; font-size: 17px; font-weight: 600; background: #fff; border: 1px solid var(--input-line); }
.overlay { position: fixed; inset: 0; background: rgba(27,31,26,.55); display: flex; align-items: center; justify-content: center; z-index: 40; padding: 16px; }
.dialog { width: 100%; max-width: 560px; background: #fff; padding: 24px; display: flex; flex-direction: column; gap: 14px; max-height: 92vh; overflow-y: auto; }
.qr { width: 200px; height: 200px; flex: none; }
.qr svg { width: 100%; height: 100%; }

/* Planung */
.plan { display: grid; grid-template-columns: 60px minmax(0,1fr); column-gap: 12px; }
.plan .t { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line-soft); padding-top: 4px; }
.plan .free { border: 0; border-top: 1px solid var(--line-soft); background: transparent; color: var(--muted); text-align: left; padding: 0 10px; font-size: 13px; }
.plan .free.on { background: var(--accent-soft); }
.plan .bk { margin: 2px 0; padding: 6px 10px; display: flex; justify-content: space-between; gap: 10px; overflow: hidden; background: var(--neutral-bg); }
.plan .bk.m { background: var(--ok-bg); } .plan .bk.sel { outline: 3px solid var(--accent); } .plan .bk.paid { opacity: .6; }
.plan .bk button { height: 30px; padding: 0 8px; font-size: 13px; background: #fff; border: 1px solid var(--input-line); }
.daybtn { text-align: left; padding: 10px 12px; background: #fff; border: 2px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.daybtn.on { border-color: var(--accent); background: var(--accent-soft); }
.hits { display: flex; flex-direction: column; gap: 4px; }
.hits button { text-align: left; min-height: 40px; padding: 0 12px; background: #fff; border: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hits button.on { background: var(--ok-bg); }

@media (max-width: 900px) {
  .kasse .body { grid-template-columns: 1fr; }
  .kasse aside { max-height: 34vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .pos { grid-template-columns: 1fr; }
  .pay { grid-template-columns: 1fr; }
}
@media print { .topnav, .subnav, .noprint { display: none !important; } body { background: #fff; } }
