/* Skiverleih – Gestaltung
   Layout: dunkle Seitenleiste (Backoffice) · weite Touch-Flächen (Check-In) · einspaltig groß (Handheld)
   Farben: Schnee-Grau als Grund, Pistenblau als Marke (je Mandant überschreibbar), Pistenrot für Verspätung, Liftgelb für Scan-Fokus */
:root {
  --bg: #EEF2F5;
  --surface: #FFFFFF;
  --surface-2: #F6F8FA;
  --ink: #0F1B26;
  --muted: #5A6976;
  --line: #D8DFE6;
  --brand: #1550B8;
  --brand-ink: #FFFFFF;
  --brand-soft: color-mix(in srgb, var(--brand) 12%, var(--surface));
  --side: #0F1B26;
  --side-ink: #DCE5EE;
  --side-muted: #8798A8;
  --good: #1D7A4C;
  --good-soft: #E1F2E8;
  --warn: #A9650B;
  --warn-soft: #FBF0DC;
  --bad: #BE3127;
  --bad-soft: #FBE5E2;
  --scan: #F2B705;
  --shadow: 0 1px 2px rgba(15, 27, 38, .06), 0 4px 16px rgba(15, 27, 38, .06);
  --r: 10px;
  --f-ui: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C131A; --surface: #141E28; --surface-2: #1A2531; --ink: #E4EBF1; --muted: #93A3B2; --line: #26333F;
    --brand-soft: color-mix(in srgb, var(--brand) 26%, var(--surface));
    --side: #0A1016; --side-ink: #D5DFE8; --side-muted: #7D8E9E;
    --good: #4FC28A; --good-soft: #15301F; --warn: #E3A23B; --warn-soft: #33270F; --bad: #F06A5E; --bad-soft: #3A1714;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0C131A; --surface: #141E28; --surface-2: #1A2531; --ink: #E4EBF1; --muted: #93A3B2; --line: #26333F;
  --brand-soft: color-mix(in srgb, var(--brand) 26%, var(--surface));
  --side: #0A1016; --side-ink: #D5DFE8; --side-muted: #7D8E9E;
  --good: #4FC28A; --good-soft: #15301F; --warn: #E3A23B; --warn-soft: #33270F; --bad: #F06A5E; --bad-soft: #3A1714;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--f-ui); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-stretch: 85%; line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: 1.5rem; font-weight: 750; }
h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: .6rem; }
h3 { font-size: 1rem; font-weight: 700; }
h3.sub { margin: 1.1rem 0 .5rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
p { margin: 0 0 .6rem; }
code, .mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.late { color: var(--bad) !important; }
.error { color: var(--bad); }
.dim { opacity: .55; }
.spacer { flex: 1; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* --------------------------------- Icons -------------------------------- */
.ic { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.ic.big { width: 40px; height: 40px; }
.ic.flip { transform: rotate(180deg); }

/* -------------------------------- Buttons ------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: 600 .9rem var(--f-ui); padding: .55rem .9rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap; min-height: 38px; transition: background .12s, border-color .12s; }
.btn:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger.ghost { background: transparent; color: var(--bad); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { padding: .3rem .6rem; min-height: 32px; font-size: .82rem; }
.btn.block { width: 100%; }
.btn.huge { font-size: 1.35rem; padding: 1.1rem 2.2rem; border-radius: 14px; min-height: 72px; }
.btn.huge .ic { width: 28px; height: 28px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.icon-btn:hover { background: color-mix(in srgb, currentColor 10%, transparent); }

/* -------------------------------- Inputs -------------------------------- */
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .65rem; min-height: 38px; width: 100%; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--brand); }
input[type=color] { padding: 2px; height: 38px; width: 80px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.field { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.field > span { font-size: .78rem; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem 1rem; }
.grid-form .span2, .grid-form .checks { grid-column: 1 / -1; }
.checks { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.checks label { display: flex; align-items: center; gap: .4rem; }
.pair { display: flex; gap: .4rem; align-items: center; }
.scan-input, .room-input { font-family: var(--f-mono); font-size: 1.1rem; letter-spacing: .03em; }
.scan-input:focus { border-color: var(--scan); box-shadow: 0 0 0 4px color-mix(in srgb, var(--scan) 35%, transparent); }
.logo-edit { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.logo-edit img { max-height: 48px; max-width: 180px; background: #fff; padding: 4px; border-radius: 6px; border: 1px solid var(--line); }
.hint { background: var(--warn-soft); color: var(--warn); padding: .5rem .75rem; border-radius: 8px; font-size: .85rem; }

/* --------------------------------- Chips -------------------------------- */
.chip { display: inline-flex; align-items: center; gap: .25rem; font-size: .74rem; font-weight: 650; padding: .15rem .5rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; line-height: 1.5; }
.chip .ic { width: 13px; height: 13px; vertical-align: -2px; }
.chip.blue { background: var(--brand-soft); color: var(--brand); }
.chip.green { background: var(--good-soft); color: var(--good); }
.chip.green.solid { background: var(--good); color: #fff; }
.chip.amber { background: var(--warn-soft); color: var(--warn); }
.chip.red { background: var(--bad); color: #fff; }
.chip.grey { background: var(--surface-2); color: var(--muted); }
.chip.outline { background: transparent; border: 1px solid var(--line); }
.chip.tiny { font-size: .65rem; padding: 0 .35rem; }
.serial { font-family: var(--f-mono); font-weight: 600; font-size: .84rem; padding: .1rem .45rem; border-radius: 5px; background: var(--surface-2); border: 1px dashed var(--line); white-space: nowrap; letter-spacing: .02em; }
.tiny-tag { color: var(--muted); }
.tiny-tag .ic { width: 14px; height: 14px; }

/* ------------------------------- Login ---------------------------------- */
body.is-login { background: var(--side); color: var(--side-ink); }
.login { max-width: 1120px; margin: 0 auto; padding: 2.5rem 16px 4rem; display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.login-brand { grid-column: 1 / -1; display: flex; gap: 1rem; align-items: center; }
.login-brand h1 { font-size: 2.4rem; font-stretch: 75%; letter-spacing: -.01em; }
.login-brand p { color: var(--side-muted); margin: 0; }
.login-brand .ic.big { width: 54px; height: 54px; color: var(--scan); }
.login-demo h2 { color: #fff; }
.login-demo .muted { color: var(--side-muted); }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; margin-top: 1rem; }
.role-tile { text-align: left; display: flex; flex-direction: column; gap: .25rem; padding: 1rem; border-radius: 12px; background: #172634; border: 1px solid #22384B; color: var(--side-ink); cursor: pointer; font: inherit; transition: transform .12s, border-color .12s; }
.role-tile:hover { transform: translateY(-2px); border-color: var(--scan); }
.role-tile .ic { width: 28px; height: 28px; color: var(--scan); margin-bottom: .3rem; }
.role-tile b { font-size: 1.05rem; font-stretch: 85%; color: #fff; }
.role-tile small { color: var(--side-muted); font-size: .8rem; flex: 1; }
.role-tile em { font-style: normal; font-size: .75rem; color: #9FC0E8; font-family: var(--f-mono); }
.role-tile.mobile { border-style: dashed; }
.login-form { background: var(--surface); color: var(--ink); display: flex; flex-direction: column; gap: .8rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem 1.1rem; box-shadow: var(--shadow); min-width: 0; }

/* ------------------------------ Backoffice ------------------------------ */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; padding: 1rem .75rem; gap: .6rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: .5rem; padding: .25rem .35rem; min-height: 44px; }
.brand img { max-width: 100%; max-height: 52px; background: #fff; border-radius: 8px; padding: 6px 8px; }
.tenant-name { font-size: .78rem; color: var(--side-muted); padding: 0 .4rem; text-transform: uppercase; letter-spacing: .07em; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin: .2rem 0 .4rem; }
.quick .btn { padding: .5rem .4rem; font-size: .82rem; }
.quick .btn:not(.primary) { background: #1A2A39; color: var(--side-ink); border-color: #263A4D; }
.side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: .65rem; padding: .55rem .6rem; border-radius: 8px; color: var(--side-ink); text-decoration: none; font-weight: 550; font-size: .92rem; }
.nav-item:hover { background: #1A2A39; }
.nav-item.active { background: color-mix(in srgb, var(--brand) 70%, var(--side)); color: #fff; }
.me { display: flex; align-items: center; gap: .55rem; padding: .6rem .4rem 0; border-top: 1px solid #22384B; }
.me div { flex: 1; min-width: 0; }
.me b { display: block; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { color: var(--side-muted); font-size: .75rem; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .7rem 1.4rem; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top h1 { font-size: 1.35rem; white-space: nowrap; }
.menu-btn { display: none; }
.top-scan { flex: 1; max-width: 520px; margin-left: auto; display: flex; align-items: center; gap: .5rem; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 .4rem 0 .9rem; }
.top-scan input { border: 0; background: transparent; min-height: 40px; box-shadow: none !important; }
.top-scan:focus-within { border-color: var(--scan); box-shadow: 0 0 0 3px color-mix(in srgb, var(--scan) 30%, transparent); }
.loc-select { display: flex; align-items: center; gap: .3rem; }
.loc-select select { min-width: 160px; }
.page { padding: 1.2rem 1.4rem 3rem; display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.loading { color: var(--muted); padding: 2rem; text-align: center; }
.empty { text-align: center; color: var(--muted); padding: 1.6rem 1rem; }
.empty .ic { width: 30px; height: 30px; opacity: .6; }
.empty p { margin: .3rem 0 0; }
.toolbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.toolbar p { margin: 0; max-width: 70ch; font-size: .88rem; }
.toolbar .search { display: flex; align-items: center; gap: .4rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding-left: .6rem; flex: 1; min-width: 220px; max-width: 420px; }
.toolbar .search input { border: 0; box-shadow: none !important; }
.toolbar .search.big input { font-size: 1.15rem; min-height: 48px; }
.toolbar select { width: auto; }
.toolbar .inline { display: flex; align-items: center; gap: .4rem; font-size: .88rem; }
.toolbar .inline input { width: auto; }
.cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.kpi { text-align: left; display: flex; flex-direction: column; gap: .1rem; padding: .85rem 1rem; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); font: inherit; color: var(--ink); cursor: pointer; box-shadow: var(--shadow); }
.kpi.static { cursor: default; }
.kpi b { font-size: 1.6rem; font-stretch: 80%; font-weight: 750; font-variant-numeric: tabular-nums; }
.kpi span { font-size: .8rem; color: var(--muted); }
.kpi.blue b { color: var(--brand); }
.kpi.amber b { color: var(--warn); }
.kpi.red { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.kpi.red b { color: var(--bad); }

/* -------------------------------- Tabellen ------------------------------ */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; padding: .45rem .6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl.click tbody tr { cursor: pointer; }
.tbl.click tbody tr:hover { background: var(--surface-2); }
.tbl.small td, .tbl.small th { padding: .35rem .5rem; }
.tbl .room { font-family: var(--f-mono); }
.tbl td.actions { text-align: right; white-space: nowrap; }
.tbl td.actions .act-wrap { display: flex; flex-wrap: wrap; gap: .25rem; justify-content: flex-end; min-width: 120px; }
h2.mt { margin-top: 1.2rem; }
.row-late td { background: color-mix(in srgb, var(--bad) 6%, transparent); }
.row-now td { background: var(--brand-soft); }
.tbl input.qty, input.qty { width: 70px; text-align: right; min-height: 32px; padding: .2rem .4rem; }
.tbl td .ic { color: var(--muted); }

/* ----------------------------- Auftragsdetail --------------------------- */
.order-top { display: flex; gap: 1rem; align-items: flex-start; }
.ot-main { flex: 1; min-width: 0; }
.ot-title { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .8rem; }
.mono.big { font-size: 1.6rem; font-weight: 600; letter-spacing: -.01em; }
.ot-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem 1.2rem; }
.ot-facts div { display: flex; flex-direction: column; min-width: 0; }
.ot-facts small { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 650; }
.ot-facts b { font-size: 1rem; }
.ot-facts span { font-size: .8rem; }
.room-fact b { font-family: var(--f-mono); font-size: 1.5rem; line-height: 1.1; color: var(--brand); }
.ot-qr { display: flex; flex-direction: column; align-items: center; gap: .2rem; }
.ot-qr .qr { border-radius: 6px; }
.note { margin: .8rem 0 0; background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: .4rem .6rem; display: flex; gap: .4rem; align-items: center; font-size: .88rem; }
.doc-bar { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; }
.order-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; align-items: start; }
.order-persons { display: flex; flex-direction: column; gap: .9rem; min-width: 0; }
.order-side { display: flex; flex-direction: column; gap: .9rem; position: sticky; top: 76px; }
.person.focus { border-color: var(--scan); box-shadow: 0 0 0 3px color-mix(in srgb, var(--scan) 35%, transparent); }
.person-head2 { display: flex; align-items: center; gap: .7rem; margin-bottom: .5rem; }
.pnum { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 750; flex: none; }
.it-ic { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: .4rem; border-radius: 6px; background: var(--surface-2); color: var(--muted); vertical-align: middle; }
.tbl.lines td:first-child { min-width: 180px; }
.add-line { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; padding-top: .6rem; border-top: 1px dashed var(--line); }
.add-line select { flex: 1; min-width: 200px; width: auto; }
.add-line #art-code { flex: 1; min-width: 180px; font-family: var(--f-mono); }
.add-person { align-self: flex-start; }
.pad { padding: .5rem 0; }
.totals dl { display: grid; grid-template-columns: 1fr auto; gap: .35rem .8rem; margin: .4rem 0 0; font-variant-numeric: tabular-nums; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; text-align: right; font-weight: 600; }
.totals .total { font-size: 1.25rem; font-weight: 800; color: var(--ink); border-top: 1px solid var(--line); padding-top: .4rem; }
.paid-note { margin: .8rem 0 0; padding: .5rem .6rem; border-radius: 8px; background: var(--good-soft); color: var(--good); font-size: .85rem; }
.late-note { margin: .8rem 0 0; padding: .5rem .6rem; border-radius: 8px; background: var(--bad-soft); color: var(--bad); font-size: .85rem; display: flex; gap: .4rem; }
.sig { width: 100%; background: #fff; border-radius: 6px; border: 1px solid var(--line); }
.history { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; font-size: .84rem; max-height: 320px; overflow-y: auto; }
.history li { display: flex; flex-direction: column; border-left: 2px solid var(--line); padding-left: .6rem; }
.history small { color: var(--muted); font-size: .72rem; }
.history em { font-style: normal; color: var(--muted); font-size: .75rem; }

.persons-editor { display: flex; flex-direction: column; gap: .4rem; }
.person-head, .person-row { display: grid; grid-template-columns: minmax(140px, 2fr) repeat(3, minmax(56px, .7fr)) minmax(110px, 1.2fr) minmax(56px, .6fr) 36px; gap: .4rem; align-items: center; }
.person-head span { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; }
.persons-editor > .btn { align-self: flex-start; }

/* ------------------------------- Inventar ------------------------------- */
.inv-sum { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.inv-pill { display: inline-flex; gap: .25rem; align-items: center; font-size: .78rem; padding: .15rem .55rem; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.inv-pill.available { background: var(--good-soft); color: var(--good); }
.inv-pill.rented { background: var(--brand-soft); color: var(--brand); }
.inv-pill.service { background: var(--warn-soft); color: var(--warn); }
.inv-pill.retired { background: var(--surface-2); color: var(--muted); }
.drop { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; padding: 1rem; border: 2px dashed var(--line); border-radius: 10px; margin: .6rem 0; }
.drop input { width: auto; border: 0; }
.errs { max-height: 300px; overflow: auto; font-size: .85rem; }

/* ------------------------------ Preise ---------------------------------- */
.price-grid input { min-height: 34px; padding: .25rem .4rem; text-align: right; font-variant-numeric: tabular-nums; min-width: 64px; }
.price-grid input.gname { text-align: left; min-width: 160px; font-weight: 600; }
.price-grid td { padding: .3rem .25rem; }
.price-grid .ex { color: var(--muted); }

/* ---------------------------- Auswertungen ------------------------------ */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--f-ui); }
.chart .bar-r { fill: var(--brand); }
.chart .bar-s { fill: var(--scan); }
.legend { display: flex; gap: .4rem 1rem; align-items: center; font-size: .8rem; color: var(--muted); margin-bottom: .4rem; flex-wrap: wrap; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .2rem; vertical-align: -1px; }
.sw.r { background: var(--brand); }
.sw.s { background: var(--scan); }
.hbars { display: flex; flex-direction: column; gap: .5rem; }
.hbar { display: grid; grid-template-columns: 140px 1fr auto; gap: .6rem; align-items: center; font-size: .86rem; }
.hbar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar i { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--brand) var(--w), var(--surface-2) var(--w)); }
.hbar.util i { background: linear-gradient(90deg, var(--good) var(--w), var(--surface-2) var(--w)); }
.hbar b { font-variant-numeric: tabular-nums; font-size: .82rem; }

/* ---------------------------- Einstellungen ----------------------------- */
.settings { display: flex; flex-direction: column; gap: 1rem; }
.types input[type=text], .types input:not([type]) { min-height: 32px; padding: .2rem .4rem; }
.add-type { display: flex; gap: .4rem; margin-top: .6rem; flex-wrap: wrap; }
.add-type input { flex: 1; min-width: 160px; }
.qr-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.qr-item { display: flex; gap: .8rem; align-items: center; }
.qr-item div { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.qr-item small { word-break: break-all; font-size: .72rem; color: var(--muted); }
.qr-item .btn { align-self: flex-start; }
.sticky-save { position: sticky; bottom: 0; padding: .8rem 0; background: linear-gradient(transparent, var(--bg) 40%); display: flex; justify-content: flex-end; }

/* ------------------------------ Rezeption ------------------------------- */
.room-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .75rem; }
.room-card { display: flex; align-items: center; gap: .9rem; text-align: left; padding: .8rem 1rem; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); cursor: pointer; font: inherit; color: var(--ink); box-shadow: var(--shadow); }
.room-card:hover { border-color: var(--brand); }
.rc-room { font-family: var(--f-mono); font-size: 1.8rem; font-weight: 600; color: var(--brand); min-width: 64px; text-align: center; }
.rc-body { flex: 1; display: flex; flex-direction: column; gap: .15rem; min-width: 0; align-items: flex-start; }
.rc-body small { color: var(--muted); }
.rc-amount { font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; }

/* -------------------------------- Mandanten ----------------------------- */
.tenant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.tenant-card { text-align: left; display: flex; flex-direction: column; gap: .3rem; padding: 1rem; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--tc); cursor: pointer; font: inherit; color: var(--ink); box-shadow: var(--shadow); }
.tc-logo { height: 64px; display: flex; align-items: center; margin-bottom: .3rem; }
.tc-logo img { max-height: 56px; max-width: 220px; }
.tc-stats { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .4rem; }
.tc-stats span { font-size: .74rem; background: var(--surface-2); border-radius: 999px; padding: .1rem .5rem; color: var(--muted); }
.loc-row { display: flex; align-items: center; gap: .7rem; padding: .55rem .3rem; border-bottom: 1px solid var(--line); cursor: pointer; }
.loc-row:last-child { border-bottom: 0; }
.loc-row div { flex: 1; display: flex; flex-direction: column; }
.loc-row:hover { background: var(--surface-2); }

/* -------------------------------- Modal --------------------------------- */
.modal-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(8, 15, 22, .5); display: grid; place-items: center; padding: 16px; animation: fade .12s ease-out; }
.modal { background: var(--surface); color: var(--ink); border-radius: 14px; width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.modal.wide { width: min(900px, 100%); }
.modal header { display: flex; align-items: center; gap: .6rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); }
.modal header h2 { margin: 0; flex: 1; font-size: 1.15rem; }
.modal-body { padding: 1rem 1.1rem; overflow-y: auto; }
.modal footer { display: flex; gap: .5rem; justify-content: flex-end; padding: .8rem 1.1rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal footer .danger.ghost { margin-right: auto; }
.confirm-text { font-size: 1.02rem; }
.pay-amount { font-size: 2.2rem; font-weight: 800; font-variant-numeric: tabular-nums; margin: 0 0 .6rem; }
.sig-pad { width: 100%; height: 220px; border: 2px dashed var(--line); border-radius: 10px; background: #fff; touch-action: none; display: block; margin: .5rem 0; }
.pdf-view { background: var(--surface-2); border-radius: 8px; padding: .8rem; display: flex; flex-direction: column; align-items: center; gap: .8rem; min-height: 300px; }
.pdf-page { background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .15); max-width: 100%; height: auto; }
.pdf-frame { width: 100%; height: 70vh; border: 0; }
.cam { width: 100%; border-radius: 10px; background: #000; }
@keyframes fade { from { opacity: 0; } }

/* -------------------------------- Toasts -------------------------------- */
#toasts { position: fixed; z-index: 200; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; flex-direction: column; gap: .5rem; align-items: center; width: min(560px, calc(100% - 32px)); pointer-events: none; }
.toast { display: flex; gap: .5rem; align-items: center; padding: .65rem .9rem; border-radius: 10px; background: var(--ink); color: var(--bg); font-weight: 550; box-shadow: 0 8px 30px rgba(0, 0, 0, .3); animation: up .2s ease-out; pointer-events: auto; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.warn { background: var(--warn); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); transition: .25s; }
@keyframes up { from { transform: translateY(10px); opacity: 0; } }

/* ------------------------------- Handheld ------------------------------- */
body.is-handheld { background: var(--bg); }
.hh { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.hh.embedded { max-width: 760px; min-height: 0; margin: 0; }
.hh-top { display: flex; align-items: center; gap: .6rem; padding: .6rem 16px; background: var(--side); color: var(--side-ink); }
.hh-top img { height: 30px; background: #fff; border-radius: 6px; padding: 2px 5px; }
.hh-top div { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.hh-top small { color: var(--side-muted); font-size: .75rem; }
.hh-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 10px 16px 0; }
.hh.embedded .hh-modes, .hh.embedded .hh-scan, .hh.embedded .hh-body, .hh.embedded .hh-msg { padding-left: 0; padding-right: 0; }
.hh-mode { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .6rem .3rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font: 650 .9rem var(--f-ui); color: var(--muted); cursor: pointer; }
.hh-mode .ic { width: 24px; height: 24px; }
.hh-mode.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.hh-scan { display: flex; gap: .4rem; align-items: center; padding: 10px 16px; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); }
.hh-scan-ic { color: var(--muted); }
.hh-scan input { font-family: var(--f-mono); font-size: 1.15rem; min-height: 50px; letter-spacing: .04em; border-width: 2px; }
.hh-scan input::placeholder { font-family: var(--f-ui); font-size: .92rem; letter-spacing: 0; }
.hh-scan input:focus { border-color: var(--scan); box-shadow: 0 0 0 4px color-mix(in srgb, var(--scan) 30%, transparent); }
.hh-scan .btn { min-height: 50px; }
.hh-msg { display: none; margin: 0 16px; padding: .7rem .9rem; border-radius: 12px; gap: .6rem; align-items: center; font-size: 1rem; }
.hh-msg.show { display: flex; animation: up .15s ease-out; }
.hh-msg div { display: flex; flex-direction: column; }
.hh-msg small { font-size: .85rem; opacity: .9; }
.hh-msg .ic { width: 28px; height: 28px; }
.hh-msg.ok { background: var(--good); color: #fff; }
.hh-msg.warn { background: var(--warn); color: #fff; }
.hh-msg.bad { background: var(--bad); color: #fff; }
.hh-body { padding: 10px 16px 40px; display: flex; flex-direction: column; gap: .7rem; }
.hh-hint { text-align: center; padding: 1.4rem 1rem; background: var(--surface); border: 2px dashed var(--line); border-radius: 14px; color: var(--muted); }
.hh-hint .ic.big { color: var(--brand); }
.hh-hint b { display: block; font-size: 1.15rem; color: var(--ink); margin: .3rem 0; }
.hh-sub { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-top: .4rem; }
.hh-wait { display: flex; flex-direction: column; gap: .4rem; }
.hh-wait-row { display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.hh-wait-row > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.hh-wait-row small { color: var(--muted); }
.hh-wait-row em { font-style: normal; font-size: .8rem; color: var(--brand); font-weight: 650; }
.hh-order { display: flex; align-items: center; gap: .5rem; background: var(--side); color: var(--side-ink); border-radius: 12px; padding: .6rem .8rem; }
.hh-order > div { flex: 1; display: flex; flex-wrap: wrap; gap: 0 .5rem; align-items: baseline; }
.hh-order small { width: 100%; color: var(--side-muted); }
.hh-order .mono { color: var(--scan); font-weight: 600; }
.hh-persons { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: 2px; }
.hh-person { display: flex; align-items: center; gap: .35rem; padding: .45rem .7rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font: 600 .9rem var(--f-ui); color: var(--ink); white-space: nowrap; cursor: pointer; }
.hh-person span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: .75rem; }
.hh-person em { font-style: normal; font-size: .75rem; color: var(--muted); }
.hh-person.active { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.hh-person.done span { background: var(--good); color: #fff; }
.hh-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .9rem; display: flex; flex-direction: column; gap: .6rem; }
.hh-card h2 { font-size: 1.45rem; margin: 0; }
.hh-card.choice { border-color: var(--scan); }
.hh-bodydata { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: .4rem; }
.hh-bodydata div { background: var(--surface-2); border-radius: 8px; padding: .35rem .5rem; display: flex; flex-direction: column; }
.hh-bodydata small { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.hh-bodydata b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.hh-lines { display: flex; flex-direction: column; gap: .4rem; }
.hh-line { display: flex; align-items: center; gap: .55rem; padding: .55rem .6rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.hh-line > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.hh-line small { color: var(--muted); font-size: .8rem; }
.hh-line.next { border: 2px solid var(--scan); background: color-mix(in srgb, var(--scan) 10%, var(--surface)); }
.hh-line.issued, .hh-line.returned { background: var(--surface-2); }
.hh-line.late { border-color: var(--bad); }
.hh-z { display: flex; gap: .3rem; align-items: center; margin-top: .3rem; }
.hh-z label { display: flex; align-items: center; gap: .3rem; font-size: .8rem; color: var(--muted); }
.hh-z input { width: 80px; min-height: 30px; padding: .15rem .4rem; }
.hh-done { text-align: center; background: var(--good-soft); color: var(--good); border-radius: 14px; padding: 1.2rem; }
.hh-done b { display: block; font-size: 1.2rem; margin: .3rem 0; }
.hh-done p { color: var(--ink); }
.hh-actions { display: flex; gap: .4rem; justify-content: center; flex-wrap: wrap; }
.hh-tip { color: var(--muted); font-size: .85rem; display: flex; gap: .4rem; align-items: center; }
.hh-pick { display: flex; align-items: center; gap: .6rem; padding: .7rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
.hh-pick span:nth-child(2) { flex: 1; }
.hh-arrow { display: flex; align-items: center; gap: .6rem; justify-content: center; padding: .6rem; font-size: 1.05rem; }
.hh-arrow .ic { width: 26px; height: 26px; color: var(--brand); }
.hh-ret-person { display: flex; flex-direction: column; gap: .35rem; }
.hh-returned { display: flex; flex-direction: column; gap: .35rem; }
.hh-ret { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.hh-ret div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.hh-ret small { color: var(--muted); font-size: .78rem; }
.hh-ret em { font-style: normal; font-weight: 700; color: var(--bad); font-size: .85rem; white-space: nowrap; }
.hh-ret em.ok { color: var(--good); }
.hh-ret.late { border-color: var(--bad); background: var(--bad-soft); }

/* -------------------------------- Check-In ------------------------------ */
body.is-kiosk, body.is-mobile-checkin { background: var(--bg); }
.kiosk { min-height: 100vh; display: flex; flex-direction: column; }
.k-top { display: flex; align-items: center; gap: 1.2rem; padding: .8rem 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.k-top img { height: 46px; }
.k-steps { display: flex; gap: .3rem; list-style: none; margin: 0 auto; padding: 0; }
.k-steps li { display: flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .9rem; padding: .3rem .6rem; border-radius: 999px; }
.k-steps li span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 700; font-size: .8rem; }
.k-steps li em { font-style: normal; }
.k-steps li.cur { color: var(--ink); font-weight: 700; background: var(--brand-soft); }
.k-steps li.cur span { background: var(--brand); color: #fff; }
.k-steps li.done span { background: var(--good); color: #fff; }
.k-loc { color: var(--muted); font-size: .85rem; display: flex; gap: .3rem; align-items: center; white-space: nowrap; }
.k-main { flex: 1; overflow-y: auto; padding: 2rem 24px 2rem; }
.k-sec { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
.k-sec.narrow { max-width: 640px; }
.k-sec h1 { font-size: 2.1rem; font-stretch: 80%; }
.k-lead { color: var(--muted); font-size: 1.05rem; max-width: 62ch; }
.k-welcome { max-width: 760px; margin: 6vh auto 0; text-align: center; display: flex; flex-direction: column; gap: 1.2rem; align-items: center; }
.k-welcome h1 { font-size: 3.2rem; font-stretch: 75%; letter-spacing: -.01em; }
.k-welcome p { font-size: 1.2rem; color: var(--muted); max-width: 52ch; }
.k-langs { font-size: .95rem !important; letter-spacing: .04em; }
.k-exit { position: fixed; left: 10px; bottom: 10px; width: 40px; height: 40px; border: 0; background: transparent; color: var(--line); cursor: pointer; }
.k-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .6rem; }
.k-day { padding: 1rem .3rem; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); font: inherit; color: var(--ink); cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.k-day b { font-size: 2rem; font-stretch: 80%; line-height: 1; }
.k-day small { color: var(--muted); }
.k-day.active { border-color: var(--brand); background: var(--brand); color: #fff; }
.k-day.active small { color: rgba(255, 255, 255, .85); }
.k-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 260px)); gap: 1rem; }
.k-dates label, .k-field { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; color: var(--muted); font-size: .9rem; }
.k-dates input, .k-field input { min-height: 56px; font-size: 1.2rem; color: var(--ink); border-radius: 12px; }
.k-field.room input { font-family: var(--f-mono); font-size: 1.8rem; max-width: 220px; }
.k-period { font-size: 1.15rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.k-persons { display: flex; flex-direction: column; gap: .8rem; }
.k-person { display: grid; grid-template-columns: 44px minmax(220px, 2.2fr) repeat(3, minmax(80px, .8fr)) minmax(220px, 2fr) 40px; gap: .6rem; align-items: end; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .9rem; }
.k-person label { display: flex; flex-direction: column; gap: .2rem; font-size: .78rem; color: var(--muted); font-weight: 600; min-width: 0; }
.k-person input, .k-person select { min-height: 50px; font-size: 1.1rem; border-radius: 10px; }
.k-pnum { width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; align-self: center; }
.k-rm { align-self: center; }
.k-add { align-self: flex-start; min-height: 52px; font-size: 1.05rem; }
.k-ptabs { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: 4px; }
.k-ptab { display: flex; flex-direction: column; align-items: flex-start; padding: .55rem .9rem; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); font: inherit; color: var(--ink); cursor: pointer; white-space: nowrap; }
.k-ptab small { color: var(--muted); }
.k-ptab.active { border-color: var(--brand); background: var(--brand-soft); }
.k-copy { align-self: flex-start; }
.k-cat h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: .4rem 0 .5rem; }
.k-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
.k-tile { position: relative; text-align: left; display: flex; flex-direction: column; gap: .2rem; padding: 1rem; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); font: inherit; color: var(--ink); cursor: pointer; min-height: 150px; transition: border-color .12s, transform .12s; }
.k-tile:active { transform: scale(.98); }
.k-tile-ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand); margin-bottom: .3rem; }
.k-tile-ic .ic { width: 28px; height: 28px; }
.k-tile b { font-size: 1.12rem; }
.k-tile small { color: var(--muted); flex: 1; }
.k-tile em { font-style: normal; font-weight: 800; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.k-check { position: absolute; top: .8rem; right: .8rem; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; color: transparent; }
.k-tile.sel { border-color: var(--brand); background: var(--brand-soft); }
.k-tile.sel .k-check { background: var(--brand); border-color: var(--brand); color: #fff; }
.k-chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.k-chip { padding: .7rem 1rem; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); font: 600 1rem var(--f-ui); color: var(--ink); cursor: pointer; }
.k-chip.active { border-color: var(--brand); background: var(--brand-soft); }
.k-nav { display: flex; align-items: center; gap: 1rem; padding: .9rem 24px calc(.9rem + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--line); position: sticky; bottom: 0; }
.k-nav .btn { min-height: 60px; font-size: 1.15rem; padding: .8rem 1.6rem; border-radius: 12px; }
.k-nav .k-next { margin-left: auto; }
.k-total { flex: 1; text-align: right; display: flex; flex-direction: column; }
.k-total small { color: var(--muted); }
.k-total b { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.k-sum-head { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.k-sum-head div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .8rem; display: flex; flex-direction: column; }
.k-sum-head small { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.k-sum-head b { font-size: 1.15rem; }
.k-sum-head em { font-style: normal; color: var(--muted); }
.k-sum-p { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .8rem; }
.k-sum-p h3 { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.k-sum-p h3 span { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: .8rem; }
.k-sum-p h3 .btn { margin-left: auto; }
.k-sum-l { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; border-top: 1px solid var(--line); }
.k-sum-l span { flex: 1; }
.k-sum-l b { font-variant-numeric: tabular-nums; }
.k-sum-total { display: flex; justify-content: space-between; font-size: 1.5rem; font-weight: 800; padding: .6rem .2rem; border-top: 2px solid var(--ink); }
.k-accept { display: flex; gap: .7rem; align-items: flex-start; font-size: 1.02rem; background: var(--surface); padding: .9rem; border-radius: 12px; border: 1px solid var(--line); }
.k-accept input { width: 26px; height: 26px; flex: none; }
.k-done { align-items: center; text-align: center; }
.k-ok { width: 84px; height: 84px; border-radius: 50%; background: var(--good); color: #fff; display: grid; place-items: center; }
.k-ok .ic.big { width: 48px; height: 48px; }
.k-done-grid { display: flex; gap: 2rem; align-items: center; text-align: left; flex-wrap: wrap; justify-content: center; }
.k-done-qr { display: flex; flex-direction: column; align-items: center; gap: .4rem; background: #fff; color: #000; padding: 1rem; border-radius: 16px; border: 1px solid var(--line); }
.k-done-text { max-width: 440px; font-size: 1.1rem; display: flex; flex-direction: column; gap: .6rem; align-items: flex-start; }
.k-done-sum { color: var(--muted); font-size: .95rem; }
.k-pqr { display: flex; gap: .7rem; flex-wrap: wrap; }
.k-pqr div { display: flex; flex-direction: column; align-items: center; background: #fff; color: #000; padding: .4rem; border-radius: 10px; border: 1px solid var(--line); }
.k-pqr small { font-size: .78rem; max-width: 100px; text-align: center; }
.kiosk.mobile .k-top { padding: .6rem 16px; gap: .6rem; }
.kiosk.mobile .k-top img { height: 34px; }
.kiosk.mobile .k-steps em, .kiosk.mobile .k-loc { display: none; }
.kiosk.mobile .k-main { padding: 1.2rem 16px; }
.kiosk.mobile .k-sec h1 { font-size: 1.6rem; }
.kiosk.mobile .k-nav { padding-left: 16px; padding-right: 16px; gap: .5rem; }
.kiosk.mobile .k-nav .btn { min-height: 50px; font-size: 1rem; padding: .6rem 1rem; }
.kiosk.mobile .k-total b { font-size: 1.2rem; }
.kiosk.mobile .k-days { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kiosk.mobile .k-person { grid-template-columns: repeat(2, minmax(0, 1fr)); position: relative; padding-top: 2.6rem; }
.kiosk.mobile .k-person .k-name, .kiosk.mobile .k-person .k-level { grid-column: 1 / -1; }
.kiosk.mobile .k-pnum { position: absolute; top: .6rem; left: .9rem; width: 28px; height: 28px; font-size: .85rem; }
.kiosk.mobile .k-rm { position: absolute; top: .3rem; right: .3rem; }
.kiosk.mobile .k-tiles { grid-template-columns: 1fr; }
.kiosk.mobile .k-tile { min-height: 0; display: grid; grid-template-columns: 46px 1fr auto; column-gap: .7rem; align-items: center; padding-right: 3.2rem; }
.kiosk.mobile .k-tile-ic { grid-row: span 2; margin: 0; }
.kiosk.mobile .k-tile small { grid-column: 2; }
.kiosk.mobile .k-tile em { grid-column: 3; grid-row: 1 / span 2; font-size: 1.05rem; }
.kiosk.mobile .k-check { top: 50%; transform: translateY(-50%); }

/* ------------------------------ Vorschau -------------------------------- */
#pv-switch { position: fixed; z-index: 150; left: 50%; top: 0; transform: translateX(-50%); opacity: .75; transition: opacity .15s; border-top-left-radius: 0 !important; border-top-right-radius: 0 !important; padding: .2rem .7rem !important; font-size: .74rem !important; display: flex; gap: .4rem; align-items: center; padding: .5rem .85rem; border-radius: 999px; border: 0; background: var(--scan); color: #1b1400; font: 700 .85rem var(--f-ui); cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
body.is-login #pv-switch { display: none; }
@media (min-width: 700px) {
  .pv body.is-mobile-checkin, .pv body.is-handheld { background: #1B2733; }
  .pv body.is-mobile-checkin .kiosk, .pv body.is-handheld .hh { max-width: 420px; margin: 24px auto; min-height: calc(100vh - 48px); border-radius: 26px; overflow: hidden; box-shadow: 0 0 0 10px #0B1118, 0 30px 60px rgba(0, 0, 0, .5); background: var(--bg); }
  .pv body.is-mobile-checkin .k-main { max-height: calc(100vh - 48px - 130px); }
}

/* ------------------------------ Responsiv ------------------------------- */
@media (max-width: 1100px) {
  .order-grid { grid-template-columns: minmax(0, 1fr); }
  .order-side { position: static; }
  .cols2 { grid-template-columns: minmax(0, 1fr); }
  .k-person { grid-template-columns: 44px repeat(3, minmax(0, 1fr)); }
  .k-person .k-name, .k-person .k-level { grid-column: span 3; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, .4); }
  .menu-btn { display: inline-grid; }
  .top { flex-wrap: wrap; padding: .6rem 16px; gap: .5rem; }
  .top-scan { order: 5; flex-basis: 100%; max-width: none; }
  .page { padding: 1rem 16px 3rem; }
  .login { grid-template-columns: minmax(0, 1fr); }
  .grid-form { grid-template-columns: minmax(0, 1fr); }
  .person-head { display: none; }
  .person-row { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: .5rem; border: 1px solid var(--line); border-radius: 8px; }
  .person-row input[name=name] { grid-column: span 2; }
  .order-top { flex-direction: column-reverse; }
  .k-steps em { display: none; }
  .k-days { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .k-welcome h1 { font-size: 2.2rem; }
  .k-dates { grid-template-columns: minmax(0, 1fr); }
  .hbar { grid-template-columns: 100px 1fr auto; }
}

/* ------------------------------- Z-Wert --------------------------------- */
.zp { display: flex; flex-direction: column; gap: .6rem; }
.zp-inputs { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: .45rem; }
.zp-inputs label.zp-level { grid-column: span 2; }
.zp-inputs label { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.zp-inputs label > span { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; }
.zp-inputs input, .zp-inputs select { min-height: 44px; font-size: 1.05rem; font-variant-numeric: tabular-nums; padding: .3rem .5rem; }
.zp-sole { grid-column: 1 / -1; align-items: flex-start; text-align: left; }
.zp-sole input { font-family: var(--f-mono); font-size: 1.35rem; font-weight: 600; max-width: 180px; border-width: 2px; }
.zp-sole.empty input { border-color: var(--scan); }
.zp-sole small { color: var(--muted); font-size: .78rem; }
.zp-result { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "lbl lbl" "val meta" "em em" "btn btn"; column-gap: .9rem; align-items: center; padding: .75rem .9rem; border-radius: 12px; background: var(--brand-soft); border: 2px solid var(--brand); }
.zp-result small { grid-area: lbl; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; color: var(--brand); }
.zp-result b { grid-area: val; font-size: 2.8rem; line-height: 1; font-stretch: 80%; font-variant-numeric: tabular-nums; color: var(--ink); }
.zp-result span { grid-area: meta; color: var(--muted); font-size: .88rem; }
.zp-result em { grid-area: em; font-style: normal; font-size: .85rem; margin-top: .3rem; font-weight: 600; }
.zp-result .btn { grid-area: btn; margin-top: .5rem; min-height: 48px; font-size: 1rem; }
.zp-result.set { background: var(--good-soft); border-color: var(--good); }
.zp-result.set small, .zp-result.set em { color: var(--good); }
.zp-result.warn { background: var(--warn-soft); border-color: var(--warn); }
.zp-result.warn small, .zp-result.warn em { color: var(--warn); }
.zp-result.miss { background: var(--surface-2); border: 2px dashed var(--line); }
.zp-result.miss small { color: var(--muted); }
.zp-result.miss b { color: var(--muted); }
.zp-warn { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; font-size: .84rem; color: var(--warn); }
.zp-warn li { display: flex; gap: .35rem; align-items: flex-start; }
.zp-warn .ic { width: 15px; height: 15px; margin-top: 2px; }
.zp-steps { font-size: .84rem; color: var(--muted); }
.zp-steps summary { cursor: pointer; font-weight: 600; }
.zp-steps ol { margin: .3rem 0 0; padding-left: 1.2rem; }
.zp-note { font-size: .74rem; color: var(--muted); margin: 0; }
.zbadge { display: inline-block; font-family: var(--f-mono); font-size: .78rem; font-weight: 600; padding: .05rem .45rem; border-radius: 6px; vertical-align: middle; margin-right: .3rem; }
.zbadge.todo { background: var(--brand); color: #fff; }
.zbadge.set { background: var(--good-soft); color: var(--good); }
.zbadge.warn { background: var(--warn); color: #fff; }
.zbadge.miss { background: var(--surface-2); color: var(--muted); border: 1px dashed var(--line); }
.hh-card h2 .zbadge { font-size: .9rem; }
.zline-ok { color: var(--good) !important; font-weight: 600; }
.zline-todo { color: var(--warn) !important; font-weight: 600; }
.ztable input { min-height: 30px; padding: .15rem .35rem; text-align: right; width: 64px; font-variant-numeric: tabular-nums; }
.ztable td { padding: .2rem .3rem; }

/* ---------------------------- Sprachen ---------------------------------- */
.lang-switch { display: inline-flex; gap: 2px; padding: 2px; border-radius: 999px; background: color-mix(in srgb, currentColor 10%, transparent); }
.lang-switch button { display: inline-flex; align-items: center; gap: .3rem; border: 0; background: transparent; color: inherit; font: 650 .75rem var(--f-ui); padding: .25rem .55rem; border-radius: 999px; cursor: pointer; opacity: .7; }
.lang-switch button.active { background: var(--surface); color: var(--ink); opacity: 1; }
.lang-switch svg { width: 18px; height: 12px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); }
.login-brand .lang-switch { margin-left: auto; }
.side > .lang-switch { align-self: flex-start; margin: .2rem .4rem 0; }
.hh-top .lang-switch { color: var(--side-ink); }
.k-choose { font-size: 1.05rem; color: var(--muted); font-weight: 600; margin-top: .6rem; }
.k-langgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .9rem; width: 100%; max-width: 900px; }
.k-lang { display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 1.1rem .6rem 1rem; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; transition: transform .12s, border-color .12s; }
.k-lang:hover, .k-lang:focus-visible { border-color: var(--brand); transform: translateY(-2px); }
.k-lang.suggested { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.k-lang b { font-size: 1.15rem; }
.k-flag { width: 96px; max-width: 100%; aspect-ratio: 3 / 2; border-radius: 8px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12), 0 4px 12px rgba(0, 0, 0, .12); display: block; }
.k-flag svg { width: 100%; height: 100%; display: block; }
.k-flags { display: flex; gap: .35rem; align-items: center; white-space: nowrap; }
.k-flag-mini { width: 34px; height: 24px; padding: 0; border: 2px solid transparent; border-radius: 5px; overflow: hidden; background: none; cursor: pointer; opacity: .55; }
.k-flag-mini svg { width: 100%; height: 100%; display: block; }
.k-flag-mini.active { opacity: 1; border-color: var(--brand); }
.tr-grid { display: grid; grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1.6fr); gap: .4rem; align-items: center; }
.tr-flag svg { width: 26px; height: 18px; border-radius: 3px; display: block; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); }
.lang-fact { display: inline-flex !important; align-items: center; gap: .4rem; }
.lang-fact svg { width: 22px; height: 15px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); }
@media (max-width: 860px) {
  .k-langgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kiosk.mobile .k-flags { gap: .2rem; }
  .kiosk.mobile .k-flag-mini { width: 26px; height: 18px; }
}
.kiosk.mobile .k-langgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kiosk.mobile .k-welcome h1 { font-size: 2rem; }
.kiosk.mobile .k-steps { display: none; }

#pv-switch:hover, #pv-switch:focus-visible { opacity: 1; }
.k-welcome { max-width: 900px; }

/* ---------------------- Kategoriewechsel / Erweitern -------------------- */
.chg { display: flex; flex-direction: column; gap: .1rem; margin-top: .25rem; padding: .3rem .45rem; border-left: 3px solid var(--scan); background: color-mix(in srgb, var(--scan) 8%, transparent); border-radius: 0 6px 6px 0; }
.chg small { color: var(--ink); font-size: .76rem; }
.ex-modes { display: flex; flex-direction: column; gap: .4rem; margin-top: .6rem; }
.ex-modes label { display: grid; grid-template-columns: auto 1fr; column-gap: .5rem; align-items: start; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.ex-modes label small { grid-column: 2; color: var(--muted); }
.ex-modes label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.ex-opt { display: grid !important; grid-template-columns: 1fr auto; text-align: left; white-space: normal; min-height: 52px; gap: 0 .6rem; }
.ex-opt small { grid-column: 1 / -1; font-weight: 500; opacity: .85; font-size: .78rem; }
.ap-price { font-size: 1.05rem; }
.label-banner { display: flex; align-items: center; gap: .8rem; padding: .7rem 1rem; border-radius: var(--r); background: color-mix(in srgb, var(--scan) 18%, var(--surface)); border: 1px solid color-mix(in srgb, var(--scan) 60%, var(--line)); flex-wrap: wrap; }
.label-banner span { flex: 1; min-width: 200px; }

/* -------------------------------- Inventur ------------------------------- */
.progress { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: .3rem; min-width: 120px; }
.progress i { display: block; height: 100%; background: var(--good); border-radius: 4px; }
.plus { color: var(--warn); }
.kpi.amber b { color: var(--warn); }
.checks.col { flex-direction: column; gap: .5rem; }
.hh-modes { grid-template-columns: repeat(4, 1fr); }
.hh-mode { font-size: .82rem; }
.st-progress { display: flex; flex-direction: column; }
.st-progress b { font-size: 1.8rem; font-stretch: 80%; font-variant-numeric: tabular-nums; }
.st-progress span { color: var(--muted); font-size: .85rem; }
.st-stats { display: flex; gap: 1rem; font-size: .88rem; color: var(--muted); }
.st-qty { display: flex; flex-direction: column; gap: .35rem; font-size: .82rem; color: var(--muted); }
.st-qty div { display: flex; gap: .3rem; flex-wrap: wrap; }

/* ---------------------------- Mein Check-In ------------------------------ */
.k-save { display: flex; flex-direction: column; gap: .5rem; align-items: stretch; width: 100%; max-width: 440px; }
.k-save .btn.primary { min-height: 52px; font-size: 1.05rem; }
.k-link { display: grid; grid-template-columns: 1fr auto; gap: .2rem .5rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .5rem .7rem; }
.k-link small { grid-column: 1 / -1; color: var(--muted); }
.k-link code { font-size: .78rem; word-break: break-all; }
.k-mine { display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem; border-radius: 14px; background: var(--good-soft); border: 2px solid var(--good); color: var(--ink); text-decoration: none; width: 100%; max-width: 520px; text-align: left; }
.k-mine span { display: flex; flex-direction: column; }
.k-mine small { color: var(--muted); }
.k-mine .qr { flex: none; border-radius: 4px; }
.kiosk.mobile .k-done .k-done-qr { align-self: center; }

/* ------------------------- Rechnungsempfänger / Reset ------------------- */
.k-billing { display: flex; flex-direction: column; gap: .7rem; margin-top: 1rem; padding: 1rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.k-billing h2 { font-size: 1.15rem; margin: 0; }
.k-billing select { min-height: 56px; font-size: 1.1rem; border-radius: 12px; }
.k-err { color: var(--bad); font-weight: 600; margin: -.3rem 0 0; }
.k-sum-head { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.k-sum-bill { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .8rem; display: flex; flex-direction: column; min-width: 0; }
.k-sum-bill small { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.k-sum-bill em { font-style: normal; color: var(--muted); overflow-wrap: anywhere; }
.k-countdown { display: flex; flex-direction: column; align-items: center; gap: .4rem; color: var(--muted); font-size: 1rem; }
.k-countbar { width: 260px; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.k-countbar i { display: block; height: 100%; width: 100%; background: var(--brand); transition: width .25s linear; }
.kiosk.mobile .k-sum-head { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 860px) { .k-sum-head { grid-template-columns: minmax(0, 1fr); } }

/* ----------------- Elemente nur für das App-Design (theme.css) ------------ */
.app-grid, .avatar, .cp-new, .statusbar, .ribbon { display: none; }
.theme-switch { display: inline-flex; gap: 2px; padding: 2px; border-radius: 999px; background: color-mix(in srgb, currentColor 10%, transparent); }
.theme-switch button { border: 0; background: transparent; color: inherit; font: 650 .72rem var(--f-ui); padding: .25rem .6rem; border-radius: 999px; cursor: pointer; opacity: .7; }
.theme-switch button.active { background: var(--surface); color: var(--ink); opacity: 1; }
.login-switches, .side-switches { display: inline-flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.login-brand .login-switches { margin-left: auto; }
.side-switches { margin: .2rem .4rem 0; }
.side > .lang-switch { display: none; }

/* ---------- Demo-Mandant ---------- */
.demo-chip { display: inline-block; font-size: .62rem; font-weight: 800; letter-spacing: .06em; padding: .1rem .4rem; border-radius: 4px; background: #F59E0B; color: #fff; vertical-align: middle; margin-left: .25rem; }
.demo-bar { display: flex; align-items: center; gap: .6rem; padding: .5rem 1.25rem; background: #FFFBEB; border-bottom: 1px solid #FDE68A; color: #92400E; font-size: .85rem; }
.demo-bar svg { width: 18px; height: 18px; flex: none; }
.demo-bar span { flex: 1; }
.demo-bar .btn { color: #92400E; border-color: #FCD34D; white-space: nowrap; }
.login-sub { font-size: .95rem; margin: 1.4rem 0 0; color: var(--muted, #6B7280); font-weight: 600; }
.role-grid.small { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tenant-card .demo-chip { position: absolute; top: .6rem; right: .6rem; }
.tenant-card { position: relative; }
.onboard { border: 1px dashed var(--brand); background: var(--brand-soft, #EEF3FC); }
.onboard ol { margin: .5rem 0 0; padding: 0; list-style: none; display: grid; gap: .45rem; }
.onboard li { display: flex; align-items: center; gap: .6rem; }
.onboard li .chk { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 2px solid #CBD5E1; font-size: .75rem; font-weight: 700; color: #64748B; flex: none; background: #fff; }
.onboard li.done .chk { background: #16A34A; border-color: #16A34A; color: #fff; }
.onboard li.done span { color: #64748B; text-decoration: line-through; }
.onboard li .btn { margin-left: auto; }
@media (max-width: 700px) { .demo-bar { padding: .5rem .8rem; flex-wrap: wrap; } }
