/* KDS-Stationsseiten (Plan 7a, 7b, 13) nach dem Mockup: Anmelden, Stationsauswahl, Archiv, Statistik,
   PIN, Tag abschließen. Oswald, nur Token-Variablen; Inline-Styles sind per CSP verboten. */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font-family: var(--wf-font-kds); color: var(--wf-ink); background: var(--wf-neutral-50); min-height: 100vh; display: flex; flex-direction: column; }
button, input { font-family: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: var(--wf-ink); }
:focus-visible { outline: 3px solid var(--wf-green-600); outline-offset: 2px; }
.muted { color: var(--wf-neutral-600); }
.flash { margin: 0; padding: 12px 16px; border-radius: 10px; font-size: 18px; font-weight: 500; }
.flash.error { background: var(--wf-danger-bg); color: var(--wf-danger); }
.flash.ok { background: var(--wf-green-100); color: var(--wf-green-900); }

/* ---- Knöpfe ---- */
.btn { min-height: 64px; padding: 0 24px; border-radius: 12px; border: 0; background: var(--wf-ink); color: var(--wf-white); display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; font-size: 22px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.btn.block { width: 100%; }
.btn.line { min-height: 56px; background: var(--wf-white); color: var(--wf-ink); border: 2px solid var(--wf-ink); font-size: 20px; text-transform: none; letter-spacing: 0; padding: 0 22px; }
.btn.line.on { background: var(--wf-ink); color: var(--wf-white); }
.link { background: none; border: 0; padding: 0; min-height: var(--wf-touch-min); font-size: 18px; color: var(--wf-neutral-700); text-decoration: underline; }

/* ---- Zentrierte Karte (Anmelden, PIN, Tag abschließen) ---- */
.center-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; gap: 12px; }
.panel { width: min(520px, 100%); padding: 40px 44px; border-radius: 18px; background: var(--wf-white); display: flex; flex-direction: column; gap: 18px; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.brand img { height: 90px; width: auto; display: block; }
.brand b { font-size: 30px; font-weight: 600; }
.brand span { font-size: 20px; color: var(--wf-neutral-600); }
.panel form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; font-size: 18px; font-weight: 500; }
.field input { height: 60px; padding: 0 16px; border-radius: 10px; border: 2px solid var(--wf-neutral-300); font-size: 22px; font-weight: 400; color: var(--wf-ink); background: var(--wf-white); }
.field input:focus { border-color: var(--wf-ink); outline: none; }
.panel p { margin: 0; font-size: 18px; line-height: 1.4; color: var(--wf-neutral-700); }
.panel .hint { font-size: 17px; }
.panel .center { text-align: center; }
.version { margin: 0; font-size: 14px; color: var(--wf-neutral-600); }

/* ---- PIN-Feld mit Ziffernblock ---- */
.pinpad { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.pinpad .dots { display: flex; gap: 14px; min-height: 22px; }
.pinpad .dots span { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--wf-ink); }
.pinpad .dots span.full { background: var(--wf-ink); }
.pinpad .keys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; }
.pinpad .keys button { height: 64px; border-radius: 12px; border: 2px solid var(--wf-neutral-200); background: var(--wf-white); font-size: 28px; font-weight: 600; color: var(--wf-ink); }
.pinpad .keys button:active { background: var(--wf-neutral-100); }
.pinpad .keys .ok { background: var(--wf-green-500); border-color: var(--wf-green-500); font-size: 22px; text-transform: uppercase; }
.pinpad .keys .del { background: var(--wf-neutral-100); }
.pinpad input[type="password"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.js .pinpad .fallback { display: none; }
.pinpad .fallback { display: flex; gap: 10px; width: 100%; }
.pinpad .fallback input { flex: 1; height: 56px; padding: 0 14px; border-radius: 10px; border: 2px solid var(--wf-neutral-300); font-size: 22px; }

/* ---- Stationsauswahl ---- */
body.m-plain { background: var(--wf-white); }
.plain-main { flex: 1; padding: 48px 64px 32px; display: flex; flex-direction: column; align-items: center; gap: 36px; }
.select-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.select-brand img { height: 110px; width: auto; display: block; }
.select-brand b { font-size: 30px; font-weight: 600; }
.select-brand b small { font-size: 16px; font-weight: 400; color: var(--wf-neutral-600); }
.select-brand > span { font-size: 20px; color: var(--wf-neutral-600); }
.stations { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; width: 100%; flex-grow: 1; min-height: 320px; }
.station { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; border-radius: 18px; border: 2px solid var(--wf-neutral-200); background: var(--wf-white); text-decoration: none; color: var(--wf-ink); text-align: center; }
.station:active { background: var(--wf-green-50); }
.station.pack { border: 3px solid var(--wf-ink); background: var(--wf-green-50); }
.station .badge { position: absolute; top: 18px; right: 18px; padding: 6px 12px; border-radius: var(--wf-radius-pill); background: var(--wf-orange-500); font-size: 16px; font-weight: 600; }
.station b { font-size: 38px; font-weight: 700; }
.station small { font-size: 17px; color: var(--wf-neutral-600); }
.station.pack small { color: var(--wf-neutral-700); }
.device-bar { width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding-top: 20px; border-top: 2px solid var(--wf-neutral-200); font-size: 18px; }
.device-bar .btn.line { min-height: 48px; font-size: 18px; }
.device-bar form { margin-left: auto; }
@media (max-width: 760px) {
  .plain-main { padding: 32px 16px; }
  .stations { grid-template-columns: 1fr; gap: 16px; min-height: 0; }
  .station { min-height: 160px; }
}

/* ---- Unterseiten mit dunkler Kopfzeile (Archiv, Statistik) ---- */
.kds-head { height: 84px; flex-shrink: 0; padding: 0 20px; background: var(--wf-ink); color: var(--wf-white); display: flex; align-items: center; gap: 18px; }
.sq { width: var(--wf-touch-kds); height: var(--wf-touch-kds); flex-shrink: 0; border-radius: 12px; background: var(--wf-neutral-900); color: var(--wf-white); display: flex; align-items: center; justify-content: center; text-decoration: none; font-size: 30px; }
.kds-name { display: flex; flex-direction: column; min-width: 0; }
.kds-name b { font-size: 26px; font-weight: 600; line-height: 1.1; }
.kds-name small { font-size: 16px; color: var(--wf-neutral-300); }
.kds-head .tile { margin-left: auto; min-width: 118px; height: 60px; padding: 6px 14px; border-radius: 12px; display: flex; flex-direction: column; justify-content: center; background: var(--wf-neutral-800); }
.tile .lbl { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.tile .val { font-size: 26px; font-weight: 700; line-height: 1; }
.sub-main { flex: 1; display: flex; flex-direction: column; padding: 14px 20px 20px; gap: 14px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar .right { margin-left: auto; }

/* Archiv */
.rows { display: flex; flex-direction: column; gap: 10px; }
.row { min-height: 76px; padding: 10px 12px 10px 18px; border-radius: var(--wf-radius-kds); background: var(--wf-white); display: flex; align-items: center; gap: 18px; }
.row .nr { font-size: 26px; font-weight: 700; min-width: 76px; }
.pill { padding: 5px 12px; border-radius: var(--wf-radius-pill); font-size: 15px; font-weight: 600; white-space: nowrap; }
.pill.kaffee { background: var(--wf-info-bg); color: var(--wf-info-text); }
.pill.baeckerei { background: var(--wf-orange-100); color: var(--wf-orange-700); }
.pill.late { background: var(--wf-neutral-100); color: var(--wf-neutral-700); }
.row .items { flex-grow: 1; min-width: 0; font-size: 20px; line-height: 1.3; }
.row .times { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.row .times b { font-size: 19px; font-weight: 500; }
.row .times small { font-size: 16px; color: var(--wf-neutral-600); }
.row .btn.line { min-height: 56px; font-size: 18px; padding: 0 18px; flex-shrink: 0; }
.empty-box { padding: 40px 20px; border-radius: var(--wf-radius-kds); border: 2px dashed var(--wf-neutral-300); font-size: 22px; color: var(--wf-neutral-600); text-align: center; }

/* PIN-Dialog (Archiv) */
dialog.pin-dialog { width: min(440px, calc(100% - 32px)); padding: 26px 28px; border: 0; border-radius: 18px; background: var(--wf-white); color: var(--wf-ink); }
dialog.pin-dialog::backdrop { background: color-mix(in srgb, var(--wf-ink) 55%, transparent); }
dialog.pin-dialog form { display: flex; flex-direction: column; align-items: center; gap: 14px; }
dialog.pin-dialog h2 { margin: 0; font-size: 28px; font-weight: 700; }
dialog.pin-dialog p { margin: 0; font-size: 18px; color: var(--wf-neutral-700); text-align: center; line-height: 1.35; }
dialog.pin-dialog .btn.line { width: 100%; }

/* Statistik */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { padding: 14px 18px; border-radius: var(--wf-radius-kds); background: var(--wf-white); display: flex; flex-direction: column; gap: 2px; }
.kpi span { font-size: 15px; text-transform: uppercase; letter-spacing: .05em; color: var(--wf-neutral-600); }
.kpi b { font-size: 40px; font-weight: 700; line-height: 1.1; }
.kpi small { font-size: 16px; color: var(--wf-neutral-700); }
.stat-row { display: flex; gap: 14px; min-height: 380px; }
.box { padding: 18px 22px; border-radius: 16px; background: var(--wf-white); display: flex; flex-direction: column; gap: 10px; }
.box h2 { margin: 0; font-size: 22px; font-weight: 600; }
.box.grow { flex-grow: 1; min-width: 0; }
.box.side { width: 420px; flex-shrink: 0; gap: 12px; }
.chart { flex-grow: 1; min-height: 240px; display: flex; align-items: flex-end; gap: 14px; padding-top: 10px; border-bottom: 2px solid var(--wf-ink); }
.chart .bar { flex: 1 1 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.chart .bar b { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .fill { width: 100%; border-radius: 6px 6px 0 0; background: var(--wf-green-500); min-height: 2px; }
.chart .bar.peak .fill { background: var(--wf-orange-500); }
.chart-labels { display: flex; gap: 14px; }
.chart-labels span { flex: 1 1 0; text-align: center; font-size: 16px; color: var(--wf-neutral-600); }
.top { display: flex; flex-direction: column; gap: 5px; }
.top div { display: flex; justify-content: space-between; align-items: baseline; font-size: 20px; }
.top div b { font-weight: 700; font-variant-numeric: tabular-nums; }
.top .track { display: block; height: 10px; border-radius: 5px; background: var(--wf-neutral-100); overflow: hidden; }
.top .track i { display: block; height: 100%; background: var(--wf-green-500); }
.days { width: 100%; border-collapse: collapse; font-size: 18px; }
.days th, .days td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--wf-neutral-200); font-variant-numeric: tabular-nums; }
.days th { font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--wf-neutral-600); font-weight: 500; }
@media (max-width: 1000px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-row { flex-direction: column; }
  .box.side { width: auto; }
  .row { flex-wrap: wrap; }
}
.row form.restore { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.nojs-pin { width: 7rem; height: 56px; padding: 0 12px; border-radius: 10px; border: 2px solid var(--wf-neutral-300); font-size: 20px; }
