/* ============ DESIGN-TOKENS ============ */
:root {
  --primary: #246df3;
  --primary-dark: #1f5fd1;
  --primary-soft: rgba(41, 112, 243, .1);
  --primary-text: var(--primary);
  --accent: #46d993;
  --whatsapp: #46d993;

  --dark-bg: #0b1220;
  --dark-bg-2: #111a2b;
  --sidebar-text: #aab4c5;

  --grey-bg: #f3f5f9;
  --card-bg: #ffffff;
  --surface-2: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e6e9ef;
  --input-border: #7c8ba1;
  --input-border-hover: #64748b;
  --input-border-muted: #cbd5e1;

  --success: #15803d;
  --danger: #dc2626;
  --warning: #d97706;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .05);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .25);

  --sidebar-w: 248px;
  --header-h: 68px;
  --bottom-nav-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

body.dark {
  --grey-bg: #0b1220;
  --card-bg: #111a2b;
  --surface-2: #0f1726;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: #1f2a3d;
  --input-border: #5a6c87;
  --input-border-hover: #7186a3;
  --input-border-muted: #3a4860;
  --primary-soft: rgba(41, 112, 243, .18);
  --primary-text: #5c92ff;
  --shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

/* Grüne Schrift im Dunkelmodus wie bisher: --success ist für weiße Schrift auf Grün abgedunkelt */
body.dark .summary-pill-profit .summary-value,
body.dark .auth-message-success,
body.dark .field.ocr-verified label::after,
body.dark .integration-stat.good b {
  color: #16a34a;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--grey-bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
.logo-fallback {
  font-family: 'Exo 2', 'Inter', sans-serif;
}

a {
  color: var(--primary-text);
}

.ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ============ LAYOUT ============ */
.app {
  display: flex;
  min-height: 100vh;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.content {
  padding: 28px;
  width: 100%;
  max-width: 2200px;
  margin: 0 auto;
}

/* ============ SIDEBAR ============ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0f1a30 0%, var(--dark-bg) 60%);
  color: #fff;
  border-right: 1px solid rgba(255, 255, 255, .04);
  z-index: 60;
}

.brand-block {
  padding: 22px 20px 18px;
}

/* Topbar und Logo-Bereich der Seitenleiste: gleiche Höhe, eine durchgehende Unterkante */
@media (min-width: 901px) {
  :root {
    --ajx-top-h: 84px;
  }

  .brand-block {
    box-sizing: border-box;
    height: var(--ajx-top-h);
    padding-top: 0;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .header {
    box-sizing: border-box;
    height: var(--ajx-top-h);
    min-height: var(--ajx-top-h);
  }
}

/* Felder in einer Zeile: Beschriftungen unten bündig, Eingaben auf einer Linie */
.ajx-align-end {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.ajx-align-end > label {
  margin-top: auto;
}

.brand-logo {
  display: flex;
  align-items: center;
}

.logo-fallback {
  display: grid;
  grid-template-columns: 3px 1fr;
  column-gap: 10px;
  row-gap: 1px;
  align-items: center;
  min-width: 0;
}

.logo-fallback .logo-accent {
  grid-row: 1 / 3;
  grid-column: 1;
  height: 100%;
  min-height: 34px;
}

.logo-fallback .logo-thin {
  grid-column: 2;
  font-size: 11px;
  letter-spacing: 2.5px;
}

.logo-fallback .logo-bold {
  grid-column: 2;
  font-size: 17px;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
}

.logo-thin {
  color: #9aa6ba;
  font-weight: 500;
  letter-spacing: 1.5px;
  font-size: 14px;
  text-transform: uppercase;
}

.logo-accent {
  width: 3px;
  height: 18px;
  border-radius: 2px;
  background: var(--accent);
  display: inline-block;
  flex-shrink: 0;
}

.logo-bold {
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 1px;
  font-size: 15px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  margin-top: 6px;
  font-size: 11px;
  color: #6f7c92;
  letter-spacing: .6px;
  text-transform: uppercase;
}

.nav-scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 12px 12px;
  /* Schmale, abgerundete Scrollleiste, die nur beim Überfahren sichtbar wird */
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  transition: scrollbar-color .2s;
}

.nav-scroll:hover,
.nav-scroll:focus-within {
  scrollbar-color: rgba(255, 255, 255, .18) transparent;
}

.nav-scroll::-webkit-scrollbar {
  width: 6px;
}

.nav-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.nav-scroll::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
}

.nav-scroll:hover::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .18);
}

/* Fokus-Rahmen nur bei Tastaturbedienung und mit runden Ecken */
.nav-btn:focus,
.bottom-nav-btn:focus {
  outline: none;
}

.nav-btn:focus-visible {
  outline: 2px solid rgba(143, 180, 255, .7);
  outline-offset: -2px;
  border-radius: 10px;
}

.nav-section-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--sidebar-text);
  padding: 16px 10px 6px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  margin: 1px 0;
  background: none;
  border: none;
  border-radius: 10px;
  color: var(--sidebar-text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, .06);
  color: #fff;
}

.nav-btn.active {
  background: rgba(41, 112, 243, .22);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--primary);
}

.nav-btn.active .ico {
  color: #8fb4ff;
}

.sidebar-footer {
  padding: 14px 16px calc(14px + var(--safe-bottom));
  border-top: 1px solid rgba(255, 255, 255, .06);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #6d5dfc);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}

.sidebar-user-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sidebar-user .user-chip {
  color: #dbe2ee;
}

.sidebar-footer-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.sidebar-footer-actions .btn {
  flex: 1;
}

.sidebar-backdrop {
  display: none;
}

/* ============ HEADER ============ */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 28px;
  background: color-mix(in srgb, var(--card-bg) 85%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-title {
  min-width: 0;
  flex: 0 1 auto;
  max-width: 300px;
}

.header h1 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.deal-label {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-search-wrap {
  position: relative;
  flex: 1 1 260px;
  min-width: 220px;
  max-width: 420px;
  margin-left: auto;
}

.global-search-wrap .search-ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.global-search-wrap input {
  padding-left: 36px;
  border-radius: 999px;
  background: var(--surface-2);
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.icon-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}

.icon-btn .ico {
  width: 20px;
  height: 20px;
}

/* ============ KARTEN & FORMULARE ============ */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fade .2s ease;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.card h3 {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card h3::before {
  content: '';
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--primary);
  flex-shrink: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px 16px;
}

.field {
  margin-bottom: 2px;
  min-width: 0;
}

label {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
  min-height: 42px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

input[readonly] {
  background: var(--surface-2);
}

input[type="checkbox"] {
  width: 18px !important;
  height: 18px;
  min-height: 0;
  accent-color: var(--primary);
  flex-shrink: 0;
}

input[type="file"] {
  padding: 8px;
  background: var(--surface-2);
  border-style: dashed;
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  border: none;
  background: var(--primary);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  margin-right: 10px;
  font-weight: 600;
  cursor: pointer;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s, border-color .15s, color .15s;
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover {
  background: var(--primary-dark);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.btn-outline {
  background: var(--card-bg);
  border-color: var(--border);
  color: var(--text);
}

.btn-outline:hover {
  background: var(--card-bg);
  border-color: var(--primary);
  color: var(--primary-text);
}

.btn-ghost {
  background: rgba(255, 255, 255, .06);
  color: #c9d2e0;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

.btn-danger {
  background: var(--danger);
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-success {
  background: var(--success);
}

.btn-success:hover {
  background: #166534;
}

.btn-sm {
  min-height: 32px;
  padding: 5px 12px;
  font-size: 12.5px;
}

.btn-icon {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 13px;
}

label.btn {
  margin: 0;
  color: var(--text);
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

td .btn+.btn {
  margin-left: 6px;
}

/* ============ TABELLEN ============ */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin-top: 14px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  background: var(--surface-2);
}

th:first-child {
  border-top-left-radius: 8px;
}

th:last-child {
  border-top-right-radius: 8px;
}

tbody tr {
  transition: background .1s;
}

tbody tr:hover {
  background: var(--surface-2);
}

tbody tr:last-child td {
  border-bottom: none;
}

.table-empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px;
}

/* ============ KLEINE ELEMENTE ============ */
.summary-box {
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 14px;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-box b {
  color: var(--primary-text);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 4px 0;
}

.summary-row b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.summary-total {
  border-top: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  margin-top: 4px;
  padding-top: 10px;
  font-weight: 600;
}

.summary-total b {
  color: var(--primary-text);
  font-size: 18px;
}

.summary-total:only-child {
  border-top: none;
  margin-top: 0;
  padding-top: 4px;
}

.badge {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary-text);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.legal-hint {
  font-size: 13px;
  color: #92400e;
  background: rgba(217, 119, 6, .08);
  border: 1px solid rgba(217, 119, 6, .35);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
}

body.dark .legal-hint {
  color: #fbbf24;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 0;
}

.progress-wrap {
  background: var(--surface-2);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin-top: 12px;
}

.progress-bar {
  background: linear-gradient(90deg, var(--primary), #6d5dfc);
  height: 100%;
  width: 0%;
  transition: width .2s;
}

iframe.pdf-frame {
  width: 100%;
  height: 520px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 14px;
  background: var(--surface-2);
}

/* Dokumentenvorschau: immer A4 hochkant, mittig, skaliert bis 960 px */
.card iframe.pdf-frame {
  display: block;
  width: 100%;
  max-width: 960px;
  height: auto;
  aspect-ratio: 210 / 297;
  margin-left: auto;
  margin-right: auto;
}

/* Dokumentenvorschau (HTML, A4-Breite skaliert); weißes Papier auch im dunklen Thema */
.dvw-gone { display: none; }

.dvw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.dvw-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.dvw-tab {
  font: inherit;
  font-size: 13px;
  padding: 6px 11px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.dvw-tab.is-active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

.dvw-wrap {
  position: relative;
  height: 60vh;
  min-height: 480px;
  overflow: hidden;
  background: #8a8f98;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.dvw-frame {
  position: absolute;
  display: block;
  border: 0;
  background: #fff;
  transform-origin: top left;
  box-shadow: 0 2px 14px rgba(0, 0, 0, .35);
}
.dvw-note {
  position: absolute;
  z-index: 1;
  top: 12px;
  left: 14px;
  right: 14px;
  margin: 0;
  color: #444;
  background: #fff;
}

.dvw-actions, .tdr-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  background: var(--card-bg);
}
.dvw-actions .btn, .tdr-actions .btn { white-space: nowrap; flex: 0 0 auto; min-height: 30px; padding: 4px 9px; }
.dvw-actions .dvw-saved, .tdr-actions .dvw-saved { margin: 0; font-size: 12px; min-width: 0; flex: 1 1 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dvw-actions .dvw-stale, .tdr-actions .dvw-stale { margin: 0; color: var(--warning); flex: 0 1 auto; font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dvw-actions-end { margin-left: auto; display: flex; gap: 6px; flex: 0 0 auto; }
.dvw-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 1499px) {
  .dvw-saved-prefix { display: none; }
}
@media (max-width: 1199px) {
  .dvw-actions, .tdr-actions { flex-wrap: wrap; }
  .dvw-saved-prefix { display: inline; }
  .dvw-actions .dvw-saved, .dvw-actions .dvw-stale, .tdr-actions .dvw-saved, .tdr-actions .dvw-stale { flex: 1 1 100%; white-space: normal; }
}

/* Ansicht-Umschalter, Großansicht */
.dvw-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dvw-seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.dvw-seg-btn { font: inherit; font-size: 12.5px; padding: 5px 10px; background: transparent; color: var(--muted); border: 0; cursor: pointer; }
.dvw-seg-btn + .dvw-seg-btn { border-left: 1px solid var(--border); }
.dvw-seg-btn.is-active { background: var(--primary-soft); color: var(--text); font-weight: 600; }
.dvw-big { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; background: rgba(2, 6, 23, .72); }
.dvw-big[hidden] { display: none; }
.dvw-big-box { width: 95vw; height: 95vh; display: flex; flex-direction: column; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; }
.dvw-big-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.dvw-big-wrap { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #8a8f98; border-radius: var(--radius-sm); }

/* Linke Spalte: kompakte Prüfliste */
.dvw-open { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.dvw-sec { border-top: 1px solid var(--border); }
.dvw-sec > summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  cursor: pointer;
  font-size: 13.5px;
}
.dvw-sec-t { font-weight: 600; }
.dvw-sec-v { color: var(--muted); text-align: right; min-width: 0; overflow-wrap: anywhere; }
.dvw-sec-b { padding-bottom: 10px; }
.dvw-sec-edit { margin-top: 8px; }
.dvw-mail > details > summary { cursor: pointer; font-weight: 700; }
.dvw-mail > details[open] > summary { margin-bottom: 10px; }

/* Handy/Tablet: untereinander, Aktionsleiste unten fest (über der Fußleiste des Assistenten) */
@media (max-width: 1199px) {
  .dvw-actions, .tdr-actions {
    position: sticky;
    bottom: 72px;
    z-index: 2;
  }
}
@media (max-width: 900px) {
  .dvw-actions, .tdr-actions { bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 70px); }
}

/* Desktop: zwei Spalten, nur Liste und Vorschau scrollen, die Seite nicht */
@media (min-width: 1200px) {
  body.dvw-on .app { height: 100vh; min-height: 0; }
  body.dvw-on .main { height: 100vh; overflow-x: hidden; overflow-y: auto; }
  body.dvw-on .content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding-top: 14px;
    padding-bottom: 14px;
  }
  /* Platz für die feste Fußleiste des Assistenten als echtes Element: so scrollt die Seite bis hinter die Aktionsleiste, wenn die Vorschau sonst unter 480 px fiele */
  body.dvw-on.wizard-on .content { padding-bottom: 14px; }
  body.dvw-on .content::after { content: ''; flex: 0 0 74px; }
  body.dvw-on .wizard-bar { margin-bottom: 10px; flex-shrink: 0; }
  body.dvw-on #dsReqNote { display: none; }
  body.dvw-on #tab-dokumente.active {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
    min-height: 600px;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 12px 16px;
  }
  body.dvw-on #tab-dokumente > .card { margin-bottom: 0; }
  @media (max-width: 1499px) { body.dvw-on #tab-dokumente.active { grid-template-columns: 300px minmax(0, 1fr); } }
  body.dvw-on #wizardSummaryCard { grid-column: 1; grid-row: 1; overflow-y: auto; min-height: 0; padding: 14px 18px; }
  body.dvw-on #wizardSummaryCard h3 { margin-bottom: 6px; }
  body.dvw-on .dvw-card { grid-column: 2; grid-row: 1 / 3; display: flex; flex-direction: column; min-height: 0; padding: 14px 18px; }
  body.dvw-on .dvw-mail { grid-column: 1; grid-row: 2; padding: 12px 18px; }
  body.dvw-on .dvw-wrap { flex: 1; height: auto; min-height: 0; }
}

details.debug-box {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  background: var(--surface-2);
}

details.debug-box summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

details.debug-box textarea {
  margin-top: 10px;
  min-height: 160px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
}

.rotate-wrap {
  display: none;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--surface-2);
}

.rotate-wrap canvas {
  display: block;
  max-width: 100%;
  border-radius: 8px;
  background: #fff;
  margin-bottom: 10px;
  cursor: crosshair;
  touch-action: none;
}

.rotate-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.crop-hint {
  font-size: 12px;
  color: var(--primary-text);
  margin: 8px 0 0;
  font-weight: 500;
}

.binarize-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-top: 12px;
}

.binarize-toggle label {
  font-weight: 500;
  color: var(--text);
}

.connection-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: #8a96aa;
}

.connection-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8a96aa;
}

.connection-ok::before {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(70, 217, 147, .2);
}

.connection-fail::before {
  background: var(--danger);
}

.user-chip {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

/* ============ SUCHE ============ */
.search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 50;
  max-height: 380px;
  overflow-y: auto;
  padding: 6px 0;
}

.search-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  padding: 10px 14px 4px;
}

.search-result-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.search-result-item:hover {
  background: var(--surface-2);
}

.search-result-sub {
  font-size: 12px;
  color: var(--muted);
}

.search-no-results {
  padding: 14px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* ============ TOASTS ============ */
#toastContainer {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 999;
  pointer-events: none;
}

.toast {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
  transition: opacity .4s, transform .4s;
  max-width: 380px;
  animation: toast-in .25s ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.toast-success {
  background: var(--success);
}

/* Fehlermeldungen bleiben stehen und lassen sich wegklicken */
.toast-error {
  background: var(--danger);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  cursor: pointer;
}

.ds-toast-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  margin: -12px -10px -12px auto;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.ds-toast-close:hover {
  background: rgba(255, 255, 255, .15);
}

.toast-info {
  background: #1e293b;
}

.toast.fade {
  opacity: 0;
  transform: translateY(8px);
}

/* ============ MODAL (Fahrzeugdetails) ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, .6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 200;
  overflow-y: auto;
  padding: 40px 16px;
}

.modal-box {
  background: var(--grey-bg);
  border-radius: 18px;
  padding: 24px;
  max-width: 820px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.modal-box .card {
  margin-bottom: 16px;
}

.modal-header-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 4px;
}

.summary-pill {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.summary-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 2px;
}

.summary-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.summary-pill-profit .summary-value {
  color: var(--success);
}

/* ============ DASHBOARD ============ */
#tab-dashboard {
  --viz-series: #2a78d6;
  --viz-negative: #e34948;
  --viz-grid: #eceef2;
  --viz-baseline: #c3c2b7;
  --viz-ink-muted: #898781;
  --delta-good: #006300;
  --delta-bad: #d03b3b;
}

body.dark #tab-dashboard {
  --viz-series: #3987e5;
  --viz-negative: #e66767;
  --viz-grid: #1f2a3d;
  --viz-baseline: #33405a;
  --viz-ink-muted: #8b96a8;
  --delta-good: #0ca30c;
  --delta-bad: #e66767;
}

#tab-dashboard.is-loading .kpi-grid,
#tab-dashboard.is-loading .dash-grid {
  opacity: .55;
  transition: opacity .2s;
}

.dash-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 6px;
}

.dash-filters .field {
  margin: 0;
  min-width: 130px;
  flex: 1 1 150px;
  max-width: 200px;
}

.dash-filters .dash-custom {
  display: contents;
}

.dash-filters .dash-custom[hidden] {
  display: none;
}

.dash-filters .dash-custom .hint {
  flex-basis: 100%;
}

.dash-filters .dash-quickwrap {
  flex: 0 0 auto;
  max-width: none;
}

.dash-reset {
  margin-left: auto;
  flex-shrink: 0;
}

/* Einheitliche Filter-/Aktionszeilen: gleiche Höhe, Schrift, Rahmen; Unterkante bündig */
.flt-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.flt-item {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.flt-item > label,
.flt-grid .field > label,
.dash-filters .field > label {
  display: block;
  height: 18px;
  line-height: 18px;
  margin: 0 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flt-item > label.flt-check {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.flt-fmt {
  margin-left: 4px;
  font-size: 11px;
  font-weight: 400;
  opacity: .75;
}

.flt-row .hint {
  flex-basis: 100%;
}

.range-quick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.flt-control,
.flt-grid .field input:not([type="checkbox"]),
.flt-grid .field select,
.dash-filters .field input,
.dash-filters .field select {
  box-sizing: border-box;
  height: 40px;
  min-height: 40px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
}

.btn.flt-control {
  padding: 0 14px;
  font-weight: 600;
}

.flt-date,
.flt-grid .field input[type="date"],
.dash-filters .field input[type="date"] {
  width: 160px;
  min-width: 160px;
}

.flt-sel {
  width: 110px;
}

.flt-reset.dash-reset {
  box-sizing: border-box;
  height: 40px;
  width: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
}

.flt-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.flt-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
}

.flt-toggle,
.flt-reset {
  background: none;
  border: 0;
  padding: 2px 6px;
  font-size: 16px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  border-radius: 4px;
}

.flt-toggle {
  font-size: 14px;
  transition: transform 0.15s;
}

.flt-toggle.flt-open {
  transform: rotate(90deg);
}

.flt-reset {
  margin-left: auto;
  font-size: 18px;
}

.flt-toggle:hover,
.flt-reset:hover {
  color: var(--text);
}

.flt-body {
  margin-bottom: 8px;
}

.flt-body[hidden] {
  display: none;
}

.flt-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .flt-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.dash-period {
  font-size: 12.5px;
  color: var(--muted);
  margin: 6px 0 16px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.kpi-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.kpi-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-hero .kpi-value {
  font-size: 30px;
}

.kpi-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: 12px;
  min-height: 18px;
}

.kpi-sub {
  color: var(--muted);
}

.kpi-delta {
  font-weight: 700;
  white-space: nowrap;
}

.kpi-delta.good {
  color: var(--delta-good);
}

.kpi-delta.bad {
  color: var(--delta-bad);
}

.kpi-delta.neutral {
  color: var(--muted);
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px;
}

.dash-grid .card {
  min-width: 0;
}

.dash-wide {
  grid-column: 1 / -1;
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.card-head h3 {
  margin: 0;
}

.card-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
}

.seg {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
}

.seg-btn.active {
  background: var(--card-bg);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.chart {
  width: 100%;
  min-height: 260px;
}

.chart svg {
  display: block;
  overflow: visible;
}

.viz-grid {
  stroke: var(--viz-grid);
  stroke-width: 1;
}

.viz-baseline {
  stroke: var(--viz-baseline);
  stroke-width: 1;
}

.viz-axis {
  fill: var(--viz-ink-muted);
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  font-variant-numeric: tabular-nums;
}

.viz-value {
  fill: var(--text);
  font-size: 11.5px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
}

.viz-empty {
  fill: var(--muted);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
}

.viz-bar {
  fill: var(--viz-series);
  transition: opacity .1s;
}

.viz-bar-neg {
  fill: var(--viz-negative);
}

.viz-bar-partial {
  opacity: .45;
}

.viz-hit {
  fill: transparent;
  cursor: default;
  outline: none;
}

.viz-hit.is-hover,
.viz-hit:focus-visible {
  fill: color-mix(in srgb, var(--viz-series) 7%, transparent);
}

.viz-tooltip {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 10px 12px;
  font-size: 12.5px;
  min-width: 150px;
}

.viz-tip-title {
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.viz-tip-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 1px 0;
}

.viz-tip-row b {
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.viz-tip-row span {
  color: var(--muted);
}

.card-collapse summary {
  cursor: pointer;
  list-style: none;
}

.card-collapse summary::-webkit-details-marker {
  display: none;
}

.card-collapse:not([open]) summary h3 {
  margin-bottom: 0;
}

.card-collapse .collapse-arrow {
  order: -1;
  font-size: 14px;
  color: var(--muted);
  transition: transform 0.15s;
}

.card-collapse[open] .collapse-arrow {
  transform: rotate(90deg);
}

.table-toggle {
  margin-top: 12px;
}

.table-toggle summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.bar-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bar-list-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin: 16px 0 4px;
}

.bar-row {
  display: grid;
  grid-template-columns: 22px minmax(70px, 34%) 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 7px 6px;
  border-radius: 8px;
  outline: none;
}

.bar-row-plain {
  grid-template-columns: minmax(80px, 30%) 1fr auto;
}

.bar-row.is-hover,
.bar-row:focus-visible {
  background: var(--surface-2);
}

.dsh-expandable {
  cursor: pointer;
}

.dsh-expandable:hover {
  background: var(--surface-2);
}

.dsh-arrow {
  display: inline-block;
  margin-right: 6px;
  font-size: 14px;
  color: var(--muted);
  transition: transform 0.15s;
}

.dsh-expandable[aria-expanded="true"] .dsh-arrow {
  transform: rotate(90deg);
}

.fzx-custom {
  margin-top: 6px;
}

.fzx-custom[hidden] {
  display: none;
}

.dsh-sub {
  margin: 0 0 6px 32px;
  padding-left: 10px;
  border-left: 2px solid var(--surface-2);
}

.dsh-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 7px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.3);
  vertical-align: -1px;
}

.bar-rank {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bar-label {
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  height: 10px;
}

.bar-fill {
  height: 100%;
  background: var(--viz-series);
  border-radius: 0 4px 4px 0;
}

.bar-fill-neg {
  background: var(--viz-negative);
}

.bar-value {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.viz-more,
.viz-empty-text {
  font-size: 12.5px;
  color: var(--muted);
  margin: 8px 0 0;
}

.viz-empty-text {
  padding: 18px 0;
  text-align: center;
}

.mini-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mini-kpis div {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
}

.mini-kpis span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.mini-kpis b {
  font-size: 17px;
}

.dash-footnote {
  max-width: 900px;
  line-height: 1.6;
  margin-top: 4px;
}

/* Status-Kennzeichnung: immer Text + Farbe, nie nur Farbe */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.status-offen {
  background: var(--primary-soft);
  color: var(--primary-text);
}

.status-verkauft {
  background: rgba(22, 163, 74, .12);
  color: #15803d;
}

.status-verkauft::before {
  content: '✓';
}

.status-storniert {
  background: rgba(100, 116, 139, .15);
  color: var(--muted);
  text-decoration: line-through;
}

.status-warning {
  background: rgba(217, 119, 6, .12);
  color: #b45309;
}

.status-gewaehrleistung-aktiv {
  background: rgba(220, 38, 38, .12);
  color: #b91c1c;
}

body.dark .status-gewaehrleistung-aktiv {
  color: #f87171;
}

body.dark .status-verkauft {
  color: #4ade80;
}

body.dark .status-warning {
  color: #fbbf24;
}

.link-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 13.5px;
  font-weight: 500;
}

.link-info[hidden],
.dash-custom[hidden],
#soldAtField[hidden],
#ocrCancelBtn[hidden],
#ocrRescanBtn[hidden],
#fzCancelBtn[hidden],
#fzRescanBtn[hidden],
#nav-admin[hidden],
.header-actions .btn[hidden],
.ds-req-note[hidden] {
  display: none;
}

@media (max-width: 1100px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .dash-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .dash-filters .field {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
  }

  .dash-reset {
    margin-left: auto;
  }

  .kpi-grid {
    gap: 10px;
  }

  .kpi {
    padding: 12px 14px;
  }

  .kpi-value,
  .kpi-hero .kpi-value {
    font-size: 20px;
  }


  .bar-row {
    grid-template-columns: 18px minmax(60px, 30%) 1fr auto;
    gap: 8px;
  }

  .bar-row-plain {
    grid-template-columns: minmax(90px, 36%) 1fr auto;
  }
}

/* ============ HANDY-NAVIGATION (unten) ============ */
.bottom-nav {
  display: none;
}

/* ============ LOGIN / REGISTRIERUNG ============ */
body.auth-pending .app,
body.auth-pending .auth-screen,
body.auth-mode .app {
  display: none;
}

body.lock-mode .app {
  display: none;
}

body.lock-mode .lock-screen {
  display: flex;
}

body.lock-mode .auth-screen:not(.lock-screen) {
  display: none;
}

.auth-screen {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(41, 112, 243, .35), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(70, 217, 147, .18), transparent 60%),
    var(--dark-bg);
}

body.auth-mode .auth-screen:not(.lock-screen) {
  display: flex;
}

#lockScreen[hidden] {
  display: none !important;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card-bg);
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
}

.auth-brand .logo-thin {
  color: var(--muted);
}

.auth-brand .logo-bold {
  color: var(--text);
}

.auth-form {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.auth-form h2 {
  margin: 0 0 4px;
  font-size: 22px;
}

.auth-submit {
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  margin-top: 4px;
}

.auth-links a {
  text-decoration: none;
  font-weight: 600;
}

.auth-message:empty {
  display: none;
}

.auth-message {
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 8px;
}

.auth-message-error {
  background: rgba(220, 38, 38, .1);
  color: var(--danger);
}

.auth-message-success {
  background: rgba(22, 163, 74, .1);
  color: var(--success);
}

.register-trial {
  font-weight: 700;
  margin: 0 0 8px;
}

.register-plan-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.register-plan {
  flex: 1 1 140px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--border, #ddd);
  border-radius: 8px;
  font-size: 13px;
}

.register-terms {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
}

.trial-banner {
  padding: 6px 16px;
  font-size: 12px;
  text-align: center;
  background: var(--surface-2);
  color: var(--muted);
}
.trial-banner.is-urgent {
  background: rgba(217, 119, 6, .1);
  color: #b45309;
  font-weight: 600;
}

/* ============ TABLET & HANDY ============ */
@media (max-width: 1100px) {
  .header .btn-label {
    display: none;
  }

  .header .btn {
    padding: 9px 12px;
  }
}

@media (max-width: 900px) {

  /* Seitenleiste wird zum ausklappbaren Menü */
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100%;
    width: min(300px, 86vw);
    transform: translateX(-100%);
    transition: transform .25s ease;
  }

  body.sidebar-open .sidebar {
    transform: none;
    box-shadow: var(--shadow-lg);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, .5);
    z-index: 55;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
  }

  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .icon-btn {
    display: inline-flex;
  }

  .header {
    flex-wrap: wrap;
    gap: 10px 12px;
    padding: 10px 16px;
    padding-top: max(10px, env(safe-area-inset-top));
  }

  .header-title {
    flex: 1;
    max-width: none;
  }

  .global-search-wrap {
    min-width: 0;
  }

  .header h1 {
    font-size: 18px;
  }

  .global-search-wrap {
    order: 10;
    flex-basis: 100%;
    max-width: none;
  }

  .content {
    padding: 16px 14px calc(var(--bottom-nav-h) + var(--safe-bottom) + 24px);
  }

  .card {
    padding: 18px 16px;
    border-radius: 12px;
    margin-bottom: 14px;
  }

  /* Navigationsleiste unten */
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    height: calc(var(--bottom-nav-h) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: color-mix(in srgb, var(--card-bg) 92%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    border-top: 1px solid var(--border);
  }

  .bottom-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    color: var(--muted);
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .bottom-nav-btn .ico {
    width: 22px;
    height: 22px;
  }

  .bottom-nav-btn.active {
    color: var(--primary-text);
  }

  #toastContainer {
    left: 12px;
    right: 12px;
    bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 12px);
    align-items: center;
  }

  .toast {
    max-width: 100%;
  }

  /* Fahrzeugdetails als Vollbild */
  .modal-overlay {
    padding: 0;
  }

  .modal-box {
    border-radius: 0;
    min-height: 100%;
    padding: 16px 14px calc(24px + var(--safe-bottom));
    padding-top: max(16px, env(safe-area-inset-top));
  }

  iframe.pdf-frame {
    height: 420px;
  }
}

@media (max-width: 720px) {

  /* Größere Schrift verhindert das automatische Hineinzoomen auf dem iPhone */
  input,
  select,
  textarea {
    font-size: 16px;
    min-height: 46px;
  }

  .btn {
    min-height: 44px;
  }

  .btn-sm {
    min-height: 36px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .modal-header-summary {
    grid-template-columns: 1fr;
  }

  .summary-pill {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  /* Tabellen werden zu Karten */
  .responsive-table thead {
    display: none;
  }

  .responsive-table,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table td {
    display: block;
    width: 100%;
  }

  .responsive-table tr {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px 14px;
    margin-bottom: 10px;
    background: var(--card-bg);
  }

  .responsive-table tbody tr:hover {
    background: var(--card-bg);
  }

  .responsive-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    text-align: right;
    word-break: break-word;
  }

  .responsive-table tr td:last-child {
    border-bottom: none;
  }

  .responsive-table td::before {
    content: attr(data-label);
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-align: left;
    flex-shrink: 0;
  }

  .responsive-table td[data-label="Aktion"] {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .responsive-table td[data-label="Aktion"]::before {
    display: none;
  }

  .responsive-table td.table-empty {
    justify-content: center;
    text-align: center;
  }

  .responsive-table td.table-empty::before {
    display: none;
  }

  .responsive-table tr:has(.table-empty) {
    border-style: dashed;
  }
}

/* ============ OCR: Hinweise & Feldstatus ============ */
.ocr-tips {
  font-size: 12.5px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 12px;
  line-height: 1.55;
}

.ocr-tips code {
  font-size: 12px;
}

.field.ocr-verified label::after {
  content: ' ✓ geprüft';
  color: var(--success);
  font-weight: 700;
}

.field.ocr-verified input {
  border-color: color-mix(in srgb, var(--success) 55%, var(--border));
}

.field.ocr-found label::after {
  content: ' · bitte prüfen';
  color: var(--warning);
  font-weight: 600;
}

.field.ocr-uncertain label::after {
  content: ' ⚠ unsicher';
  color: var(--warning);
  font-weight: 700;
}

.field.ocr-uncertain input {
  border-color: var(--warning);
  background: color-mix(in srgb, var(--warning) 12%, var(--surface-2));
}

.ocr-note {
  font-size: 12px;
  color: var(--warning);
  margin-top: 4px;
}

/* ============ DASHBOARD: SICHTSCHUTZ ============ */
.dash-protect {
  position: relative;
}

.dash-protect.is-locked .dash-protect-content {
  filter: blur(14px);
  user-select: none;
  pointer-events: none;
}

.dash-hide-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  margin-bottom: 6px;
}

/* ============ DASHBOARD: AUFKLAPPBARE KARTEN ============ */
.dsh-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.dsh-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  cursor: pointer;
  border-radius: 6px;
  user-select: none;
}

.dsh-head h3 {
  margin: 0;
}

.dsh-head .collapse-arrow {
  font-size: 14px;
  color: var(--muted);
  transition: transform 0.15s;
}

.dsh-head[aria-expanded="true"] .collapse-arrow {
  transform: rotate(90deg);
}

.dsh-head[aria-expanded="false"] {
  margin-bottom: 0;
}

.dash-grid {
  align-items: start;
}

.dash-grid .card {
  transition: padding 0.2s ease, margin 0.2s ease;
}

/* Zugeklappt: die ganze Karte schrumpft auf die Kopfzeile */
.dash-grid .card.dsh-card-closed {
  padding-top: 13px;
  padding-bottom: 13px;
  margin-bottom: 10px;
}

.dsh-head {
  transition: margin 0.2s ease;
}

.dsh-body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.2s ease, visibility 0.2s;
}

.dsh-body.dsh-closed {
  grid-template-rows: 0fr;
  visibility: hidden;
}

.dsh-inner {
  min-height: 0;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .dash-grid .card,
  .dsh-head,
  .dsh-body,
  .dsh-head .collapse-arrow {
    transition: none;
  }
}

.dsh-head:hover .collapse-arrow {
  color: var(--text);
}

.dsh-head:focus-visible {
  outline: 2px solid var(--primary, #2563eb);
  outline-offset: 2px;
}

.dsh-tools {
  margin-bottom: 14px;
}

@media (pointer: coarse) {
  .dsh-head {
    min-height: 44px;
  }
}

/* ============ DASHBOARD: KARTE ============ */
#tab-dashboard {
  --geo-land: #eef2f8;
  --geo-border: #cdd6e4;
}

body.dark #tab-dashboard {
  --geo-land: #17223a;
  --geo-border: #2a3a58;
}

.geo-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.live-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(70, 217, 147, .6);
  animation: live-dot 2s infinite;
}

@keyframes live-dot {
  70% { box-shadow: 0 0 0 7px rgba(70, 217, 147, 0); }
  100% { box-shadow: 0 0 0 0 rgba(70, 217, 147, 0); }
}

.geo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

.geo-map {
  position: relative;
  min-height: 320px;
  border-radius: var(--radius-sm);
  background:
    radial-gradient(120% 90% at 50% 40%, color-mix(in srgb, var(--viz-series) 5%, transparent), transparent 70%),
    var(--surface-2);
  overflow: hidden;
}

.geo-map svg {
  display: block;
}

.geo-state {
  fill: var(--geo-land);
  stroke: var(--geo-border);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  transition: fill .15s;
}

.geo-state:hover {
  fill: color-mix(in srgb, var(--geo-land) 85%, var(--viz-series));
}

.geo-bubble {
  fill: var(--viz-series);
  fill-opacity: .55;
  stroke: var(--card-bg);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  outline: none;
  transition: fill-opacity .15s;
}

.geo-bubble.is-hover,
.geo-bubble:focus-visible {
  fill-opacity: .9;
  stroke: var(--text);
}

.geo-pulse {
  fill: none;
  stroke: var(--viz-series);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
  transform-box: fill-box;
  transform-origin: center;
  animation: geo-pulse 1.6s ease-out 4;
  opacity: 0;
}

@keyframes geo-pulse {
  0% { transform: scale(1); opacity: .8; }
  100% { transform: scale(2.6); opacity: 0; }
}

.geo-dealer-dot {
  fill: var(--text);
  stroke: var(--card-bg);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.geo-dealer-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}

.geo-label {
  fill: var(--text);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  stroke: var(--surface-2);
  paint-order: stroke;
  stroke-linejoin: round;
  pointer-events: none;
}

.geo-empty {
  position: absolute;
  inset: auto 16px 16px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.geo-side .mini-kpis {
  margin-bottom: 4px;
}

.geo-info-btn {
  background: none;
  border: 0;
  padding: 0 2px;
  margin-left: 4px;
  font-size: 15px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

.geo-info-btn:hover {
  color: var(--text);
}

.geo-note {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 10px;
}

.geo-note[hidden] {
  display: none;
}

.geo-note-active {
  color: var(--text);
  font-weight: 600;
}

.geo-filters {
  margin-top: 14px;
}

.geo-side .mini-kpis small {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
  margin-top: 2px;
}

.geo-attribution {
  font-size: 11px;
  color: var(--muted);
  margin: 10px 0 0;
  text-align: right;
}

@media (max-width: 1100px) {
  .geo-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .geo-pulse,
  .live-badge::before {
    animation: none;
  }
}

.geo-ref-dot {
  fill: var(--muted);
  opacity: .7;
  pointer-events: none;
}

.geo-ref-label {
  fill: var(--muted);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  stroke: var(--surface-2);
  paint-order: stroke;
  stroke-linejoin: round;
  pointer-events: none;
}

.geo-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.geo-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.geo-legend-item svg {
  overflow: visible;
}

.geo-legend .geo-bubble {
  cursor: default;
}

/* ============ INTEGRATIONEN ============ */
.integration-intro {
  color: var(--muted);
  margin: 0 0 18px;
}

.integrations-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.integration-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.integration-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.integration-brand h3 {
  margin: 0;
}

.integration-brand h3::before {
  display: none;
}

.integration-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-family: 'Exo 2', sans-serif;
  font-weight: 800;
  font-size: 14px;
  color: var(--muted);
}

.integration-logo-mobile {
  background: #0d1b3e;
  border-color: #0d1b3e;
  color: #fff;
  letter-spacing: .2px;
}

.integration-meta {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.integration-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.integration-status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status-not_connected {
  background: var(--surface-2);
  color: var(--muted);
}

.status-connected {
  background: rgba(22, 163, 74, .12);
  color: #15803d;
}

.status-error {
  background: rgba(220, 38, 38, .1);
  color: var(--danger);
}

.status-importing {
  background: var(--primary-soft);
  color: var(--primary-text);
}

body.dark .status-connected {
  color: #4ade80;
}

.integration-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.btn-danger-outline {
  margin-left: auto;
  color: var(--danger);
}

.btn-danger-outline:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.field-error:empty {
  display: none;
}

.field-error {
  font-size: 12px;
  color: var(--danger);
  font-weight: 600;
  margin: 6px 0 0;
}

.field.has-error input,
.field.has-error select {
  border-color: var(--danger);
}

.integration-message {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
}

.message-success {
  background: rgba(22, 163, 74, .1);
  color: #15803d;
}

.message-error {
  background: rgba(220, 38, 38, .1);
  color: var(--danger);
}

.message-info {
  background: var(--primary-soft);
  color: var(--primary-text);
}

body.dark .message-success {
  color: #4ade80;
}

.integration-result {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.integration-result-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}

.integration-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.integration-stat {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
}

.integration-stat b {
  font-size: 20px;
}

.integration-stat span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.integration-stat.good b {
  color: var(--success);
}

.integration-stat.bad b {
  color: var(--danger);
}

.integration-details {
  margin-top: 12px;
  font-size: 13px;
}

.integration-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
}

.integration-details ul {
  margin: 8px 0 0;
  padding-left: 18px;
  max-height: 240px;
  overflow-y: auto;
}

.integration-details li {
  margin-bottom: 4px;
}

.integration-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--primary-text);
  font-weight: 500;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--primary-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 720px) {
  .integration-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .integration-actions .btn {
    flex: 1 1 calc(50% - 5px);
  }

  .btn-danger-outline {
    margin-left: 0;
  }
}

/* ============ Aktionen in Tabellenzeilen ============ */
.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
}

.row-actions .btn {
  white-space: nowrap;
}

td .row-actions .btn + .btn {
  margin-left: 0;
}

.btn-icon-only {
  width: 32px;
  padding: 0;
}

.btn-icon-only .ico {
  width: 16px;
  height: 16px;
}

.btn-delete {
  color: var(--danger);
}

.btn-delete:hover {
  border-color: var(--danger);
  color: #fff;
  background: var(--danger);
}

#tab-fahrzeugbestand th:last-child {
  text-align: right;
}

@media (max-width: 720px) {
  .responsive-table td.actions-cell {
    display: block;
    padding-top: 12px;
  }

  .row-actions .btn:not(.btn-icon-only) {
    flex: 1;
  }

  .row-actions .btn-icon-only {
    width: 44px;
    min-height: 44px;
  }
}

/* Abo-Status im Admin-Bereich */
.sub-pending_approval { background: rgba(217, 119, 6, .14); color: #b45309; }
.sub-trial { background: var(--primary-soft); color: var(--primary-text); }
.sub-active { background: rgba(22, 163, 74, .12); color: #15803d; }
.sub-past_due { background: rgba(217, 119, 6, .12); color: #b45309; }
.sub-locked, .sub-trial_expired, .sub-cancelled { background: rgba(220, 38, 38, .12); color: #b91c1c; }

.status-zurueckgenommen {
  background: rgba(217, 119, 6, .12);
  color: #b45309;
}

body.dark .status-zurueckgenommen {
  color: #fbbf24;
}

/* ============ VERKAUFSASSISTENT ============ */
/* Ausblenden per Klasse mit !important, damit keine display-Regel das Verstecken überschreibt */
.wizard-hidden {
  display: none !important;
}

.wizard-invisible {
  visibility: hidden;
}

.wizard-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  overflow-x: auto;
}

.wizard-step {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.wizard-step-num {
  position: relative;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 12px;
}

.wizard-step-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.wizard-step-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wizard-step-note {
  font-size: 11px;
  color: var(--warning);
}

.wizard-step.is-active {
  border-color: var(--primary);
  color: var(--text);
  font-weight: 600;
}

.wizard-step.is-active .wizard-step-num {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.wizard-step-num .ico {
  width: 16px;
  height: 16px;
}

.wizard-step-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 14px;
  height: 14px;
  fill: var(--success);
  stroke: #fff;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wizard-step-badge circle {
  stroke: none;
}

.wizard-step-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
}

.wizard-step.is-done .wizard-step-num {
  border-color: var(--success);
  color: var(--success);
}

.wizard-step.is-incomplete .wizard-step-num {
  border-color: var(--warning);
  color: var(--warning);
}

.wizard-step.is-locked {
  opacity: .75;
  color: var(--text);
  cursor: not-allowed;
}

.wizard-step:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.wizard-invalid {
  border-color: var(--danger) !important;
}

.wizard-error {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--danger);
}

.wizard-block-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.wizard-block-head h4 {
  margin: 0;
  font-size: 14px;
}

.wizard-summary .summary-box {
  margin-top: 6px;
}

.wizard-summary .summary-row b {
  white-space: normal;
  text-align: right;
}

.wizard-success {
  border: 1px solid var(--success);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.wizard-footer {
  position: fixed;
  left: var(--sidebar-w);
  right: 0;
  bottom: 0;
  z-index: 45;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 28px;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
}

body.wizard-on .content {
  padding-bottom: 96px;
}

/* Leise Speicheranzeige neben dem Weiter-Button; Meldungen erscheinen oberhalb der Fußleiste */
.ds-save-state {
  margin-left: auto;
  align-self: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

body.wizard-on #toastContainer {
  bottom: 84px;
}

@media (max-width: 900px) {
  .wizard-footer {
    left: 0;
    bottom: calc(var(--bottom-nav-h) + var(--safe-bottom));
    padding: 10px 14px;
    flex-wrap: wrap;
    row-gap: 0;
  }

  .wizard-footer .btn {
    flex: 1;
  }

  /* Eigene Zeile über den Buttons, damit diese nicht schmaler werden oder springen */
  .ds-save-state {
    order: -1;
    flex-basis: 100%;
    margin-left: 0;
    line-height: 16px;
    text-align: right;
  }

  .ds-save-state:not(:empty) {
    margin-bottom: 6px;
  }

  body.wizard-on .content {
    padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 88px);
  }

  body.wizard-on #toastContainer {
    bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 80px);
  }

  .wizard-step {
    flex: 0 0 auto;
    padding: 6px 8px;
  }

  .wizard-step.is-active .wizard-step-label {
    display: inline;
  }

  .wizard-step:not(.is-active) .wizard-step-text {
    display: none;
  }
}

/* Schmale Fenster mit sichtbarer Seitenleiste: nicht aktive Schritte nur als Symbol, damit die Beschriftungen nicht abgeschnitten werden */
@media (max-width: 1240px) {
  .wizard-step {
    flex: 0 0 auto;
    padding: 6px 8px;
  }

  .wizard-step:not(.is-active) .wizard-step-text {
    display: none;
  }
}

.wizard-pick-selected {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--success);
  border-radius: var(--radius-sm);
}

.wizard-pick-list {
  margin-top: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.wizard-pick-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}

.wizard-pick-meta {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
}

/* ============ AUSWAHLTABELLE (uikPickTable): Aussehen wie die Bestandstabelle, feste Kopfzeile, scrollbar ============ */
.upt-search { width: 100%; box-sizing: border-box; }
.upt-scroll { margin-top: 8px; max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.upt-table { margin-top: 0; min-width: 560px; }
.upt-table th, .upt-table td { padding: 8px 12px; }
.upt-table thead th { position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.upt-table .upt-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.upt-sort { all: unset; cursor: pointer; font: inherit; color: inherit; }
.upt-sort:focus-visible { outline: 2px solid var(--primary, #2563eb); outline-offset: 2px; }
.upt-row { cursor: pointer; }
.upt-row.is-active, .upt-row.is-selected { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--success); }
.upt-row:focus-visible { outline: 2px solid var(--primary, #2563eb); outline-offset: -2px; }
.upt-table td.upt-empty { text-align: center; color: var(--muted); padding: 18px 12px; }

/* ============ ADMIN: Kennzahlen und Liste ============ */
.adm-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.adm-kpi { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.adm-kpi[aria-pressed="true"] { border-color: var(--success); box-shadow: inset 3px 0 0 var(--success); }
.adm-kpi:focus-visible { outline: 2px solid var(--primary, #2563eb); outline-offset: 2px; }
.adm-kpi-num { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.adm-kpi-label { color: var(--muted); font-size: .85rem; }
.adm-filter { max-width: 300px; margin-bottom: 10px; }
#admOrgTable .upt-scroll { max-height: 520px; }
#admOrgTable .upt-table { min-width: 900px; }

/* Detail-Fenster (Drawer); Sichtbarkeit nur über das hidden-Attribut */
.adm-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 90; }
.adm-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface-2); border-left: 1px solid var(--border); box-shadow: -8px 0 24px rgba(0, 0, 0, .2); z-index: 91; overflow-y: auto; }
.adm-drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface-2); z-index: 1; }
.adm-drawer-head h3 { margin: 0; }
.adm-drawer-body { padding: 14px 18px 40px; }
.adm-drawer-body h4 { margin: 18px 0 6px; }
.adm-dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.adm-dl dt { color: var(--muted); }
.adm-dl dd { margin: 0; overflow-wrap: anywhere; }
.adm-mini { width: 100%; border-collapse: collapse; font-size: .85rem; }
.adm-mini th, .adm-mini td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--border); }
.adm-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.adm-extend:not([hidden]) { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.adm-delete { margin-top: 18px; padding: 12px; border: 1px solid #b91c1c; border-radius: 8px; }
.adm-warn { color: #b91c1c; font-weight: 600; }
.adm-danger { background: #b91c1c; color: #fff; }
.adm-danger:disabled { opacity: .5; cursor: not-allowed; }
.adm-log { list-style: none; margin: 0; padding: 0; font-size: .85rem; }
.adm-log li { padding: 4px 0; border-bottom: 1px solid var(--border); }
#admDetailNote { width: 100%; box-sizing: border-box; margin-bottom: 6px; }

/* ============ KUNDENLISTE ============ */
/* Ausblenden per Klasse mit !important, damit keine display-Regel das Verstecken überschreibt */
.kdl-hidden {
  display: none !important;
}

.fzl-hidden {
  display: none !important;
}

.kdl-bar {
  margin-bottom: 10px;
  align-items: center;
}

.kdl-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  white-space: nowrap;
}

.kdl-check input {
  width: auto;
}

.kdl-note {
  margin-top: 12px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
}

.kdl-note-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 0;
}

.kdl-deal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px 6px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  cursor: pointer;
}

.kdl-deal-row:hover {
  background: var(--surface-2);
}

.kdl-group {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.kdl-members {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.kdl-member {
  flex: 1 1 200px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 13px;
}

.kdl-member label {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  cursor: pointer;
}

.kdl-member input[type="radio"] {
  width: auto;
  margin-top: 3px;
}

.kdl-member small {
  display: block;
  color: var(--muted);
}

.vh-similar {
  color: var(--muted);
  font-size: 13px;
}

.vh-details summary {
  cursor: pointer;
}

.vh-details > div {
  padding: 2px 0 0 14px;
}

/* ============ TOUCHGERÄTE ============ */
/* Mindest-Tippfläche 44 px für Buttons und Symbole (z. B. ↺, ▸) auf allen Touchgeräten, unabhängig von der Breite */
@media (pointer: coarse) {
  button,
  .btn {
    min-width: 44px;
    min-height: 44px;
  }

  /* Aufklapp-Zeilen: größere Tippfläche, ohne das Layout zu verschieben */
  summary {
    min-height: 44px;
    padding: 10px 0;
    margin: -10px 0;
  }
}

/* Pflichtfeld-Markierung */
.ds-req {
  color: #dc2626;
  font-weight: 700;
}

.ds-req-note {
  margin: 0 0 10px;
}

/* Interne Zahlen: verborgen, auch im Druck */
[data-ds-intern][hidden] {
  display: none !important;
}

.ds-intern-slot {
  align-self: flex-end;
}

/* Aus der FIN abgeleitete Vorbelegung (gelb, bis der Nutzer das Feld ändert) */
.tin-derived {
  background: #fef3c7;
  border-color: var(--warning);
}

.tin-note {
  background: #fef3c7;
  border-color: var(--warning);
  color: #78350f;
}

/* ============ ADRESSVORSCHLÄGE (js/address.js) ============ */
.adr-list {
  position: fixed;
  z-index: 1100;
  overflow-y: auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .18);
}

.adr-list[hidden] {
  display: none;
}

.adr-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  padding: 6px 12px;
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
}

.adr-item:hover,
.adr-item.adr-active {
  background: var(--primary-soft);
}

.adr-plz {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Adresszeile: PLZ und Ort haben gleiche Höhe; der Hinweis liegt im reservierten Platz darunter und schiebt nichts */
.adr-host {
  position: relative;
  padding-bottom: 20px;
}

.row:has(> .adr-host),
.grid:has(> .adr-host) {
  align-items: start;
}

.adr-hint {
  position: absolute;
  left: 0;
  bottom: 0;
  display: block;
  width: max-content;
  max-width: min(340px, calc(100vw - 48px));
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 16px;
  color: var(--muted);
}

.adr-hint[hidden] {
  display: none;
}

@media (pointer: coarse) {
  .adr-item {
    min-height: 44px;
  }
}

/* ============ Tabellen Bestand & Historie (Präfix tbl) ============
   Breiten (px): Bestand fest = Preis 108 + Kilometer 100 + Farbe 44 (ab 1400: 90) + Aktionen 170 (+ FIN 150 ab 1500), dazu Fahrzeug mind. 280
   -> Mindestbreite 702 / 748 / 898. Historie fest = 90 + 140 + 110 + 130 + 170 = 640, Fahrzeug mind. 200 -> 840.
   Verfügbar neben der Seitenleiste (248) = Fenster - 248 - 56 (Innenabstand) - 50 (Karte) - 15 (Scrollbalken) = Fenster - 369.
   Breitester Fall (Historie, 840) passt ab 1209 px -> Umbruch zur Kartenansicht bei 1210 px für beide Tabellen. */
.tbl-table { table-layout: fixed; }
.tbl-table th, .tbl-table td { padding: 8px; overflow: hidden; }
.tbl-table th:first-child, .tbl-table td:first-child { padding-left: 12px; }
.tbl-table th:last-child, .tbl-table td:last-child { padding-right: 12px; }
.tbl-table tbody td { height: 56px; }
.tbl-inv tbody td { height: 72px; }
.tbl-table td.tbl-actions { overflow: visible; }
.tbl-table th.tbl-num, .tbl-table td.tbl-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl-table th.tbl-actions { text-align: right; }
.tbl-nowrap { white-space: nowrap; }
.tbl-ellip { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; min-width: 0; line-height: 1.3; word-break: break-word; }
.tbl-veh { min-width: 0; }
.tbl-sub { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.tbl-sub .status-badge { font-size: 11px; padding: 1px 7px; }
.tbl-subvin { display: none; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.tbl-vin { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.tbl-color { display: flex; align-items: center; gap: 7px; min-width: 0; }
.tbl-dot { flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--border); box-shadow: 0 0 0 1px rgba(128, 128, 128, .25); }
.tbl-status { white-space: nowrap; }
.tbl-status .status-badge { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }

/* Spaltenbreiten: Fahrzeug bekommt den Rest */
.tbl-inv { min-width: 702px; }
.tbl-inv th:nth-child(2), .tbl-inv td:nth-child(2) { display: none; }
.tbl-inv th:nth-child(3) { width: 108px; }
.tbl-inv th:nth-child(4) { width: 100px; }
.tbl-inv th:nth-child(5) { width: 44px; }
.tbl-inv th:nth-child(6) { width: 170px; }
.tbl-inv th:nth-child(1) { min-width: 280px; }
.tbl-hist { min-width: 840px; }
.tbl-hist th:nth-child(1) { width: 90px; }
.tbl-hist th:nth-child(2) { width: 140px; }
.tbl-hist th:nth-child(4) { width: 110px; }
.tbl-hist th:nth-child(5) { width: 130px; }
.tbl-hist th:nth-child(6) { width: 170px; }
.tbl-color-txt { display: none; }
@media (min-width: 1400px) {
  .tbl-inv { min-width: 748px; }
  .tbl-inv th:nth-child(5) { width: 90px; }
  .tbl-color-txt { display: block; }
}
@media (min-width: 1500px) {
  .tbl-inv { min-width: 898px; }
  .tbl-inv th:nth-child(2), .tbl-inv td:nth-child(2) { display: table-cell; }
  .tbl-inv th:nth-child(2) { width: 150px; }
}
@media (min-width: 1211px) and (max-width: 1499px) {
  .tbl-subvin { display: inline; }
}

/* Aktionen: gleiche Höhe, gleicher Abstand */
.tbl-table .row-actions { gap: 8px; }
.tbl-table .row-actions .btn { height: 36px; min-height: 36px; padding: 0 12px; box-sizing: border-box; }
.tbl-table .tbl-main { width: 96px; flex: 0 0 96px; }
.tbl-table .tbl-main:disabled { opacity: .5; cursor: not-allowed; }
.tbl-table tbody tr.tbl-click { cursor: pointer; }
.tbl-more { position: relative; flex: 0 0 auto; }
.tbl-table .row-actions .tbl-more-btn { width: 36px; padding: 0; font-size: 18px; line-height: 1; }
.tbl-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 140px; padding: 4px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.tbl-menu[hidden] { display: none; }
.dsc-menu { position: relative; }
.dsc-menu[hidden] { display: none; }
.dsc-menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 160px; padding: 4px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.dsc-menu-list[hidden] { display: none; }
.tbl-menu-item { display: block; width: 100%; min-height: 36px; padding: 0 12px; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.tbl-menu-item:hover, .tbl-menu-item:focus-visible { background: var(--surface-2); }
.tbl-menu-danger { color: var(--danger); }
.tbl-menu-danger:hover, .tbl-menu-danger:focus-visible { background: rgba(220, 38, 38, .1); }
body.dark .tbl-menu-danger { color: #f87171; }
@media (pointer: coarse) {
  .tbl-table .row-actions .btn { height: 44px; min-height: 44px; }
  .tbl-table .row-actions .tbl-more-btn { width: 44px; }
  .tbl-menu-item { min-height: 44px; }
}

/* Bis 1210 px: Kartendarstellung (gleiche Texte wie die Spaltenköpfe über data-label) */
@media (max-width: 1210px) {
  .tbl-table { min-width: 0; }
  .tbl-table thead { display: none; }
  .tbl-table, .tbl-table tbody, .tbl-table tr, .tbl-table td { display: block; width: 100%; }
  .tbl-table tr { border: 1px solid var(--border); border-radius: 12px; padding: 6px 14px; margin-bottom: 10px; background: var(--card-bg); }
  .tbl-table tbody tr:hover { background: var(--card-bg); }
  .tbl-table tbody td, .tbl-inv tbody td { display: flex; justify-content: space-between; align-items: center; gap: 12px; height: auto; min-height: 40px; padding: 9px 0 !important; border-bottom: 1px solid var(--border); text-align: right; overflow: visible; }
  .tbl-inv td:nth-child(2) { display: flex; }
  .tbl-table tr td:last-child { border-bottom: none; }
  .tbl-table td::before { content: attr(data-label); font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; flex-shrink: 0; }
  .tbl-table td > .tbl-ellip, .tbl-table td > .tbl-color { max-width: 70%; text-align: right; }
  .tbl-color-txt { display: block; }
  .tbl-table td .tbl-veh { max-width: 75%; }
  .tbl-table td.tbl-actions { display: block; padding-top: 12px !important; }
  .tbl-table td.tbl-actions::before { display: none; }
  .tbl-table .row-actions { justify-content: stretch; }
  .tbl-table .row-actions .tbl-main { flex: 1 1 auto; width: auto; }
  .tbl-table .row-actions .btn { height: 44px; min-height: 44px; }
  .tbl-table .row-actions .tbl-more-btn { flex: 0 0 44px; width: 44px; }
  .tbl-table td.table-empty { justify-content: center; text-align: center; }
  .tbl-table td.table-empty::before { display: none; }
  .tbl-table tr:has(.table-empty) { border-style: dashed; }
}

/* ============ ui3: Kopfzeile ohne Suche, Nach-oben-Knopf, Integrationsanleitung ============ */
.global-search-wrap[hidden] { display: none; }
.global-search-wrap[hidden] + .header-actions { margin-left: auto; }

.ui3-totop {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 45;
  width: 48px;
  height: 48px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.ui3-totop[hidden] { display: none; }
.ui3-totop.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.ui3-totop:hover { filter: brightness(1.1); }
.ui3-totop:focus-visible { outline: 3px solid var(--primary-text); outline-offset: 3px; }
.ui3-totop .ico { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
body.dark .ui3-totop { background: #3b7bff; border-color: rgba(255, 255, 255, .25); }
@media (max-width: 900px) {
  .ui3-totop { right: 14px; bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 14px); }
}
@media (prefers-reduced-motion: reduce) {
  .ui3-totop { transition: none; }
}

#ui3MdGuide { margin-bottom: 18px; }
#ui3MdGuide .integration-intro { margin-top: 12px; }
.ui3-guide-quote {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  overflow-wrap: anywhere;
  user-select: all;
}

/* ============ ui3: Rahmen der Eingabefelder (zentral über --input-border) ============ */
input::placeholder,
textarea::placeholder { color: var(--muted); opacity: 1; }

input:hover:not(:focus):not(:disabled):not([readonly]),
select:hover:not(:focus):not(:disabled),
textarea:hover:not(:focus):not(:disabled):not([readonly]) { border-color: var(--input-border-hover); }

.field.has-error input:hover:not(:focus):not(:disabled):not([readonly]),
.field.has-error select:hover:not(:focus):not(:disabled) { border-color: var(--danger); }
.field.ocr-uncertain input:hover:not(:focus):not(:disabled):not([readonly]) { border-color: var(--warning); }
.field.ocr-verified input:hover:not(:focus):not(:disabled):not([readonly]) { border-color: color-mix(in srgb, var(--success) 55%, var(--border)); }

input:disabled,
select:disabled,
textarea:disabled,
input[readonly],
textarea[readonly] { border-color: var(--input-border-muted); }
/* Gesperrte Felder (z. B. Art im Kalender, gesperrte Fahrzeugfelder): deutlich grau, gedämpfte Schrift, nicht-erlaubt-Cursor */
input:disabled:not([type="checkbox"]):not([type="radio"]),
select:disabled,
textarea:disabled {
  background: color-mix(in srgb, var(--muted) 16%, var(--card-bg));
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
  opacity: 1;
  cursor: not-allowed;
}

input[type="checkbox"],
input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  display: inline-grid;
  place-content: center;
  padding: 0;
  border: 1px solid var(--input-border);
  background: var(--card-bg);
  cursor: pointer;
}
input[type="checkbox"] { border-radius: 5px; }
input[type="radio"] { width: 18px !important; height: 18px; min-height: 0; border-radius: 50%; flex-shrink: 0; }
input[type="checkbox"]:hover:not(:disabled),
input[type="radio"]:hover:not(:disabled) { border-color: var(--input-border-hover); }
input[type="checkbox"]:checked,
input[type="radio"]:checked { background-color: var(--primary); border-color: var(--primary); }
input[type="checkbox"]:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-6.5'/%3E%3C/svg%3E");
  background-size: 100% 100%;
}
input[type="radio"]:checked { box-shadow: inset 0 0 0 3px var(--card-bg); }
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input[type="checkbox"]:disabled,
input[type="radio"]:disabled { border-color: var(--input-border-muted); cursor: not-allowed; }

/* Firmendaten-Gruppen und Logo-Bereich (Einstellungen) */
.cfg-group { margin-bottom: 16px; }
.cfg-group-title { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.logo-preview-box { display: flex; align-items: center; justify-content: center; min-height: 90px; padding: 12px; margin-bottom: 12px; border: 1px dashed var(--input-border-muted); border-radius: 8px; background: #fff; }
.logo-preview-img { max-width: 220px; max-height: 120px; }
.logo-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.logo-actions .btn[hidden], .logo-preview-img[hidden], #logoEmptyNote[hidden] { display: none; }

/* Abgelegte Dokumente (Kunde, Fahrzeug, Verkauf, Schritt "Prüfen & Dokumente") */
.dcs-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.dcs-row:last-child { border-bottom: 0; }
.dcs-type { font-weight: 600; min-width: 110px; }
.dcs-meta { flex: 1; min-width: 160px; color: var(--muted); font-size: 13px; }
.dcs-stale { color: var(--warning); }
.dcs-older { margin-top: 8px; }
.dcs-older > summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 6px 0; }
.dvw-saved { margin: 8px 0 0; font-size: 12px; }

/* Käuferart: Felder nur bei Gewerbe (hidden bleibt wirksam) */
#kvtFirmaField[hidden], #kvtUstField[hidden], #kdlFCompanyField[hidden], #kdlFVatField[hidden] { display: none; }

#dvwMailRow[hidden] { display: none; }

.date-check { border-color: var(--warning); }

/* ---- Einheitliches Erfassungsmuster (uikSourceBar): genau eine Option aktiv, Bereiche über das hidden-Attribut ---- */
[hidden] { display: none !important; }
.uik-bar { margin-bottom: 12px; }
.uik-seg { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.uik-seg [role="radio"][aria-checked="true"] { cursor: default; }
.uik-bar-note { margin-top: 8px; }

/* Probefahrt: links Eingaben, rechts Vorschau (wie im Schritt Prüfen & Dokumente) */
.tdr-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px 16px; }
.tdr-left > .card { margin-bottom: 12px; }
.tdr-check { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.tdr-check input { width: auto; }
@media (min-width: 1200px) {
  .tdr-layout { grid-template-columns: minmax(340px, 520px) minmax(0, 1fr); align-items: start; }
  .tdr-preview { position: sticky; top: 12px; }
  .tdr-preview .dvw-wrap { height: calc(100vh - 250px); min-height: 420px; }
}

/* Passwort-Auge */
.uik-pw-wrap { position: relative; display: block; }
.uik-pw-wrap > input { width: 100%; box-sizing: border-box; padding-right: 40px; }
.uik-pw-eye { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); background: none; border: 0; padding: 4px; cursor: pointer; color: var(--muted); display: inline-flex; line-height: 0; }
.uik-pw-eye:hover, .uik-pw-eye:focus-visible, .uik-pw-eye[aria-pressed="true"] { color: var(--text); }

/* Testzugang: Passwortregeln und Honeypot (außerhalb des sichtbaren Bereichs, nicht per display ausgeblendet) */
.trial-rules { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.trial-rules li.trial-rule-ok { color: #15803d; }
.trial-hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ============ carxcel: Marke (Login) ============ */
/* Banner oben in der Login-Karte (volle Kartenbreite, Ecken wie die Karte); "Powered by AJ Solution" steht im Bild */
.auth-brand {
  display: block;
  margin: -32px -28px 22px;
}
.cxl-banner {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 840 / 350;
  object-fit: cover;
  border-radius: 20px 20px 0 0;
}
.cxl-footer {
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
/* Seitenleiste: "carxcel" klein (trotz Großschreibung der Zeile), Händlername höchstens zwei Zeilen */
.cxl-word { text-transform: none; }
.brand-block .logo-fallback .logo-bold {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============ KALENDER ============ */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 16px; align-items: start; }
.cal-main, .cal-side { margin: 0; }
.cal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 14px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); margin-left: auto; }
.cal-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.cal-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.cal-box { display: inline-block; width: 11px; height: 11px; border-radius: 3px; border: 2px solid var(--muted); flex: none; }
.cal-count { color: var(--muted); font-weight: 400; }
.cal-main [hidden], .cal-side [hidden], .cal-modal [hidden] { display: none !important; }

/* FullCalendar im Design der Anwendung (Hell/Dunkel über die vorhandenen Farben) */
.cal-wrap {
  --fc-border-color: var(--border);
  --fc-page-bg-color: var(--card-bg);
  --fc-neutral-bg-color: var(--surface-2);
  --fc-neutral-text-color: var(--muted);
  --fc-today-bg-color: var(--primary-soft);
  --fc-now-indicator-color: var(--danger);
  --fc-list-event-hover-bg-color: var(--surface-2);
  --fc-event-text-color: #fff;
  --fc-button-text-color: var(--text);
  --fc-button-bg-color: var(--card-bg);
  --fc-button-border-color: var(--input-border-muted);
  --fc-button-hover-bg-color: var(--surface-2);
  --fc-button-hover-border-color: var(--input-border);
  --fc-button-active-bg-color: var(--primary);
  --fc-button-active-border-color: var(--primary);
  color: var(--text);
  font-size: 14px;
}
.cal-wrap .fc-toolbar-title { font-size: 1.15rem; }
.cal-wrap .fc-button-primary:not(:disabled).fc-button-active,
.cal-wrap .fc-button-primary:not(:disabled):active { color: #fff; }
.cal-wrap .fc-button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; box-shadow: none; }
.cal-wrap .fc-list { border-color: var(--border); }
.cal-wrap a { color: inherit; }
.cal-wrap .fc-col-header-cell-cushion, .cal-wrap .fc-daygrid-day-number, .cal-wrap .fc-list-day-text, .cal-wrap .fc-list-day-side-text { color: var(--text); }
.cal-wrap .fc-event { cursor: pointer; }
.cal-wrap .fc-daygrid-event { padding: 1px 3px; }
.cal-wrap .fc-more-popover { background: var(--card-bg); }

/* To-dos: heller Grund mit Kategoriefarbe am Rand, erledigte durchgestrichen, überfällige rot */
.cal-wrap .fc-event.cal-ev-todo { background: var(--card-bg) !important; color: var(--text); border-width: 1px 1px 1px 4px; border-style: solid; }   /* FullCalendar setzt den Grund inline; die Kategoriefarbe bleibt am Rand */
.cal-wrap .fc-timegrid-axis-cushion { font-size: 11px; }
/* Stundenraster höher: ein einstündiger Termin zeigt Uhrzeit und Titel vollständig (56 px je Stunde) */
.cal-wrap .fc-timegrid-slot { height: 28px; }
.cal-wrap .fc-timegrid-event .fc-event-main { padding: 2px 3px; }
.cal-wrap .fc-timegrid-event .fc-event-time { font-size: 11px; line-height: 14px; }
.cal-wrap .fc-timegrid-event .fc-event-title { font-size: 12.5px; line-height: 16px; }
/* Nur das Stundenraster zeigt eine Scrollleiste; Kopfzeile und "Ganztägig" lassen deren Platz als leeren Rand frei (bündig mit dem Raster) */
.cal-wrap .fc-timegrid .fc-scroller:not(:has(.fc-timegrid-body))::-webkit-scrollbar { width: var(--cal-sbw, 15px); height: var(--cal-sbw, 15px); background: transparent; }
.cal-wrap .fc-timegrid .fc-scroller:not(:has(.fc-timegrid-body))::-webkit-scrollbar-track, .cal-wrap .fc-timegrid .fc-scroller:not(:has(.fc-timegrid-body))::-webkit-scrollbar-thumb { background: transparent; }
.cal-wrap .fc-timegrid .fc-scroller:not(:has(.fc-timegrid-body))::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.cal-wrap .fc-event.cal-ev-todo .fc-event-main { color: var(--text); }
.cal-wrap .fc-event.cal-overdue { box-shadow: inset 0 0 0 1px var(--danger); }
.cal-wrap .fc-event.cal-overdue .cal-title { color: var(--danger); }
.cal-wrap .fc-event.cal-done .cal-title, .cal-todo-row .is-done + .cal-todo-main .cal-todo-title { text-decoration: line-through; opacity: .6; }
.cal-wrap .fc-list-event.cal-ev-todo td { background: transparent; }
.cal-todo { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.cal-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* lange Titel im Monat: sauber mit "…" abschneiden (voller Titel im title-Attribut) */
.cal-wrap .fc-daygrid-event { overflow: hidden; }
.cal-wrap .fc-daygrid-event .fc-event-title, .cal-wrap .fc-daygrid-event .fc-event-time { white-space: nowrap; }
.cal-wrap .fc-daygrid-event .fc-event-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cal-wrap .fc-daygrid-block-event .fc-event-main, .cal-wrap .fc-daygrid-dot-event .fc-event-title { min-width: 0; }
.cal-wrap .fc-daygrid-block-event .fc-event-title { display: block; overflow: hidden; text-overflow: ellipsis; }
.cal-check { all: unset; box-sizing: border-box; flex: none; width: 16px; height: 16px; border: 2px solid var(--muted); border-radius: 4px; cursor: pointer; color: #fff; font-size: 11px; line-height: 12px; text-align: center; font-weight: 700; }
.cal-check:hover { border-color: var(--primary); }
.cal-check:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.cal-check.is-done { background: var(--success); border-color: var(--success); }

/* Seitenliste "Offene To-dos" */
.cal-todo-list { display: flex; flex-direction: column; gap: 4px; }
.cal-todo-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 6px; border-radius: 8px; }
.cal-todo-row:hover { background: var(--surface-2); }
.cal-todo-row .cal-check { margin-top: 2px; }
.cal-todo-main { all: unset; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.cal-todo-main:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.cal-todo-title { font-weight: 600; overflow-wrap: anywhere; }
.cal-todo-meta { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.cal-todo-row.is-overdue .cal-todo-title, .cal-todo-row.is-overdue .cal-todo-meta { color: var(--danger); }
.cal-todo-row.is-overdue { box-shadow: inset 3px 0 0 var(--danger); }

/* Fenster */
.cal-modal { position: relative; max-width: 640px; }
.cal-x { position: absolute; top: 14px; right: 14px; z-index: 5; }
.cal-dt { display: flex; gap: 6px; }
.cal-dt input[type="date"] { flex: 1 1 auto; min-width: 0; }
.cal-dt input[type="time"] { flex: 0 0 110px; }
.cal-link-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.cal-link-label { width: 70px; font-size: 12.5px; color: var(--muted); }
.cal-error { color: var(--danger); min-height: 1.2em; margin: 4px 0 8px; }
.cal-d-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.cal-d-row { display: flex; gap: 12px; padding: 6px 0; border-top: 1px solid var(--border); }
.cal-d-row:first-child { border-top: 0; }
.cal-d-label { width: 110px; flex: none; color: var(--muted); font-size: 12.5px; padding-top: 2px; }
.cal-note { white-space: pre-wrap; overflow-wrap: anywhere; }
.cal-red { color: var(--danger); }
body.cal-modal-open { overflow: hidden; }

@media (max-width: 1100px) {
  .cal-layout { grid-template-columns: minmax(0, 1fr); }
  .cal-legend { margin-left: 0; }
}
@media (max-width: 700px) {
  .cal-wrap .fc-toolbar { flex-wrap: wrap; gap: 8px; }
  .cal-wrap .fc-toolbar-title { font-size: 1rem; }
  .cal-d-row { flex-direction: column; gap: 2px; }
}
#calDetailModal .card h3::before { background: var(--cal-cat, var(--primary)); }

/* Kalender: automatische Einträge (Probefahrt, Übergabe, HU) */
.cal-auto-tag { display: inline-block; font-size: 9px; line-height: 1.5; font-weight: 600; letter-spacing: .02em; padding: 0 5px; border-radius: 999px; background: rgba(255, 255, 255, .28); border: 1px solid currentColor; vertical-align: middle; white-space: nowrap; }
.cal-d-row .cal-auto-tag { font-size: 11px; background: var(--surface-2); color: var(--muted); border-color: var(--border); margin-right: 6px; }
.cal-wrap .fc-event.cal-auto { cursor: pointer; }
.cal-auto-note { margin: 10px 0 0 0; }
.cal-auto-note[hidden] { display: none; }
.cal-todo.has-auto { flex-wrap: wrap; row-gap: 2px; }
.cal-todo.has-auto .cal-title { flex: 1 1 60px; min-width: 0; }
.cal-wrap .fc-event .fc-event-title .cal-auto-tag { margin-left: 2px; }
.cal-wrap .fc-timegrid-event .cal-auto-tag { font-size: 0; padding: 0 4px; position: absolute; right: 3px; top: 3px; background: rgba(0, 0, 0, .25); border-color: transparent; color: #fff; }
.cal-wrap .fc-timegrid-event .cal-auto-tag::after { content: 'A'; font-size: 9px; }
.cal-wrap .fc-timegrid-event .cal-auto-tag, .cal-wrap .fc-timegrid .fc-daygrid-event .cal-auto-tag { width: 14px; height: 14px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
/* ganztägige Einträge in der Wochenzeile sind schmal: ebenfalls Kurzform, rechts im Eintrag */
.cal-wrap .fc-timegrid .fc-daygrid-event { position: relative; }
.cal-wrap .fc-timegrid .fc-daygrid-event .cal-auto-tag { font-size: 0; padding: 0 4px; position: absolute; right: 3px; top: 50%; transform: translateY(-50%); background: rgba(0, 0, 0, .25); border-color: transparent; color: #fff; }
.cal-wrap .fc-timegrid .fc-daygrid-event .cal-auto-tag::after { content: 'A'; font-size: 9px; }
.cal-wrap .fc-timegrid .fc-daygrid-event.cal-auto { padding-right: 20px; }
.cal-wrap .fc-timegrid .fc-daygrid-event.cal-auto .fc-event-title { padding-right: 18px; }
.cal-wrap .fc-timegrid .cal-todo.has-auto { padding-right: 18px; }

/* ============ DASHBOARD: KARTE "HEUTE" ============ */
.tdy-card { margin-bottom: 14px; transition: padding 0.2s ease; }
.tdy-head { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; cursor: pointer; border-radius: 6px; user-select: none; transition: margin 0.2s ease; }
.tdy-head h3 { margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tdy-head .collapse-arrow { font-size: 14px; color: var(--muted); transition: transform 0.15s; }
.tdy-head[aria-expanded="true"] .collapse-arrow { transform: rotate(90deg); }
.tdy-head[aria-expanded="false"] { margin-bottom: 0; }
.tdy-head:hover .collapse-arrow { color: var(--text); }
.tdy-head:focus-visible { outline: 2px solid var(--primary, #2563eb); outline-offset: 2px; }
.tdy-card.tdy-card-closed { padding-top: 13px; padding-bottom: 13px; }
.tdy-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tdy-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-top: 1px solid var(--border); min-height: 40px; }
.tdy-row:first-child { border-top: 0; }
.tdy-row:hover { background: var(--surface-2); }
.tdy-main { all: unset; box-sizing: border-box; cursor: pointer; flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.tdy-main:focus-visible { outline: 2px solid var(--primary, #2563eb); outline-offset: 2px; }
.tdy-time { flex: none; width: 84px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tdy-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.tdy-auto { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; font-size: 10px; font-weight: 700; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.tdy-row.is-overdue { box-shadow: inset 3px 0 0 var(--danger); }
.tdy-row.is-overdue .tdy-time, .tdy-row.is-overdue .tdy-title { color: var(--danger); }
.tdy-more { all: unset; box-sizing: border-box; cursor: pointer; display: block; margin-top: 8px; padding: 6px 4px; color: var(--primary, #2563eb); font-size: 13px; font-weight: 600; }
.tdy-more:hover { text-decoration: underline; }
.tdy-more:focus-visible { outline: 2px solid var(--primary, #2563eb); outline-offset: 2px; }
.tdy-empty { margin: 0; }
.tdy-card [hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { .tdy-head, .tdy-card, .tdy-head .collapse-arrow { transition: none; } }
@media (pointer: coarse) { .tdy-head, .tdy-row, .tdy-more { min-height: 44px; } }
@media (max-width: 700px) {
  .tdy-time { width: 70px; }
  .tdy-head { flex-wrap: wrap; }
  .tdy-head h3 { flex-basis: calc(100% - 30px); }
  .tdy-link { margin-left: 20px; }
}
.cal-todo-later { all: unset; box-sizing: border-box; cursor: pointer; display: block; margin-top: 8px; padding: 6px 6px; color: var(--primary, #2563eb); font-size: 13px; font-weight: 600; }
.cal-todo-later:hover { text-decoration: underline; }
.cal-todo-later:focus-visible { outline: 2px solid var(--primary, #2563eb); outline-offset: 2px; }

/* Liste "Offene To-dos": eigener Scrollbereich, Umschalter bleibt unten sichtbar */
.cal-side .cal-todo-list > * { flex: none; }
.cal-side .cal-todo-list { overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
.cal-todo-foot { flex: none; margin-top: 6px; padding-top: 2px; border-top: 1px solid var(--border); }
.cal-todo-foot:empty { display: none; }
.cal-todo-foot .hint { margin: 4px 6px 6px; font-size: 12.5px; }
.cal-todo-foot .cal-todo-later { margin-top: 0; }
.cal-todo-sep { margin: 8px 0 2px; padding: 8px 6px 2px; border-top: 1px solid var(--border); font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
@media (min-width: 1101px) {
  /* am Computer höchstens so hoch wie der Kalender daneben (gleiche Unterkante); die Liste scrollt darin */
  .cal-layout { align-items: stretch; }
  .cal-side { position: relative; min-height: 320px; overflow: hidden; }
  .cal-side-inner { position: absolute; top: 22px; bottom: 22px; left: 24px; right: 24px; display: flex; flex-direction: column; min-height: 0; }
  .cal-side-inner > h3 { flex: none; }
  .cal-side .cal-todo-list { flex: 1 1 auto; min-height: 0; }
}
@media (max-width: 1100px) {
  /* unter 1100 px und am Handy: höchstens etwa 60 % der Fensterhöhe */
  .cal-side .cal-todo-list { max-height: 60vh; }
}

/* ============ FAHRTENBUCH (ftb) und Sortierkopf (tbl-sort) ============ */
.tbl-sort { display: inline-flex; align-items: center; gap: 2px; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; text-align: inherit; cursor: pointer; }
.tbl-sort:hover { color: var(--primary); }
.tbl-sort:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.tbl-arrow { font-size: 10px; white-space: pre; }
.tbl-table th.tbl-num .tbl-sort { justify-content: flex-end; }
.tbl-ftb { min-width: 960px; }
.tbl-ftb th:nth-child(1) { width: 100px; }
.tbl-ftb th:nth-child(2) { width: 104px; }
.tbl-ftb th:nth-child(3) { width: 128px; }
.tbl-ftb th:nth-child(5) { width: 108px; }
.tbl-ftb th:nth-child(6) { width: 138px; }
.tbl-ftb th:nth-child(7) { width: 66px; }
.tbl-ftb th:nth-child(8) { width: 100px; }
.tbl-ftb th:nth-child(9) { width: 140px; }
.ftb-modal .card > .field, .ftb-modal .card > .row { margin-bottom: 10px; }
@media (max-width: 1210px) { .tbl-ftb { min-width: 0; } }
#tab-fahrtenbuch [hidden], .ftb-modal [hidden] { display: none !important; }
.ftb-search { max-width: 420px; }
.ftb-count { margin: 8px 0; }
.ftb-badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 1.6; vertical-align: middle; white-space: nowrap; }
.ftb-badge-rot { background: rgba(220, 38, 38, .12); color: #b91c1c; }
.ftb-badge-kurz { background: rgba(217, 119, 6, .14); color: #92400e; }
.ftb-badge-open { background: rgba(217, 119, 6, .14); color: #92400e; }
body.dark .ftb-badge-rot { background: rgba(248, 113, 113, .18); color: #f87171; }
body.dark .ftb-badge-kurz, body.dark .ftb-badge-open { background: rgba(251, 191, 36, .16); color: #fbbf24; }
.ftb-modal { position: relative; max-width: 720px; }
.ftb-x { position: absolute; top: 14px; right: 14px; z-index: 5; }
.ftb-h { margin: 18px 0 6px; font-size: 14px; }
.ftb-link { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.ftb-dist { display: block; padding: 10px 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.ftb-dist-bad { color: var(--danger); }
.ftb-danger { color: var(--danger); }
body.ftb-modal-open { overflow: hidden; }

/* Fahrzeug bearbeiten (Bestand): Hinweise, gesperrte Felder bei verkauften Fahrzeugen */
.inv-edit-info { margin-bottom: 12px; }
.inv-edit-info p { margin: 0 0 6px 0; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-size: 13px; }
.grid > .inv-wide { grid-column: 1 / -1; }
