/* Tulz – Stylesheet
   Marke: Graphit-Seitenleiste, helle Arbeitsfläche, Signalorange für Bildmarke und Hauptaktionen, Schrift Barlow (selbst gehostet). */

@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/barlow-500.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/barlow-700.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 800; font-display: swap; src: url('../fonts/barlow-800.woff2') format('woff2'); }

:root {
  --bg: #f1f3f5;
  --surface: #ffffff;
  --surface-2: #f5f6f7;
  --line: #dde1e5;
  --text: #1c1f23;
  --muted: #5f666e;
  --sidebar: #1c1f23;
  --sidebar-text: #b8bec5;
  --sidebar-active: #2a2f36;
  --accent: #f26b1d;
  --accent-ink: #1c1f23;
  --accent-hover: #ff7f35;
  --accent-soft: #fff1e8;
  --focus: #1971c2;
  --green: #2f9e44;
  --blue: #1971c2;
  --red: #c92a2a;
  --amber: #a16207;
  --grey: #868e96;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(20, 24, 30, .06), 0 1px 6px rgba(20, 24, 30, .04);
  --sidebar-w: 240px;
  --topbar-h: 62px;                                  /* wird von app.js gemessen (Kopfzeile kann umbrechen) */
  --safe-t: env(safe-area-inset-top, 0px);           /* Aussparungen (Notch, Home-Balken) bei Startbildschirm-Apps */
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Barlow', system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
  overflow-wrap: break-word;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .75rem; font-weight: 700; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: .95rem; margin-top: 1.25rem; }
p { margin: 0 0 .75rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; background: var(--surface-2); padding: .05em .3em; border-radius: 4px; }
img { max-width: 100%; height: auto; }
.muted { color: var(--muted); }
.small { font-size: .85em; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-danger { color: var(--red); font-weight: 600; }
.text-warning { color: var(--amber); font-weight: 600; }
.inline { display: inline; }
.hint { display: block; color: var(--muted); font-size: .82rem; margin-top: .25rem; }
.list { padding-left: 1.2rem; margin: 0 0 1rem; }
.list li { margin-bottom: .3rem; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; min-height: 100dvh; }
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;                /* lange Navigation auch im Querformat erreichbar (Bereiche lassen sich zuklappen) */
  overscroll-behavior: contain;
  padding-top: var(--safe-t);
  padding-left: var(--safe-l);
  scrollbar-width: thin;
}
.brand { display: flex; align-items: center; gap: .7rem; padding: 1.05rem 1.1rem .9rem; color: #fff; text-decoration: none; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 36px; height: 36px; color: var(--accent); flex: none; display: block; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-weight: 800; font-size: 1.55rem; line-height: .95; letter-spacing: -.045em; }
.brand-company { font-size: .74rem; font-weight: 500; color: var(--sidebar-text); margin-top: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-lg { flex-direction: column; gap: .5rem; padding: .25rem 0 1.5rem; color: var(--text); text-align: center; }
.brand-lg .brand-mark { width: 60px; height: 60px; }
.brand-lg .brand-text { align-items: center; }
.brand-lg .brand-name { font-size: 2.3rem; }
.brand-lg .brand-company { color: var(--muted); font-size: .85rem; white-space: normal; }
.nav { display: flex; flex-direction: column; padding: .25rem .6rem; gap: 1px; }
.nav a {
  display: flex; align-items: center; gap: .7rem;
  padding: .5rem .75rem; border-radius: 6px;
  color: var(--sidebar-text); font-weight: 500; font-size: .95rem; line-height: 1.4;
}
.nav a:hover { background: var(--sidebar-active); color: #fff; text-decoration: none; }
.nav a.active { background: var(--sidebar-active); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav svg { width: 19px; height: 19px; flex: none; opacity: .9; }
/* Bereiche der Hauptnavigation (seit 2.25.2): Überschrift klappt den Bereich auf/zu; ist er zugeklappt, wandert der Zähler
   der enthaltenen Punkte auf die Überschrift. Kurze Menüs starten offen, lange zugeklappt (Bereich der aktuellen Seite offen). */
.nav-group { display: flex; flex-direction: column; gap: 1px; margin-top: .45rem; }
.nav-head {
  display: flex; align-items: center; gap: .4rem; width: 100%; margin: 0; padding: .3rem .75rem .25rem;
  background: none; border: 0; border-radius: 6px; cursor: pointer; text-align: left;
  color: #8a929b; font: inherit; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; line-height: 1.4;
}
.nav-head:hover { color: #fff; }
.nav-head-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-head .nav-head-count { display: none; letter-spacing: 0; text-transform: none; font-weight: 500; }
.nav-chevron { width: 14px; height: 14px; flex: none; opacity: .7; transition: transform .15s ease; }
.nav-list { display: flex; flex-direction: column; gap: 1px; }
.nav-group.is-collapsed .nav-list { display: none; }
.nav-group.is-collapsed .nav-chevron { transform: rotate(-90deg); }
.nav-group.is-collapsed .nav-head .nav-head-count { display: inline-block; }
.nav-foot { margin-top: auto; padding-top: .6rem; }
.nav-foot + .sidebar-user { margin-top: 0; }
.sidebar-user { margin-top: auto; padding: .9rem 1.1rem; border-top: 1px solid #333a44; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.user-link { display: flex; flex-direction: column; color: var(--sidebar-text); line-height: 1.3; min-width: 0; }
.user-link strong { color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-link span { font-size: .78rem; }
.user-link:hover, .user-link.active { text-decoration: none; color: #fff; }
.sidebar .btn-ghost { color: var(--sidebar-text); border-color: #3d444d; }
.sidebar .btn-ghost:hover { background: var(--sidebar-active); color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: calc(.75rem + var(--safe-t)) calc(1.5rem + var(--safe-r)) .75rem 1.5rem; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: clamp(1.05rem, .8rem + 1vw, 1.35rem); }
.topbar-search { display: flex; }
.topbar-search input { width: 260px; max-width: 40vw; }
.search-toggle { display: none; }
.menu-toggle { display: none; background: none; border: 0; padding: .3rem; color: var(--text); cursor: pointer; }
.menu-toggle svg { width: 26px; height: 26px; }
.content { padding: 1.5rem; max-width: 1280px; width: 100%; }
.sidebar-backdrop { display: none; }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; width: min(var(--sidebar-w), 85vw); transform: translateX(-100%); transition: transform .2s ease; z-index: 40; box-shadow: 0 0 30px rgba(0,0,0,.3); padding-bottom: var(--safe-b); }
  .sidebar.open { transform: none; }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 30; }
  .sidebar-backdrop[hidden] { display: none; }
  .menu-toggle { display: inline-flex; }
  .topbar { flex-wrap: wrap; gap: .6rem; padding: calc(.55rem + var(--safe-t)) calc(.9rem + var(--safe-r)) .55rem calc(.9rem + var(--safe-l)); }
  /* Suche hinter einem Lupen-Knopf; geöffnet als eigene Zeile über die volle Breite */
  .topbar-search { display: none; flex: 1 1 100%; order: 10; }
  .topbar.search-open .topbar-search { display: flex; }
  .topbar.search-open .topbar-search input { width: 100%; max-width: none; flex: 1; }
  .search-toggle { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); flex: none; }
  .search-toggle svg { width: 20px; height: 20px; }
  .topbar.search-open .search-toggle { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
  .content { padding: .9rem calc(.9rem + var(--safe-r)) calc(.9rem + var(--safe-b)) calc(.9rem + var(--safe-l)); }
}
/* Spalten ausblenden nur auf mittleren Breiten – unter 640 px werden Tabellen zu Karten und zeigen alles */
@media (min-width: 641px) and (max-width: 900px) { .hide-sm { display: none !important; } }
@media (min-width: 641px) and (max-width: 1100px) { .hide-md { display: none !important; } }
/* Tablet quer / kleine Monitore: Seitenleiste als schmale Symbolleiste (Beschriftung als Tooltip) */
@media (min-width: 901px) and (max-width: 1180px) {
  :root { --sidebar-w: 68px; }
  .brand { justify-content: center; padding: 1rem .5rem .75rem; }
  .brand-text, .nav a span:not(.count), .user-link span, .user-link strong { display: none; }
  .nav { padding: .25rem .45rem; }
  .nav a { justify-content: center; padding: .55rem 0; }
  .nav a.active { box-shadow: inset 3px 0 0 var(--accent); }
  .nav svg { width: 22px; height: 22px; }
  .nav a { position: relative; }
  .nav a .count { position: absolute; top: .25rem; right: .35rem; margin: 0; min-width: 1.2em; padding: 0 .25em; font-size: .62rem; line-height: 1.4; }  /* Zähler als kleine Marke am Symbol */
  .nav-head { display: none; }                          /* keine Überschriften, Bereiche immer offen, Trennlinie dazwischen */
  .nav-group { margin-top: .3rem; padding-top: .3rem; border-top: 1px solid #333a44; }
  .nav-group.is-collapsed .nav-list { display: flex; }
  .nav-foot { padding-top: .3rem; }
  .sidebar-user { flex-direction: column; padding: .6rem .3rem; gap: .45rem; }
  .user-link { align-items: center; }
  .user-link::before { content: attr(data-initials); display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--sidebar-active); color: #fff; font-weight: 700; font-size: .8rem; }
  .sidebar-user .btn { padding: .25rem .35rem; font-size: .7rem; min-height: 28px; }
}
@media (prefers-reduced-motion: reduce) { .sidebar, .nav-chevron { transition: none; } }

/* ---------- Panels & Grids ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; box-shadow: var(--shadow);
}
.panel > h2:first-child { margin-top: 0; }
.panel-danger { border-color: #f1b8b8; background: #fff8f8; }
.panel-wide { grid-column: 1 / -1; }
.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(460px, 1fr)); gap: 1.25rem; }   /* 460 px: Tablet eine Spalte, Notebook (1366/1440) zwei, ab ~1650 px drei – Datums- und Aktionsspalten bleiben sichtbar */
.panel-grid .panel { margin-bottom: 0; }
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; }
.detail-grid .panel { margin-bottom: 0; }
.panel-image { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.panel-image img { border-radius: 6px; max-height: 320px; object-fit: contain; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .9rem; margin-bottom: 1.25rem; }
.stat {
  display: flex; flex-direction: column; gap: .15rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .9rem 1rem; color: var(--text); box-shadow: var(--shadow);
  border-left: 5px solid var(--grey);
}
.stat:hover { text-decoration: none; border-color: var(--muted); }
.stat-available { border-left-color: var(--green); }
.stat-loaned { border-left-color: var(--blue); }
.stat-inspection { border-left-color: var(--amber); }
.stat-defect { border-left-color: var(--red); }
.stat-value { font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: .85rem; }
.stat-label b { color: var(--red); }
.quick-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.25rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .5rem .95rem; border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap; min-height: 40px;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #a61e1e; }
.btn-ghost { background: transparent; }
.btn-sm { padding: .3rem .65rem; min-height: 32px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Formulare ---------- */
input[type="text"], input[type="search"], input[type="password"], input[type="email"], input[type="number"],
input[type="date"], input[type="file"], select, textarea {
  width: 100%; padding: .5rem .65rem; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); color: var(--text); font: inherit; min-height: 40px;
}
textarea { min-height: auto; resize: vertical; }
select[size] { min-height: auto; padding: .25rem; }
select[size] option { padding: .35rem .5rem; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: 2px solid rgba(25, 113, 194, .25); outline-offset: 0; }
input[disabled], select[disabled] { background: var(--surface-2); color: var(--muted); }
.input-sm { width: 6rem; }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field > span { font-weight: 600; font-size: .88rem; }
.field-wide { grid-column: 1 / -1; }
.field-grow { flex: 1; }
.field .static { padding: .5rem 0; }
.field-error { color: var(--red); font-size: .85rem; margin: .1rem 0 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1.1rem; }
.form-grid-1 { grid-template-columns: 1fr; }
.form-stack { display: flex; flex-direction: column; gap: .9rem; }
.form-columns { display: grid; grid-template-columns: 3fr 2fr; gap: 1.25rem; align-items: start; }
.form-columns > *, .panel-grid > *, .detail-grid > *, .stat-grid > *, .form-grid > *, .field { min-width: 0; }
select, input, textarea { max-width: 100%; }   /* breiter Inhalt (Codeblock, lange Nummer) darf die Spalte nicht aufdrücken (seit 2.33.3) */
.dl dd { min-width: 0; overflow-wrap: anywhere; }   /* lange Nummern, Links, Seriennummern ohne Leerzeichen brechen um statt die Seite zu verbreitern */
pre.code { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: .6rem .75rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; line-height: 1.5; margin: 0 0 1rem; }
.form-columns-pick { grid-template-columns: 2fr 3fr; }
.form-side { display: flex; flex-direction: column; }
.form-narrow { max-width: 760px; }
.form-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: .25rem 0 1.25rem; }
.check { display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; }
.check input { width: 18px; height: 18px; min-height: 0; margin: 0; }
.check { max-width: 100%; align-items: flex-start; } .check input { flex: none; margin-top: .15rem; } .check > :not(input) { min-width: 0; }   /* lange Häkchen-Texte brechen um (seit 2.33.3) */
.check:has(> .small) { flex-wrap: wrap; row-gap: .1rem; } .check > .small { flex-basis: 100%; padding-left: calc(18px + .45rem); } .check:has(> .small) > :not(input):not(.small) { flex: 1 1 0; }   /* Erklärtext unter der Beschriftung */
.chosen-tool { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .7rem .9rem; background: var(--surface-2); border-radius: 6px; margin-bottom: .75rem; }
.tool-image-preview { max-height: 180px; border-radius: 6px; margin-bottom: .75rem; }
.return-form { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-top: .75rem; }
.return-form .field { min-width: 180px; }
.return-inline { display: inline-flex; gap: .35rem; align-items: center; }
.return-inline select { width: auto; min-height: 32px; padding: .2rem .4rem; font-size: .85rem; }
@media (max-width: 900px) {
  .form-grid, .form-columns { grid-template-columns: 1fr; }
  .form-narrow { max-width: none; }
}

/* ---------- Toolbar, Filter, Tabs ---------- */
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.filters input[type="search"] { width: 280px; max-width: 100%; }
.filters select { width: auto; max-width: 220px; }
.tabs { display: flex; gap: .25rem; border-bottom: 2px solid var(--line); }
.tabs a { padding: .55rem .9rem; margin-bottom: -2px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }
.count { display: inline-block; min-width: 1.5em; padding: 0 .4em; border-radius: 999px; background: var(--surface-2); font-size: .78rem; text-align: center; margin-left: .2rem; }
.count-danger { background: var(--red); color: #fff; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1rem; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .65rem .8rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table th { font-size: .82rem; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafbfc; }
.table-compact th, .table-compact td { padding: .45rem .6rem; }
.table-compact { font-size: .93rem; }
.table-compact td.nowrap, .table-compact td .inv { white-space: nowrap; }
.panel .table-compact { margin: 0 -.25rem; }
.panel .table-x { overflow-x: auto; margin: 0 -.25rem; -webkit-overflow-scrolling: touch; }   /* Übersichts-Tabellen scrollen seitlich statt abgeschnitten zu werden */
.panel .table-x .table-compact { margin: 0; }
.table th a.sort { color: inherit; }
.table th a.sort.active { color: var(--text); }
.col-check { width: 2rem; }
.col-check input { width: 18px; height: 18px; min-height: 0; margin: 0; }
.col-img { width: 52px; }
.col-img img, .img-placeholder { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; display: block; background: var(--surface-2); border: 1px solid var(--line); }
.img-placeholder-lg { width: 160px; height: 120px; margin: 1rem auto .5rem; }
.col-actions { width: 1%; white-space: nowrap; text-align: right; }
.col-actions .btn + .inline { margin-left: .35rem; }
.row-overdue td { background: #fff5f5; }
.row-inactive td { color: var(--muted); }
.table-edit input { min-height: 34px; padding: .3rem .5rem; }
/* Stammdaten-Listen (Kategorien, Standorte): Name-Spalte bekommt den freien Platz; Zahlenfelder, „Mon.“ und Knöpfe
   bleiben kompakt in einer Zeile. Ohne feste Breiten drückte die automatische Tabellenbreite das Namensfeld auf
   Minimalgröße zusammen (nur 2–3 Buchstaben sichtbar). Unter 640 px hebt der Karten-Modus die Regeln wieder auf. */
.table-edit td { vertical-align: middle; }
.table-edit td:first-child { width: 100%; }
.table-edit td:not(:first-child) { white-space: nowrap; }
.table-edit input[type="text"] { min-width: 11rem; }
.table-edit input.input-sm { width: 4.75rem; }
.table-perms th, .table-perms td { font-size: .85rem; }
.perm-yes { color: var(--green); font-size: 1.1em; }
.perm-no { color: var(--line); }

.inv { font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.table td .inv, .table td.col-actions { white-space: nowrap; }   /* Inventarnummern nicht am Bindestrich umbrechen; Tabelle scrollt lieber seitlich */
input.inv { font-weight: 600; }

.badge { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; color: #fff; background: var(--grey); }
.badge-available { background: var(--green); }
.badge-loaned { background: var(--blue); }
.badge-defect, .badge-danger { background: var(--red); }
.badge-inspection { background: var(--amber); }
.badge-retired, .badge-muted { background: var(--grey); }

.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; margin: 0 0 1.25rem; }
.pagination a, .pagination span { padding: .35rem .65rem; border-radius: 5px; border: 1px solid var(--line); background: var(--surface); }
.pagination a:hover { text-decoration: none; background: var(--surface-2); }
.pagination .current { background: var(--sidebar); color: #fff; border-color: var(--sidebar); }
.pagination .disabled, .pagination .dots { color: var(--muted); border-color: transparent; background: none; }
.pagination .total { margin-left: auto; border: 0; background: none; color: var(--muted); }

/* ---------- Detailseite ---------- */
.detail-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; }
.detail-status { display: flex; gap: .4rem; margin-bottom: .4rem; }
.detail-title { font-size: 1.4rem; margin: 0 0 .25rem; }
.detail-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.25rem; margin: 0; }
.dl dt { color: var(--muted); font-size: .88rem; padding-top: .05rem; }
.dl dd { margin: 0; }
.dl-inline { grid-template-columns: max-content 1fr max-content 1fr max-content 1fr; }
.notes { white-space: pre-line; }
.panel-loan { border-left: 5px solid var(--blue); }
.panel-loan.panel-danger { border-left-color: var(--red); }
.loan-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem 1.25rem; }
@media (max-width: 700px) { .dl-inline { grid-template-columns: max-content 1fr; } }

/* ---------- Sonstiges ---------- */
.flash { padding: .7rem 1rem; border-radius: 6px; margin-bottom: 1rem; border: 1px solid; font-weight: 500; }
.flash-success { background: #ebfbee; border-color: #b2f2bb; color: #2b8a3e; }
.flash-error { background: #fff5f5; border-color: #ffc9c9; color: #c92a2a; }
.flash-info { background: #e7f5ff; border-color: #a5d8ff; color: #1864ab; }
.empty-state { text-align: center; padding: 3rem 1rem; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-state h2 { margin-bottom: .4rem; }
.empty-state p { color: var(--muted); margin-bottom: 1rem; }
.activity { list-style: none; padding: 0; margin: 0; }
.activity li { display: grid; grid-template-columns: 8.5rem 9rem 12rem 1fr; gap: .75rem; padding: .4rem 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.activity li:last-child { border-bottom: 0; }
.activity-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.activity-user { font-weight: 600; }
.activity-details { color: var(--muted); }
@media (max-width: 700px) { .activity li { grid-template-columns: 1fr; gap: .1rem; } }

/* ---------- Login ---------- */
.auth-body { display: grid; place-items: center; min-height: 100vh; padding: 1rem; }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 2rem; box-shadow: 0 8px 30px rgba(20,24,30,.08); }
.auth-title { font-size: 1.25rem; margin-bottom: 1.25rem; }
.auth-check { margin: -.25rem 0 0; }
.auth-hint { margin: .1rem 0 .25rem; font-size: .82rem; color: var(--muted); }
.auth-sep { display: flex; align-items: center; gap: .75rem; margin: 1.15rem 0 .9rem; color: var(--muted); font-size: .85rem; }
.auth-sep::before, .auth-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.passkey-login { margin-top: .25rem; }
.btn-passkey { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.btn-passkey svg { width: 20px; height: 20px; flex: none; }
.passkey-note { margin: .75rem 0 0; font-size: .9rem; }
.passkey-note .passkey-detail { display: block; margin-top: .4rem; font-size: .8rem; opacity: .75; overflow-wrap: anywhere; }
.inline-edit { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.inline-edit input[type="text"] { min-height: 34px; padding: .3rem .5rem; min-width: 10rem; flex: 1 1 10rem; }
.inline-edit + .hint { display: block; margin-top: .2rem; }

/* ---------- Etiketten / Druck ---------- */
.print-body { background: var(--bg); color: var(--text); padding: 1rem calc(1rem + var(--safe-r)) calc(1rem + var(--safe-b)) calc(1rem + var(--safe-l)); overflow-x: auto; }   /* folgt dem Design; A4-Bögen am Handy seitlich scrollbar */
.print-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.labels { display: flex; flex-wrap: wrap; gap: 6mm; --lw: 62mm; --lh: 40mm; --qr: 28mm; --no: 15pt; --name: 9pt; --meta: 7pt; }
.label {
  width: var(--lw); height: var(--lh); border: 1px dashed #bbb; border-radius: 2mm;
  display: flex; gap: 2.5mm; padding: 2.5mm; break-inside: avoid; overflow: hidden; box-sizing: border-box; background: #fff; color: #000;   /* Etikett ist Papier – auch im dunklen Design */
}
.label-qr { width: var(--qr); height: var(--qr); flex: none; }
.label-qr img, .label-qr canvas { width: var(--qr) !important; height: var(--qr) !important; }
.label-qr-fallback { font-size: 8pt; color: #999; }
.label-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.label-company { font-size: var(--meta); color: #555; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: flex; align-items: center; gap: .8mm; }
.label-company span { overflow: hidden; text-overflow: ellipsis; }
.label-mark { width: calc(var(--meta) * 1.4); height: calc(var(--meta) * 1.4); flex: none; color: #000; }
.label-no { font-size: var(--no); font-weight: 800; font-variant-numeric: tabular-nums; margin: 1mm 0; word-break: normal; overflow-wrap: normal; overflow: hidden; line-height: 1.05; }
.label-no.fit-anywhere, .label-name.fit-anywhere, .label-numbers.fit-anywhere { overflow-wrap: anywhere; }
.label-numbers { font-size: var(--meta); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: .5mm; overflow: hidden; overflow-wrap: normal; }
.label-more { font-weight: 400; color: #555; }
.labels-38x19 .label-numbers { display: none; }
.labels-62x29 .label-numbers, .labels-50x30 .label-numbers { -webkit-line-clamp: 1; display: -webkit-box; -webkit-box-orient: vertical; }
.label-name { font-size: var(--name); font-weight: 600; overflow: hidden; overflow-wrap: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.label-meta { font-size: var(--meta); color: #555; margin-top: auto; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* Barcode-Variante: Text oben, Strichcode unten über volle Breite */
.labels-code128 .label { flex-direction: column; gap: 1mm; }
.labels-code128 .label-text { flex: 1; }
.labels-code128 .label-name { -webkit-line-clamp: 2; }
.labels-code128 .label-meta { margin-top: 0; }
.label-barcode { flex: none; height: calc(var(--lh) * .36); }
.label-barcode svg { width: 100%; height: 100%; display: block; }
/* Formate */
.labels-62x29 { --lw: 62mm; --lh: 29mm; --qr: 22mm; --no: 13pt; --name: 8pt; --meta: 6pt; }
.labels-62x29 .label { padding: 2mm; gap: 2mm; }
.labels-62x29 .label-name { -webkit-line-clamp: 2; }
.labels-50x30 { --lw: 50mm; --lh: 30mm; --qr: 22mm; --no: 12pt; --name: 7.5pt; --meta: 6pt; }
.labels-50x30 .label { padding: 2mm; gap: 2mm; }
.labels-50x30 .label-name { -webkit-line-clamp: 2; }
.labels-38x19 { --lw: 38mm; --lh: 19mm; --qr: 14mm; --no: 10pt; --name: 6pt; --meta: 5pt; }
.labels-38x19 .label { padding: 1.5mm; gap: 1.5mm; }
.labels-38x19 .label-name, .labels-38x19 .label-company, .labels-38x19 .label-meta { display: none; }
.labels-code128 .label-company { max-width: 100%; }
.labels-38x19 .label-text { justify-content: center; }
.labels-38x19.labels-code128 .label-name { display: -webkit-box; -webkit-line-clamp: 1; }
.labels-a4-70x37 { --lw: 70mm; --lh: 37mm; --qr: 28mm; --no: 13pt; --name: 8.5pt; --meta: 6.5pt; gap: 0; width: 210mm; }
.labels-a4-105x48 { --lw: 105mm; --lh: 48mm; --qr: 40mm; --no: 18pt; --name: 11pt; --meta: 8pt; gap: 0; width: 210mm; }
.labels-a4-70x37 .label, .labels-a4-105x48 .label { border-radius: 0; border-color: #eee; }
@media print {
  .print-toolbar { display: none; }
  .print-body { padding: 0; }
  .labels { gap: 0; }
  .label { border-color: transparent; margin: 0; }
  .labels-a4-70x37 .label, .labels-a4-105x48 .label { border-color: transparent; }
  @page { margin: 8mm; }
  @page labelsheet { size: A4 portrait; margin: 0; }
  .labels-a4-70x37, .labels-a4-105x48 { page: labelsheet; width: 210mm; margin: 0; }
  .labels-a4-70x37 { padding-top: .5mm; }
  .labels-a4-105x48 { padding-top: 4.5mm; }
  .labels-a4-70x37 .label:nth-child(24n) { break-after: page; }
  .labels-a4-105x48 .label:nth-child(12n) { break-after: page; }
}

/* ---------- Begleitscheine ---------- */
.table-scroll { max-height: 60vh; overflow-y: auto; }
.table-scroll thead th { position: sticky; top: 0; background: var(--surface-2); z-index: 1; }
.table-select tbody tr { cursor: pointer; }
.table-select tbody tr:hover { background: var(--surface-2); }
.table-select tbody tr.selected { background: var(--accent-soft); }
.filter-rows { width: 100%; margin-bottom: .6rem; }
.row-done td { color: var(--muted); }
.row-done .inv { opacity: .6; }
.toolbar .toolbar-actions .inline { display: inline-block; }

/* Druckansicht Begleitschein (A4) */
.sheet { max-width: 190mm; margin: 0 auto; color: #000; font-size: 10.5pt; background: #fff; padding: clamp(.75rem, 4vw, 10mm); border-radius: 4px; box-shadow: var(--shadow); color-scheme: light; }   /* am Bildschirm als „Blatt“, auch im dunklen Design */
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; border-bottom: 2px solid #000; padding-bottom: 4mm; margin-bottom: 4mm; }
.sheet-brand { display: flex; align-items: flex-start; gap: 5mm; min-width: 0; }
.sheet-logo { width: auto; height: 9mm; flex: none; margin-top: .5mm; }
.sheet-company { font-size: 9pt; color: #444; }
.sheet h1 { font-size: 18pt; margin: 1mm 0 0; }
.sheet-qr { width: 24mm; height: 24mm; flex: none; }
.sheet-qr img, .sheet-qr canvas { width: 24mm !important; height: 24mm !important; }
.sheet-meta { display: grid; grid-template-columns: max-content 1fr; gap: 1mm 6mm; margin: 0 0 5mm; }
.sheet-meta dt { color: #444; }
.sheet-meta dd { margin: 0; font-weight: 600; }
.sheet-table { width: 100%; border-collapse: collapse; margin-bottom: 8mm; }
.sheet-table th, .sheet-table td { border: 1px solid #000; padding: 2mm 2.5mm; text-align: left; vertical-align: top; }
.sheet-table th { background: #eee; font-size: 9pt; }
.sheet-table .c { text-align: center; width: 14mm; }
.sheet-table .inv { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 700; white-space: nowrap; }
.sheet-table .sub { font-size: 8.5pt; color: #444; }
.sheet-table .box { display: inline-block; width: 4.5mm; height: 4.5mm; border: 1px solid #000; vertical-align: middle; }
.sheet-sign { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8mm; margin-top: 14mm; font-size: 8.5pt; color: #444; }
.sheet-sign .line { border-top: 1px solid #000; margin-bottom: 1.5mm; }
.sheet-foot { margin-top: 8mm; font-size: 8pt; color: #666; }
@media print {
  .sheet { max-width: none; padding: 0; border-radius: 0; box-shadow: none; }
  .sheet-table tr { page-break-inside: avoid; }
  /* Auswertungen als PDF/Ausdruck (seit 2.27.4): nur der Inhalt, Kopfzeile mit Betrieb und Zeitraum */
  body.print-report .sidebar, body.print-report .topbar, body.print-report .filters, body.print-report .license-banner,
  body.print-report .cookie-note, body.print-report .flash, body.print-report .sidebar-backdrop, body.print-report .no-print { display: none !important; }
  body.print-report .main, body.print-report .content { margin: 0; padding: 0; max-width: none; }
  body.print-report .panel, body.print-report .stat { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
  body.print-report .print-head { display: block !important; margin: 0 0 1rem; padding-bottom: .5rem; border-bottom: 2px solid #000; }
  body.print-report .print-head h1 { margin: 0; font-size: 1.4rem; }
  body.print-report a { color: inherit; text-decoration: none; }
}
.print-head { display: none; }

/* ---------- Version 1.2: Sätze, Lagerplätze, Reservierungen, Schäden, Inventur, Auswertungen, Scanner ---------- */
.badge-incomplete { background: #b35c00; }
.topbar-search { align-items: center; gap: .35rem; }
.topbar-scan { background: transparent; border: 1px solid var(--line); border-radius: 8px; height: 38px; width: 42px; cursor: pointer; font-size: 1.1rem; line-height: 1; }
.topbar-scan:hover { background: var(--bg); }
.tree-indent { display: inline-block; width: calc(var(--depth, 0) * 1.25rem); position: relative; vertical-align: middle; }
.tree-indent::after { content: ''; position: absolute; right: .25rem; top: -.2rem; width: .6rem; height: .9rem; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0 0 0 4px; }
.tree-indent[style*="--depth:0"]::after { display: none; }
.table-form td { padding: .3rem .4rem; vertical-align: top; }
.table-form input, .table-form select { width: 100%; min-height: 36px; padding: .3rem .5rem; }
.table-form input.input-sm { width: 5.5rem; }
.table-form .col-actions { white-space: nowrap; width: 3rem; }
[data-repeater] > .btn { margin-top: .6rem; }
/* Auswahl-Liste (z. B. offener Begleitschein für ein Werkzeug) – große Touch-Ziele, ganze Karte klickbar */
.choice-list { display: flex; flex-direction: column; gap: .5rem; margin: .75rem 0 1rem; }
.choice { display: flex; gap: .75rem; align-items: flex-start; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.choice:hover { border-color: var(--muted); }
.choice input { width: 20px; height: 20px; min-height: 0; margin: .15rem 0 0; flex: none; accent-color: var(--accent); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice-body { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.choice-title { font-weight: 600; }
.choice-meta { font-size: .85rem; color: var(--muted); }
.choice-note { font-size: .88rem; }
/* Nachträglich Werkzeug auf einen Schein buchen (Scheinseite) */
.slip-add { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-bottom: 1rem; padding: .75rem .9rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }
.slip-add .field { flex: 1 1 320px; margin: 0; }
.slip-add .btn-primary { margin-bottom: 1.35rem; }
@media (max-width: 640px) { .slip-add .btn-primary { margin-bottom: 0; width: 100%; } }

.input-scan { display: flex; gap: .4rem; align-items: stretch; }
.input-scan input, .input-scan textarea { flex: 1; min-width: 0; }
.input-scan textarea + .btn { align-self: flex-start; }
.input-scan .btn { padding: 0 .8rem; font-size: 1.1rem; }
.input-lg { font-size: 1.25rem; min-height: 50px; letter-spacing: .04em; }
.row-highlight td { background: #fff8e0; }
.progress { height: 12px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; margin: .25rem 0 .35rem; }
.progress-bar { height: 100%; background: var(--accent); transition: width .3s; }
.bars { display: flex; align-items: flex-end; gap: .35rem; height: 160px; padding-top: 1.2rem; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; min-width: 0; }
.bar-fill { width: 70%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.bar-value { position: absolute; top: -1.1rem; font-size: .75rem; color: var(--muted); }
.bar-label { font-size: .7rem; color: var(--muted); margin-top: .3rem; white-space: nowrap; }
.meter { display: inline-block; width: 90px; height: 8px; border-radius: 4px; background: var(--bg); border: 1px solid var(--line); vertical-align: middle; overflow: hidden; }
.meter-fill { height: 100%; background: var(--green); }
.meter-fill.meter-high { background: var(--amber); }
.field-inline { display: inline-flex; align-items: center; gap: .4rem; }
.field-inline span { font-size: .85rem; color: var(--muted); }
.form-inline-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .75rem; }
.form-inline-row input[type="email"] { width: 260px; max-width: 100%; }
code.wrap { display: block; white-space: pre-wrap; word-break: break-all; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: .4rem .5rem; font-size: .8rem; user-select: all; }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { padding: .4rem 0; border-bottom: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: 0; }
.auth-links { text-align: center; margin: 1rem 0 0; font-size: .9rem; }
.static { padding: .5rem 0; font-weight: 600; }
#smtp-fields[hidden] { display: none; }
.count-danger { background: var(--red); color: #fff; }

/* Scanner-Overlay */
#scan-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .85); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.scan-box { position: relative; width: min(92vw, 520px); background: #000; border-radius: 12px; overflow: hidden; text-align: center; padding-bottom: 1rem; }
.scan-box video { width: 100%; max-height: 70vh; display: block; object-fit: cover; }
.scan-frame { position: absolute; left: 50%; top: 40%; width: 60%; aspect-ratio: 1; transform: translate(-50%, -50%); border: 3px solid var(--accent); border-radius: 12px; box-shadow: 0 0 0 4000px rgba(0, 0, 0, .35); pointer-events: none; }
.scan-hint { color: #fff; margin: .75rem 0 .5rem; font-size: .9rem; }
@media (max-width: 720px) {
  .bars { height: 120px; }
  .bar-label { font-size: .6rem; }
}
.extend-inline { display: inline-flex; gap: .3rem; align-items: center; flex-wrap: wrap; }
.extend-inline .input-date { min-height: 32px; padding: .2rem .4rem; width: 9.5rem; font-size: .9rem; }
.order-no { font-weight: 700; font-variant-numeric: tabular-nums; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .5rem; margin-top: .75rem; }
.gallery-sm { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
.gallery-item { margin: 0; position: relative; }
.gallery-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.gallery-item figcaption { display: flex; gap: .2rem; justify-content: center; margin-top: .2rem; }
.hidden-form { display: none; }
.part-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); display: block; }
.part-image-cell { width: 130px; }
.part-image-cell input[type="file"] { font-size: .75rem; max-width: 130px; }
.bulk-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius); padding: .5rem .75rem; margin-bottom: .75rem; position: sticky; top: calc(var(--topbar-h) + .4rem); z-index: 5; }
.bulk-bar[hidden] { display: none; }
.bulk-bar select, .bulk-bar input { min-height: 34px; padding: .25rem .5rem; }
.bulk-bar [hidden] { display: none; }
.log-box { font-size: .75rem; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: .5rem; max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-all; }

/* ---------- 1.6: Weitergeben, Sammelartikel, Unterschrift, Offline-Warteschlange ---------- */
.badge-transfer { background: #6741d9; }
.badge-qty { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.input-qty { width: 5.5rem; }
.form-inline-row input[type="text"] { width: 240px; max-width: 100%; }
.signature-list { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.signature-item { margin: 0; max-width: 320px; }
.signature-item img { display: block; width: 100%; max-width: 320px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.signature-item figcaption { font-size: .82rem; color: var(--muted); margin-top: .3rem; }
.signature-pad-wrap { position: relative; max-width: 600px; margin: .75rem 0; }
.signature-pad { display: block; width: 100%; height: 200px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface); touch-action: none; cursor: crosshair; }
.signature-pad-line { position: absolute; left: 1.5rem; right: 1.5rem; bottom: 2.2rem; border-top: 1px solid var(--line); pointer-events: none; }
.sheet-sign-img { display: block; max-height: 22mm; max-width: 100%; margin-bottom: 1mm; }
#offline-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; background: var(--amber); color: #fff; padding: .6rem calc(1rem + var(--safe-r)) calc(.6rem + var(--safe-b)) calc(1rem + var(--safe-l)); display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; box-shadow: 0 -2px 8px rgba(0,0,0,.2); font-weight: 600; }
#offline-banner[hidden] { display: none; }
#offline-banner.offline-banner-online { background: var(--blue); }
#offline-banner .btn-ghost { color: #fff; border-color: rgba(255,255,255,.6); }
#offline-banner .offline-list { flex-basis: 100%; margin: .4rem 0 0; padding-left: 1.2rem; font-weight: 400; font-size: .88rem; max-height: 40vh; overflow: auto; }
#offline-banner .offline-list li { margin-bottom: .25rem; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); flex: none; }
.theme-toggle svg { width: 20px; height: 20px; display: block; }
.theme-toggle[data-mode="dark"] { color: var(--accent); border-color: var(--accent); }
.theme-toggle[data-mode="light"] { color: var(--amber); border-color: var(--amber); }
/* Symbol zeigt, was der nächste Tipp bringt: im dunklen Design die Sonne, im hellen den Mond */
.theme-toggle .icon-sun { display: none; }
.theme-toggle[data-effective="dark"] .icon-sun { display: block; }
.theme-toggle[data-effective="dark"] .icon-moon { display: none; }

/* ---------- Dark Mode: automatisch (Systemeinstellung) oder per Umschalter in der Seitenleiste ---------- */
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; } }
:root[data-theme="dark"],
:root:not([data-theme="light"]).dark-auto { color-scheme: dark; }

:root[data-theme="dark"] {
  --bg: #15181c; --surface: #1e2228; --surface-2: #262b33; --line: #363c46; --text: #e6e9ee; --muted: #9aa4b1;
  --sidebar: #0f1113; --sidebar-text: #aeb6c2; --sidebar-active: #22272e; --accent-hover: #ff8a45; --accent-soft: #2e1f14; --focus: #4dabf7;
  --green: #51cf66; --blue: #4dabf7; --red: #ff6b6b; --amber: #fbbf24; --grey: #6c757d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 1px 6px rgba(0, 0, 0, .3);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15181c; --surface: #1e2228; --surface-2: #262b33; --line: #363c46; --text: #e6e9ee; --muted: #9aa4b1;
    --sidebar: #0f1113; --sidebar-text: #aeb6c2; --sidebar-active: #22272e; --accent-hover: #ff8a45; --accent-soft: #2e1f14; --focus: #4dabf7;
    --green: #51cf66; --blue: #4dabf7; --red: #ff6b6b; --amber: #fbbf24; --grey: #6c757d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 1px 6px rgba(0, 0, 0, .3);
  }
}
/* Feste Farben, die im dunklen Design angepasst werden müssen */
:root[data-theme="dark"] .panel-danger, :root[data-theme="dark"] .row-overdue td, :root[data-theme="dark"] .flash-error { background: #2a1a1a; border-color: #5a2a2a; color: #ff8787; }
:root[data-theme="dark"] .flash-success { background: #14261a; border-color: #2b5a34; color: #8ce99a; }
:root[data-theme="dark"] .flash-info { background: #14222e; border-color: #1f4a6e; color: #a5d8ff; }
:root[data-theme="dark"] .table tbody tr:hover td { background: #22272e; }
:root[data-theme="dark"] .row-highlight td { background: #2e1f14; }
:root[data-theme="dark"] .sidebar-user, :root[data-theme="dark"] .nav-group { border-top-color: #262b33; }
:root[data-theme="dark"] .badge-qty { background: #262b33; color: #e6e9ee; }
:root[data-theme="dark"] .signature-pad { background: #1e2228; }
:root[data-theme="dark"] .signature-item img { background: #fff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .panel-danger, :root:not([data-theme="light"]) .row-overdue td, :root:not([data-theme="light"]) .flash-error { background: #2a1a1a; border-color: #5a2a2a; color: #ff8787; }
  :root:not([data-theme="light"]) .flash-success { background: #14261a; border-color: #2b5a34; color: #8ce99a; }
  :root:not([data-theme="light"]) .flash-info { background: #14222e; border-color: #1f4a6e; color: #a5d8ff; }
  :root:not([data-theme="light"]) .table tbody tr:hover td { background: #22272e; }
  :root:not([data-theme="light"]) .row-highlight td { background: #2e1f14; }
  :root:not([data-theme="light"]) .sidebar-user, :root:not([data-theme="light"]) .nav-group { border-top-color: #262b33; }
  :root:not([data-theme="light"]) .badge-qty { background: #262b33; color: #e6e9ee; }
  :root:not([data-theme="light"]) .signature-pad { background: #1e2228; }
  :root:not([data-theme="light"]) .signature-item img { background: #fff; }
}
/* Druckansichten (Etiketten, Begleitschein, Inhaltsliste): Seite folgt dem Design, die Papierflächen (Etikett, Blatt)
   bleiben weiß – kein Aufblitzen mehr beim Wechsel aus dem dunklen Design. Gedruckt wird immer hell (siehe @media print). */
.label, .sheet { color-scheme: light; }
.sheet-contents { border-bottom: 0; }
.sheet-contents + .sheet-contents { margin-top: 6mm; }
@media print {
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    color-scheme: light;
    --bg: #fff; --surface: #fff; --surface-2: #f5f6f7; --line: #bbb; --text: #000; --muted: #555; --shadow: none;
  }
  .print-body { background: #fff; color: #000; }
}

/* ---------- Inhaltslisten je Lagerplatz (Ausdruck) ---------- */
.sheet-contents { margin-bottom: 14mm; padding-bottom: 6mm; border-bottom: 1px dashed #bbb; break-after: page; }
.sheet-contents:last-of-type { border-bottom: 0; }
.sheet-section { font-size: 11pt; margin: 6mm 0 2mm; border-bottom: 1px solid #000; padding-bottom: 1mm; }
.sheet-count { font-weight: 400; color: #444; }
.sheet-empty { font-size: 9pt; color: #666; margin: 1mm 0 3mm; }
.sheet-table th.img, .sheet-table td.img { width: 16mm; padding: 1mm; }
.sheet-table td.img img { width: 14mm; height: 14mm; object-fit: cover; display: block; }
.sheet-contents .sheet-table td.c { width: 8mm; text-align: center; }
@media print { .sheet-contents { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; } .sheet-contents .sheet-head { page-break-after: avoid; } }

/* ---------- 1.7: Voll responsiv – Karten statt Tabellen, Touch-Ziele, Nachladen ---------- */
.detail-image { max-width: 100%; height: auto; }
.lazy-panel { min-height: 4.5rem; }
.lazy-panel[data-loaded] { min-height: 0; }
.lazy-panel.lazy-error p { color: var(--red); margin: 0; }
.skeleton { padding: .25rem 0; }
.skeleton span { display: block; height: .85rem; border-radius: 4px; margin: .6rem 0; background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: wzm-shimmer 1.4s linear infinite; }
.skeleton span:nth-child(2) { width: 82%; }
.skeleton span:nth-child(3) { width: 58%; }
@keyframes wzm-shimmer { to { background-position: -200% 0; } }
.load-more { display: flex; justify-content: center; margin: -.5rem 0 1.25rem; }
.load-more .btn[aria-busy="true"] { opacity: .6; pointer-events: none; }
.table-sort { display: none; }
.table-sort select { width: auto; flex: 1; }
.table-cards tbody tr.card-hidden { display: none; }
@media (prefers-reduced-motion: reduce) { .skeleton span { animation: none; } .progress-bar { transition: none; } }

/* Touch-Geräte: Bedienelemente mindestens 44 px hoch, Schrift 16 px (verhindert Auto-Zoom auf iOS) */
@media (pointer: coarse) {
  input[type="text"], input[type="search"], input[type="password"], input[type="email"], input[type="number"],
  input[type="date"], input[type="file"], select, textarea { font-size: max(16px, 1em); }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 40px; }
  .nav a { padding: .65rem .75rem; }
  .nav-head { padding-top: .45rem; padding-bottom: .35rem; }
  .pagination a, .pagination span { padding: .5rem .8rem; }
  .tabs a { padding: .7rem .9rem; }
  .check input, .col-check input { width: 22px; height: 22px; }
}

/* Handys und schmale Tablets (Hochformat) */
@media (max-width: 640px) {
  html { font-size: 15.5px; }
  h1 { font-size: 1.2rem; }
  .content { padding: .75rem calc(.75rem + var(--safe-r)) calc(1rem + var(--safe-b)) calc(.75rem + var(--safe-l)); }
  .panel { padding: .9rem .95rem; margin-bottom: .9rem; }
  .panel-grid, .detail-grid { gap: .9rem; grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-bottom: .9rem; }
  .stat { padding: .7rem .8rem; }
  .stat-value { font-size: 1.5rem; }
  .stat-label { font-size: .78rem; }
  .quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .quick-actions .btn { white-space: normal; padding: .5rem .6rem; }
  .toolbar { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }   /* nowrap: sonst wächst eine Zeile mit Tabs über die Seitenbreite */
  .toolbar > * { min-width: 0; max-width: 100%; }
  .toolbar-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .5rem; }
  .toolbar-actions .btn { white-space: normal; }
  .toolbar .toolbar-actions .inline { display: block; }
  .toolbar .toolbar-actions .inline .btn { width: 100%; }
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; align-items: stretch; }
  .filters input[type="search"], .filters .btn, .filters .check, .filters input[type="hidden"] + input { grid-column: 1 / -1; }
  .filters input[type="search"], .filters select { width: 100%; max-width: none; }
  .filters .check { padding: .2rem 0; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin-bottom: .25rem; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { white-space: nowrap; flex: none; }
  .form-actions.is-sticky { position: sticky; bottom: 0; background: var(--bg); padding: .6rem 0 calc(.6rem + var(--safe-b)); margin: 0 0 .5rem; z-index: 4; border-top: 1px solid var(--line); }   /* nur lange Formulare (Klasse setzt app.js) */
  .form-actions .btn { flex: 1 1 calc(50% - .6rem); white-space: normal; }
  .form-actions .btn-primary { flex-basis: 100%; }
  .detail-header { flex-direction: column; }
  .detail-title { font-size: 1.2rem; }
  .detail-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .detail-actions .btn { white-space: normal; }
  .return-form .field { min-width: 100%; flex: 1 1 100%; }
  .return-form .btn { width: 100%; }
  .extend-inline { width: 100%; }
  .extend-inline .input-date { flex: 1 1 8rem; width: auto; }
  .form-inline-row input[type="text"], .form-inline-row input[type="email"], .form-inline-row select { width: 100%; }
  .form-inline-row .btn { width: 100%; }
  .field-inline { width: 100%; }
  .dl { gap: .35rem .9rem; }
  .dl dt { font-size: .82rem; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
  .signature-pad { height: 160px; }
  .signature-item { max-width: none; width: 100%; }
  .pagination { justify-content: center; }
  .pagination .total { flex-basis: 100%; text-align: center; margin: .35rem 0 0; }
  .auth-card { padding: 1.4rem 1.2rem; }
  .auth-body { padding: .75rem; align-items: start; padding-top: 2rem; }
  .scan-box video { max-height: 60vh; }
  .sheet-sign { grid-template-columns: 1fr; gap: 1.2rem; margin-top: 8mm; }
  .sheet-head { flex-wrap: wrap; }
  .chosen-tool { padding: .6rem .7rem; }
  .table-scroll { max-height: 55vh; }
  .bulk-bar { flex-direction: column; align-items: stretch; }
  .bulk-bar select, .bulk-bar input, .bulk-bar .btn { width: 100%; }
  code.wrap { font-size: .75rem; }
  .table-sort { display: flex; gap: .5rem; align-items: center; margin: 0 0 .6rem; font-size: .85rem; }

  /* Tabellen als Karten: jede Zeile eine Karte, jede Zelle „Spaltenname: Wert“ (data-label setzt app.js) */
  .table-wrap { overflow: visible; background: transparent; border: 0; box-shadow: none; }
  .table-wrap.table-scroll { overflow-y: auto; }
  .table-cards { display: block; }
  .table-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); }
  .table-cards tbody { display: block; }
  .table-cards tbody tr { display: block; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: .4rem .85rem .45rem; margin-bottom: .6rem; }
  .table-cards tbody tr:last-child { margin-bottom: 0; }
  .table-cards tbody tr:hover td { background: transparent; }
  /* Zelle = Raster aus Spaltenname (::before) und Wert (.td-value, von app.js umhüllt) */
  .table-cards td { display: grid; grid-template-columns: minmax(5.5rem, 34%) minmax(0, 1fr); gap: .1rem .75rem; align-items: start; border: 0; padding: .22rem 0; white-space: normal; text-align: left; width: auto; }
  .table-cards td::before { content: attr(data-label); color: var(--muted); font-size: .76rem; font-weight: 600; padding-top: .15rem; line-height: 1.3; }
  .table-cards td > .td-value { min-width: 0; overflow-wrap: anywhere; }
  /* Karten am Handy: Nummern (.inv) und nowrap-Zellen dürfen umbrechen – sonst laufen lange Bezeichnungen aus der Karte (seit 2.33.3) */
  .table-cards td .inv, .table-cards td.nowrap, .table-cards td .nowrap { white-space: normal; overflow-wrap: anywhere; }
  .table-cards td[data-label=""], .table-cards td:not([data-label]) { grid-template-columns: minmax(0, 1fr); }
  .table-cards td[data-label=""]::before, .table-cards td:not([data-label])::before { display: none; }
  .table-cards td.text-right, .table-cards td.text-center { text-align: left; }
  .table-cards td[data-empty] { display: none; }
  .table-cards td.col-check { position: absolute; top: .55rem; right: .7rem; padding: 0; width: auto; z-index: 1; }
  .table-cards td.col-check + td { padding-right: 2rem; }
  .table-cards td.col-check + td.col-img { padding-right: 0; }
  .table-cards td.col-img { display: block; padding: .2rem 0 .3rem; }
  .table-cards td.col-img img, .table-cards td.col-img .img-placeholder { width: 56px; height: 56px; }
  .table-cards td.col-img .img-placeholder { display: none; }
  .table-cards td.col-actions { border-top: 1px solid var(--line); margin-top: .35rem; padding-top: .55rem; }
  .table-cards td.col-actions::before { display: none; }
  .table-cards td.col-actions > .td-value { display: flex; flex-wrap: wrap; gap: .4rem; }
  .table-cards td.col-actions .btn { flex: 1 1 auto; }
  .table-cards td.col-actions .inline, .table-cards td.col-actions form { display: flex; flex: 1 1 auto; gap: .35rem; }
  .table-cards td.col-actions form .btn { flex: 1 1 auto; }
  .table-cards td.col-actions .btn + .inline { margin-left: 0; }
  .table-cards .inv { font-size: 1.02em; }
  .table-cards tr.row-overdue td, .table-cards tr.row-highlight td, .table-cards tr.selected td { background: transparent; }
  .table-cards tr.row-overdue { border-left: 4px solid var(--red); }
  .table-cards tr.row-highlight { border-left: 4px solid var(--accent); }
  .table-select.table-cards tbody tr.selected { border-color: var(--accent); background: #fff8dd; }
  .table-cards tr.row-done { opacity: .75; }
  .table-cards tr.row-inactive td { color: var(--muted); }
  .table-form.table-cards td, .table-edit.table-cards td { grid-template-columns: minmax(0, 1fr); }
  .table-form.table-cards td::before, .table-edit.table-cards td::before { padding-top: 0; }
  .table-form.table-cards input.input-sm, .table-edit.table-cards input.input-sm { width: 100%; }
  .table-form.table-cards td.col-actions .btn, .table-edit.table-cards td.col-actions .btn { flex: 0 1 auto; }
  .part-image-cell { width: auto; }
  .part-image-cell input[type="file"] { max-width: none; }
  .table-cards .extend-inline, .table-cards .return-inline { width: 100%; }
  .table-cards .return-inline select { flex: 1; width: auto; }
  .table-cards .table-scroll thead { display: none; }
  .table-cards .check-all-wrap { display: none; }
  /* Berechtigungsmatrix bleibt eine echte Tabelle (seitlich scrollbar) */
  .table-perms { display: table; }
  .table-perms thead { position: static; width: auto; height: auto; overflow: visible; clip: auto; clip-path: none; }
  .table-perms tbody, .table-perms tr { display: table-row-group; }
  .table-perms tr { display: table-row; }
  .table-perms td, .table-perms th { display: table-cell; }
  .table-wrap:has(.table-perms) { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); }
}
@media (max-width: 360px) {
  .stat-grid, .quick-actions, .detail-actions, .filters { grid-template-columns: 1fr; }
  .form-actions .btn { flex-basis: 100%; }
  .table-cards td { grid-template-columns: minmax(0, 1fr); }
  .table-cards td::before { padding-top: 0; }
  .dl { grid-template-columns: 1fr; gap: 0; }
  .dl dt { margin-top: .5rem; }
}
/* Querformat auf Handys: Kopfzeile schlank halten, Scanner-Overlay passt sich an */
@media (max-height: 480px) and (orientation: landscape) {
  .topbar { padding-top: max(.4rem, var(--safe-t)); padding-bottom: .4rem; }
  .content { padding-top: .6rem; }
  .scan-box video { max-height: 70vh; }
  .scan-frame { top: 45%; width: 40%; }
  .sidebar .brand { padding: .6rem 1.1rem .4rem; }
  .nav a { padding: .4rem .75rem; }
  .nav-group { margin-top: .25rem; }
}
:root[data-theme="dark"] .table-select.table-cards tbody tr.selected { background: #2a2610; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .table-select.table-cards tbody tr.selected { background: #2a2610; } }
/* Normale Seiten drucken: nur der Inhalt */
@media print {
  .sidebar, .sidebar-backdrop, .topbar, #offline-banner, .skip-link, .load-more, .table-sort, .form-actions, .toolbar-actions, .bulk-bar { display: none !important; }
  .app, .main { display: block; }
  .content { max-width: none; padding: 0; }
  .panel { box-shadow: none; break-inside: avoid; }
  .table-wrap { overflow: visible; box-shadow: none; }
}
/* Kartenansicht im dunklen Design: überfällige Karten nur dezent einfärben statt kompletten Text rot */
@media (max-width: 640px) {
  :root[data-theme="dark"] .table-cards tr.row-overdue td, :root[data-theme="dark"] .table-cards tr.row-overdue td::before { background: transparent; color: inherit; }
  :root[data-theme="dark"] .table-cards tr.row-overdue td::before { color: var(--muted); }
  :root[data-theme="dark"] .table-cards tr.row-overdue { background: #241b1b; border-color: #4a2a2a; }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .table-cards tr.row-overdue td, :root:not([data-theme="light"]) .table-cards tr.row-overdue td::before { background: transparent; color: inherit; }
    :root:not([data-theme="light"]) .table-cards tr.row-overdue td::before { color: var(--muted); }
    :root:not([data-theme="light"]) .table-cards tr.row-overdue { background: #241b1b; border-color: #4a2a2a; }
  }
}

/* ---------- Standorte (1.9) ---------- */
.badge-site { background: #4c6ef5; }
.badge-site-foreign { background: var(--grey); }
.badge-site-global { background: #6741d9; }
.site-switch { display: flex; align-items: center; flex: none; }
.site-switch select { max-width: 220px; font-weight: 600; padding-top: .35rem; padding-bottom: .35rem; }
.panel-foreign { border-left: 5px solid #4c6ef5; }
.text-success { color: var(--green); font-weight: 600; }
@media (max-width: 900px) {
  .site-switch { flex: 1 1 100%; order: 9; }
  .site-switch select { width: 100%; max-width: none; }
}

/* ---- Plattform (seit 2.1): Einstieg, Plattform-Admin, Partner-Portal ---- */
.auth-card-wide { max-width: 560px; }
.auth-tenant { margin: -.75rem 0 1rem; }
.entry-known { background: var(--surface-2, rgba(127,127,127,.08)); border-radius: 8px; padding: .6rem .8rem; margin: 0 0 1rem; }
.tenant-info { margin: 0; padding: .6rem .8rem; border: 1px dashed var(--line); border-radius: 8px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.secret-box { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; background: var(--surface-2, rgba(127,127,127,.1)); padding: .6rem .8rem; border-radius: 8px; user-select: all; }
.license-banner { padding: .55rem 1rem; font-size: .92rem; background: var(--amber); color: #1c1f23; text-align: center; }
.license-banner-danger { background: var(--red); color: #fff; }
.license-banner a { color: inherit; font-weight: 700; text-decoration: underline; }
.kv-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
/* White-Label-Logo (seit 2.7) */
img.brand-mark.brand-logo { object-fit: contain; border-radius: 6px; background: transparent; }

/* ---- Support (seit 2.10): Verlauf, Ticketansicht, Hilfe-Knopf ---- */
.thread { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .75rem; }
.msg { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; box-shadow: var(--shadow); max-width: 52rem; }
.msg-agent { border-left: 4px solid var(--accent); }
.msg-customer { border-left: 4px solid var(--muted); }
.msg-system { background: var(--surface-2); box-shadow: none; font-size: .9rem; }
.msg-internal { background: #fff8e1; border-style: dashed; }
[data-theme="dark"] .msg-internal { background: #3a3322; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .msg-internal { background: #3a3322; } }
.msg-head { display: flex; flex-wrap: wrap; gap: .4rem; align-items: baseline; margin-bottom: .35rem; }
.msg-time { margin-left: auto; }
.msg-body { overflow-wrap: anywhere; line-height: 1.5; }
.msg-files { list-style: none; padding: 0; margin: .5rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .9rem; }
.support-detail { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 1rem; align-items: start; }
.support-side .panel { margin-bottom: 1rem; }
@media (max-width: 1100px) { .support-detail { grid-template-columns: 1fr; } }
.support-subnav { margin-bottom: 1rem; }
.dl-diag dd { overflow-wrap: anywhere; }
/* „?“-Knopf in der Kopfzeile: wie der Design-Knopf (Symbol zentriert, gedämpfte Farbe), roter Punkt bei neuer Antwort */
.help-toggle { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); flex: none; position: relative; text-decoration: none; }
.help-toggle:hover, .help-toggle:focus-visible { color: var(--text); text-decoration: none; }
.help-toggle svg { width: 20px; height: 20px; display: block; }
.help-toggle.has-news { color: var(--accent); border-color: var(--accent); }
.help-toggle.has-news::after { content: ""; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); border: 2px solid var(--surface); }
.nav a .count { margin-left: auto; }
.support-files-note { font-size: .85rem; color: var(--muted); }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
/* Bewertung (seit 2.13) und Auswertung */
.rating-stars { display: inline-flex; flex-direction: row-reverse; gap: .15rem; font-size: 1.8rem; line-height: 1; }
.rating-stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rating-stars label { cursor: pointer; color: var(--line); transition: color .1s; }
.rating-stars input:checked ~ label, .rating-stars label:hover, .rating-stars label:hover ~ label { color: #f2a51d; }
.rating-stars input:focus-visible + label { outline: 2px solid var(--accent); border-radius: 4px; }
.stars { color: #f2a51d; letter-spacing: .05em; }
.bar-row { display: grid; grid-template-columns: 7rem 1fr 3rem; gap: .5rem; align-items: center; font-size: .85rem; margin: .15rem 0; }
.bar { height: .8rem; background: var(--accent); border-radius: 3px; min-width: 2px; }
/* Support-Zugriff (seit 2.14): roter Balken in der Sitzung */
.support-banner { position: sticky; top: 0; z-index: 1000; background: var(--red); color: #fff; padding: .45rem 1rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .9rem; }
.support-banner form { margin-left: auto; }
.support-banner .btn { background: #fff; color: var(--red); border-color: #fff; }
/* Hilfe-Center und Mitteilungen (seit 2.15) */
.help-search { display: flex; gap: .5rem; margin: 0 0 1rem; }
.help-search input { flex: 1; }
/* Werkzeugsuche mit Live-Vorschlägen (seit 2.28.3): Feld in einem Rahmen, Treffer als Liste darunter */
.suggest-host { position: relative; display: block; min-width: 0; }
.topbar-search .suggest-host, .input-scan .suggest-host { flex: 1; min-width: 0; }
.input-scan .suggest-host input { width: 100%; }
.filters .suggest-host { width: 280px; max-width: 100%; }
.filters .suggest-host input[type="search"] { width: 100%; }
.suggest-host.is-loading::after { content: ""; position: absolute; right: .7rem; top: 50%; width: 14px; height: 14px; margin-top: -7px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: ts-spin .7s linear infinite; pointer-events: none; }
.topbar-search .suggest-host.is-loading::after { right: .75rem; }
@keyframes ts-spin { to { transform: rotate(360deg); } }
.tool-suggest { position: absolute; top: calc(100% + 4px); left: 0; width: max(100%, 27rem); max-width: calc(100vw - 1.5rem); max-height: min(70vh, 34rem); overflow-y: auto; z-index: 60;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0, 0, 0, .18), var(--shadow); text-align: left; }
.topbar-search .tool-suggest { left: auto; right: 0; }
.ts-item { display: flex; align-items: center; gap: .65rem; padding: .5rem .7rem; color: var(--text); text-decoration: none; border-top: 1px solid var(--line); cursor: pointer; min-height: 52px; }
.ts-item:first-child { border-top: 0; }
.ts-item:hover, .ts-item.is-active { background: var(--surface-2); text-decoration: none; }
.ts-item.is-active { box-shadow: inset 3px 0 0 var(--accent); }
.ts-img, .ts-img img { width: 42px; height: 42px; border-radius: 4px; object-fit: cover; flex: none; display: block; background: var(--surface-2); border: 1px solid var(--line); }
.ts-img img { width: 100%; height: 100%; border: 0; }
.ts-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.ts-line1 { display: flex; gap: .45rem; align-items: baseline; min-width: 0; }
.ts-line1 .inv { flex: none; }
.ts-line1 strong, .ts-line1 > span:not(.inv) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-line2 { color: var(--muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-line2.ts-create { color: var(--accent); font-weight: 600; }
.ts-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; font-size: .78rem; color: var(--muted); max-width: 45%; text-align: right; }
.ts-side .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ts-holder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ts-overdue { color: var(--red); font-weight: 600; }
.ts-head { padding: .3rem .7rem; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); border-top: 1px solid var(--line); }
.ts-more { justify-content: center; font-weight: 700; color: var(--accent); min-height: 42px; }
.ts-empty { padding: .7rem .8rem; color: var(--muted); font-size: .9rem; }
.ts-foreign { opacity: .85; }
.ts-item mark { background: transparent; color: inherit; font-weight: 800; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 2px; }
@media (max-width: 640px) {
  .filters .suggest-host { grid-column: 1 / -1; width: auto; }
  .tool-suggest { width: 100%; max-width: none; max-height: min(60vh, 30rem); }
  .ts-side { max-width: 40%; }
}
.help-suggest { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .75rem; margin-top: .35rem; box-shadow: var(--shadow); }
.help-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .5rem 1.5rem; }
.help-groups h2, .help-groups h3 { font-size: 1rem; margin: .75rem 0 .3rem; }
.help-article { line-height: 1.6; }
.help-article h3, .help-article h4 { margin: 1.1rem 0 .4rem; }
.help-feedback { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 1rem 0; }
.help-results li { margin-bottom: .75rem; }
.announce { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .5rem; padding: .55rem .9rem; border-radius: var(--radius); margin-bottom: .6rem; border: 1px solid var(--line); background: var(--surface-2); }
.announce-danger { background: #fdecec; border-color: #f5b5b5; }
.announce-warning { background: #fff6e0; border-color: #f2d28b; }
.announce-success { background: #e8f6ec; border-color: #a9dbb7; }
[data-theme="dark"] .announce-danger, [data-theme="dark"] .announce-warning, [data-theme="dark"] .announce-success { background: var(--surface-2); }
.announce-more { flex-basis: 100%; font-size: .9rem; }
.announce-more summary { cursor: pointer; }
.announce-close { margin-left: auto; }
.btn-link { background: none; border: 0; font-size: 1.2rem; line-height: 1; cursor: pointer; color: inherit; padding: 0 .25rem; }
.status-overall { font-size: 1.2rem; font-weight: 700; padding: .8rem 1rem; border-radius: var(--radius); margin: .5rem 0 1rem; text-align: center; }
.status-ok { background: #e8f6ec; color: #1e7a3a; }
.status-warn { background: #fff6e0; color: #8a5a00; }
.status-bad { background: #fdecec; color: var(--red); }
.status-item { border-left: 4px solid var(--accent); padding-left: .75rem; margin-bottom: 1rem; }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9rem; }
/* hidden-Attribut gilt immer, auch bei Elementen mit eigenem display (.field, .check, .panel) – seit 2.15.2 */
[hidden] { display: none !important; }
/* Bilder in Hilfe-Artikeln (seit 2.15.5) */
.help-figure { margin: 1rem 0 1.25rem; }
.help-figure img, .help-article img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); background: #fff; display: block; }
.help-figure figcaption { font-size: .85rem; color: var(--muted); margin-top: .4rem; }
.help-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .5rem; margin-top: .5rem; }
.help-thumb { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: .3rem; cursor: pointer; text-align: left; font-size: .7rem; color: var(--muted); overflow: hidden; }
.help-thumb img { width: 100%; height: 5rem; object-fit: cover; object-position: top; border-radius: 4px; display: block; margin-bottom: .2rem; }
.help-thumb span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Standort-Anfragen (seit 2.16): Antwort als schwebendes Feld an der Zeile */
.request-actions { position: relative; display: inline-block; }
.request-actions > summary { list-style: none; }
.request-actions > summary::-webkit-details-marker { display: none; }
.request-actions[open] > form { position: absolute; right: 0; top: calc(100% + .35rem); z-index: 20; width: min(22rem, 80vw); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: .75rem; }
.request-actions[open] > form .kv-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
/* Sichtbare Formularprüfung (seit 2.18) */
.field-error { display: block; color: var(--red, #c62828); font-size: .85rem; margin-top: .3rem; font-weight: 600; }
[aria-invalid="true"] { border-color: var(--red, #c62828) !important; box-shadow: 0 0 0 2px rgba(198, 40, 40, .15); }


/* ---------------------------------------------------------------- Rechtstexte (seit 2.19) */
.legal-footer { padding: .9rem 1rem calc(.9rem + env(safe-area-inset-bottom, 0px)); text-align: center; font-size: .8rem; color: var(--muted); }
.legal-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .2rem 1rem; }
.legal-footer a { color: inherit; text-decoration: none; }
.legal-footer a:hover { color: var(--text); text-decoration: underline; }
.main > .legal-footer { margin-top: auto; }
.auth-body { grid-template-rows: 1fr auto; }
.auth-body > .legal-footer { align-self: end; }
.legal-body { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); }
.legal-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.5rem; padding: calc(.75rem + env(safe-area-inset-top, 0px)) 1.25rem .75rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.legal-head .brand { display: flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; }
.legal-head .brand-mark { width: 32px; height: 32px; }
.legal-head .brand-logo { max-height: 34px; width: auto; }
.legal-nav { display: flex; flex-wrap: wrap; gap: .2rem; font-size: .9rem; }
.legal-nav a { padding: .35rem .65rem; border-radius: 8px; color: var(--muted); text-decoration: none; }
.legal-nav a:hover, .legal-nav a.active { background: var(--accent-soft, rgba(127,127,127,.12)); color: var(--text); }
.legal-main { flex: 1; width: 100%; max-width: 860px; margin: 0 auto; padding: 1.5rem 1.25rem 2rem; }
.legal-doc h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 .35rem; letter-spacing: -.01em; }
.legal-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; margin: 0 0 1.25rem; color: var(--muted); font-size: .88rem; }
.legal-text { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1.5rem 1.75rem; line-height: 1.65; overflow-wrap: anywhere; }
.legal-text h3 { font-size: 1.1rem; margin: 1.7rem 0 .5rem; scroll-margin-top: 1rem; }
.legal-text h3:first-child { margin-top: 0; }
.legal-text h4 { font-size: 1rem; margin: 1.2rem 0 .4rem; }
.legal-text p { margin: 0 0 .8rem; }
.legal-text ul, .legal-text ol { margin: 0 0 .8rem; padding-left: 1.4rem; }
.legal-text table { font-size: .9rem; }
.legal-toc { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.25rem; margin: 0 0 1rem; font-size: .92rem; }
.legal-toc ol { margin: .45rem 0 0; padding-left: 1.3rem; columns: 2 16rem; column-gap: 2rem; }
.legal-toc a { color: inherit; }
.legal-list { display: grid; gap: .6rem; }
.legal-list-item { display: flex; flex-direction: column; gap: .15rem; padding: .9rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--text); text-decoration: none; }
.legal-list-item:hover { border-color: var(--accent); }
.legal-check { align-items: flex-start; line-height: 1.5; }
.legal-check input { margin-top: .25rem; flex-shrink: 0; }
.legal-logout { margin-top: 1rem; }
.legal-editor { width: 100%; min-height: 60vh; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .85rem; line-height: 1.5; }
.legal-history summary { cursor: pointer; font-size: .88rem; }
@media (max-width: 640px) { .legal-text { padding: 1.1rem 1rem; } .legal-doc h1 { font-size: 1.45rem; } }
@media print {
  .legal-head, .legal-footer, .no-print { display: none !important; }
  .legal-body { background: #fff; color: #000; }
  .legal-main { max-width: none; padding: 0; }
  .legal-text { border: 0; padding: 0; background: none; }
  .legal-text a { color: inherit; }
}

/* Hinweis zu Cookies (seit 2.19.2) */
.cookie-note { position: fixed; left: calc(1rem + var(--safe-l, 0px)); right: calc(1rem + var(--safe-r, 0px)); bottom: calc(1rem + var(--safe-b, 0px)); z-index: 95; max-width: 680px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; padding: .9rem 1.1rem; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.18); font-size: .9rem; line-height: 1.5; }
.cookie-note p { flex: 1 1 18rem; margin: 0; }
.cookie-note .btn { flex: 0 0 auto; }
@media print { .cookie-note { display: none !important; } }

/* ---------- Konfigurator (seit 2.20): Preise, Tarif erweitern ---------- */
.cfg-main { max-width: 1120px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.cfg-intro { max-width: 46rem; margin: .5rem 0 1.75rem; }
.cfg-intro h1 { font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.05; margin: 0 0 .6rem; letter-spacing: -.01em; }
.cfg-intro p { font-size: 1.1rem; color: var(--muted); margin: 0; max-width: 38rem; }
.cfg { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 900px) { form.cfg:not(.cfg-in-app) { grid-template-columns: minmax(0, 1fr) 340px; } .cfg-side { position: sticky; top: 1rem; } }
.cfg fieldset { border: 0; padding: 0; margin: 0 0 1.5rem; min-width: 0; }
.cfg legend { font-weight: 700; font-size: 1.15rem; margin-bottom: .6rem; padding: 0; }
.cfg-plans { display: grid; gap: .6rem; }
.cfg-plan { display: flex; gap: .8rem; align-items: flex-start; padding: .9rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.cfg-plan:has(input:checked) { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
.cfg-plan input { margin-top: .3rem; accent-color: var(--accent); }
.cfg-plan-body { display: grid; gap: .2rem; flex: 1; }
.cfg-plan-name { font-weight: 700; font-size: 1.05rem; }
.cfg-plan-price { font-weight: 700; font-variant-numeric: tabular-nums; }
.cfg-plan-price small { font-weight: 500; color: var(--muted); }
.cfg-plan-facts { color: var(--muted); }
.cfg-addons { display: grid; gap: .5rem; margin-bottom: 1rem; }
.cfg-addon { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .35rem .9rem; align-items: center; padding: .7rem .9rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.cfg-addon.is-set { border-color: var(--accent); background: var(--accent-soft); }
.cfg-addon-text { display: grid; gap: .1rem; }
.cfg-unit { grid-column: 1; color: var(--muted); font-variant-numeric: tabular-nums; }
.cfg-unit:empty { display: none; }
.cfg-stepper { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: .25rem; }
.cfg-stepper input { width: 3.6rem; text-align: center; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.cfg-stepper input::-webkit-inner-spin-button, .cfg-stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.cfg-stepper .btn { min-width: 2.25rem; font-weight: 700; }
/* Aufstellung im Stil eines Begleitscheins: gelochter Rand, gestrichelte Zeilen */
.cfg-slip { background: var(--surface); border: 1px solid var(--line); border-radius: 2px; padding: 1.4rem 1.1rem 1rem; position: relative; margin-bottom: 1rem; }
.cfg-slip::before { content: ""; position: absolute; left: 10px; right: 10px; top: 7px; height: 6px; background: radial-gradient(circle, var(--bg) 2.5px, transparent 3px) 0 0 / 14px 6px repeat-x; }
.cfg-slip-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; padding-bottom: .5rem; border-bottom: 2px solid var(--text); }
.cfg-slip-per { font-weight: 500; font-size: .85rem; color: var(--muted); }
.cfg-slip-lines { list-style: none; margin: 0; padding: 0; counter-reset: pos; }
.cfg-slip-lines li { display: flex; justify-content: space-between; gap: .75rem; padding: .5rem 0; border-bottom: 1px dashed var(--line); counter-increment: pos; }
.cfg-slip-lines li:not(.cfg-l-empty)::before { content: counter(pos) "."; color: var(--muted); min-width: 1.4rem; font-variant-numeric: tabular-nums; }
.cfg-l-name { flex: 1; }
.cfg-l-name em { font-style: normal; color: var(--green); font-size: .85em; white-space: nowrap; }
.cfg-l-sum { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cfg-l-empty { color: var(--muted); }
.cfg-slip-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: .7rem; }
.cfg-slip-total strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; color: var(--text); border-bottom: 3px solid var(--accent); line-height: 1.15; }
.cfg-slip-note { color: var(--muted); margin: .6rem 0 0; }
.cfg-go { width: 100%; justify-content: center; font-size: 1.05rem; padding: .8rem 1rem; margin-bottom: .5rem; }
.cfg-in-app .cfg-slip { margin-top: .5rem; }
.flash-limit a { font-weight: 700; margin-left: .35rem; white-space: nowrap; }
@media (prefers-reduced-motion: no-preference) { .cfg-addon, .cfg-plan { transition: border-color .15s, background-color .15s; } }
/* Frühwarnung Tarif-Grenzen (seit 2.21) */
.license-banner-soft { background: var(--accent-soft); color: var(--text); border-bottom: 1px solid var(--line); }
.license-banner-soft a { font-weight: 700; }
/* Konfigurator 2.21: Tarifwechsel-Hinweis, Angebot, Verkleinern */
.cfg-hint { border: 1px solid var(--accent); border-left-width: 4px; background: var(--accent-soft); border-radius: var(--radius); padding: .8rem 1rem; margin-bottom: 1rem; }
.cfg-hint p { margin: 0 0 .5rem; }
.cfg-intro-by { font-size: .45em; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.cfg-quote { margin: .5rem 0 1rem; }
.cfg-quote summary { cursor: pointer; font-weight: 700; }
.cfg-quote .field { margin: .5rem 0; }
.cfg-reduce summary { cursor: pointer; font-weight: 700; margin: .5rem 0; }
.cfg-reduce .inline-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .4rem 0; }
.row-warn td { color: var(--danger, #b42318); font-weight: 700; }
.cfg-offer { max-width: 760px; margin: 0 auto; }
.cfg-offer-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; align-items: flex-end; margin: .5rem 0 1.5rem; border-bottom: 2px solid var(--text); padding-bottom: 1rem; }
.cfg-offer-kicker { text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--accent); margin: 0 0 .25rem; font-size: .85rem; }
.cfg-offer-head h1 { margin: 0; font-size: clamp(1.6rem, 3.5vw, 2.3rem); line-height: 1.1; }
.cfg-offer-meta { display: grid; grid-template-columns: auto auto; gap: .15rem 1rem; margin: 0; font-size: .9rem; }
.cfg-offer-meta div { display: contents; }
.cfg-offer-meta dt { color: var(--muted); }
.cfg-offer-meta dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.cfg-offer-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
@media print { .legal-head, .legal-footer, .cookie-notice, .no-print, .flash { display: none !important; } body { background: #fff; } .cfg-main { padding: 0; } .cfg-slip { border-color: #000; } }
/* Werkstatt-Verbund (seit 2.22) */
.card-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card-grid .card { display: grid; gap: .3rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: inherit; }
.card-grid .card:hover { border-color: var(--accent); }
.share-box { border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .9rem; margin: .5rem 0; }
.share-box legend { font-weight: 700; padding: 0 .3rem; }
.share-box .check { margin-right: .8rem; }
.share-sites { margin: .35rem 0 .35rem 1.5rem; }
.share-row { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.share-row:last-of-type { border-bottom: 0; }
.share-head { margin-bottom: .2rem; }
/* Verbund-Vorgang (seit 2.25): Kopfzeile je Vorgang in „Meine Anfragen“ */
.row-group td { background: var(--accent-soft); border-top: 2px solid var(--accent); padding-top: .55rem; padding-bottom: .55rem; }
.row-group td::before { display: none !important; }
/* Eigene Marke des Betriebs (White-Label, seit 2.26) */
.brand-form .form-grid { align-items: start; }
.brand-color-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.brand-color-row input[type="color"] { width: 3.2rem; height: 2.2rem; padding: .15rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); cursor: pointer; }
.brand-preview { display: flex; flex-direction: column; gap: .4rem; }
.brand-preview-img { max-height: 64px; max-width: 100%; width: auto; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 4px; align-self: flex-start; }
.brand-swatch { display: inline-block; width: .9em; height: .9em; border-radius: 3px; border: 1px solid var(--line); vertical-align: -.1em; }
.form-actions-left { margin-top: .5rem; }
.form-actions-left .btn { flex: 0 0 auto; }
.sheet-logo-brand { max-width: 40mm; object-fit: contain; }
.sheet-logo-text { font-weight: 800; font-size: 14pt; line-height: 9mm; white-space: nowrap; }

/* 2.27: Kiosk, Marktplatz, Verlust */
.kiosk-banner { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.kiosk-banner form.inline { margin: 0; }
.kiosk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.kiosk-tile, .kiosk-tile button { display: flex; flex-direction: column; gap: .35rem; padding: 1.6rem 1.2rem; border-radius: var(--radius, 12px); background: var(--panel, #fff); border: 1px solid var(--border, #ddd); text-decoration: none; color: inherit; min-height: 120px; justify-content: center; font: inherit; width: 100%; text-align: left; cursor: pointer; }
.kiosk-tile strong { font-size: 1.25rem; }
.kiosk-tile span { color: var(--muted, #666); font-size: .9rem; }
.kiosk-tile:hover, .kiosk-tile button:hover { border-color: var(--primary, #1f6feb); }
.kiosk-tile-form { padding: 0; border: 0; background: none; }
.kiosk-box .input-lg { font-size: 1.5rem; padding: .8rem 1rem; }
.btn-lg { font-size: 1.15rem; padding: .9rem 1.2rem; }
.badge-lost { background: #7c3aed; color: #fff; }
.text-danger { color: var(--danger, #c0392b); }

/* ---------- Prüfmittelliste & Prüfabfrage (seit 2.28) ---------- */
.catalog-hint { border: 1px solid #ffd8a8; background: var(--accent-soft); border-radius: var(--radius); padding: .75rem .9rem; margin-bottom: .9rem; }
.catalog-hint strong { display: block; margin-bottom: .2rem; }
.catalog-hint .form-inline-row { margin-top: .5rem; }
.catalog-hint p { margin: .5rem 0 0; }
.catalog-hint-static { background: var(--surface-2); border-color: var(--line); }
.choice-list { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .9rem; }
.choice { display: flex; gap: .6rem; align-items: flex-start; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { margin-top: .25rem; flex: 0 0 auto; }
.choice-body { padding: .5rem .8rem .2rem 2.1rem; }
.choice-body[hidden] { display: none; }
.catalog-entry dd { margin-bottom: .35rem; }
.details-inline { display: inline-block; }
.details-inline summary { list-style: none; display: inline-block; }
.details-inline summary::-webkit-details-marker { display: none; }
.details-inline[open] .details-body { position: absolute; z-index: 5; right: 1rem; max-width: min(28rem, 90vw); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: .6rem .8rem; margin-top: .3rem; text-align: left; }
.details-inline .details-body p { margin: 0 0 .4rem; }
.panel-catalog { border-left: 4px solid var(--accent); }
.panel-catalog.panel-skipped { border-left-color: var(--grey); }
.panel-catalog.panel-tracked { border-left-color: var(--green); }
:root[data-theme="dark"] .catalog-hint { background: #2b2118; border-color: #6b4a2a; }
:root[data-theme="dark"] .catalog-hint-static { background: var(--surface-2); border-color: var(--line); }
:root[data-theme="dark"] .choice:has(input:checked) { background: #2b2118; border-color: var(--accent); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .catalog-hint { background: #2b2118; border-color: #6b4a2a; }
  :root:not([data-theme="light"]) .catalog-hint-static { background: var(--surface-2); border-color: var(--line); }
  :root:not([data-theme="light"]) .choice:has(input:checked) { background: #2b2118; border-color: var(--accent); }
}
.panel-equipment { border-left-color: var(--blue); }
.equipment-hits-compact { padding: .6rem .9rem; }
.equipment-hits-compact h2 { font-size: 1rem; margin-bottom: .3rem; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: .35rem .9rem; }

/* ---- SEO & KI (seit 2.29) ---- */
/* Plattform-Admin → SEO & KI */
.seo-switch { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; border-left: 4px solid var(--grey); }
.seo-switch.is-on { border-left-color: var(--green); }
.seo-switch-state { display: flex; align-items: flex-start; gap: .85rem; flex: 1 1 22rem; }
.seo-switch-state h2 { margin: 0 0 .25rem; }
.seo-switch-state p { margin: 0; }
.seo-switch-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--grey); margin-top: .35rem; flex: none; }
.seo-switch.is-on .seo-switch-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(47, 158, 68, .18); }
.seo-switch-btn { min-width: 14rem; font-size: 1.02rem; padding-top: .7rem; padding-bottom: .7rem; }
.seo-switch-note { flex-basis: 100%; margin: 0; }
.seo-serp { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .85rem 1rem; font-family: Arial, sans-serif; margin-bottom: 1rem; }
.seo-serp-url { font-size: .8rem; color: #4d5156; }
.seo-serp-title { font-size: 1.15rem; color: #1a0dab; margin: .15rem 0 .2rem; line-height: 1.3; }
.seo-serp-desc { font-size: .85rem; color: #4d5156; line-height: 1.45; }
:root[data-theme="dark"] .seo-serp-title { color: #8ab4f8; }
:root[data-theme="dark"] .seo-serp-url, :root[data-theme="dark"] .seo-serp-desc { color: #bdc1c6; }
.seo-links { margin: 0 0 1rem; padding-left: 1.1rem; line-height: 1.8; }
.seo-count { display: block; }
@media print { .seo-cta, .seo-end { display: none !important; } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .seo-serp-title { color: #8ab4f8; }
  :root:not([data-theme="light"]) .seo-serp-url, :root:not([data-theme="light"]) .seo-serp-desc { color: #bdc1c6; }
}
/* Plattform-Admin → Übersicht → Verkauf (seit 2.32) */
.sales-switch { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; border-left: 4px solid var(--amber); }
.sales-switch.is-open { border-left-color: var(--green); }
.sales-switch h2 { display: flex; align-items: center; gap: .6rem; margin: 0 0 .25rem; }
.sales-switch p { margin: 0; }
/* Plattform-Admin → Tester (seit 2.34) */
.beta-app-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .3rem 1rem; margin-bottom: .6rem; }
.beta-app-head h2 { margin: 0; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.beta-actions { display: grid; gap: .6rem; margin-top: 1rem; }
.beta-actions details { border: 1px solid var(--line); border-radius: 8px; padding: .5rem .8rem; }
.beta-actions summary { cursor: pointer; font-weight: 700; }
.beta-actions details[open] summary { margin-bottom: .7rem; }
.beta-delete { margin-top: .8rem; text-align: right; }
/* Captcha öffentlicher Formulare (seit 2.35) */
.captcha { font-size: .82rem; color: var(--muted); }
.captcha-status { display: inline-flex; align-items: center; gap: .4rem; }
.captcha-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); flex: none; }
.captcha.is-busy .captcha-dot { background: var(--amber); animation: captcha-pulse 1s ease-in-out infinite; }
.captcha.is-ok .captcha-dot { background: var(--green); }
.captcha.is-error .captcha-dot { background: var(--red); }
.captcha-fallback { margin-top: .5rem; }
.captcha-math input { max-width: 8rem; }
@keyframes captcha-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .captcha.is-busy .captcha-dot { animation: none; } }
/* Update einspielen (seit 2.36) */
.update-notes { white-space: pre-wrap; max-height: 24rem; }
