/* IT-Bestandsaufnahme · Gestaltung im Stil von it-service-commander.de
   Schrift: Ubuntu (lokal eingebunden, Ubuntu Font Licence – siehe fonts/UFL.txt) */

@font-face { font-family: "Ubuntu"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("fonts/ubuntu-regular.woff2") format("woff2"); }
@font-face { font-family: "Ubuntu"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("fonts/ubuntu-medium.woff2") format("woff2"); }
@font-face { font-family: "Ubuntu"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("fonts/ubuntu-bold.woff2") format("woff2"); }

:root {
  /* Markenfarben */
  --slate: #333945;        /* Kopfzeile der Webseite */
  --slate-2: #3d4452;
  --navy: #00102e;         /* Überschriften */
  --blue: #2f72b3;         /* Schaltflächen & Links (Logo-Blau, für Lesbarkeit abgedunkelt) */
  --blue-hover: #275f96;
  --blue-logo: #3d82c4;    /* Bildschirm im Logo */
  --blue-wing: #4a90d9;    /* blaue Linie im Logo */
  --chrome: #e9edf1;       /* hellgrau im Logo */

  --bg: #f4f6f9;
  --sheet: #ffffff;
  --soft: #eef2f7;         /* Seitenleiste der Webseite */
  --ink: #1e2a3b;
  --ink-2: #3a4555;
  --muted: #5f6775;
  --line: #e1e6ed;
  --line-strong: #c9d3de;

  --ok: #1f7a4a;   --ok-soft: #e2f2e9;
  --warn: #9a5a00; --warn-soft: #fcefd9; --warn-line: #e0a23a;
  --danger: #b3261e; --danger-soft: #fbe5e3;

  --radius: 4px;
  --radius-sm: 3px;
  --font: "Ubuntu", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --tech: "Ubuntu", ui-monospace, Menlo, Consolas, monospace;
  --header-h: 72px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --navy: #f1f4f8;
    --blue: #4a90d9;
    --blue-hover: #6aa5e3;
    --bg: #1a1e25;
    --sheet: #232933;
    --soft: #1f242c;
    --ink: #e3e8ee;
    --ink-2: #c7cfd9;
    --muted: #95a0ae;
    --line: #313946;
    --line-strong: #46505e;
    --ok: #6fd39d; --ok-soft: #173426;
    --warn: #f0b75a; --warn-soft: #3a2c13; --warn-line: #b8862f;
    --danger: #f2877f; --danger-soft: #3c1d1b;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15.5px/1.55 var(--font); }
img { max-width: 100%; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { color: var(--navy); line-height: 1.2; margin: 0 0 .45em; letter-spacing: -0.01em; }
h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 500; }
p { margin: 0 0 .8em; }
code { font-family: var(--tech); font-size: .92em; background: var(--soft); padding: 1px 5px; border-radius: 3px; }
strong, .strong { font-weight: 500; }
.muted { color: var(--muted); }
.small { font-size: .87rem; }
.lead { font-size: 1.08rem; color: var(--ink-2); max-width: 62ch; }
.pre { white-space: pre-line; }
.inline { display: inline; }
.tech { font-family: var(--tech); letter-spacing: .01em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--blue-wing); outline-offset: 2px; }

/* ---- Kopfzeile ---------------------------------------------------------- */
.topbar { background: var(--slate); position: sticky; top: 0; z-index: 30; padding-top: env(safe-area-inset-top); }
.topbar-inner { max-width: 1320px; margin: 0 auto; height: var(--header-h); padding: 0 24px;
  display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 18px; color: #fff; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 40px; width: auto; display: block; }
.brand-app { color: #c9d1dc; font-size: .9rem; font-weight: 500; padding-left: 18px; border-left: 1px solid #555d6b; white-space: nowrap; }
.topnav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.topnav a, .nav-button {
  color: #dfe5ec; font: 400 15px/1 var(--font); padding: 10px 14px; border-radius: var(--radius-sm);
  background: none; border: 0; cursor: pointer; position: relative;
}
.topnav a:hover, .nav-button:hover { color: #fff; background: rgba(255,255,255,.06); text-decoration: none; }
.topnav a[aria-current="page"] { color: #fff; }
.topnav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: -14px; height: 3px; border-radius: 2px; background: var(--blue-wing);
}
.nav-user { color: #9aa4b2; }
.menu-toggle { display: none; }

/* ---- Seitenrahmen ------------------------------------------------------- */
.page { max-width: 1180px; margin: 0 auto; padding: 32px 24px 72px; }
.page-wide { max-width: 1320px; }
.page-medium { max-width: 820px; }
.page-narrow { max-width: 520px; padding-top: 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin-bottom: 4px; }
.page-head p { margin: 0; }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs span[aria-hidden] { color: var(--line-strong); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; align-items: start; }
.two-col-wide-right { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.two-col > .sheet { margin-bottom: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
.center-note { text-align: center; margin-top: 16px; }

.sheet {
  background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 32px; margin-bottom: 20px; box-shadow: 0 1px 2px rgba(0, 16, 46, .04);
}
.sheet-soft { background: var(--soft); border-color: transparent; box-shadow: none; }
.table-sheet { padding: 0; overflow: hidden; }
.table-sheet .section-head { padding: 22px 28px 10px; }
.narrow-sheet { max-width: 560px; }
.empty { text-align: center; padding: 48px 24px; }

/* ---- Meldungen ---------------------------------------------------------- */
.flashes { display: grid; gap: 8px; margin-bottom: 20px; }
.flash { padding: 12px 16px; border-radius: var(--radius); border-left: 4px solid var(--blue-wing); background: var(--sheet); margin-bottom: 16px; }
.flashes .flash { margin: 0; }
.flash-success { border-left-color: var(--ok); background: var(--ok-soft); }
.flash-error { border-left-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.flash-info { background: var(--soft); }

/* ---- Schaltflächen ------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 500 15px/1.2 var(--font); padding: 10px 18px; min-height: 44px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--sheet); color: var(--navy); cursor: pointer; white-space: nowrap;
  transition: background-color .12s, border-color .12s;
}
.btn:hover { background: var(--soft); text-decoration: none; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--soft); }
.btn-danger-ghost { background: transparent; border-color: transparent; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-small { padding: 6px 12px; min-height: 36px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn-wide { min-width: 220px; }
.btn[disabled] { opacity: .55; cursor: progress; }

/* ---- Formulare ---------------------------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stack { display: grid; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label { font-size: .88rem; font-weight: 500; color: var(--ink-2); }
.field-help { font-size: .82rem; color: var(--muted); }
.req { color: var(--danger); }
input, select, textarea {
  font: 400 15.5px/1.35 var(--font); color: var(--ink); background: var(--sheet);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 10px 12px; min-height: 46px; width: 100%;
  transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(74, 144, 217, .25); }
textarea { resize: vertical; min-height: 84px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
input.tech { font-family: var(--tech); }
select { appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.input-wrap { position: relative; display: flex; }
.input-wrap .scan-btn { position: absolute; right: 4px; top: 4px; bottom: 4px; }
.input-wrap input[data-scan-ready] { padding-right: 96px; }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; min-height: 0; margin-top: 2px; flex: none; accent-color: var(--blue); }
fieldset { border: 0; padding: 0; margin: 0 0 26px; min-width: 0; }
legend { font-weight: 700; font-size: 1.02rem; color: var(--navy); padding: 0; margin-bottom: 14px; }
.form-sheet fieldset + fieldset, .add-device fieldset + fieldset { border-top: 1px solid var(--line); padding-top: 22px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.compact-form { gap: 10px; }
.searchbar { display: flex; gap: 8px; margin-bottom: 20px; }
.searchbar input { flex: 1; }

/* ---- Tabs (Admin) ------------------------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-strong); margin-bottom: 22px; }
.tabs a { padding: 10px 16px; color: var(--ink-2); font-weight: 500; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { text-decoration: none; color: var(--navy); }
.tabs a[aria-current="page"] { color: var(--navy); border-bottom-color: var(--blue-wing); }

/* ---- Tabellen ----------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table thead th { font-size: .85rem; color: var(--ink-2); font-weight: 500; background: var(--soft); border-bottom: 0; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-sheet .table th:first-child, .table-sheet .table td:first-child { padding-left: 28px; }
.device-table { table-layout: fixed; }
.device-table { font-size: .92rem; }
.device-table th:first-child { width: 21%; }
.device-table th.col-status { width: 150px; }
.device-table th.col-value { width: 112px; }
.device-table th, .device-table td { padding-left: 10px; padding-right: 10px; }
.device-table .col-value { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.per-piece { display: block; }
.device-table td { overflow-wrap: anywhere; }
.inline-select select { min-height: 38px; padding-top: 6px; padding-bottom: 6px; max-width: 190px; }

/* ---- Badges ------------------------------------------------------------- */
.badge { display: inline-block; font-size: .8rem; font-weight: 500; padding: 3px 9px; border-radius: 99px; white-space: nowrap; vertical-align: 1px; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-neutral { background: var(--soft); color: var(--ink-2); }
.badge-muted { background: transparent; color: var(--muted); border: 1px dashed var(--line-strong); }
.qty { font-size: .82rem; font-weight: 500; color: var(--blue); background: rgba(74, 144, 217, .12); padding: 1px 8px; border-radius: 99px; margin-left: 4px; }
.state-text-done { color: var(--ok); font-weight: 500; }
.state-text-none { color: var(--muted); }
.state-text-open { color: var(--warn); font-weight: 500; }

/* ---- Kundenliste -------------------------------------------------------- */
.customer-list { list-style: none; margin: 0; padding: 0; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); }
.customer-list li + li { border-top: 1px solid var(--line); }
.customer-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1.4fr); gap: 4px 24px; align-items: center; padding: 16px 24px; color: var(--ink); }
.customer-row:hover { background: var(--soft); text-decoration: none; }
.customer-name { font-weight: 700; color: var(--navy); font-size: 1.05rem; }
.customer-meta { color: var(--ink-2); }
.customer-surveys { color: var(--muted); font-size: .9rem; text-align: right; }

/* ---- Kunden-Detail ------------------------------------------------------ */
.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 8px 20px; margin: 0; }
.kv dt { color: var(--muted); font-size: .9rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv-grid { grid-template-columns: minmax(160px, max-content) 1fr minmax(160px, max-content) 1fr; }
.danger-zone { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line-strong); }
.survey-list { list-style: none; margin: 0; padding: 0; }
.survey-list li { padding: 18px 0; border-top: 1px solid var(--line); }
.survey-list li:first-child { border-top: 0; padding-top: 2px; }
.survey-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.survey-meta { display: flex; align-items: center; gap: 14px; margin: 12px 0; }
.survey-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Fortschritt als „Flügel“ des Logos --------------------------------- */
.wings { display: grid; gap: 5px; width: 100%; }
.wings-inline { width: 140px; flex: none; }
.wing { display: block; height: 6px; border-radius: 3px; }
.wing-track { background: var(--line-strong); width: 100%; }
.wing-progress { background: var(--blue-wing); width: 0; min-width: 6px; }
.pct-0 { width: 0; } .pct-5 { width: 5%; } .pct-10 { width: 10%; } .pct-15 { width: 15%; } .pct-20 { width: 20%; }
.pct-25 { width: 25%; } .pct-30 { width: 30%; } .pct-35 { width: 35%; } .pct-40 { width: 40%; } .pct-45 { width: 45%; }
.pct-50 { width: 50%; } .pct-55 { width: 55%; } .pct-60 { width: 60%; } .pct-65 { width: 65%; } .pct-70 { width: 70%; }
.pct-75 { width: 75%; } .pct-80 { width: 80%; } .pct-85 { width: 85%; } .pct-90 { width: 90%; } .pct-95 { width: 95%; }
.pct-100 { width: 100%; }

/* ---- Assistent ---------------------------------------------------------- */
.wizard { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 28px; align-items: start; }
.wizard-nav { position: sticky; top: calc(var(--header-h) + 20px); }
.wizard-steps { background: var(--soft); border-radius: var(--radius); padding: 22px 14px 14px; }
.wizard-steps > summary { list-style: none; padding: 0 10px 16px; display: grid; gap: 4px; cursor: default; }
.wizard-steps > summary::-webkit-details-marker { display: none; }
.wizard-customer { font-weight: 700; color: var(--navy); font-size: 1.05rem; line-height: 1.3; }
.wizard-title { color: var(--muted); font-size: .9rem; margin-bottom: 12px; }
.wizard-progress-text { color: var(--muted); font-size: .85rem; margin-top: 6px; }
.wizard-steps ol { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--line-strong); }
.wizard-steps li a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--ink-2); font-size: .93rem; line-height: 1.3; }
.wizard-steps li a:hover { background: rgba(255, 255, 255, .6); text-decoration: none; color: var(--navy); }
.wizard-steps li.current a { background: var(--sheet); color: var(--navy); font-weight: 500; box-shadow: inset 3px 0 0 var(--blue-wing); }
.wizard-steps li.step-none .step-label { color: var(--muted); }
.step-label { flex: 1; min-width: 0; }
.count { font-size: .78rem; font-weight: 500; color: var(--ink-2); background: var(--sheet); border-radius: 99px; padding: 1px 8px; }

.state { width: 20px; height: 20px; border-radius: 50%; flex: none; position: relative; }
.state-open { border: 2px solid var(--line-strong); background: var(--sheet); }
.state-done { background: var(--blue); }
.state-done::after { content: ""; position: absolute; left: 7px; top: 3.5px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.state-none { background: var(--line-strong); }
.state-none::after { content: ""; position: absolute; left: 5px; right: 5px; top: 9px; height: 2px; background: var(--sheet); border-radius: 1px; }
.state-summary { background: var(--slate); }
.state-summary::after { content: ""; position: absolute; left: 5px; right: 5px; top: 6px; height: 2px; background: #fff; box-shadow: 0 3px 0 #fff, 0 6px 0 var(--blue-wing); border-radius: 1px; }

.wizard-main { min-width: 0; }
.step-head { margin-bottom: 22px; }
.step-head h1 { margin-bottom: 6px; }
.step-head p { margin-bottom: 0; }
.step-count { color: var(--muted); font-size: .92rem; margin-bottom: 6px !important; }
.summary-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; flex-wrap: wrap; }
.summary-head .badge { margin-left: 6px; }
.export-box { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.export-buttons { display: flex; gap: 8px; }
.export-buttons .btn { min-width: 76px; }

.device-list { display: grid; gap: 10px; margin-bottom: 18px; }
.device { display: flex; justify-content: space-between; gap: 16px; align-items: center; background: var(--sheet);
  border: 1px solid var(--line); border-left: 3px solid var(--blue-wing); border-radius: var(--radius); padding: 14px 18px; scroll-margin-top: 100px; }
.device-main { min-width: 0; color: var(--ink); flex: 1; }
.device-main:hover { text-decoration: none; }
.device-main:hover h3 { color: var(--blue); }
.device h3 { margin: 0 0 3px; font-size: 1.05rem; font-weight: 700; }
.device-main p { margin: 0; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.device-side { display: flex; align-items: center; gap: 14px; flex: none; }
.device-actions { display: flex; gap: 4px; }
.device:target { box-shadow: 0 0 0 2px var(--blue-wing); }

.add-device { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; scroll-margin-top: 100px; }
.add-device > summary { cursor: pointer; padding: 18px 24px; font-weight: 500; font-size: 1.05rem; list-style: none; display: flex; align-items: center; gap: 12px; color: var(--blue); }
.add-device > summary::-webkit-details-marker { display: none; }
.add-device > summary:hover { background: var(--soft); }
.plus { width: 28px; height: 28px; border-radius: var(--radius-sm); background: var(--blue); position: relative; flex: none; }
.plus::before, .plus::after { content: ""; position: absolute; background: #fff; border-radius: 1px; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.plus::before { width: 12px; height: 2px; }
.plus::after { width: 2px; height: 12px; transition: transform .15s; }
.add-device[open] .plus::after { transform: translate(-50%, -50%) scaleY(0); }
.add-device[open] > summary { border-bottom: 1px solid var(--line); }
.add-device form { padding: 24px; }

.step-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--soft); border-radius: var(--radius); padding: 18px 22px; }
.step-footer-text { margin: 0; }
.step-footer-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* Leiste unten am Handy */
.step-bar { display: none; }

/* ---- Zusammenfassung ---------------------------------------------------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 16px 20px 18px; background: var(--sheet);
  border: 1px solid var(--line); border-top: 3px solid var(--blue-wing); border-radius: var(--radius); }
.kpi-value { font-size: 2.1rem; font-weight: 700; color: var(--navy); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 1.1rem; color: var(--muted); font-weight: 500; }
.kpi-money { font-size: 1.65rem; line-height: 1.35; overflow-wrap: anywhere; }
.kpi-label { color: var(--muted); font-size: .9rem; }
.kpi-warn { border-top-color: var(--warn-line); }
.kpi-warn .kpi-value { color: var(--warn); }

.cat-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.cat-bar-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 46px; align-items: center; gap: 12px; padding: 5px 0; }
.cat-bar-label { color: var(--ink); font-size: .93rem; line-height: 1.3; }
.cat-bar-row.cat-none .cat-bar-label { color: var(--muted); }
.cat-bar-track { height: 12px; display: block; }
.cat-bar { display: block; height: 100%; background: var(--blue-logo); border-radius: 0 4px 4px 0; min-width: 4px; }
.cat-bar-value { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; font-size: .93rem; }

.value-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(220px, 2fr); gap: 28px; align-items: start; }
.value-row { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 110px; }
.value-total { background: var(--soft); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.value-amount { font-size: 2rem; font-weight: 700; color: var(--navy); line-height: 1.15; font-variant-numeric: tabular-nums; }
.value-missing { margin: 10px 0 0; font-size: .9rem; color: var(--ink-2); }
.choice-row { display: flex; gap: 28px; flex-wrap: wrap; }
.choice-row .check input { border-radius: 50%; }
input.money { text-align: right; font-variant-numeric: tabular-nums; }
.hints { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; max-height: 460px; overflow: auto; }
.hint { padding: 10px 12px 10px 14px; border-radius: var(--radius-sm); border-left: 3px solid var(--blue-wing); background: var(--soft); font-size: .93rem; }
.hint-warn { border-left-color: var(--warn-line); background: var(--warn-soft); }
.hint a { font-weight: 500; }
.hint-text { display: block; color: var(--ink-2); }
.device-details { margin-top: 6px; }
.device-details summary { cursor: pointer; font-size: .82rem; color: var(--muted); }
.device-details .kv { margin-top: 8px; grid-template-columns: max-content 1fr; font-size: .87rem; }
.manage .actions { margin-bottom: 12px; }

/* ---- Benutzer-Menü in Tabellen ------------------------------------------ */
.row-menu { position: relative; }
.row-menu > summary { list-style: none; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu-body { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; width: 280px; background: var(--sheet);
  border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 14px; display: grid; gap: 12px;
  box-shadow: 0 12px 30px rgba(0, 16, 46, .14); }

/* ---- Anmeldung ---------------------------------------------------------- */
.auth-page { background: var(--slate); min-height: 100vh; min-height: 100dvh; }
.auth-main { max-width: 440px; margin: 0 auto; padding: max(48px, env(safe-area-inset-top)) 20px 40px; }
.auth-brand { display: flex; justify-content: center; margin: 12px 0 30px; }
.auth-brand img { width: 100%; max-width: 360px; height: auto; }
.auth-sheet { background: var(--sheet); border-radius: var(--radius); padding: 30px 30px 26px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.auth-sheet h1 { font-size: 1.6rem; }
.auth-foot { text-align: center; color: #9aa4b2; font-size: .85rem; margin-top: 22px; }
.auth-page .flashes { max-width: 440px; margin: 0 auto 16px; }
.cf-turnstile { min-height: 65px; }
.hint-details { margin-top: 18px; }
.hint-details summary { cursor: pointer; color: var(--blue); font-size: .92rem; }
.hint-details p { margin-top: 8px; }
.otp-input { font-family: var(--tech); font-size: 1.5rem; letter-spacing: .25em; text-align: center; font-variant-numeric: tabular-nums; }
.small-otp { font-size: 1.1rem; letter-spacing: .15em; }

/* Zwei-Faktor-Einrichtung */
.setup-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 28px; }
.setup-steps > li { counter-increment: s; position: relative; padding-left: 52px; }
.setup-steps > li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--slate); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.setup-steps h2 { font-size: 1.1rem; margin-bottom: 4px; }
.qr { display: block; width: 220px; height: 220px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin: 10px 0 4px; image-rendering: pixelated; }
.secret-key { font-size: 1.1rem; word-spacing: .3em; background: var(--soft); padding: 10px 12px; border-radius: var(--radius-sm); user-select: all; }
.otp-form { display: flex; gap: 10px; flex-wrap: wrap; max-width: 420px; }
.otp-form input { flex: 1 1 180px; }
.codes { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; font-size: 1.15rem; }
.codes li { background: var(--soft); padding: 10px 14px; border-radius: var(--radius-sm); text-align: center; letter-spacing: .06em; }

/* ---- Barcode-Scanner ---------------------------------------------------- */
.scan-btn { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border: 0; border-radius: var(--radius-sm);
  background: var(--soft); color: var(--blue); font: 500 .85rem/1 var(--font); cursor: pointer; }
.scan-btn:hover { background: var(--line); }
.scan-icon { width: 16px; height: 12px; border: 2px solid currentColor; border-radius: 2px; position: relative; }
.scan-icon::after { content: ""; position: absolute; left: -4px; right: -4px; top: 3px; height: 2px; background: currentColor; }
.scanner { border: 0; padding: 0; width: 100%; max-width: 560px; background: #000; color: #fff; border-radius: var(--radius); }
.scanner::backdrop { background: rgba(0, 10, 25, .8); }
.scanner video { display: block; width: 100%; max-height: 70vh; object-fit: cover; background: #000; }
.scanner-frame { position: absolute; left: 12%; right: 12%; top: 32%; bottom: 32%; border: 2px solid var(--blue-wing); border-radius: 6px; pointer-events: none; }
.scanner-stage { position: relative; }
.scanner-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; background: var(--slate); }
.scanner-bar p { margin: 0; font-size: .92rem; color: #dfe5ec; }

/* ---- Tablet ------------------------------------------------------------- */
@media (max-width: 1100px) {
  .wizard { grid-template-columns: 250px minmax(0, 1fr); gap: 22px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kv-grid { grid-template-columns: minmax(130px, max-content) 1fr; }
  .brand-app { display: none; }
}

/* ---- Handy & kleines Tablet --------------------------------------------- */
@media (max-width: 860px) {
  :root { --header-h: 60px; }
  body { font-size: 16px; }
  input, select, textarea { font-size: 16px; }   /* verhindert Zoom auf iOS */
  .topbar-inner { padding: 0 12px 0 16px; gap: 12px; }
  .brand-logo { height: 32px; }
  .menu-toggle { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; background: none; border: 1px solid #555d6b;
    color: #fff; font: 500 15px/1 var(--font); padding: 0 14px; min-height: 42px; border-radius: var(--radius-sm); cursor: pointer; }
  .menu-icon, .menu-icon span, .menu-icon::before, .menu-icon::after { display: block; width: 18px; height: 2px; background: #fff; border-radius: 1px; }
  .menu-icon { position: relative; background: transparent; }
  .menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
  .menu-icon::before { top: -6px; } .menu-icon::after { top: 6px; }
  .topnav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--slate-2); flex-direction: column;
    align-items: stretch; padding: 8px 12px 14px; gap: 2px; box-shadow: 0 12px 24px rgba(0, 0, 0, .25); }
  .topnav.open { display: flex; }
  .topnav a, .nav-button { padding: 14px 12px; font-size: 16px; text-align: left; width: 100%; }
  .topnav a[aria-current="page"]::after { left: 0; right: auto; top: 12px; bottom: 12px; width: 3px; height: auto; }
  .topnav form { display: block; }

  .page { padding: 20px 16px 48px; }
  h1 { font-size: 1.6rem; }
  .sheet { padding: 20px 18px; margin-bottom: 16px; }
  .two-col, .two-col-wide-right { grid-template-columns: 1fr; gap: 16px; margin-bottom: 16px; }
  .page-head { margin-bottom: 16px; }
  .page-head .actions, .page-head > .btn { width: 100%; }
  .page-head .actions .btn, .page-head > .btn { flex: 1; }
  .searchbar input { min-width: 0; }

  .customer-row { grid-template-columns: 1fr; padding: 14px 16px; gap: 2px; }
  .customer-surveys { text-align: left; }

  /* Assistent: Schrittliste aufklappbar, Navigation unten */
  .has-wizard main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .wizard { grid-template-columns: 1fr; gap: 16px; }
  .wizard-nav { position: static; }
  .wizard-steps { padding: 14px 10px 10px; }
  .wizard-steps > summary { cursor: pointer; padding: 0 8px 4px; position: relative; padding-right: 36px; }
  .wizard-steps > summary::after { content: ""; position: absolute; right: 12px; top: 6px; width: 9px; height: 9px;
    border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .15s; }
  .wizard-steps[open] > summary::after { transform: rotate(-135deg); top: 10px; }
  .wizard-title { margin-bottom: 8px; }
  .wizard-steps ol { margin-top: 10px; }
  .wizard-steps li a { padding: 11px 10px; font-size: 1rem; }

  .step-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    background: var(--slate); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -6px 18px rgba(0, 16, 46, .18); }
  .step-bar-progress { position: absolute; left: 0; top: 0; height: 3px; background: var(--blue-wing); }
  .step-bar-btn, .step-bar-mid { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 60px; color: #fff; font-weight: 500; font-size: 1rem; }
  .step-bar-btn:hover, .step-bar-mid:hover { text-decoration: none; }
  .step-bar-btn:first-of-type { justify-content: flex-start; padding-left: 16px; }
  .step-bar-next { justify-content: flex-end; padding-right: 16px; }
  .step-bar-mid { color: #c9d1dc; font-weight: 400; font-size: .92rem; padding: 0 10px; }
  .chev { width: 9px; height: 9px; border: solid currentColor; border-width: 0 2px 2px 0; display: inline-block; }
  .chev-left { transform: rotate(135deg); }
  .chev-right { transform: rotate(-45deg); }

  .device { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 14px 12px; }
  .device-side { justify-content: space-between; flex-wrap: wrap; }
  .device-actions { gap: 2px; }
  .add-device > summary { padding: 16px; }
  .add-device form { padding: 18px 16px; }
  .form-actions { flex-direction: column-reverse; align-items: stretch; }
  .form-actions .btn, .btn-wide { width: 100%; }
  .step-footer { padding: 16px; }
  .step-footer-actions { width: 100%; flex-direction: column-reverse; }
  .step-footer-actions form, .step-footer-actions .btn, .step-footer-actions form .btn { width: 100%; }
  .export-box { align-items: stretch; width: 100%; }
  .export-buttons .btn { flex: 1; }
  .kpi { padding: 12px 14px 14px; }
  .kpi-value { font-size: 1.7rem; }
  .cat-bar-row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 40px; }
  .value-layout { grid-template-columns: 1fr; gap: 16px; }
  .value-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr) 92px; }
  .value-amount { font-size: 1.7rem; }
  .device-table .col-value { text-align: left; }
  .per-piece { display: inline; margin-left: 6px; }

  /* Tabellen werden zu Karten */
  .table.responsive thead { display: none; }
  .table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
  .table.responsive tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table.responsive tbody tr:last-child { border-bottom: 0; }
  .table-sheet .table.responsive td:first-child { padding-left: 0; }
  .table.responsive td { border: 0; padding: 3px 0; display: grid; grid-template-columns: 120px 1fr; gap: 10px; }
  .table.responsive td::before { content: attr(data-label); color: var(--muted); font-size: .85rem; }
  .table.responsive td:first-child { grid-template-columns: 1fr; font-size: 1.02rem; }
  .table.responsive td:first-child::before { display: none; }
  .table-sheet .section-head { padding: 18px 16px 6px; }
  .device-table { table-layout: auto; }
  .row-menu-body { position: static; width: 100%; box-shadow: none; margin-top: 8px; }

  .setup-steps > li { padding-left: 46px; }
  .codes { font-size: 1.05rem; }
}

@media (max-width: 420px) {
  .brand-logo { height: 27px; }
  .menu-label { display: none; }
  .menu-toggle { padding: 0 12px; }
  .kpis { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

@media print {
  .topbar, .wizard-nav, .export-box, .manage, .btn, .step-footer, .step-bar, .add-device { display: none !important; }
  .wizard { display: block; }
  body { background: #fff; }
  .sheet, .kpi { box-shadow: none; }
}
