/* Kundenportal Wäschereitechnik Kleine
   Farben aus dem Firmenlogo: Wasserblau und Blattgrün. Grün steht immer für Einsparung. */
:root {
  --bg: #eef3f6; --surface: #ffffff; --surface-2: #f6f9fb; --fg: #13212c; --muted: #5a6b79; --line: #d9e2e9;
  --brand: #1670c4; --brand-soft: #e3eefa; --green: #5f9e1f; --green-soft: #ebf5df;
  --ok: #2f8f4e; --warn: #b7791f; --warn-soft: #fbf1dd; --crit: #c2412d; --crit-soft: #fbe6e2; --off: #7b8794; --off-soft: #eceff2;
  --f-display: "Barlow", "Arial Narrow", Arial, sans-serif;
  --f-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --r: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d151b; --surface: #15202a; --surface-2: #1a2733; --fg: #e5edf3; --muted: #93a4b2; --line: #263643;
    --brand: #5aa7ee; --brand-soft: #18314a; --green: #8cc94e; --green-soft: #1f3317;
    --ok: #5cc27b; --warn: #e2a948; --warn-soft: #3a2d14; --crit: #ef7a66; --crit-soft: #3d1d18; --off: #8f9ba6; --off-soft: #222e38;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font-family: var(--f-body); font-size: 15px; line-height: 1.5; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; line-height: 1.15; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap { max-width: 1180px; margin: 0 auto; }

.logo { display: flex; align-items: center; gap: 10px; }
.logo svg { flex: none; }
.logo b { font-family: var(--f-display); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: 15px; display: block; line-height: 1.1; }
.logo span { font-size: 12px; color: var(--muted); display: block; }

#login { min-height: 100vh; display: grid; place-items: center; padding-block: 48px; }
.login-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; display: grid; gap: 18px; }
.login-card h1 { font-size: 26px; }
.login-card p { margin: 0; color: var(--muted); }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; }
.field input, .field select { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--fg); width: 100%; }
.btn { border: 0; border-radius: 8px; padding: 11px 16px; font-weight: 600; background: var(--brand); color: #fff; }
.btn[disabled] { opacity: .6; cursor: wait; }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); padding: 7px 12px; font-weight: 500; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.note { font-size: 13px; color: var(--muted); background: var(--surface-2); border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px; }
.err { font-size: 14px; color: var(--crit); background: var(--crit-soft); border-radius: 8px; padding: 10px 12px; }
.okmsg { font-size: 14px; color: var(--ok); }

header.top { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; padding-block: 12px; flex-wrap: wrap; }
.who { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.who .cust { text-align: right; }
.who .cust b { display: block; font-size: 14px; }
.who .cust span { font-size: 12px; color: var(--muted); }
.who select { font: inherit; font-size: 14px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--fg); }
nav.tabs { display: flex; gap: 4px; overflow-x: auto; }
nav.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 12px; color: var(--muted); font-weight: 500; white-space: nowrap; }
nav.tabs button[aria-current="page"] { color: var(--fg); border-color: var(--brand); }
nav.tabs .count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 10px; background: var(--crit-soft); color: var(--crit); font-size: 12px; font-weight: 600; text-align: center; }
.demo-band { background: var(--warn-soft); font-size: 13px; }
.demo-band .wrap { padding-block: 7px; }

main { padding-block: 24px 48px; }
.stack { display: grid; gap: 24px; }
.stack > * { min-width: 0; } /* breite Tabellen scrollen in sich, nicht die ganze Seite */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-head h2 { font-size: 22px; }
.sub { color: var(--muted); font-size: 13px; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 6px; vertical-align: 1px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpis.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 4px; align-content: start; }
.kpi .lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.kpi .val { font-family: var(--f-display); font-size: 30px; font-weight: 600; line-height: 1.1; }
.kpi .val small { font-size: 16px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.kpi .hint { font-size: 13px; color: var(--muted); }
.kpi.save .val { color: var(--green); }
.kpi.bad .val { color: var(--crit); }
@media (max-width: 860px) { .kpis, .kpis.six { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 12px; }
.mcard { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 12px; color: var(--fg); position: relative; overflow: hidden; }
.mcard::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: transparent; }
.mcard.st-warn::before { background: var(--warn); }
.mcard.st-crit::before { background: var(--crit); }
.mcard:hover { border-color: var(--brand); }
.mcard .row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.mcard h3 { font-size: 19px; }
.mcard .main { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.mcard .big { font-family: var(--f-display); font-size: 30px; font-weight: 600; line-height: 1; color: var(--green); }
.mcard .big small { font-size: 15px; color: var(--muted); font-weight: 500; margin-left: 3px; }
.mcard .biglbl { font-size: 12px; color: var(--muted); margin-top: 4px; }
.mcard .foot { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; flex-wrap: wrap; }
.spark { width: 130px; height: 40px; flex: none; }
.spark rect { fill: var(--green); }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.pill.warn { color: var(--warn); background: var(--warn-soft); }
.pill.crit { color: var(--crit); background: var(--crit-soft); }
.pill.off { color: var(--off); background: var(--off-soft); }

.back { background: none; border: 0; color: var(--brand); padding: 0; font-weight: 600; }
.detail-head h2 { font-size: 28px; margin-top: 4px; }
.meta { color: var(--muted); font-size: 14px; display: flex; gap: 8px 14px; flex-wrap: wrap; margin-top: 6px; align-items: center; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.panel h3 { font-size: 17px; margin-bottom: 2px; }
.panel .sub { margin: 0 0 10px; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 860px) { .two { grid-template-columns: minmax(0, 1fr); } }
.chart { width: 100%; height: auto; display: block; }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart text { fill: var(--muted); font-family: var(--f-body); font-size: 11px; }
.chart .b-v { fill: var(--brand); }
.chart .b-e { fill: var(--green); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 12px; height: 12px; vertical-align: -2px; margin-right: 6px; border-radius: 3px; }
.legend i.v { background: var(--brand); }
.legend i.e { background: var(--green); }
.mono { font-family: var(--f-mono); font-size: 12.5px; }
.topics { font-family: var(--f-mono); font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; white-space: pre; line-height: 1.7; }

.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.r, th.r { text-align: right; white-space: nowrap; }
td.g { color: var(--green); font-weight: 600; }
tr.sum td { font-weight: 600; border-top: 2px solid var(--line); }
.empty { color: var(--muted); padding: 12px 0; margin: 0; }
.laden { color: var(--muted); padding: 32px 0; }
.foot-note { font-size: 12px; color: var(--muted); margin: 0; }
form.pw { display: grid; gap: 12px; max-width: 360px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.vform { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); align-items: end; }
.vform h3 { grid-column: 1 / -1; }
.vform .wide, .vform .actions { grid-column: 1 / -1; }
.vform .field { gap: 4px; }
.lbl-like { font-size: 13px; font-weight: 600; }
td select { font: inherit; font-size: 14px; padding: 5px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); color: var(--fg); max-width: 260px; }
.pwbox { border-style: solid; border-color: var(--green); background: var(--green-soft); color: var(--fg); font-size: 14px; line-height: 1.8; }
.pwbox .sel { font-size: 16px; user-select: all; background: var(--surface); padding: 2px 6px; border-radius: 4px; }
.section-head h3 { margin: 0; }
.linkbtn { background: none; border: 0; color: var(--brand); padding: 0; font-weight: 500; justify-self: start; text-decoration: underline; text-underline-offset: 3px; }
.code-feld { font-family: var(--f-mono); font-size: 22px !important; letter-spacing: .18em; text-align: center; }
.qr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: start; }
.qr img { width: 180px; height: 180px; border-radius: 8px; background: #fff; padding: 6px; border: 1px solid var(--line); }
@media (max-width: 560px) { .qr { grid-template-columns: minmax(0, 1fr); } }
.schritte { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
.ersatz { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 6px 22px; font-family: var(--f-mono); font-size: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; user-select: all; }
.badge-ok { color: var(--ok); font-weight: 600; }

/* Häkchen in Formularen nicht auf volle Breite ziehen */
.field input[type="checkbox"] { width: auto; padding: 0; }
.check { justify-content: flex-start; }
.check input { flex: none; width: 18px; height: 18px; margin: 0; }
td.aktionen { white-space: nowrap; }
td.aktionen .btn { margin: 2px 0; }

/* Verwaltungs-Tabellen werden am Handy zu Karten: eine Karte je Zeile, Beschriftung vor jedem Wert */
@media (max-width: 700px) {
  table.karten, table.karten tbody, table.karten tr, table.karten td { display: block; width: 100%; }
  table.karten thead { display: none; }
  table.karten tr { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; background: var(--surface-2); }
  table.karten td { border: 0; padding: 4px 0; text-align: left; display: flex; gap: 10px; align-items: center; justify-content: space-between; min-width: 0; }
  table.karten td[data-label]::before { content: attr(data-label); font-size: 12px; color: var(--muted); font-weight: 600; flex: none; }
  table.karten td.titel { font-weight: 600; font-size: 16px; justify-content: flex-start; flex-wrap: wrap; }
  table.karten td.titel::before { display: none; }
  table.karten td.umbruch { word-break: break-all; }
  table.karten td.breit select { max-width: 62%; min-width: 0; flex: 1 1 auto; }
  table.karten td.aktionen { white-space: normal; display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 6px; padding-top: 8px; border-top: 1px solid var(--line); margin-top: 6px; }
  table.karten td.aktionen:empty { display: none; }
  .tbl-wrap:has(table.karten) { overflow: visible; }
}
