/*
  Werkstatt Windisch – Oberfläche
  Gestaltung nach den Regeln von „unslop“ von Damir Sokolovsky (@heydamir),
  https://github.com/heydamir/unslop, CC BY 4.0.

  Richtung
  - Produkt: Rechnungs- und Kundenprogramm einer freien Kfz-Werkstatt
  - Charakter: werkstattnah, genau, unaufgeregt
  - Welt: Werkstatthalle mit Kennzeichen, Prüfplakette und Auftragsschein
  - Momente: Kennzeichen-Schilder, HU-Plaketten, das Umsatzdiagramm
  - Signatur: das Kennzeichen als echtes Nummernschild
  Graue Flächen für langes Arbeiten, ein Akzent: das Rot aus dem Windisch-Briefpapier.
*/

@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-latin-400-normal.77bc02670657.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-sans-latin-500-normal.f7016cd446d2.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-sans-latin-600-normal.196e3cbc5fee.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-latin-ext-400-normal.1bc0d8e41d21.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-sans-latin-ext-500-normal.93a0df997e00.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-sans-latin-ext-600-normal.8fccbdf5bf67.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-latin-400-normal.79936b18df9f.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-mono-latin-500-normal.b1c8a895f5fd.woff2") format("woff2"); }

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --raised: #f4f4f5;
  --raised-2: #ececee;
  --text: #171717;
  --text-2: #525252;
  --muted: #737373;
  --line: rgb(23 23 23 / 0.08);
  --line-strong: rgb(23 23 23 / 0.16);

  --brand: #e8432b;          /* Rot aus dem Briefpapier, nur für Flächen ohne Text */
  --accent: #d93a22;         /* Fläche mit weißem Text, Kontrast 4,6:1 */
  --accent-ink: #b92d17;     /* Akzent als Schrift auf hellem Grund */
  --accent-soft: rgb(217 58 34 / 0.08);

  --positive: #16a34a;
  --negative: #c42b1c;
  --warning: #a16207;

  --font: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --r-control: 8px;
  --r-card: 12px;
  --r-small: 6px;

  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.05);
  --shadow-float: 0 8px 24px rgb(0 0 0 / 0.06);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/20px var(--font);
  font-feature-settings: "tnum" 0;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-ink); }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.icon { width: 16px; height: 16px; flex: none; stroke-width: 1.5; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 12px; line-height: 16px; }
.muted { color: var(--muted); }
.secondary { color: var(--text-2); }
.nowrap { white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- App-Rahmen ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 24px;
  padding: 20px 12px 16px;
  background: var(--raised);
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand-mark { width: 4px; height: 24px; border-radius: 2px; background: var(--brand); }
.brand-name { font-size: 17px; line-height: 1; font-weight: 600; letter-spacing: 0.01em; }
.brand-sub { display: block; margin-top: 4px; font-size: 12px; line-height: 1; color: var(--muted); font-weight: 400; }

.search { position: relative; }
.search .icon { position: absolute; left: 10px; top: 10px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 36px; padding: 0 36px 0 32px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-control);
}
.search input::placeholder { color: var(--muted); }
.search .keycap { position: absolute; right: 8px; top: 8px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { padding: 0 8px; margin: 0 0 8px; font-size: 12px; line-height: 16px; color: var(--muted); }
.nav-group + .nav-group { margin-top: 24px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 8px; border-radius: var(--r-control);
  color: var(--text-2); font-weight: 500;
  transition: background-color 140ms var(--ease), color 140ms var(--ease);
}
.nav a .icon { color: var(--muted); }
.nav a:hover { background: var(--raised-2); color: var(--text); }
.nav a.is-active { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-sm); }
.nav a.is-active .icon { color: var(--accent-ink); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.sidebar-user { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-body { display: contents; }  /* Desktop: Inhalt gehört direkt zur Seitenleiste; Handy: aufklappbares Menü */
.nav-toggle { display: none; }
.nav-toggle .when-open { display: none; }
.nav-toggle[aria-expanded="true"] .when-open { display: inline-flex; }
.nav-toggle[aria-expanded="true"] .when-closed { display: none; }
.view-switch summary { display: flex; align-items: center; gap: 6px; min-height: 28px; font-size: 12px; color: var(--muted); cursor: pointer; list-style: none; border-radius: var(--r-small); }
.view-switch summary::-webkit-details-marker { display: none; }
.view-switch summary:hover { color: var(--text); }
.view-switch summary .icon { width: 14px; height: 14px; }
.view-switch-chevron { margin-left: auto; display: inline-flex; transition: transform 120ms var(--ease); }
.view-switch[open] .view-switch-chevron { transform: rotate(90deg); }
.view-switch form { margin-top: 6px; }
.view-switch .segmented { display: flex; flex-wrap: nowrap; }
.view-switch .segmented button { flex: 1 1 0; justify-content: center; }
.segmented-sm button { height: 26px; padding: 0 6px; gap: 4px; font-size: 12px; }
.segmented-sm .icon { width: 14px; height: 14px; }
.only-sm { display: none; }
.sidebar-foot .user { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { min-width: 0; }
.page { max-width: 1440px; padding: 24px 32px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; min-height: 56px; margin-bottom: 24px; }
.page-head h1 { font-size: 28px; line-height: 32px; font-weight: 500; }
.page-head .sub { margin-top: 4px; color: var(--text-2); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.crumb:hover { color: var(--text); }

.demo-banner { padding: 8px 32px; font-size: 13px; color: var(--warning); background: rgb(161 98 7 / 0.08); border-bottom: 1px solid rgb(161 98 7 / 0.18); }

/* ---------- Buttons und Formulare ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 16px; border-radius: var(--r-control);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background-color 140ms var(--ease), border-color 140ms var(--ease), transform 120ms var(--ease);
}
.btn:hover { background: var(--raised); color: var(--text); }
.btn:active { transform: scale(0.98); }
.btn .icon { color: var(--text-2); }
.btn-primary { background: var(--text); border-color: var(--text); color: #fff; }
.btn-primary .icon { color: #fff; }
.btn-primary:hover { background: #2b2b2b; color: #fff; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-ink); color: #fff; }
.btn-quiet { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-quiet:hover { background: var(--raised); }
.btn-danger { color: var(--negative); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.keycap {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 4px;
  font: 500 11px/1 var(--mono); color: var(--text-2);
  background: var(--raised); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px;
}

.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px 20px; }
.field { display: flex; flex-direction: column; gap: 6px; grid-column: span 6; }
.field.span-12 { grid-column: span 12; }
.field.span-8 { grid-column: span 8; }
.field.span-4 { grid-column: span 4; }
.field.span-3 { grid-column: span 3; }
.field.span-2 { grid-column: span 2; }
.field label { font-size: 13px; color: var(--text-2); }
.field .help { font-size: 12px; line-height: 16px; color: var(--muted); }
.field .error, .errorlist { margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--negative); }
.input, .field input[type="text"], .field input[type="email"], .field input[type="number"], .field input[type="date"], .field input[type="password"],
.field input[type="search"], .field input[type="file"], .field select, .field textarea, select.input {
  width: 100%; min-height: 36px; padding: 7px 10px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-control);
  transition: border-color 140ms var(--ease);
}
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--text-2); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.field.has-error input, .field.has-error select { border-color: var(--negative); }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--text); }
.check input { margin-top: 3px; accent-color: var(--text); }
.form-actions { display: flex; gap: 8px; margin-top: 24px; }
.form-section { margin-top: 32px; }
.form-section:first-child { margin-top: 0; }
.form-section h2 { margin-bottom: 16px; font-size: 16px; line-height: 24px; font-weight: 500; }

/* ---------- Flächen ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 16px; line-height: 24px; font-weight: 500; }
.card-head .meta { font-size: 13px; color: var(--muted); }
.stack-24 > * + * { margin-top: 24px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.grid-equal { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .input { width: auto; min-width: 280px; }
.toolbar .grow { flex: 1; }
.segmented { display: inline-flex; padding: 2px; gap: 2px; background: var(--raised); border-radius: var(--r-control); border: 1px solid var(--line); }
.segmented a, .segmented button { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border: 0; border-radius: var(--r-small); background: transparent; color: var(--text-2); font-size: 13px; font-weight: 500; cursor: pointer; }
.segmented .is-active { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-sm); }

/* ---------- Tabellen ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { height: 36px; padding: 0 12px; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--muted); text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { height: 44px; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 24px; }
.table th:last-child, .table td:last-child { padding-right: 24px; }
.table .num { text-align: right; }
.table tbody tr { position: relative; transition: background-color 120ms var(--ease); }
.table tbody tr:hover { background: var(--raised); }
/* Ganze Zeile klickbar per app.js (kein ::after-Overlay: Safari ignoriert position: relative auf <tr>,
   das Overlay würde sonst die ganze Seite samt Seitenleiste überdecken) */
.table tbody tr:has(.row-link) { cursor: pointer; }
.table .row-link { font-weight: 500; }
.table .row-link:hover { color: inherit; }
.table .row-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.table td .sub { display: block; font-size: 13px; color: var(--muted); }
.table-compact td { height: 36px; padding-top: 4px; padding-bottom: 4px; }
.table .is-inactive td { color: var(--muted); }

.empty { padding: 48px 24px; text-align: center; color: var(--text-2); }
.empty p + p { margin-top: 8px; }
.empty .btn { margin-top: 16px; }

.pagination { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.pagination .pages { display: flex; gap: 4px; }

/* ---------- Kennzeichen (Signatur) ---------- */
.plate {
  display: inline-flex; align-items: stretch; height: 22px; overflow: hidden;
  background: #fff; border: 1.5px solid #1a1a1a; border-radius: 4px;
  font: 500 12.5px/19px var(--mono); letter-spacing: 0.04em; color: #111; white-space: nowrap;
  vertical-align: middle;
}
.plate-eu { width: 11px; background: #003399; color: #fff; font: 500 7px/1 var(--font); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 3px; letter-spacing: 0; }
.plate-text { padding: 0 6px 0 5px; }
.plate--lg { height: 32px; border-width: 2px; border-radius: 5px; font-size: 18px; line-height: 28px; }
.plate--lg .plate-eu { width: 15px; font-size: 9px; padding-bottom: 4px; }
.plate--lg .plate-text { padding: 0 10px 0 8px; }
.plates { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- HU-Plakette ---------- */
.hu { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.hu-plaque {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  font: 600 9px/1 var(--mono); color: rgb(0 0 0 / 0.72);
  background: var(--hu); box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.12), inset 0 -2px 0 rgb(0 0 0 / 0.08);
}
.hu--orange { --hu: #f08a24; }
.hu--blue { --hu: #3a7bd5; }
.hu--blue .hu-plaque, .hu--brown .hu-plaque { color: rgb(255 255 255 / 0.92); }
.hu--yellow { --hu: #f2cf3a; }
.hu--brown { --hu: #8a5a3c; }
.hu--pink { --hu: #f0a3c4; }
.hu--green { --hu: #57b26a; }
.hu-state { font-size: 12px; line-height: 16px; }
.hu-state--overdue .hu-state { color: var(--negative); }
.hu-state--soon .hu-state { color: var(--warning); }

/* ---------- Kennzahlen und Diagramm ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { padding: 16px 20px; }
.stat .label { font-size: 13px; color: var(--text-2); }
.stat .figure { margin-top: 8px; font-size: 28px; line-height: 32px; font-weight: 500; font-variant-numeric: tabular-nums; }
.stat .figure.is-key { color: var(--accent-ink); }
.stat .change { margin-top: 6px; font-size: 13px; color: var(--muted); }
.stat .change .up { color: var(--positive); }
.stat .change .down { color: var(--negative); }

.chart { width: 100%; height: auto; display: block; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-label { font: 400 11px var(--mono); fill: var(--muted); }
.chart .bar { fill: #d4d4d8; }
.chart .bar.is-current { fill: var(--brand); }
.chart .value-label { font: 500 11px var(--mono); fill: var(--text-2); }

.share { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.share svg { width: 72px; height: 6px; }
.share .track { fill: var(--raised-2); }
.share .fill { fill: var(--text-2); }

/* ---------- Detailansichten ---------- */
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 24px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 4px; font-size: 12px; line-height: 16px; color: var(--text-2); background: var(--raised); border: 1px solid var(--line); }
.tag-warn { color: var(--warning); background: rgb(161 98 7 / 0.06); border-color: rgb(161 98 7 / 0.18); }

.messages { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.messages li { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: var(--r-control); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.messages .success .icon { color: var(--positive); }
.messages .error .icon, .messages .warning .icon { color: var(--negative); }

/* ---------- Import ---------- */
.steps { display: flex; gap: 24px; margin-bottom: 24px; font-size: 13px; color: var(--muted); }
.steps .is-done { color: var(--text-2); }
.steps .is-current { color: var(--text); font-weight: 500; }
.steps span { display: inline-flex; align-items: center; gap: 8px; }
.steps b { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--raised); border: 1px solid var(--line-strong); font: 500 11px/1 var(--mono); color: var(--text-2); }
.steps .is-current b { background: var(--text); border-color: var(--text); color: #fff; }
.mapping td { height: 52px; }
.mapping select { min-width: 220px; }
.sample { display: block; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 12px/16px var(--mono); color: var(--muted); }
.required-mark { color: var(--accent-ink); }
.counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.issue-list { margin: 0; padding: 0; list-style: none; }
.issue-list li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 8px 24px; border-bottom: 1px solid var(--line); font-size: 13px; }
.issue-list li:last-child { border-bottom: 0; }
.issue-list .row-no { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.issue-list .warn { color: var(--warning); }
.issue-list .err { color: var(--negative); }

/* ---------- Anmeldung ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--raised); }
.login .card { width: 100%; max-width: 380px; padding: 32px; }
.login .brand { padding: 0; margin-bottom: 24px; }
.login h1 { margin-bottom: 20px; font-size: 20px; line-height: 28px; font-weight: 500; }
.login .field { grid-column: auto; margin-bottom: 16px; }
.login .btn { width: 100%; margin-top: 8px; }

@media (max-width: 1100px) {
  .grid-2, .grid-equal { grid-template-columns: 1fr; }
  .stats, .counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .app { grid-template-columns: 216px minmax(0, 1fr); }
  .page { padding: 24px 24px 64px; }
  .table .hide-md { display: none; }
}
/* Handy-Regeln: mobile.css (wird je nach gewählter Ansicht geladen) */

/* Hilfsklassen (keine Inline-Styles wegen Content Security Policy) */
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.stat-flush { padding: 16px 0 0; }
.card-title { font-size: 16px; line-height: 24px; font-weight: 500; }
.group-row td { height: 36px; padding-top: 16px; font-size: 13px; font-weight: 500; color: var(--text-2); background: var(--bg); }
.mb-16 { margin-bottom: 16px; }
.segmented { flex-wrap: wrap; }
.segmented a, .segmented button { white-space: nowrap; }
.chart .axis-label { font-size: 12px; }
.segmented a, .segmented button { gap: 6px; }
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.check-list li { display: flex; gap: 8px; align-items: flex-start; color: var(--text-2); }
.check-list .icon { margin-top: 2px; color: var(--warning); }
.figure .down { color: var(--negative); }

/* ---------- Rechnungseditor ---------- */
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.editor-side { position: sticky; top: 24px; }
.head-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.head-customer { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.head-customer .label { width: 100%; margin-bottom: 0; }
.head-customer .label { font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.head-name { display: block; font-size: 16px; line-height: 24px; font-weight: 500; margin-bottom: 4px; }
.head-fields { gap: 12px 16px; }
.btn-block { width: 100%; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 0; border-radius: var(--r-small); background: transparent; color: var(--muted); cursor: pointer; transition: background-color 120ms var(--ease), color 120ms var(--ease); }
.btn-icon:hover { background: var(--raised-2); color: var(--negative); }
.tag-ok { color: var(--positive); background: rgb(22 163 74 / 0.06); border-color: rgb(22 163 74 / 0.18); }
.input-lg { min-height: 44px; font-size: 16px; min-width: 420px; }
.row-actions { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

.lines-table th, .lines-table td { padding-left: 4px; padding-right: 4px; }
.lines-table td { height: auto; padding-top: 6px; padding-bottom: 6px; vertical-align: top; }
.lines-table th:first-child, .lines-table td:first-child { padding-left: 12px; }
.lines-table th:last-child, .lines-table td:last-child { padding-right: 12px; }
.lines-table tbody tr:hover { background: transparent; }
.lines-table .col-drag { width: 24px; }
.lines-table .col-pos { width: 32px; padding-top: 14px; }
.lines-table .col-no { width: 88px; }
.lines-table .col-name { min-width: 200px; }
.lines-table .col-qty { width: 64px; }
.lines-table .col-unit { width: 76px; }
.lines-table .col-price { width: 100px; }
.lines-table .col-disc { width: 60px; }
.lines-table .col-net { width: 88px; padding-top: 14px; font-weight: 500; }
.lines-table .col-del { width: 36px; padding-top: 8px; }
.lines-table .line--heading td, .lines-table .line--text td { padding-top: 10px; }
.drag-handle { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 32px; margin-top: 2px; color: var(--muted); cursor: grab; border-radius: 4px; }
.drag-handle:hover { color: var(--text); background: var(--raised); }
.line.is-dragging { opacity: 0.4; }
.line.drop-before td { box-shadow: inset 0 2px 0 var(--accent); }
.line.drop-after td { box-shadow: inset 0 -2px 0 var(--accent); }

.cell { width: 100%; height: 32px; padding: 5px 8px; border: 1px solid transparent; border-radius: var(--r-small); background: transparent; transition: border-color 120ms var(--ease), background-color 120ms var(--ease); }
.cell:hover { border-color: var(--line-strong); background: var(--surface); }
.cell:focus { outline: none; border-color: var(--text-2); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.cell.num { text-align: right; font-variant-numeric: tabular-nums; }
select.cell { padding-right: 4px; }
.cell-strong { font-weight: 500; }
.cell-sub { height: 26px; margin-top: 2px; font-size: 13px; color: var(--text-2); }
.cell-sub::placeholder, .cell::placeholder { color: rgb(115 115 115 / 0.6); }
.cell-level { height: 24px; margin-top: 2px; padding: 0 4px; font-size: 12px; color: var(--muted); }
.cell-heading { font-weight: 600; }
.cell-note { color: var(--text-2); }
.cell.is-invalid { border-color: var(--negative); background: rgb(196 43 28 / 0.04); }

.add-bar { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; padding: 12px 12px 4px; border-top: 1px solid var(--line); }
.quick-add { flex: 1 1 360px; }
.quick-search { position: relative; }
.quick-search > .icon { position: absolute; left: 10px; top: 10px; color: var(--muted); pointer-events: none; }
.quick-search input { width: 100%; height: 36px; padding: 0 12px 0 32px; border: 1px solid var(--line-strong); border-radius: var(--r-control); background: var(--surface); }
.quick-search input:focus { outline: none; border-color: var(--text-2); box-shadow: 0 0 0 3px var(--accent-soft); }
.quick-results { position: absolute; left: 0; right: 0; top: 40px; z-index: 20; }
.quick-list { list-style: none; margin: 0; padding: 4px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-control); box-shadow: var(--shadow-float); max-height: 320px; overflow-y: auto; }
.quick-item { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--r-small); background: transparent; text-align: left; cursor: pointer; }
.quick-item:hover, .quick-item:focus-visible { background: var(--raised); outline: none; }
.quick-item.is-inactive { color: var(--muted); }
.quick-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-empty { margin: 0; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-control); color: var(--muted); box-shadow: var(--shadow-float); }
.add-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.quick-notice { margin: 0; padding: 4px 12px 12px; font-size: 13px; color: var(--warning); min-height: 8px; }

.totals-list { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; margin: 0; }
.totals-list dt { color: var(--text-2); }
.totals-list dd { margin: 0; }
.totals-list .totals-grand { padding-top: 8px; border-top: 1px solid var(--line); font-size: 18px; line-height: 24px; font-weight: 500; color: var(--text); }
.file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.file-list li { display: flex; justify-content: space-between; gap: 12px; }
.file-list a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }

@media (max-width: 1100px) {
  .editor-grid { grid-template-columns: 1fr; }
  .editor-side { position: static; }
  .head-grid { grid-template-columns: 1fr; }
}

.table-scroll { overflow-x: auto; }
.table-scroll .lines-table { min-width: 760px; }
.field.span-1 { grid-column: span 1; }
.field.span-5 { grid-column: span 5; }
.field.span-7 { grid-column: span 7; }
.field.span-9 { grid-column: span 9; }
.field.span-10 { grid-column: span 10; }
.field.span-11 { grid-column: span 11; }

.sidebar-foot .user { display: flex; flex-direction: column; min-width: 0; }
.user-role { font-size: 12px; line-height: 16px; color: var(--muted); }
.form-narrow { max-width: 760px; }
.role-choice { border: 0; margin: 0; padding: 0; gap: 8px; }
.role-choice legend { font-size: 13px; color: var(--text-2); margin-bottom: 6px; padding: 0; }
.row-action { position: relative; z-index: 1; }


/* ---------- E-Mail ---------- */
.tag-bad { color: var(--negative); background: rgb(196 43 28 / 0.06); border-color: rgb(196 43 28 / 0.18); }
.notice-warn { border-color: rgb(161 98 7 / 0.30); }
.notice-warn .icon { color: var(--warning); vertical-align: -2px; }
.card-title .icon { margin-right: 8px; vertical-align: -2px; }
.result-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.result-list li { display: flex; gap: 10px; align-items: flex-start; }
.result-list .icon { flex: none; margin-top: 2px; }
.result-list .is-ok .icon { color: var(--positive); }
.result-list .is-bad .icon { color: var(--negative); }
.result-list strong { font-weight: 600; margin-right: 6px; }
.check-list-plain .icon { color: var(--muted); }
.mail-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.mail-list li { display: flex; flex-direction: column; gap: 4px; }
.mail-list .mail-meta { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.mail-list .mail-error { color: var(--negative); font-size: 13px; }
.mail-list .mail-actions { display: flex; gap: 8px; margin-top: 4px; }
.file-list .icon { margin-right: 6px; vertical-align: -2px; color: var(--muted); }
.btn[disabled] { opacity: 0.6; cursor: progress; }

.page-head h1 .mono { white-space: nowrap; }

/* ---------- Fahrzeugannahme ---------- */
.btn-lg { height: 44px; padding: 0 18px; font-size: 15px; }
.pick-list { list-style: none; margin: 0; padding: 0; }
.pick-list li + li { border-top: 1px solid var(--line); }
.pick-list a { display: flex; align-items: center; gap: 14px; padding: 12px 20px; color: var(--text); text-decoration: none; min-height: 56px; }
.pick-list a:hover { background: var(--raised); }
.pick-list .pick-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pick-list .icon:last-child { color: var(--muted); }
.upload-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.upload-row select { width: auto; min-width: 140px; height: 44px; }
.upload-button { cursor: pointer; }
.upload-button:focus-within { outline: 2px solid var(--accent, #d93a22); outline-offset: 2px; }
.upload-busy { margin-top: 10px; }
.photo-grid { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.photo-card { display: flex; flex-direction: column; gap: 8px; }
.photo-card img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-control); border: 1px solid var(--line); background: var(--raised); display: block; }
.photo-meta { display: flex; flex-direction: column; gap: 6px; }
.input-sm { height: 32px; font-size: 13px; padding: 0 8px; }
.photo-caption { margin: 0; font-size: 13px; color: var(--text-2); }


/* ---------- Erinnerungen ---------- */
.check-row { border: 0; margin: 0; padding: 0; display: flex; gap: 16px; flex-wrap: wrap; }
.mini-title { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0; }
.toolbar .segmented + .segmented { margin-left: 8px; }
body.public { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 64px 16px; background: var(--bg, #f6f6f5); }
.public-card { width: 100%; max-width: 480px; }
.public-card h1 { font-size: 22px; line-height: 28px; margin: 8px 0 8px; }
.public-brand { margin: 0; font-size: 13px; color: var(--muted); }

/* ---------- Offene Posten ---------- */
.grid-wide-left { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .grid-wide-left { grid-template-columns: 1fr; } }
.text-neg { color: var(--negative); }
.text-pos { color: var(--positive); }
.text-warn { color: var(--warning); }
.cell-wrap { white-space: normal; max-width: 360px; }
details > summary { cursor: pointer; }

/* ---------- Sicherheit ---------- */
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 16px; }
.steps li { padding-left: 4px; }
.qr { display: block; width: fit-content; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-control); }
.qr svg { display: block; }
.form-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.code-input { width: 140px; font-family: var(--mono); font-size: 18px; letter-spacing: 0.15em; text-align: center; }
.code-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; font-size: 16px; }
.device-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; }
.device-row + .device-row { border-top: 1px solid var(--line); }
.mb-16 { margin-bottom: 16px; }

/* ---------- Vorlagen ---------- */
.template-lines input[type="text"], .template-lines select { width: 100%; height: 32px; padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: var(--r-small); background: var(--surface); font: inherit; }
.template-lines td { vertical-align: top; }
.template-lines td input + input { margin-top: 4px; font-size: 13px; }
.template-lines .num input { text-align: right; }
.template-lines td:nth-child(1) select { min-width: 110px; }
.template-lines td:nth-child(4) { min-width: 220px; }
.template-bar { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; padding: 8px 12px 12px; border-top: 1px dashed var(--line); }
.template-bar form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.template-bar select, .template-bar input { height: 32px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: var(--r-small); background: var(--surface); font: inherit; }
.template-bar .label { font-size: 13px; color: var(--muted); }
