/* ============================================================
   AUTERIQ – Design System (seit 05.10.2026; vorher CleanHub)
   Dunkle Leiste, heller Arbeitsbereich:
     Chrome (Seitenleiste, Kopf, Anmeldung, Betreiber)  #05070A, feine Linien rgba(255,255,255,.07)
     Arbeitsbereich                                      #F6F7FA, Karten weiß
   Farben: --brand = Knopf-/Linkfarbe (UI-Farbe des Produkts bzw. Mandantenfarbe, im Layout auf ≥ 4,5 : 1 gegen Weiß
   abgedunkelt), --akzent = Markenfarbe für dunkle Flächen (aktiver Eintrag, Zeichen an Gruppen).
   Schriften (selbst gehostet, assets/vendor/fonts): Inter (Text), Saira (Überschriften), JetBrains Mono (Labels, Nummern).
   ============================================================ */

:root {
  --brand:       #1766D6;
  --brand-dark:  color-mix(in srgb, var(--brand) 82%, #000);
  --brand-light: color-mix(in srgb, var(--brand) 7%, #fff);
  --brand-50:    color-mix(in srgb, var(--brand) 7%, #fff);
  --brand-100:   color-mix(in srgb, var(--brand) 15%, #fff);
  --brand-ring:  color-mix(in srgb, var(--brand) 18%, transparent);
  --akzent:      #1E8CFF;
  --ink:         #0B0F19;
  --ink-2:       #3A4254;
  --ink-3:       #646B7E;   /* ≥ 4,5 : 1 auf Weiß und #F6F7FA (vorher #8B90A4 = 3,2 : 1) */
  --ink-4:       #B4BAC7;
  --surface:     #F6F7FA;
  --surface-2:   #EDEFF3;
  --border:      #E5E8EE;
  --white:       #FFFFFF;
  /* --sidebar-2/-3 sind seit dem hellen Zwischenstand helle Hervorhebungen im Arbeitsbereich (ISO-Seiten nutzen sie) */
  --sidebar:     #05070A;
  --sidebar-2:   #F1F4F9;
  --sidebar-3:   #E8EDF5;
  /* Chrome (dunkle Flächen) */
  --chrome:        #05070A;
  --chrome-2:      #0B0E14;
  --chrome-3:      #121620;
  --chrome-line:   rgba(255,255,255,.07);
  --chrome-line-2: rgba(255,255,255,.12);
  --chrome-hover:  rgba(255,255,255,.05);
  --chrome-text:   #A3ABBA;   /* 8,7 : 1 auf #05070A */
  --chrome-text-2: #7C8597;   /* 5,4 : 1 */
  --chrome-hell:   #F2F4F8;
  --success:     #047857;
  --success-bg:  #ECFDF5;
  --warning:     #B45309;
  --warning-bg:  #FFFBEB;
  --danger:      #C81E1E;
  --danger-bg:   #FEF2F2;
  --info:        var(--brand);
  --info-bg:     var(--brand-50);
  --radius-sm:   6px;
  --radius:      8px;
  --radius-lg:   12px;
  --radius-xl:   14px;
  --radius-2xl:  18px;
  --shadow-xs:   0 1px 2px rgba(11,15,25,.05);
  --shadow-sm:   0 1px 3px rgba(11,15,25,.07), 0 1px 2px rgba(11,15,25,.04);
  --shadow-card: 0 1px 2px rgba(11,15,25,.04), 0 2px 8px -2px rgba(11,15,25,.06);
  --shadow-md:   0 10px 24px rgba(11,15,25,.08), 0 2px 6px rgba(11,15,25,.05);
  --shadow-lg:   0 20px 40px rgba(11,15,25,.12), 0 4px 12px rgba(11,15,25,.06);
  --font-text:   'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head:   'Saira', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:   'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --sidebar-w:   248px;
  --topbar-h:    60px;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-text);
  font-feature-settings: 'cv11', 'ss01';
  background: var(--surface);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100%;
  line-height: 1.5;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
img { max-width: 100%; display: block; }
input, select, textarea { font-family: inherit; }
[x-cloak] { display: none !important; }

/* ── Shell-Layout ────────────────────────────────────────── */
.shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar (dunkel, AUTERIQ) ───────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--chrome);
  color: var(--chrome-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 50;
  transition: transform 0.22s cubic-bezier(.4,0,.2,1);
  border-right: 1px solid var(--chrome-line);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5,7,10,.6);
  z-index: 49;
  backdrop-filter: blur(2px);
}

/* Logo: gleiche Höhe wie der Kopf, damit die feine Linie durchläuft */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--topbar-h);
  padding: 0 14px 0 18px;
  border-bottom: 1px solid var(--chrome-line);
  flex-shrink: 0;
}
.sidebar-brand-link { display: flex; align-items: center; min-width: 0; flex: 1 1 auto; border-radius: 6px; }
.sidebar-brand-link:focus-visible { outline: 2px solid var(--akzent); outline-offset: 4px; }
.sidebar-brand-img { height: 48px; width: auto; max-width: 100%; object-fit: contain; object-position: left center; }
.sidebar-brand-img.is-ai { height: 41px; margin-left: -3px; }
/* Eigenes Mandantenlogo: liegt auf heller Kachel, weil Firmenlogos meist für weißen Grund gemacht sind */
.sidebar-brand-eigen { display: inline-flex; align-items: center; background: #fff; border-radius: 8px; padding: 5px 10px; max-width: 100%; }
.sidebar-brand-eigen img { max-height: 30px; max-width: 170px; width: auto; object-fit: contain; }

/* Mandant: gut lesbar, mit gebuchten Produkten */
.sidebar-tenant {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 12px 8px;
  padding: 10px 11px;
  border: 1px solid var(--chrome-line);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.015));
  flex-shrink: 0;
}
.sidebar-tenant-mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--chrome-3);
  border: 1px solid var(--chrome-line-2);
  color: var(--chrome-hell);
  font-family: var(--font-head);
  font-size: 12.5px; font-weight: 700; letter-spacing: .02em;
  flex-shrink: 0;
}
/* Textblock darf schrumpfen, sonst schiebt ein langer Name den Anfang aus dem Bild (Mobil-Kopf, Prüfung Craft 04.10.2026) */
.sidebar-tenant-text { min-width: 0; flex: 1 1 auto; }
.sidebar-tenant-name {
  color: var(--chrome-hell);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.25;
  letter-spacing: -.1px;
  overflow: hidden;
  /* bis zu zwei Zeilen: lange Firmennamen bleiben lesbar statt nach 20 Zeichen abgeschnitten */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}
.sidebar-tenant-sub {
  color: var(--chrome-text-2);
  font-size: 11px;
  line-height: 1.35;
  margin-top: 3px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.sidebar-produkte { display: flex; flex-wrap: wrap; gap: 3px 10px; margin-top: 4px; }
.sidebar-produkt {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--m, var(--chrome-text));
  white-space: nowrap;
}
.sidebar-produkt::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: var(--m, var(--chrome-text));
  box-shadow: 0 0 6px color-mix(in srgb, var(--m, #fff) 70%, transparent);
}

.sidebar-close {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--chrome-line-2);
  color: var(--chrome-text);
  width: 32px; height: 32px;
  border-radius: 8px;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-close:hover { color: #fff; background: var(--chrome-hover); }

.sidebar-nav {
  flex: 1;
  padding: 4px 10px 10px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.12) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.10); border-radius: 3px; }

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius);
  color: var(--chrome-text);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 1px;
  transition: background .12s, color .12s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.nav-item:hover { background: var(--chrome-hover); color: var(--chrome-hell); }
.nav-item:focus-visible { outline: 2px solid var(--akzent); outline-offset: -2px; }
.nav-item.active {
  background: rgba(255,255,255,.07);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}
.nav-item.active::before {
  content: '';
  position: absolute; left: -10px; top: 7px; bottom: 7px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--akzent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--akzent) 60%, transparent);
}
.nav-item svg { flex-shrink: 0; opacity: .85; }
.nav-item:hover svg { opacity: 1; }
.nav-item.active svg { opacity: 1; color: var(--akzent); }
.nav-item > span:first-of-type { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-user {
  padding: 8px 10px;
  border-top: 1px solid var(--chrome-line);
  flex-shrink: 0;
}
.sidebar-user-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .12s;
}
.sidebar-user-inner:hover { background: var(--chrome-hover); }
.sidebar-user-avatar, .topbar-avatar, .admin-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--akzent) 55%, #0B0E14), #0B0E14);
  border: 1px solid var(--chrome-line-2);
  color: #fff;
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
  flex-shrink: 0;
}
.sidebar-user-info { min-width: 0; flex: 1 1 auto; }
.sidebar-user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--chrome-hell);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--chrome-text-2);
  line-height: 1.4;
}
.sidebar-user-chevron { color: var(--chrome-text-2); flex-shrink: 0; }
.sidebar-user-menu {
  position: absolute;
  bottom: 100%;
  left: 0; right: 0;
  margin-bottom: 6px;
  background: var(--chrome-2);
  border: 1px solid var(--chrome-line-2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0,0,0,.5);
  z-index: 100;
  padding: 4px;
}
.sidebar-menu-item {
  display: block;
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--chrome-text);
  transition: background .1s, color .1s;
}
.sidebar-menu-item:hover { background: var(--chrome-hover); color: #fff; }
.sidebar-menu-item.danger { color: #FF6B74; }
.sidebar-menu-item.danger:hover { background: rgba(255,45,58,.12); }
.sidebar-menu-item.is-support { color: #FFB547; font-weight: 700; }
.sidebar-menu-divider { border-top: 1px solid var(--chrome-line); margin: 4px 2px; }

/* ── Main Content Area ───────────────────────────────────── */
/* Der Arbeitsbereich liegt als helle Fläche mit runder Ecke im dunklen Rahmen aus Leiste und Kopf */
.main-wrap {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  background: var(--chrome);
}

/* ── Topbar (dunkel) ─────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--chrome);
  border-bottom: 1px solid var(--chrome-line);
  color: var(--chrome-text);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 30;
  flex-shrink: 0;
}
.topbar-hamburger {
  display: none;
  background: none;
  border: 1px solid var(--chrome-line-2);
  border-radius: var(--radius);
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  color: var(--chrome-hell);
  flex-shrink: 0;
}
.topbar-hamburger:hover { background: var(--chrome-hover); }
.topbar-mobile-logo { display: none; flex-shrink: 0; }
.topbar-mobile-logo img { width: 28px; height: 28px; object-fit: contain; }
.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  min-width: 0;
  color: var(--chrome-text-2);
}
.topbar-bc-root { color: var(--chrome-text); white-space: nowrap; }
.topbar-bc-current { color: var(--chrome-hell); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.topbar-search {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px;
  padding: 0 8px 0 12px;
  min-width: 220px;
  border-radius: var(--radius);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--chrome-line-2);
  color: var(--chrome-text);
  font-size: 13px;
  transition: border-color .12s, background .12s, color .12s;
}
.topbar-search:hover { background: rgba(255,255,255,.07); color: var(--chrome-hell); border-color: rgba(255,255,255,.2); }
.topbar-search:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
.topbar-search-text { flex: 1; }
.topbar-kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--chrome-text);
  border: 1px solid var(--chrome-line-2);
  border-radius: 5px;
  padding: 2px 6px;
  background: rgba(255,255,255,.03);
}
.topbar-user {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 3px 10px 3px 3px;
  border-radius: 10px;
  color: var(--chrome-hell);
  font-size: 13px; font-weight: 500;
}
.topbar-user:hover { background: var(--chrome-hover); }
.topbar-user:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
.topbar-user-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Page Content ────────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 0;
  background: var(--surface);
  border-top-left-radius: 16px;
  min-width: 0;
}
.page-content > :first-child { border-top-left-radius: 16px; }
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 20px 28px 18px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.page-header-left { min-width: 0; }
.page-title {
  font-family: var(--font-head);
  font-size: 23px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.2px;
  line-height: 1.2;
}
.page-subtitle {
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 3px;
}
.page-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.page-body {
  padding: 20px 24px;
}
.page-footer {
  padding: 22px 24px 18px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px;
  font-size: 11.5px;
  color: var(--ink-3);
  text-align: center;
}
.page-footer a { color: var(--ink-3); }
.page-footer a:hover { color: var(--ink); text-decoration: underline; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.05px;
  color: var(--ink);
}
.card-subtitle {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 1px;
}
.card-body {
  padding: 18px;
}
.card-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* ── KPI Cards ───────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.kpi-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  transition: transform .15s, box-shadow .15s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 12px;
}
.kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.6px;
  line-height: 1;
  margin-bottom: 6px;
}
.kpi-meta {
  font-size: 12px;
  color: var(--ink-3);
}
.kpi-value.success { color: var(--success); }
.kpi-value.warning { color: var(--warning); }
.kpi-value.danger  { color: var(--danger); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 14px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background .12s, transform .08s, box-shadow .12s;
  text-decoration: none;
  line-height: 1;
}
.btn:active { transform: scale(.98); }
.btn svg { flex-shrink: 0; }

.btn-primary { background: var(--brand); color: white; box-shadow: 0 1px 2px rgba(11,15,25,.12), inset 0 1px 0 rgba(255,255,255,.12); }
.btn-primary:hover { background: var(--brand-dark); box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 30%, transparent); }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.btn-secondary { background: white; color: var(--ink); border: 1px solid #D9DDE5; box-shadow: var(--shadow-xs); }
.btn-secondary:hover { background: var(--surface); }

.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface); color: var(--ink); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #A31717; }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #065F46; }

.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-xs { padding: 4px 8px; font-size: 11.5px; border-radius: 5px; }
.btn-lg { padding: 11px 20px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.form-label.required::after { content: ' *'; color: var(--danger); }
.form-hint { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.form-error { font-size: 11.5px; color: var(--danger); margin-top: 4px; }

.form-input,
.form-select,
.form-textarea {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #D9DDE5;
  border-radius: var(--radius);
  font-size: 13.5px;
  color: var(--ink);
  background: white;
  outline: none;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.form-input.error,
.form-select.error { border-color: var(--danger); }
.form-input::placeholder, .form-textarea::placeholder { color: #6E7587; }
.form-textarea { resize: vertical; min-height: 80px; }
.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%238B90A4' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 36px;
}
.form-checkbox {
  width: 15px;
  height: 15px;
  accent-color: var(--brand);
  cursor: pointer;
  border-radius: 4px;
}
.form-row { display: grid; gap: 14px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
}
.checkbox-row label { font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.badge-success  { background: var(--success-bg); color: var(--success); }
.badge-warning  { background: var(--warning-bg); color: var(--warning); }
.badge-danger   { background: var(--danger-bg);  color: var(--danger); }
.badge-info     { background: var(--brand-50);   color: var(--brand); }
.badge-brand    { background: var(--brand-100);  color: var(--brand-dark); }
.badge-neutral  { background: var(--surface-2);  color: var(--ink-2); border: 1px solid var(--border); }
.badge-purple   { background: #F5F3FF; color: #7C3AED; }

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.table {
  width: 100%;
  border-collapse: collapse;
}
table.table thead th {
  padding: 10px 14px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-3);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--ink-2);
  vertical-align: middle;
}
table.table tbody tr:hover td { background: rgba(244,245,248,.6); }
table.table tbody tr:last-child td { border-bottom: none; }
.cell-primary { color: var(--ink); font-weight: 600; }
.cell-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.cell-mono { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); white-space: nowrap; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-success { background: var(--success-bg); border: 1px solid rgba(5,150,105,.2); color: #065F46; }
.alert-error   { background: var(--danger-bg);  border: 1px solid rgba(220,38,38,.2);  color: #991B1B; }
.alert-warning { background: var(--warning-bg); border: 1px solid rgba(217,119,6,.2);  color: #92400E; }
.alert-info    { background: var(--brand-50);   border: 1px solid var(--brand-100);  color: var(--brand-dark); }

/* ── Toast Notifications ─────────────────────────────────── */
.toast-wrap {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 320px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  font-weight: 500;
}
.toast-success { background: var(--success-bg); border-color: rgba(5,150,105,.2); color: #065F46; }
.toast-error   { background: var(--danger-bg);  border-color: rgba(220,38,38,.2);  color: #991B1B; }
.toast-info    { background: var(--brand-50);   border-color: var(--brand-100);  color: var(--brand-dark); }
.toast-warning { background: var(--warning-bg); border-color: rgba(217,119,6,.2);  color: #92400E; }

/* ── Progress Bar ────────────────────────────────────────── */
.progress { background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress-bar {
  height: 100%;
  border-radius: 99px;
  background: var(--brand);
  transition: width .6s ease;
}
.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger  { background: var(--danger); }

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
}
.empty-icon { width: 48px; height: 48px; color: var(--ink-4); margin: 0 auto 14px; }
.empty-title { font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.empty-sub { font-size: 13px; color: var(--ink-3); margin-bottom: 20px; max-width: 320px; }

/* ── Tabs ────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: var(--radius-lg);
  width: fit-content;
  margin-bottom: 20px;
}
.tab-btn {
  padding: 7px 16px;
  border-radius: var(--radius);
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  cursor: pointer;
  transition: all .15s;
}
.tab-btn.active {
  background: white;
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}
.tab-btn:hover:not(.active) { color: var(--ink); }

/* ── Filters ─────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-bar .form-input,
.filter-bar .form-select {
  width: auto;
  min-width: 0;
  padding: 7px 11px;
  font-size: 13px;
}
.filter-bar .form-select { padding-right: 32px; }
.search-wrap {
  position: relative;
}
.search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}
.search-wrap .form-input { padding-left: 34px; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}
.pg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: white;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  transition: all .1s;
}
.pg-btn:hover { background: var(--surface); border-color: var(--ink-4); }
.pg-btn.active { background: var(--brand); border-color: var(--brand); color: white; }

/* ── Grid Helpers ────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.grid-main-aside { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex-center  { display: flex; align-items: center; gap: 8px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }

/* ── Divider ─────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ── Avatar ──────────────────────────────────────────────── */
.avatar {
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
}
.avatar-sm  { width: 28px; height: 28px; }
.avatar-md  { width: 36px; height: 36px; }
.avatar-lg  { width: 48px; height: 48px; }
.avatar-xl  { width: 64px; height: 64px; }
.avatar-2xl { width: 80px; height: 80px; }

/* ── Auth Layout (dunkel, AUTERIQ) ───────────────────────── */
.auth-body { background: var(--chrome); color: var(--chrome-text); }
.auth-wrap {
  display: flex;
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 12% -10%, color-mix(in srgb, var(--akzent) 16%, transparent), transparent 70%),
    radial-gradient(700px 480px at 100% 110%, color-mix(in srgb, var(--akzent) 9%, transparent), transparent 70%),
    var(--chrome);
}
.auth-panel {
  width: 46%;
  max-width: 620px;
  min-width: 420px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 56px 56px 40px;
  border-right: 1px solid var(--chrome-line);
}
.auth-panel-inner { max-width: 440px; }
.auth-logo-img { width: 300px; max-width: 100%; height: auto; margin: 0 0 44px -6px; }
.auth-claim {
  font-family: var(--font-head);
  color: #fff;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.3px;
  margin-bottom: 14px;
}
.auth-tagline-sub {
  color: var(--chrome-text);
  font-size: 14px;
  line-height: 1.65;
  margin-bottom: 28px;
}
.auth-features { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.auth-feature {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--chrome-hell);
  font-size: 13.5px;
}
.auth-feature svg {
  flex-shrink: 0;
  color: var(--akzent);
  width: 22px; height: 22px; padding: 4px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--akzent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--akzent) 28%, transparent);
}
/* Produktreihe: Zeichen der fünf Produkte, dezent */
.auth-produkte {
  list-style: none;
  display: flex; flex-wrap: wrap; gap: 6px;
  padding-top: 22px;
  border-top: 1px solid var(--chrome-line);
}
.auth-produkt {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 10px 4px 5px;
  border: 1px solid var(--chrome-line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--chrome-text);
  background: rgba(255,255,255,.02);
}
.auth-produkt img { width: 20px; height: 20px; object-fit: contain; }
.auth-produkt.is-aktiv { color: #fff; border-color: color-mix(in srgb, var(--m) 45%, transparent); background: color-mix(in srgb, var(--m) 9%, transparent); }

.auth-mobile-brand { display: none; }
.auth-mobile-zeichen { display: none; }

.auth-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px 24px;
  min-width: 0;
}
.auth-form-wrap { width: 100%; max-width: 400px; margin: auto 0; }
.auth-footer {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px;
  margin-top: 28px;
  font-size: 11.5px;
  color: var(--chrome-text-2);
  text-align: center;
}
.auth-footer a { color: var(--chrome-text); }
.auth-footer a:hover { color: #fff; text-decoration: underline; }

/* Formular-Karte: dunkel, Felder kontraststark (Text #F2F4F8 auf #05070A, Rahmen sichtbar) */
.auth-card {
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02));
  border: 1px solid var(--chrome-line-2);
  border-radius: var(--radius-2xl);
  padding: 34px 32px 30px;
  box-shadow: 0 30px 60px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.05);
  color: var(--chrome-text);
}
.auth-card h1 {
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.2px;
  margin-bottom: 4px;
}
.auth-card .subtitle {
  font-size: 13.5px;
  color: var(--chrome-text);
  margin-bottom: 26px;
}
.auth-card p { color: var(--chrome-text); }
.auth-card strong { color: var(--chrome-hell); }
.auth-card .form-label, .auth-label-row label { color: var(--chrome-hell); font-size: 12.5px; font-weight: 600; }
.auth-card .form-input {
  background: rgba(5,7,10,.75);
  border: 1px solid rgba(255,255,255,.16);
  color: #fff;
  padding: 11px 13px;
  border-radius: 9px;
}
.auth-card .form-input::placeholder { color: #7C8597; }
.auth-card .form-input:focus {
  border-color: var(--akzent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--akzent) 25%, transparent);
}
.auth-card .form-input.error { border-color: #FF6B74; }
.auth-card .form-input:-webkit-autofill { -webkit-text-fill-color: #fff; -webkit-box-shadow: 0 0 0 1000px #0B0E14 inset; caret-color: #fff; }
.auth-card .btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--akzent) 60%, transparent); }
.auth-card .btn-primary:hover { background: color-mix(in srgb, var(--brand) 88%, #fff); }
.auth-card .btn-secondary { background: transparent; color: var(--chrome-hell); border: 1px solid var(--chrome-line-2); box-shadow: none; }
.auth-card .btn-secondary:hover { background: var(--chrome-hover); }
.auth-card .form-checkbox { accent-color: var(--akzent); }
.auth-card a:not(.btn) { color: var(--chrome-text) !important; }
.auth-card a:not(.btn):hover { color: #fff !important; }
.auth-card [style*="background:#E4E6ED"] { background: var(--chrome-line-2) !important; }
.auth-card .auth-oder { color: var(--chrome-text-2) !important; }
.auth-card .alert, .auth-form-wrap > .alert { border-radius: 10px; }
.auth-wrap .alert-error   { background: rgba(255,45,58,.10);  border-color: rgba(255,45,58,.35);  color: #FFC2C6; }
.auth-wrap .alert-warning { background: rgba(255,170,40,.10); border-color: rgba(255,170,40,.35); color: #FFD9A0; }
.auth-wrap .alert-success { background: rgba(77,235,106,.09); border-color: rgba(77,235,106,.32); color: #B9F5C6; }
.auth-wrap .alert-info    { background: rgba(30,140,255,.10); border-color: rgba(30,140,255,.35); color: #BFE0FF; }
.auth-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.auth-label-row label { margin: 0; }
.auth-label-row a { font-size: 12.5px; font-weight: 600; }
.auth-label-row a:hover { text-decoration: underline; }
.auth-card .auth-label-row a { color: var(--akzent) !important; }
.auth-remember {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
}
.auth-remember label { font-size: 13px; color: var(--chrome-text); cursor: pointer; font-weight: 500; }

/* ── Admin Layout (Betreiber, dunkle Leiste) ─────────────── */
.admin-shell {
  display: flex;
  min-height: 100vh;
}
.admin-sidebar {
  width: 232px;
  min-width: 232px;
  background: var(--chrome);
  border-right: 1px solid var(--chrome-line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  --akzent: #1E8CFF;
}
.admin-sidebar-logo {
  display: flex;
  align-items: center;
  padding: 0 18px;
  height: var(--topbar-h);
  flex-shrink: 0;
}
.admin-sidebar-logo img { height: 40px; width: auto; max-width: 100%; object-fit: contain; }
.admin-logo-sub {
  margin: 0 18px 8px;
  padding: 9px 0 0;
  border-top: 1px solid var(--chrome-line);
  font-family: var(--font-mono);
  font-size: 10.5px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--akzent);
  display: flex; align-items: center; gap: 7px;
}
.admin-logo-sub::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--akzent); box-shadow: 0 0 8px var(--akzent); }
.admin-nav { flex: 1; padding: 4px 10px 10px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent; }
.admin-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--chrome-text);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 1px;
  transition: background .12s, color .12s;
}
.admin-nav-item svg { flex-shrink: 0; opacity: .85; }
.admin-nav-item:hover { background: var(--chrome-hover); color: var(--chrome-hell); }
.admin-nav-item.active { background: rgba(255,255,255,.07); color: #fff; font-weight: 600; }
.admin-nav-item.active svg { color: var(--akzent); opacity: 1; }
.admin-nav-item.active::before {
  content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--akzent); box-shadow: 0 0 10px color-mix(in srgb, var(--akzent) 60%, transparent);
}
.admin-sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--chrome-line);
  flex-shrink: 0;
}
.admin-user-info { flex: 1; min-width: 0; }
.admin-user-name { font-size: 12.5px; font-weight: 600; color: var(--chrome-hell); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-user-role { font-family: var(--font-mono); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--akzent); }
.admin-logout { color: var(--chrome-text); display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--chrome-line-2); }
.admin-logout:hover { color: #FF6B74; background: rgba(255,45,58,.1); }
.admin-main { flex: 1; min-width: 0; overflow-y: auto; }

/* ── Detail Info List ────────────────────────────────────── */
.info-list { display: flex; flex-direction: column; }
.info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--surface);
  font-size: 13px;
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--ink-3); font-size: 12px; flex-shrink: 0; }
.info-value { color: var(--ink); font-weight: 500; text-align: right; }

/* ── User Inline ─────────────────────────────────────────── */
.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-cell img { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,14,26,.5);
  backdrop-filter: blur(4px);
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  background: white;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* ── Wochentag-Picker ────────────────────────────────────── */
.day-picker { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.day-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: white;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  cursor: pointer;
  transition: all .12s;
}
.day-btn.active { background: var(--brand); border-color: var(--brand); color: white; }

/* ── Responsive ──────────────────────────────────────────── */
/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-main-aside { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  /* Sidebar: ausblenden, per Hamburger öffnen */
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    z-index: 200;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: block; }
  .sidebar-close { display: flex; }
  .main-wrap { margin-left: 0 !important; }
  .page-content, .page-content > :first-child { border-top-left-radius: 0; }
  .topbar { padding: 0 12px; gap: 10px; }
  .topbar-hamburger { display: flex; }
  .topbar-mobile-logo { display: flex; }
  .topbar-breadcrumb { font-size: 13.5px; }
  .topbar-bc-root, .topbar-breadcrumb > svg { display: none; }
  .topbar-search { min-width: 0; width: 36px; padding: 0; justify-content: center; }
  .topbar-search-text, .topbar-kbd, .topbar-user-name { display: none; }
  .topbar-user { padding: 3px; }

  /* Layout */
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-main-aside { grid-template-columns: minmax(0, 1fr); }
  .form-row.cols-2,
  .form-row.cols-3,
  .form-row.cols-4 { grid-template-columns: 1fr; }

  /* Seite */
  .page-header { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .page-body { padding: 12px 16px; }
  .page-title { font-size: 17px; }

  /* Seitenknöpfe: im Kopf umbrechen statt die Seite zu verbreitern (Handy 390 px ohne Querscrollen) */
  .page-header-right { flex-shrink: 1; min-width: 0; max-width: 100%; }
  #page-actions { display: flex !important; flex-wrap: wrap; gap: 6px; }
  #page-actions .btn { white-space: nowrap; flex-shrink: 0; }

  /* Cards */
  .card-header { flex-wrap: wrap; gap: 8px; }
  .card-body { padding: 14px; }

  /* Tabellen: horizontal scrollbar */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Filter-Bar: stacked */
  .filter-bar { flex-wrap: wrap; gap: 8px; }
  .filter-bar .form-input,
  .filter-bar .form-select { min-width: 0; flex: 1; }

  /* Auth */
  .auth-panel { display: none; }
  .auth-right { padding: 28px 16px 20px; }
  .auth-mobile-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 24px; text-align: center; }
  .auth-mobile-brand img { width: 210px; height: auto; }
  .auth-mobile-brand span { font-family: var(--font-head); color: var(--chrome-hell); font-size: 17px; font-weight: 600; }
  .auth-card { padding: 26px 20px 22px; }

  /* Tabs: horizontal scroll */
  /* Prüfung 04.10.2026: width:fit-content ließ die Leiste über den Bildschirm wachsen (Objekt-/KST-Detail bei 390px) */
  .tabs { overflow-x: auto; flex-wrap: nowrap; gap: 4px; padding-bottom: 4px; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .tab-btn { white-space: nowrap; flex-shrink: 0; }

  /* KPI kleiner */
  .kpi-card { padding: 12px 14px; }
  .kpi-value { font-size: 22px; }
  .kpi-label { font-size: 11px; }

  /* Buttons in Card-Headern */
  .card-header .btn { font-size: 11px; padding: 5px 10px; }

  /* Admin-Sidebar */
  .admin-sidebar { width: 200px; min-width: 200px; }

  /* Modals */
  #bab-editor { max-width: calc(100vw - 32px) !important; left: 16px !important; }
}

@media (max-width: 600px) {
  /* KPI: 2 Spalten */
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi-value { font-size: 20px; }
  .kpi-meta { display: none; }

  /* Seite noch kompakter */
  .page-body { padding: 10px 12px; }
  .page-header { padding: 10px 12px; }
  .page-title { font-size: 16px; }
  .page-subtitle { font-size: 11.5px; }

  /* Cards */
  .card { border-radius: 10px; }
  .card-body { padding: 12px; }
  .card-header { padding: 10px 12px; }
  .card-title { font-size: 13.5px; }

  /* Toast: volle Breite */
  .toast-wrap { width: calc(100vw - 24px); right: 12px; left: 12px; }

  /* Tabelle: kleinere Schrift */
  .table thead th { padding: 7px 8px; font-size: 10.5px; }
  .table tbody td { padding: 9px 8px; font-size: 12.5px; }
  .cell-primary { font-size: 13px; }
  .cell-sub { font-size: 11px; }

  /* Buttons: etwas kleiner */
  .btn { font-size: 12.5px; padding: 7px 12px; }
  .btn-sm { font-size: 11.5px; padding: 5px 10px; }
  .btn-xs { font-size: 11px; padding: 3px 7px; }
  .btn-block { width: 100%; }

  /* Form */
  .form-input, .form-select, .form-textarea { font-size: 15px; } /* 15px verhindert iOS Zoom */
  .form-label { font-size: 11.5px; }

  /* Topbar kompakter */
  .topbar { padding: 0 10px; }

  /* Info-List */
  .info-row { flex-direction: column; gap: 2px; padding: 8px 0; }
  .info-label { min-width: 0; font-size: 10.5px; }
  .info-value { font-size: 13px; }

  /* Badge kleiner */
  .badge { font-size: 10px; padding: 2px 6px; }

  /* Divider kompakter */
  .divider { margin: 12px 0; }

  /* Filter-Bar: untereinander */
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .form-select,
  .filter-bar .form-input { width: 100%; }

  /* Tabs kleiner */
  .tab-btn { padding: 7px 12px; font-size: 12px; }

  /* Checkbox-Row */
  .checkbox-row { gap: 8px; }
  .form-checkbox { width: 18px; height: 18px; }

  /* Form-Row: immer 1 Spalte */
  .form-row { grid-template-columns: 1fr !important; }

  /* Verstecke unwichtige Spalten in Tabellen */
  .hide-mobile { display: none !important; }

  /* Floating BAB-Editor */
  #bab-editor {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    border-radius: 16px 16px 0 0 !important;
    max-width: 100% !important;
    padding: 16px !important;
    box-shadow: 0 -4px 32px rgba(0,0,0,.2) !important;
  }

  /* Sticky Bottom-Aktionen */
  .mobile-sticky-bottom {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: white;
    padding: 12px 16px;
    border-top: 1px solid #E4E6ED;
    box-shadow: 0 -4px 16px rgba(0,0,0,.08);
    z-index: 50;
    display: flex;
    gap: 8px;
  }
}

/* Touch-Verbesserungen */
@media (hover: none) and (pointer: coarse) {
  /* Größere Touch-Targets */
  .btn { min-height: 40px; }
  .btn-sm { min-height: 34px; }
  .nav-item { min-height: 40px; }
  .tab-btn { min-height: 38px; }
  .form-input, .form-select { min-height: 44px; }
  /* 16px verhindert den iOS-Fokus-Zoom — deshalb ist maximum-scale nicht mehr nötig */
  .form-input, .form-select, .form-textarea { font-size: 16px; }
  .btn-xs { min-height: 32px; padding: 6px 10px; }

  /* Kein Hover-Effekt auf Touch */
  .btn:hover { transform: none !important; }

  /* Tabellen-Zeilen größer */
  .table tbody td { padding: 12px 8px; }
}

/* ── Print ───────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .toast-wrap, .btn { display: none !important; }
  .main-wrap { margin-left: 0 !important; background: none !important; }
  .page-content { border-radius: 0 !important; background: none !important; }
  .page-footer { display: none; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* ── Safe Area (iPhone Notch / Home Indicator) ──────────── */
.sidebar {
  padding-bottom: env(safe-area-inset-bottom);
}
.page-body {
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}
.topbar {
  padding-left: max(12px, env(safe-area-inset-left));
  padding-right: max(12px, env(safe-area-inset-right));
}
.mobile-sticky-bottom {
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

/* ── Touch-Scroll Verbesserungen ──────────────────────────── */
.table-wrap,
.tabs,
#page-actions {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.table-wrap::-webkit-scrollbar,
.tabs::-webkit-scrollbar { display: none; }

/* ── Tap-Highlight entfernen ─────────────────────────────── */
* { -webkit-tap-highlight-color: transparent; }
a, button, .btn, .nav-item, .tab-btn {
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}

/* ── Input Zoom verhindern (iOS) ─────────────────────────── */
@media (max-width: 600px) {
  input[type="text"],
  input[type="email"],
  input[type="number"],
  input[type="password"],
  input[type="tel"],
  input[type="date"],
  input[type="time"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* ═══ UX-Patch: Utility-Klassen (Basis zum schrittweisen Abbau von Inline-Styles) ═══ */
.badge { display:inline-block; padding:2px 8px; border-radius:8px; font-size:10px; font-weight:700; letter-spacing:.02em; }
.badge-green  { background:#ECFDF5; color:#065F46; }
.badge-amber  { background:#FEF3C7; color:#B45309; }
.badge-red    { background:#FEE2E2; color:#991B1B; }
.badge-blue   { background:#EFF6FF; color:#1E40AF; }
.badge-grey   { background:#F1F5F9; color:#64748B; }
.badge-purple { background:#F3E8FF; color:#7C3AED; }
.txt-ok    { color:#059669; } .txt-warn { color:#D97706; }
.txt-bad   { color:#DC2626; } .txt-dim  { color:#8B90A4; }
.txt-right { text-align:right; }
.fw-6 { font-weight:600; } .fw-7 { font-weight:700; } .fw-8 { font-weight:800; }
.notice { border-radius:12px; padding:12px 16px; font-size:12.5px; line-height:1.6; margin-bottom:14px; border:1px solid; }
.notice-info { background:#EFF6FF; border-color:#BFDBFE; color:#1E40AF; }
.notice-warn { background:#FFFBEB; border-color:#FDE68A; color:#92400E; }
.notice-ok   { background:#ECFDF5; border-color:#A7F3D0; color:#065F46; }
.notice-bad  { background:#FEF2F2; border-color:#FECACA; color:#991B1B; }


/* ═══════════════════════════════════════════════════════════
   Sidebar 2.0 — Filter + Accordion (AUTERIQ, dunkel)
   ═══════════════════════════════════════════════════════════ */

/* ── Menü-Filter ── */
.sidebar-filter {
  display: flex; align-items: center; gap: 8px;
  margin: 0 12px 8px;
  padding: 7px 10px;
  background: rgba(255,255,255,.035);
  border: 1px solid var(--chrome-line);
  border-radius: var(--radius);
  transition: border-color .15s, background .15s, box-shadow .15s;
  flex-shrink: 0;
}
.sidebar-filter svg { color: var(--chrome-text-2); flex-shrink: 0; }
.sidebar-filter input {
  flex: 1; min-width: 0;
  background: transparent; border: none; outline: none;
  color: var(--chrome-hell); font: inherit; font-size: 12.5px;
}
.sidebar-filter input::placeholder { color: var(--chrome-text-2); }
.sidebar-filter:focus-within {
  background: rgba(255,255,255,.06);
  border-color: color-mix(in srgb, var(--akzent) 60%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--akzent) 16%, transparent);
}
.sidebar-filter button {
  background: none; border: none; cursor: pointer;
  color: var(--chrome-text-2); font-size: 11px; line-height: 1;
  padding: 2px 3px; border-radius: 4px;
}
.sidebar-filter button:hover { color: #fff; background: rgba(255,255,255,.10); }

/* ── Gruppen-Kopf: Zeichen der Marke + Label in Mono ── */
.nav-group { margin-top: 2px; }
.nav-group-toggle {
  appearance: none; background: none; border: none;
  width: 100%; cursor: pointer;
  font: inherit; text-align: left;
  display: flex; align-items: center; gap: 9px;
  padding: 12px 10px 5px;
  font-family: var(--font-mono);
  font-size: 10.5px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--chrome-text-2);
  transition: color .15s;
  user-select: none;
  border-radius: 6px;
}
.nav-group-toggle:hover { color: var(--chrome-hell); }
.nav-group-toggle:focus-visible { outline: 2px solid var(--akzent); outline-offset: 0; }
.nav-group-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Zeichen der Marke: kleiner Punkt in Markenfarbe — immer sichtbar; leuchtet, wenn die Gruppe den aktiven Eintrag hat */
.nav-group-dot {
  width: 6px; height: 6px; border-radius: 2px;
  background: var(--akzent);
  flex-shrink: 0;
  opacity: .9;
  transform: rotate(45deg);
  transition: box-shadow .2s, opacity .2s;
}
.nav-group-toggle.has-active { color: var(--chrome-hell); }
.nav-group-toggle.has-active .nav-group-dot { opacity: 1; box-shadow: 0 0 8px var(--akzent); }

.nav-chevron {
  margin-left: auto;
  color: var(--chrome-text-2);
  flex-shrink: 0;
  transition: transform .22s cubic-bezier(.4,0,.2,1), color .15s;
}
.nav-group-toggle:hover .nav-chevron { color: var(--chrome-hell); }
.nav-group.collapsed .nav-chevron { transform: rotate(-90deg); }

/* ── Weiches Auf-/Zuklappen ohne JS-Höhenmessung (Grid-Trick) ── */
.nav-group-items {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows .24s cubic-bezier(.4,0,.2,1);
}
.nav-group.collapsed .nav-group-items { grid-template-rows: 0fr; }
.nav-group.filter-open .nav-group-items { grid-template-rows: 1fr !important; }
.nav-group.filter-open .nav-chevron { transform: rotate(0deg) !important; }
/* overflow nur senkrecht kappen: der Akzentbalken des aktiven Eintrags steht links über den Rand */
.nav-group-items > .nav-group-items-inner { overflow: hidden; min-height: 0; margin-left: -10px; padding-left: 10px; }

@media (prefers-reduced-motion: reduce) {
  .nav-group-items, .nav-chevron, .nav-group-dot { transition: none; }
}

/* ── UI-Politur 07/2026: Icons, Badges, Aufgaben, ruhige KPIs ── */
.ui-icon { flex-shrink: 0; vertical-align: -3px; }
.nav-badge {
  margin-left: auto;
  background: color-mix(in srgb, var(--akzent) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--akzent) 40%, transparent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  border-radius: 6px;
  padding: 0 6px;
  line-height: 1.6;
  flex-shrink: 0;
}

/* Aufgabenliste (Dashboard „Heute zu erledigen") */
.task-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--surface);
  text-decoration: none; color: inherit;
  font-size: 13px;
}
.task-row:last-child { border-bottom: none; }
.task-row:hover { background: var(--brand-50); }
.task-row .ui-icon { color: var(--ink-3); }
.task-row.t-danger .ui-icon { color: var(--danger); }
.task-row.t-warn   .ui-icon { color: var(--warning); }
.task-row.t-info   .ui-icon { color: var(--brand); }
.task-row-text { flex: 1; font-weight: 600; color: var(--ink); }
.task-row-go { color: var(--brand); font-weight: 600; font-size: 12.5px; white-space: nowrap; }

/* Karten-Titel mit Icon + Zähler-Chip */
.card-title .ui-icon { color: var(--ink-3); margin-right: 2px; }
.count-chip {
  background: var(--brand-50); color: var(--brand);
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600;
  border-radius: 9px; padding: 1px 8px; margin-left: 6px;
  vertical-align: 1px;
}

/* Ruhige Zahlen: KPI-Werte tragen Ink, Signalfarbe nur in der Meta-Zeile */
.kpi-value, .num { font-variant-numeric: tabular-nums; }
.kpi-meta .is-warn { color: var(--warning); font-weight: 600; }
.kpi-meta .is-danger { color: var(--danger); font-weight: 600; }
.kpi-meta .is-ok { color: var(--success); font-weight: 600; }

/* Status: Punkt + Wort (statt Emoji-Badges) */
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.status-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); }
.status-dot.sd-warning { color: var(--warning); } .status-dot.sd-warning::before { background: var(--warning); }
.status-dot.sd-info    { color: var(--brand); }   .status-dot.sd-info::before    { background: var(--brand); }
.status-dot.sd-success { color: var(--success); } .status-dot.sd-success::before { background: var(--success); }
.status-dot.sd-danger  { color: var(--danger); }  .status-dot.sd-danger::before  { background: var(--danger); }
.status-dot.sd-neutral { color: var(--ink-3); }

/* Eingangs-Belege: ruhige Akzentleiste statt Warnbanner */
.inbox-strip { border-left: 3px solid var(--brand); background: var(--brand-50); }
.inbox-strip-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px 4px;
  font-size: 12px; font-weight: 700; color: var(--brand-dark);
}
.inbox-strip-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; font-size: 13px;
  text-decoration: none; color: inherit;
}
.inbox-strip-row + .inbox-strip-row { border-top: 1px solid var(--brand-100); }
.inbox-strip-row:hover { background: var(--brand-100); }
.inbox-strip-row .ui-icon { color: var(--ink-3); }
.inbox-strip-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.inbox-strip-meta { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.inbox-strip-amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inbox-strip-go { color: var(--brand); font-weight: 600; font-size: 12.5px; white-space: nowrap; }

/* ── Zweistufige Navigation (Hauptpunkte mit Unterpunkten) ── */
.nav-item-row { display: flex; align-items: center; }
.nav-item-row .nav-item { flex: 1; min-width: 0; }
.nav-sub-toggle {
  background: none; border: none; cursor: pointer;
  padding: 6px; margin-left: 2px; border-radius: 6px;
  color: var(--chrome-text-2); display: flex; align-items: center;
}
.nav-sub-toggle:hover { background: var(--chrome-hover); color: var(--chrome-hell); }
.nav-sub-toggle:focus-visible { outline: 2px solid var(--akzent); outline-offset: -2px; }
.nav-sub-toggle svg { transition: transform .15s; }
.nav-node.open > .nav-item-row .nav-sub-toggle svg,
.nav-node.filter-open > .nav-item-row .nav-sub-toggle svg { transform: rotate(180deg); }
.nav-sub { display: none; margin: 1px 0 6px 18px; padding-left: 9px; border-left: 1px solid var(--chrome-line-2); }
.nav-node.open > .nav-sub,
.nav-node.filter-open > .nav-sub { display: block; }
.nav-sub .nav-item { font-size: 12.5px; padding: 5px 10px; color: var(--chrome-text); font-weight: 450; }
.nav-sub .nav-item:hover { color: var(--chrome-hell); }
.nav-sub .nav-item.active { background: rgba(255,255,255,.06); color: #fff; font-weight: 600; box-shadow: none; }
/* Unterpunkt: Akzent als Markierung auf der Führungslinie statt Balken am Rand */
.nav-sub .nav-item.active::before { left: -10px; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; }

/* ═══ Öffentliche Seiten (404, Impressum, Datenschutz) — AUTERIQ, 05.10.2026 ═══ */
.pub-body { background: var(--surface); color: var(--ink); min-height: 100vh; display: flex; flex-direction: column; }
.pub-kopf {
  background: var(--chrome);
  border-bottom: 1px solid var(--chrome-line);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 max(20px, calc((100vw - 820px) / 2));
  height: 68px;
}
.pub-kopf img { height: 44px; width: auto; }
.pub-kopf a.pub-zurueck { color: var(--chrome-text); font-size: 13px; white-space: nowrap; }
.pub-kopf a.pub-zurueck:hover { color: #fff; }
.pub-inhalt { width: 100%; max-width: 820px; margin: 32px auto; padding: 0 20px; flex: 1; }
.pub-blatt {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-card);
  padding: 36px 40px; line-height: 1.7; font-size: 14.5px; color: var(--ink-2);
}
.pub-blatt h1 { font-family: var(--font-head); font-size: 30px; font-weight: 700; color: var(--ink); letter-spacing: -.2px; margin-bottom: 6px; }
.pub-blatt h2 { font-family: var(--font-head); font-size: 17px; font-weight: 600; color: var(--ink); margin: 28px 0 6px; }
.pub-blatt p { margin-bottom: 10px; }
.pub-blatt a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.pub-blatt strong { color: var(--ink); }
.pub-stand { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .04em; color: var(--ink-3); text-transform: uppercase; }
.pub-fuss { padding: 18px 20px 26px; text-align: center; font-size: 12px; color: var(--ink-3); }
.pub-fuss a { color: var(--ink-3); }
.pub-fuss a:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 600px) {
  .pub-kopf { height: 60px; }
  .pub-kopf img { height: 32px; }
  .pub-inhalt { margin: 16px auto; padding: 0 12px; }
  .pub-blatt { padding: 22px 18px; font-size: 14px; }
  .pub-blatt h1 { font-size: 24px; }
}

/* 404 / Fehler: ganz dunkel, mittig */
.fehler-body {
  min-height: 100vh; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 20px; text-align: center; color: var(--chrome-text);
  background:
    radial-gradient(700px 420px at 50% 0%, color-mix(in srgb, var(--akzent) 14%, transparent), transparent 70%),
    var(--chrome);
}
.fehler-box { max-width: 460px; }
.fehler-box img.fehler-logo { width: 220px; height: auto; margin: 0 auto 36px; }
.fehler-code { font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; color: var(--akzent); text-transform: uppercase; margin-bottom: 10px; }
.fehler-box h1 { font-family: var(--font-head); font-size: 30px; font-weight: 700; color: #fff; margin-bottom: 10px; letter-spacing: -.2px; }
.fehler-box p { font-size: 14.5px; line-height: 1.6; margin-bottom: 26px; }
.fehler-box .btn { padding: 11px 20px; font-size: 14px; }
.fehler-box .btn-secondary { background: transparent; color: var(--chrome-hell); border-color: var(--chrome-line-2); box-shadow: none; }
.fehler-box .btn-secondary:hover { background: var(--chrome-hover); }
.fehler-aktionen { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.fehler-fuss { margin-top: 48px; font-size: 12px; color: var(--chrome-text-2); }
.fehler-fuss a { color: var(--chrome-text); }

/* Seitenknöpfe ohne Seitenkopf (siehe layout_hub_end): eigene Zeile mit Abstand statt am linken Rand */
.page-content > #page-actions.page-actions-zeile { display: flex !important; flex-wrap: wrap; gap: 8px; padding: 16px 24px 0; }
