/* ==========================================================================
   Zularis.de — CRM für Zulassungsdienste
   Own design system; Zeasy DNA: Clash Grotesk + Geist + warm off-white
   ========================================================================== */

/* --- Fonts (Zeasy DNA) --- */
@font-face { font-family: "Clash Grotesk"; src: url("/fonts/ClashGrotesk-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Clash Grotesk"; src: url("/fonts/ClashGrotesk-Semibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Clash Grotesk"; src: url("/fonts/ClashGrotesk-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Clash Grotesk"; src: url("/fonts/ClashGrotesk-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Geist Variable"; src: url("/fonts/Geist-VariableFont_wght.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }

:root {
  /* Zularis own palette — german plate blue as primary, Zeasy lilac reserved for brand badge */
  --zu-ink:        #0e1220;       /* near-black, slight cool cast */
  --zu-ink-2:      #2a2f45;
  --zu-ink-3:      #5a6080;
  --zu-ink-4:      #8a90a8;
  --zu-line:       #e6e3da;       /* warm hairline */
  --zu-line-2:     #efece3;
  --zu-bg:         #fafaf7;       /* warm off-white (Zeasy DNA) */
  --zu-bg-2:       #f3efe6;       /* warm beige, section panels */
  --zu-bg-3:       #e9e5d9;       /* sand */
  --zu-surface:    #ffffff;

  /* Zularis accent — plate-blue (EU-strip reference) */
  --zu-accent:     #1e4ed8;
  --zu-accent-2:   #1739a8;
  --zu-accent-12:  rgba(30, 78, 216, 0.12);
  --zu-accent-08:  rgba(30, 78, 216, 0.08);

  /* Zeasy brand reference — used ONLY on the "powered by" badge + brand moments */
  --zeasy-lilac:   #a351dd;

  /* Status tokens */
  --zu-status-open:     #d97706;   /* amber — new, waiting */
  --zu-status-open-bg:  #fef3c7;
  --zu-status-progress: #1e4ed8;   /* blue — in progress (shares accent) */
  --zu-status-progress-bg: #dbe5fb;
  --zu-status-closed:   #15803d;   /* green — done */
  --zu-status-closed-bg:#dcfce7;
  --zu-red:             #dc2626;
  --zu-red-bg:          #fee2e2;

  /* Typography */
  --font-display: "Clash Grotesk", "Inter", system-ui, sans-serif;
  --font-ui:      "Geist Variable", "Inter", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Spacing */
  --s-2: 2px; --s-4: 4px; --s-6: 6px; --s-8: 8px;
  --s-10: 10px; --s-12: 12px; --s-14: 14px; --s-16: 16px;
  --s-20: 20px; --s-24: 24px; --s-32: 32px; --s-40: 40px;
  --s-48: 48px; --s-64: 64px;

  /* Radii */
  --r-4: 4px; --r-6: 6px; --r-8: 8px; --r-10: 10px;
  --r-12: 12px; --r-16: 16px; --r-20: 20px;

  /* Shadows — restrained */
  --sh-1: 0 1px 2px rgba(14,18,32,0.04), 0 0 0 1px rgba(14,18,32,0.04);
  --sh-2: 0 1px 2px rgba(14,18,32,0.06), 0 4px 12px rgba(14,18,32,0.04);
  --sh-3: 0 8px 28px rgba(14,18,32,0.10), 0 2px 6px rgba(14,18,32,0.05);
  --sh-pop: 0 20px 60px -10px rgba(14,18,32,0.28), 0 0 0 1px rgba(14,18,32,0.08);

  /* Density (modulated by Tweaks) */
  --row-h: 52px;
  --cell-px: 16px;
}

/* Density variants */
[data-density="compact"] { --row-h: 40px; --cell-px: 12px; }
[data-density="cozy"]    { --row-h: 52px; --cell-px: 16px; }
[data-density="roomy"]   { --row-h: 64px; --cell-px: 20px; }

/* Accent variants */
[data-accent="blue"]   { --zu-accent: #1e4ed8; --zu-accent-2: #1739a8; --zu-accent-12: rgba(30,78,216,.12); --zu-accent-08: rgba(30,78,216,.08); --zu-status-progress:#1e4ed8; --zu-status-progress-bg:#dbe5fb; }
[data-accent="lilac"]  { --zu-accent: #a351dd; --zu-accent-2: #8d19c9; --zu-accent-12: rgba(163,81,221,.14); --zu-accent-08: rgba(163,81,221,.08); --zu-status-progress:#a351dd; --zu-status-progress-bg:#f1e4fb; }
[data-accent="green"]  { --zu-accent: #15803d; --zu-accent-2: #0f5f2d; --zu-accent-12: rgba(21,128,61,.14); --zu-accent-08: rgba(21,128,61,.08); --zu-status-progress:#15803d; --zu-status-progress-bg:#dcfce7; }
[data-accent="amber"]  { --zu-accent: #d97706; --zu-accent-2: #b45309; --zu-accent-12: rgba(217,119,6,.14); --zu-accent-08: rgba(217,119,6,.08); --zu-status-progress:#d97706; --zu-status-progress-bg:#fef3c7; }

/* Dark mode */
[data-theme="dark"] {
  --zu-ink:        #f5f3ed;
  --zu-ink-2:      #d4d1c5;
  --zu-ink-3:      #8a8b98;
  --zu-ink-4:      #5b5e70;
  --zu-line:       #2a2b38;
  --zu-line-2:     #1e1f2a;
  --zu-bg:         #0e0f16;
  --zu-bg-2:       #161722;
  --zu-bg-3:       #1e1f2a;
  --zu-surface:    #161722;
  --sh-1: 0 0 0 1px rgba(255,255,255,0.05);
  --sh-2: 0 1px 2px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.2);
  --sh-3: 0 8px 28px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06);
  --sh-pop: 0 20px 60px -10px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.08);
}

/* --- reset --- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--zu-bg);
  color: var(--zu-ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden; /* app shell */
}
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

/* ========================================================================
   APP SHELL
   ======================================================================== */
.app {
  display: grid;
  grid-template-columns: 232px 1fr;
  height: 100vh;
  width: 100vw;
}
.app[data-sidebar="collapsed"] { grid-template-columns: 64px 1fr; }

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--zu-bg);
  border-right: 1px solid var(--zu-line);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  position: relative;
}
.sidebar__brand {
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--zu-line);
  flex-shrink: 0;
}
.sidebar__logo {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--zu-ink);
  color: var(--zu-bg);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.03em;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.sidebar__logo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, var(--zu-accent) 0%, transparent 55%);
  opacity: .7;
}
.sidebar__logo span { position: relative; z-index: 1; }
.sidebar__wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--zu-ink);
  white-space: nowrap;
}
.sidebar__wordmark em {
  font-style: normal;
  color: var(--zu-ink-3);
  font-weight: 500;
}
[data-sidebar="collapsed"] .sidebar__wordmark,
[data-sidebar="collapsed"] .tenant-switcher__meta,
[data-sidebar="collapsed"] .nav__label,
[data-sidebar="collapsed"] .nav__count,
[data-sidebar="collapsed"] .sidebar__footer-text,
[data-sidebar="collapsed"] .nav__section-title { display: none; }
[data-sidebar="collapsed"] .nav__item { justify-content: center; padding: 0 8px; }
[data-sidebar="collapsed"] .sidebar__brand { justify-content: center; padding: 0; }
[data-sidebar="collapsed"] .tenant-switcher { padding: 12px 8px; }
[data-sidebar="collapsed"] .tenant-switcher a,
[data-sidebar="collapsed"] .tenant-switcher button { padding: 8px; justify-content: center; }
[data-sidebar="collapsed"] .sidebar__footer { justify-content: center; padding: 10px 4px; gap: 0; }
[data-sidebar="collapsed"] .sidebar__footer-profile { display: none; }
[data-sidebar="collapsed"] .sidebar__footer-avatar { display: none; }
[data-sidebar="collapsed"] .zeasy-brand__expanded { display: none; }
[data-sidebar="collapsed"] .zeasy-brand__collapsed { display: block; }

/* Tenant switcher */
.tenant-switcher { padding: 12px; border-bottom: 1px solid var(--zu-line); }
.tenant-switcher a,
.tenant-switcher button {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-8);
  text-align: left;
  transition: background .15s;
}
.tenant-switcher a:hover,
.tenant-switcher button:hover { background: var(--zu-bg-2); }
.tenant-switcher__avatar {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: linear-gradient(135deg, #1e4ed8, #0ea5b7);
  display: grid; place-items: center;
  color: white;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  flex-shrink: 0;
}
.tenant-switcher__meta { min-width: 0; flex: 1; }
.tenant-switcher__name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 13.5px;
  color: var(--zu-ink);
  white-space: normal; word-break: break-word; line-height: 1.3;
  letter-spacing: -0.01em;
}
.tenant-switcher__sub {
  font-size: 11.5px;
  color: var(--zu-ink-3);
  white-space: nowrap;
}
.tenant-switcher__chev { color: var(--zu-ink-4); flex-shrink: 0; }

/* Nav */
.nav { padding: 8px 8px; flex: 1; overflow-y: auto; }
.nav__section { padding: 12px 0 4px; }
.nav__section-title {
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--zu-ink-4);
  padding: 4px 12px 6px;
  font-family: var(--font-display);
}
.nav__item {
  display: flex; align-items: center; gap: 10px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--r-8);
  color: var(--zu-ink-2);
  font-size: 13.5px;
  font-weight: 500;
  transition: background .12s, color .12s;
  cursor: pointer;
  width: 100%;
  text-align: left;
  position: relative;
}
.nav__item:hover { background: var(--zu-bg-2); color: var(--zu-ink); }
.nav__item.is-active {
  background: var(--zu-ink);
  color: var(--zu-bg);
}
[data-theme="dark"] .nav__item.is-active { background: var(--zu-surface); color: var(--zu-ink); border: 1px solid var(--zu-line); }
.nav__item svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav__label { flex: 1; }
.nav__count {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--zu-bg-3);
  color: var(--zu-ink-2);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.nav__item.is-active .nav__count { background: rgba(255,255,255,0.18); color: var(--zu-bg); }

/* Sidebar footer */
.sidebar__footer {
  border-top: 1px solid var(--zu-line);
  padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
}
.sidebar__footer-avatar {
  width: 28px; height: 28px;
  border-radius: 999px;
  background: var(--zu-bg-3);
  color: var(--zu-ink);
  display: grid; place-items: center;
  font-weight: 600; font-size: 12px;
  flex-shrink: 0;
  font-family: var(--font-display);
}
.sidebar__footer-text { min-width: 0; flex: 1; }
.sidebar__footer-text > div:first-child {
  font-size: 13px; font-weight: 500; color: var(--zu-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar__footer-text > div:last-child {
  font-size: 11px; color: var(--zu-ink-3);
}
.sidebar__footer-profile {
  display: flex; align-items: center; gap: 10px;
  flex: 1; min-width: 0;
  text-decoration: none; color: inherit;
  border-radius: 6px; padding: 2px 4px; margin: -2px -4px;
  transition: background 0.15s;
}
.sidebar__footer-profile:hover { background: var(--zu-bg-2); }

/* Zeasy brand logo */
.zeasy-brand {
  padding: 10px 12px;
  border-top: 1px solid var(--zu-line);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.zeasy-brand__expanded {
  max-height: 32px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}
.zeasy-brand__collapsed {
  display: none;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

/* ========================================================================
   MAIN AREA
   ======================================================================== */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--zu-bg);
  overflow: hidden;
}
.page-host {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Top bar */
.topbar {
  height: 56px;
  padding: 0 20px;
  border-bottom: 1px solid var(--zu-line);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  background: var(--zu-bg);
}
.topbar__toggle {
  width: 32px; height: 32px;
  border-radius: var(--r-6);
  color: var(--zu-ink-3);
  display: grid; place-items: center;
}
.topbar__toggle:hover { background: var(--zu-bg-2); color: var(--zu-ink); }
.topbar__crumbs {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.topbar__crumbs .crumb { color: var(--zu-ink-3); }
.topbar__crumbs .crumb.is-current { color: var(--zu-ink); }
.topbar__crumbs .sep { color: var(--zu-ink-4); }

.topbar__search {
  flex: 1;
  max-width: 520px;
  margin: 0 auto;
  position: relative;
}
.topbar__search input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--zu-line);
  background: var(--zu-surface);
  border-radius: var(--r-8);
  padding: 0 40px 0 38px;
  font-size: 13.5px;
  color: var(--zu-ink);
  transition: border-color .15s, box-shadow .15s;
}
.topbar__search input::placeholder { color: var(--zu-ink-4); }
.topbar__search input:focus { outline: 0; border-color: var(--zu-accent); box-shadow: 0 0 0 3px var(--zu-accent-12); }
.topbar__search .topbar__search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--zu-ink-4);
  pointer-events: none;
}
.topbar__search .kbd {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  display: flex; gap: 2px;
  pointer-events: none;
}

.kbd-key {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 20px;
  padding: 0 5px;
  border: 1px solid var(--zu-line);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--zu-bg);
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--zu-ink-3);
}

.topbar__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-8);
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 500;
  transition: all .15s;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn--primary { background: var(--zu-ink); color: var(--zu-bg); }
.btn--primary:hover { background: var(--zu-ink-2); }
[data-theme="dark"] .btn--primary { background: var(--zu-ink); color: var(--zu-bg); }
.btn--accent { background: var(--zu-accent); color: white; }
.btn--accent:hover { background: var(--zu-accent-2); }
.btn--ghost { background: transparent; color: var(--zu-ink-2); }
.btn--ghost:hover { background: var(--zu-bg-2); color: var(--zu-ink); }
.btn--outline { background: var(--zu-surface); color: var(--zu-ink); border: 1px solid var(--zu-line); }
.btn--outline:hover { background: var(--zu-bg-2); border-color: var(--zu-ink-4); }
.btn--sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn--icon { width: 36px; padding: 0; }
.btn--icon.btn--sm { width: 30px; }

/* Row action dropdown (3-dot menu) */
.row-menu { position: relative; display: inline-block; }
.row-menu__dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--zu-surface);
  border: 1px solid var(--zu-line);
  border-radius: var(--r-8);
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  min-width: 160px;
  z-index: 50;
  padding: 4px;
}
.row-menu__item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 10px;
  border-radius: 5px;
  font-size: 13px; font-family: inherit;
  color: var(--zu-ink); background: none; border: 0;
  cursor: pointer; text-align: left; text-decoration: none;
  transition: background .1s;
  white-space: nowrap;
}
.row-menu__item:hover { background: var(--zu-bg-2); }
.row-menu__item--danger { color: var(--zu-red); }
.row-menu__item--danger:hover { background: var(--zu-red-bg); }

/* ========================================================================
   PAGE: DASHBOARD (tenant view)
   ======================================================================== */
.page {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px 80px;
  display: none;
}
.page.is-active { display: block; }

.page__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.page__title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 4px;
  color: var(--zu-ink);
}
.page__sub {
  font-size: 14px;
  color: var(--zu-ink-3);
  line-height: 1.4;
}
.page__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Hero search (kennzeichenzentriert) */
.plate-hero {
  background: var(--zu-surface);
  border: 1px solid var(--zu-line);
  border-radius: var(--r-16);
  padding: 24px 28px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.plate-hero::before {
  /* Subtle plate-blue EU strip suggestion on the side */
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 6px;
  background: var(--zu-accent);
}
.plate-hero__label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--zu-ink-3);
  margin-bottom: 8px;
}
.plate-hero__row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.plate-search {
  display: inline-flex;
  align-items: stretch;
  height: 44px;
  border: 2px solid var(--zu-ink);
  border-radius: 6px;
  background: white;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04), inset 0 1px 0 rgba(255,255,255,0.8);
}
.plate-search__eu {
  width: 22px;
  background: var(--zu-accent);
  color: white;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
  flex-shrink: 0;
  font-family: var(--font-display);
  padding: 3px 0;
}
.plate-search__stars {
  font-size: 5px;
  letter-spacing: -0.5px;
  opacity: .9;
  line-height: 1;
  color: #ffd600;
}
.plate-search__country {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}
.plate-search__input {
  width: 200px;
  border: 0;
  background: transparent;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.05em;
  padding: 0 12px;
  color: var(--zu-ink);
  text-transform: uppercase;
  min-width: 0;
}
.plate-search__input:focus { outline: 0; }
.plate-search__input::placeholder { color: var(--zu-ink-4); font-weight: 500; letter-spacing: 0.08em; }
.plate-search__submit {
  margin-left: 4px;
  padding: 0 14px;
  border-radius: 0;
  background: var(--zu-ink);
  color: white;
  font-weight: 500;
  font-family: var(--font-ui);
  font-size: 12.5px;
  display: flex; align-items: center; gap: 6px;
  border-left: 2px solid var(--zu-ink);
  transition: background .15s;
}
.plate-search__submit svg { width: 14px; height: 14px; }
.plate-search__submit:hover { background: var(--zu-accent-2); }

.plate-hero__hints {
  margin-top: 10px;
  display: flex; gap: 10px; flex-wrap: wrap;
  font-size: 12px;
  color: var(--zu-ink-3);
}
.plate-hero__hints strong { color: var(--zu-ink-2); font-weight: 500; font-family: var(--font-mono); }

/* KPI row */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.kpi {
  background: var(--zu-surface);
  border: 1px solid var(--zu-line);
  border-radius: var(--r-12);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}
.kpi__label {
  font-size: 12.5px;
  color: var(--zu-ink-3);
  font-weight: 500;
  display: flex; align-items: center; gap: 6px;
}
.kpi__label .dot { width: 8px; height: 8px; border-radius: 999px; }
.kpi__value {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 30px;
  letter-spacing: -0.02em;
  color: var(--zu-ink);
  line-height: 1;
  display: flex; align-items: baseline; gap: 8px;
}
.kpi__delta {
  font-size: 12px;
  color: var(--zu-status-closed);
  font-family: var(--font-ui);
  font-weight: 500;
}
.kpi__delta.is-down { color: var(--zu-red); }
.kpi__foot {
  font-size: 11.5px;
  color: var(--zu-ink-4);
}
.kpi__spark {
  position: absolute;
  right: 14px; top: 14px;
  opacity: .9;
}

/* Two-column layout for Heute + Activity */
.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

/* Section headers */
.section {
  background: var(--zu-surface);
  border: 1px solid var(--zu-line);
  border-radius: var(--r-12);
  overflow: hidden;
}
.section__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--zu-line);
  gap: 12px;
}
.section__title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--zu-ink);
}
.section__sub { font-size: 12px; color: var(--zu-ink-3); }
.section__actions { display: flex; gap: 6px; }

/* Tabs */
.tabs { display: flex; gap: 2px; }
.tab {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--zu-ink-3);
}
.tab:hover { background: var(--zu-bg-2); color: var(--zu-ink); }
.tab.is-active { background: var(--zu-ink); color: var(--zu-bg); }
[data-theme="dark"] .tab.is-active { background: var(--zu-surface); color: var(--zu-ink); border: 1px solid var(--zu-line); }

/* Table */
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl thead th {
  text-align: left;
  padding: 8px var(--cell-px);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--zu-ink-4);
  border-bottom: 1px solid var(--zu-line);
  background: var(--zu-bg-2);
  font-family: var(--font-display);
  white-space: nowrap;
}
.tbl tbody td {
  padding: 0 var(--cell-px);
  height: var(--row-h);
  border-bottom: 1px solid var(--zu-line-2);
  font-size: 13px;
  color: var(--zu-ink-2);
  vertical-align: middle;
}
.tbl tbody tr { cursor: pointer; transition: background .1s; }
.tbl tbody tr:hover { background: var(--zu-bg-2); }
.tbl tbody tr.is-selected { background: var(--zu-accent-12); }
.tbl tbody tr.is-selected:hover { background: var(--zu-accent-8, color-mix(in srgb, var(--zu-accent) 8%, transparent)); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .t-num { text-align: right; font-variant-numeric: tabular-nums; color: var(--zu-ink-3); }
.tbl .t-ink { color: var(--zu-ink); font-weight: 500; }

/* Checkbox in table rows */
.cb-wrap { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; cursor: pointer; }
.cb { width: 15px; height: 15px; cursor: pointer; accent-color: var(--zu-accent); border-radius: 3px; }

/* License plate chip (table) */
.plate-chip {
  display: inline-flex;
  align-items: stretch;
  height: 26px;
  border: 1.5px solid var(--zu-ink);
  border-radius: 4px;
  background: white;
  overflow: hidden;
  font-family: var(--font-display);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}
.plate-chip__eu {
  width: 12px;
  background: var(--zu-accent);
  color: #ffd600;
  font-size: 6px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.plate-chip__num {
  padding: 0 8px;
  display: flex; align-items: center;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--zu-ink);
  text-transform: uppercase;
}
/* Plate style variants */
[data-plate="styled"] .plate-chip__num { font-family: var(--font-mono); letter-spacing: 0.02em; font-weight: 500; }
[data-plate="minimal"] .plate-chip { border: 0; background: transparent; }
[data-plate="minimal"] .plate-chip__eu { display: none; }
[data-plate="minimal"] .plate-chip__num { padding: 0; font-family: var(--font-mono); font-size: 13px; color: var(--zu-ink); font-weight: 600; }

.plate-big {
  display: inline-flex; align-items: stretch;
  height: 44px;
  border: 2px solid var(--zu-ink);
  border-radius: 6px;
  background: white;
  overflow: hidden;
  font-family: var(--font-display);
}
.plate-big .plate-chip__eu { width: 22px; font-size: 9px; }
.plate-big .plate-chip__num { padding: 0 14px; font-size: 22px; letter-spacing: 0.05em; font-weight: 600; }

/* Status pill */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  font-family: var(--font-ui);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 999px; }
.pill--open      { background: var(--zu-status-open-bg);     color: var(--zu-status-open); }
.pill--open .dot      { background: var(--zu-status-open); }
.pill--progress  { background: var(--zu-status-progress-bg); color: var(--zu-status-progress); }
.pill--progress .dot  { background: var(--zu-status-progress); }
.pill--closed    { background: var(--zu-status-closed-bg);   color: var(--zu-status-closed); }
.pill--closed .dot    { background: var(--zu-status-closed); }
.pill--neutral   { background: var(--zu-bg-3);               color: var(--zu-ink-2); }
.pill--neutral .dot   { background: var(--zu-ink-3); }

[data-theme="dark"] .pill--open     { background: rgba(217,119,6,.18); }
[data-theme="dark"] .pill--progress { background: rgba(30,78,216,.22); }
[data-theme="dark"] .pill--closed   { background: rgba(21,128,61,.22); }

/* Type label */
.type-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px;
  color: var(--zu-ink-2);
  font-weight: 500;
}
.type-label__icon {
  width: 20px; height: 20px;
  border-radius: 5px;
  background: var(--zu-bg-2);
  color: var(--zu-ink-3);
  display: grid; place-items: center;
}
.type-label__icon svg { width: 12px; height: 12px; }

/* Contact cell */
.contact-cell {
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 28px; height: 28px;
  border-radius: 999px;
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
  font-family: var(--font-display);
  letter-spacing: 0.01em;
}
.avatar--sm { width: 22px; height: 22px; font-size: 10px; }
.avatar--md { width: 32px; height: 32px; font-size: 12px; }
.avatar--lg { width: 44px; height: 44px; font-size: 15px; }

.contact-cell__name {
  font-weight: 500;
  color: var(--zu-ink);
  font-size: 13px;
}
.contact-cell__sub {
  font-size: 11.5px;
  color: var(--zu-ink-3);
  font-variant-numeric: tabular-nums;
}
.contact-cell__tag {
  font-size: 10px;
  font-weight: 500;
  color: var(--zu-accent);
  background: var(--zu-accent-12);
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-family: var(--font-display);
}

/* Activity feed */
.activity { padding: 6px 0; }
.activity__item {
  display: flex; gap: 12px;
  padding: 12px 18px;
  position: relative;
}
.activity__item + .activity__item { border-top: 1px solid var(--zu-line-2); }
.activity__icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--zu-bg-2);
  color: var(--zu-ink-3);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.activity__icon svg { width: 14px; height: 14px; }
.activity__icon--accent { background: var(--zu-accent-12); color: var(--zu-accent); }
.activity__icon--ok { background: var(--zu-status-closed-bg); color: var(--zu-status-closed); }
.activity__icon--warn { background: var(--zu-status-open-bg); color: var(--zu-status-open); }
.activity__body { font-size: 13px; color: var(--zu-ink-2); line-height: 1.4; min-width: 0; }
.activity__body strong { color: var(--zu-ink); font-weight: 500; }
.activity__time { font-size: 11.5px; color: var(--zu-ink-4); margin-top: 2px; }

/* ========================================================================
   SLIDE-OVER / DRAWER
   ======================================================================== */
.scrim {
  position: fixed; inset: 0;
  background: rgba(14,18,32,0.4);
  z-index: 40;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
  backdrop-filter: blur(2px);
}
.scrim.is-open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(640px, 100%);
  background: var(--zu-bg);
  border-left: 1px solid var(--zu-line);
  z-index: 50;
  transform: translateX(100%);
  transition: transform .25s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column;
  box-shadow: var(--sh-pop);
}
.drawer.is-open { transform: translateX(0); }
.drawer--wide { width: min(820px, 100%); }
.drawer form { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.drawer__head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--zu-line);
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
  background: var(--zu-bg);
}
.drawer__title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--zu-ink);
  margin: 0;
  flex: 1;
}
.drawer__body {
  flex: 1; overflow-y: auto;
  padding: 24px;
}
.drawer__foot {
  padding: 14px 24px;
  border-top: 1px solid var(--zu-line);
  display: flex; align-items: center; gap: 10px;
  background: var(--zu-bg);
  flex-shrink: 0;
}
.drawer__foot .hint { font-size: 12px; color: var(--zu-ink-4); flex: 1; }
.drawer__foot .hint .kbd-key { margin: 0 2px; }

/* Form fields */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 14px;
}
.form-grid .full { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--zu-ink-2);
  letter-spacing: -0.005em;
  display: flex; align-items: center; gap: 4px;
}
.field__label .req { color: var(--zu-accent); }
.field__hint { font-size: 11.5px; color: var(--zu-ink-4); }
.input, .select, .textarea {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--zu-line);
  border-radius: var(--r-8);
  background: var(--zu-surface);
  color: var(--zu-ink);
  font-size: 13.5px;
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: 0;
  border-color: var(--zu-accent);
  box-shadow: 0 0 0 3px var(--zu-accent-12);
}
.textarea { height: auto; padding: 10px 12px; min-height: 76px; resize: vertical; font-family: var(--font-ui); }

/* Form section within drawer */
.form-section { margin-bottom: 28px; }
.form-section__head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.form-section__num {
  width: 22px; height: 22px;
  border-radius: 999px;
  background: var(--zu-ink);
  color: var(--zu-bg);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
  font-family: var(--font-display);
  flex-shrink: 0;
}
.form-section__title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--zu-ink);
}
.form-section__sub { font-size: 12.5px; color: var(--zu-ink-3); margin-left: auto; }

/* Party picker (autocomplete combobox) */
.party-picker { position: relative; }
.party-picker__trigger {
  display: flex; align-items: center; gap: 10px;
  height: 52px;
  padding: 8px 12px;
  border: 1px solid var(--zu-line);
  border-radius: var(--r-10);
  background: var(--zu-surface);
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s;
}
.party-picker__trigger:hover { border-color: var(--zu-ink-4); }
.party-picker__trigger.is-selected { border-color: var(--zu-accent); background: var(--zu-accent-08); }
.party-picker__trigger.is-placeholder { color: var(--zu-ink-4); }
.party-picker__body {
  flex: 1; min-width: 0;
}
.party-picker__name {
  font-size: 14px; font-weight: 500; color: var(--zu-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.party-picker__meta { font-size: 12px; color: var(--zu-ink-3); }

.party-picker__placeholder { display: flex; align-items: center; gap: 10px; color: var(--zu-ink-4); }
.party-picker__placeholder svg { width: 20px; height: 20px; color: var(--zu-ink-4); }

.combobox {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--zu-surface);
  border: 1px solid var(--zu-line);
  border-radius: var(--r-10);
  box-shadow: var(--sh-3);
  z-index: 10;
  overflow: hidden;
  max-height: 360px;
  display: none;
  flex-direction: column;
}
.combobox.is-open { display: flex; }
.combobox__search {
  padding: 10px 12px;
  border-bottom: 1px solid var(--zu-line);
  display: flex; align-items: center; gap: 8px;
}
.combobox__search input {
  flex: 1; border: 0; background: transparent;
  font-size: 14px; color: var(--zu-ink);
}
.combobox__search input:focus { outline: 0; }
.combobox__list { overflow-y: auto; flex: 1; padding: 4px; }
.combobox__item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-6);
  cursor: pointer;
  transition: background .1s;
}
.combobox__item:hover, .combobox__item.is-focused { background: var(--zu-bg-2); }
.combobox__item[data-new="true"] {
  color: var(--zu-accent);
  font-weight: 500;
  border-top: 1px solid var(--zu-line);
  margin-top: 4px;
  padding-top: 10px;
}
.combobox__item-name { font-size: 13.5px; color: var(--zu-ink); font-weight: 500; }
.combobox__item-meta { font-size: 11.5px; color: var(--zu-ink-3); margin-left: auto; }

/* Toggle row (checkboxen: Ansprechpartner = Kunde) */
.toggle-row {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 10px;
}
.toggle {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-8);
  cursor: pointer;
  transition: background .1s;
}
.toggle:hover { background: var(--zu-bg-2); }
.toggle__check {
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--zu-line);
  background: var(--zu-surface);
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: all .15s;
}
.toggle__check svg { width: 12px; height: 12px; color: white; opacity: 0; }
.toggle.is-on .toggle__check {
  background: var(--zu-accent);
  border-color: var(--zu-accent);
}
.toggle.is-on .toggle__check svg { opacity: 1; }
.toggle__label { font-size: 13.5px; color: var(--zu-ink-2); font-weight: 500; }
.toggle__sub { font-size: 11.5px; color: var(--zu-ink-4); margin-left: auto; }

/* Segmented control (type, status) */
.seg {
  display: inline-flex;
  background: var(--zu-bg-2);
  padding: 3px;
  border-radius: var(--r-8);
  gap: 2px;
}
.seg__btn {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--zu-ink-3);
  transition: all .12s;
  display: flex; align-items: center; gap: 5px;
}
.seg__btn:hover { color: var(--zu-ink); }
.seg__btn.is-active {
  background: var(--zu-surface);
  color: var(--zu-ink);
  box-shadow: var(--sh-1);
}
.seg__btn svg { width: 13px; height: 13px; }

/* Chips (plates within process) */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.plate-input-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px 8px 8px;
  background: var(--zu-bg-2);
  border-radius: var(--r-8);
}
.plate-input-row .plate-chip { height: 32px; }
.plate-input-row .plate-chip .plate-chip__num { font-size: 14px; padding: 0 10px; }
.plate-input-row__role {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--zu-ink-3);
  font-family: var(--font-display);
}
.plate-input-row__rm {
  color: var(--zu-ink-4);
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 999px;
  margin-left: auto;
}
.plate-input-row__rm:hover { background: var(--zu-bg-3); color: var(--zu-red); }

.add-plate-input {
  display: flex; align-items: center; gap: 6px;
  height: 38px;
  padding: 0 12px;
  border: 1.5px dashed var(--zu-line);
  border-radius: var(--r-8);
  font-size: 13px;
  color: var(--zu-ink-3);
  font-weight: 500;
  background: transparent;
  transition: all .15s;
  width: 100%;
  justify-content: center;
}
.add-plate-input:hover { border-color: var(--zu-accent); color: var(--zu-accent); background: var(--zu-accent-08); }

/* ========================================================================
   COMMAND PALETTE
   ======================================================================== */
.palette {
  position: fixed;
  top: 14vh; left: 50%;
  transform: translateX(-50%) scale(0.98);
  width: min(580px, 90vw);
  background: var(--zu-surface);
  border-radius: var(--r-12);
  box-shadow: var(--sh-pop);
  z-index: 60;
  display: none;
  flex-direction: column;
  overflow: hidden;
  max-height: 60vh;
  border: 1px solid var(--zu-line);
}
.palette.is-open { display: flex; animation: palette-in .18s cubic-bezier(.2,.8,.2,1); }
@keyframes palette-in {
  from { opacity: 0; transform: translateX(-50%) scale(0.96) translateY(-6px); }
  to { opacity: 1; transform: translateX(-50%) scale(1) translateY(0); }
}
.palette__input {
  border: 0;
  padding: 18px 20px 16px 48px;
  font-size: 16px;
  color: var(--zu-ink);
  background: transparent;
  font-family: var(--font-ui);
  border-bottom: 1px solid var(--zu-line);
  position: relative;
}
.palette__input:focus { outline: 0; }
.palette__search-wrap { position: relative; }
.palette__search-wrap svg.lead {
  position: absolute;
  left: 20px; top: 20px;
  color: var(--zu-ink-4);
  pointer-events: none;
}
.palette__list { overflow-y: auto; padding: 6px; flex: 1; }
.palette__group-title {
  padding: 10px 12px 6px;
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--zu-ink-4);
  font-family: var(--font-display);
}
.palette__item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-8);
  cursor: pointer;
  transition: background .1s;
}
.palette__item:hover, .palette__item.is-focused { background: var(--zu-bg-2); }
.palette__item-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--zu-bg-2);
  color: var(--zu-ink-3);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.palette__item-icon svg { width: 14px; height: 14px; }
.palette__item-label { font-size: 13.5px; color: var(--zu-ink); font-weight: 500; }
.palette__item-sub { font-size: 11.5px; color: var(--zu-ink-3); margin-left: auto; }
.palette__foot {
  padding: 10px 14px;
  border-top: 1px solid var(--zu-line);
  display: flex; align-items: center; gap: 12px;
  font-size: 11.5px;
  color: var(--zu-ink-4);
  background: var(--zu-bg);
}
.palette__foot span { display: flex; align-items: center; gap: 4px; }

/* ========================================================================
   VORGANG DETAIL VIEW
   ======================================================================== */
.vorgang-detail__hero {
  background: var(--zu-surface);
  border: 1px solid var(--zu-line);
  border-radius: var(--r-16);
  padding: 24px 28px;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
}
.vorgang-detail__id {
  font-size: 11.5px;
  color: var(--zu-ink-4);
  font-family: var(--font-mono);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.vorgang-detail__title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.vorgang-detail__meta {
  display: flex; gap: 20px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--zu-ink-3);
}
.vorgang-detail__meta > div { display: flex; align-items: center; gap: 6px; }
.vorgang-detail__meta strong { color: var(--zu-ink-2); font-weight: 500; }

.detail-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; }

.party-card {
  background: var(--zu-surface);
  border: 1px solid var(--zu-line);
  border-radius: var(--r-12);
  padding: 16px;
}
.party-card__head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
}
.party-card__role {
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--zu-ink-4);
  font-family: var(--font-display);
  display: inline-flex; align-items: center; gap: 5px;
}
.party-card__role .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--zu-accent); }
.party-card__name { font-family: var(--font-display); font-size: 17px; font-weight: 500; margin: 4px 0 0; letter-spacing: -0.01em; }
.party-card__subname { font-size: 12.5px; color: var(--zu-ink-3); }
.party-card__phones { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.phone-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-8);
  background: var(--zu-bg-2);
  font-size: 13px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--zu-ink);
}
.phone-row--primary { background: var(--zu-accent-08); color: var(--zu-accent); font-weight: 500; }
.phone-row--primary .phone-badge { background: var(--zu-accent); color: white; }
.phone-row svg { width: 14px; height: 14px; color: var(--zu-ink-3); }
.phone-row--primary svg { color: var(--zu-accent); }
.phone-badge {
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--zu-bg-3);
  color: var(--zu-ink-3);
}

/* Timeline */
.timeline { padding: 14px 18px; display: flex; flex-direction: column; gap: 0; }
.tl-item {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 12px;
  padding: 8px 0;
  position: relative;
}
.tl-item::before {
  content: "";
  position: absolute;
  left: 6px; top: 22px; bottom: -6px;
  width: 2px;
  background: var(--zu-line);
}
.tl-item:last-child::before { display: none; }
.tl-dot {
  width: 14px; height: 14px;
  border-radius: 999px;
  background: var(--zu-bg);
  border: 2px solid var(--zu-line);
  margin-top: 4px;
  z-index: 1;
}
.tl-item.is-current .tl-dot {
  background: var(--zu-accent);
  border-color: var(--zu-accent);
  box-shadow: 0 0 0 4px var(--zu-accent-12);
}
.tl-body { font-size: 13px; color: var(--zu-ink-2); }
.tl-body strong { color: var(--zu-ink); font-weight: 500; }
.tl-time { font-size: 11.5px; color: var(--zu-ink-4); margin-top: 1px; }

/* ========================================================================
   KONTAKTE (Party list)
   ======================================================================== */
.filter-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.filter-bar .input { max-width: 280px; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 12px;
  border: 1px solid var(--zu-line);
  border-radius: 999px;
  font-size: 12.5px;
  background: var(--zu-surface);
  color: var(--zu-ink-2);
  font-weight: 500;
  cursor: pointer;
  transition: all .1s;
}
.filter-chip:hover { border-color: var(--zu-ink-4); }
.filter-chip.is-active { background: var(--zu-ink); color: var(--zu-bg); border-color: var(--zu-ink); }
.filter-chip svg { width: 11px; height: 11px; }

/* ========================================================================
   ADMIN (tenants)
   ======================================================================== */
.admin-card {
  background: var(--zu-surface);
  border: 1px solid var(--zu-line);
  border-radius: var(--r-16);
  padding: 20px 22px;
  transition: border-color .15s;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 16px;
}
.admin-card:hover { border-color: var(--zu-ink-4); }
.admin-card__head { display: flex; align-items: center; gap: 12px; }
.admin-card__name { font-family: var(--font-display); font-size: 16px; font-weight: 500; letter-spacing: -0.01em; }
.admin-card__sub { font-size: 12px; color: var(--zu-ink-3); }
.admin-card__stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding-top: 14px; border-top: 1px solid var(--zu-line-2);
}
.admin-card__stat-label { font-size: 10.5px; color: var(--zu-ink-4); letter-spacing: 0.06em; text-transform: uppercase; font-family: var(--font-display); font-weight: 500; }
.admin-card__stat-value { font-family: var(--font-display); font-weight: 500; font-size: 19px; letter-spacing: -0.01em; margin-top: 2px; }

.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }

/* ========================================================================
   TWEAKS PANEL
   ======================================================================== */
.tweaks {
  position: fixed;
  bottom: 20px; right: 20px;
  width: 300px;
  background: var(--zu-surface);
  border: 1px solid var(--zu-line);
  border-radius: var(--r-12);
  box-shadow: var(--sh-3);
  z-index: 70;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--font-ui);
}
.tweaks.is-open { display: flex; }
.tweaks__head {
  padding: 12px 14px;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--zu-line);
}
.tweaks__head .title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  flex: 1;
}
.tweaks__head .dot {
  width: 8px; height: 8px; border-radius: 999px; background: var(--zu-accent);
}
.tweaks__body { padding: 12px 14px; display: flex; flex-direction: column; gap: 14px; }
.tweaks__row { display: flex; flex-direction: column; gap: 6px; }
.tweaks__row > .label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--zu-ink-4);
  font-family: var(--font-display);
}
.accent-swatches { display: flex; gap: 6px; }
.accent-swatch {
  width: 30px; height: 30px;
  border-radius: 7px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .12s;
  position: relative;
}
.accent-swatch.is-active { border-color: var(--zu-ink); }
[data-theme="dark"] .accent-swatch.is-active { border-color: var(--zu-ink); box-shadow: 0 0 0 2px var(--zu-bg); }

/* Utility */
.hstack { display: flex; align-items: center; gap: 8px; }
.vstack { display: flex; flex-direction: column; gap: 8px; }
.spacer { flex: 1; }
.text-muted { color: var(--zu-ink-3); }
.text-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Skeleton + page-empty helpers */
.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--zu-ink-3);
  font-size: 13px;
}

/* Login */
.login-shell {
  position: fixed; inset: 0;
  background: var(--zu-bg);
  display: grid;
  grid-template-columns: 1fr 1fr;
  z-index: 100;
}
.login-left {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--zu-line);
}
.login-right {
  background: var(--zu-bg-2);
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.login-right::before {
  content: "";
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--zu-accent-12) 0%, transparent 70%);
  pointer-events: none;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--zu-line); border-radius: 999px; border: 2px solid var(--zu-bg); }
::-webkit-scrollbar-thumb:hover { background: var(--zu-ink-4); }

/* Focus ring */
button:focus-visible, .input:focus-visible, .select:focus-visible, .textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--zu-accent);
  outline-offset: 2px;
}


/* ============ Verifier fixes ============ */

/* Plate chip: never wrap, never shrink */
.plate-chip, .plate-big {
  white-space: nowrap;
  flex-shrink: 0;
}
.plate-chip__num, .plate-big__num {
  white-space: nowrap;
}

/* Table cells: prevent cramped wrapping */
.tbl .text-mono,
.tbl td:first-child,
.tbl td:nth-child(2) {
  white-space: nowrap;
}
.tbl .contact-cell__name,
.tbl .contact-cell__sub {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tbl .contact-cell { min-width: 0; }
.tbl .contact-cell > div:last-child { min-width: 0; flex: 1; overflow: hidden; }

/* Type-label: keep on one line */
.type-label { white-space: nowrap; }

/* Vorgang detail meta: shrink icons and prevent wrap */
.vorgang-detail__meta > div {
  white-space: nowrap;
}
.vorgang-detail__meta > div svg {
  width: 14px;
  height: 14px;
  color: var(--zu-ink-4);
  flex-shrink: 0;
}

/* Party card phones: keep icons small */
.phone-row svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Topbar search: give it a minimum width so it doesn't get crushed */
.topbar__search {
  min-width: 260px;
}
.topbar__crumbs { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Palette plate row: let the chip breathe, no double-render */
.palette__item-icon--plate {
  width: auto;
  min-width: 74px;
  height: 30px;
  background: transparent;
  border-radius: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
}
.palette__item--plate .palette__item-label { font-weight: 400; font-size: 12.5px; }


/* ============ Command Hero (dashboard) ============ */
.cmd-hero {
  display: grid;
  grid-template-columns: minmax(380px, 1fr) 1px minmax(440px, 1.1fr);
  gap: 28px;
  background: var(--zu-surface);
  border: 1px solid var(--zu-line);
  border-radius: var(--r-16);
  padding: 22px 26px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.cmd-hero::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: var(--zu-accent);
}
.cmd-hero__label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--zu-ink-3);
  margin-bottom: 10px;
}
.cmd-hero__left { display: flex; flex-direction: column; min-width: 0; }
.cmd-hero__divider {
  background: linear-gradient(to bottom, transparent, var(--zu-line) 20%, var(--zu-line) 80%, transparent);
  width: 1px;
}
.cmd-hero__right { display: flex; flex-direction: column; min-width: 0; }
.cmd-hero__hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--zu-ink-3);
}
.cmd-hero__hint strong { color: var(--zu-ink-2); font-weight: 500; font-family: var(--font-mono); font-size: 11.5px; }

.cmd-hero__recents {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.cmd-hero__recents-label {
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--zu-ink-4);
  margin-right: 4px;
}
.recent-plate {
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: transform .12s;
}
.recent-plate:hover { transform: translateY(-1px); }
.recent-plate:hover .plate-chip { border-color: var(--zu-accent); }

/* ============ Quick actions ============ */
.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.quick-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--zu-line);
  background: var(--zu-surface);
  text-align: left;
  cursor: pointer;
  transition: background .12s, border-color .12s, transform .12s;
}
.quick-action:hover {
  border-color: var(--zu-ink-3);
  background: var(--zu-bg-2);
  transform: translateX(2px);
}
.quick-action__icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.quick-action__icon svg { width: 16px; height: 16px; }
.quick-action__icon--reg   { background: #dcfce7; color: #15803d; }
.quick-action__icon--dereg { background: #fef3c7; color: #b45309; }
.quick-action__icon--re    { background: var(--zu-accent-12); color: var(--zu-accent); }

.quick-action__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.quick-action__name {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 14px;
  color: var(--zu-ink);
}
.quick-action__meta {
  font-size: 11.5px;
  color: var(--zu-ink-3);
  font-family: var(--font-ui);
}
.quick-action__arrow {
  color: var(--zu-ink-4);
  display: grid; place-items: center;
  transition: transform .15s, color .15s;
}
.quick-action__arrow svg { width: 16px; height: 16px; }
.quick-action:hover .quick-action__arrow { transform: translateX(3px); color: var(--zu-accent); }

[data-theme="dark"] .quick-action__icon--reg   { background: rgba(34,197,94,0.18); color: #4ade80; }
[data-theme="dark"] .quick-action__icon--dereg { background: rgba(217,119,6,0.18); color: #fbbf24; }
[data-theme="dark"] .cmd-hero { background: var(--zu-surface); }

/* Constrain plate search inside cmd-hero */
.cmd-hero__left .plate-search { align-self: flex-start; }

/* ============================================================
   Modal (Tagesabschluss confirm / receive / add-process)
   ============================================================ */
.modal {
  position: fixed; inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.modal.is-open { display: flex; }
.modal__card {
  background: var(--zu-surface);
  border: 1px solid var(--zu-line);
  border-radius: var(--r-16);
  width: 560px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 64px);
  box-shadow: 0 30px 60px rgba(14,18,32,0.18), 0 1px 0 rgba(14,18,32,0.05);
  pointer-events: auto;
  display: flex; flex-direction: column;
  animation: modal-in .18s cubic-bezier(.2,.8,.2,1);
}
.modal__card--sm { width: 520px; }
@keyframes modal-in {
  from { transform: translateY(8px) scale(.98); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.modal__head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 20px 10px;
}
.modal__icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--zu-accent-12);
  color: var(--zu-accent);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.modal__icon svg { width: 18px; height: 18px; }
.modal__icon--success {
  background: rgba(21, 128, 61, 0.12);
  color: var(--zu-status-closed);
}
.modal__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
  color: var(--zu-ink);
  letter-spacing: -0.01em;
}
.modal__sub {
  font-size: 12.5px;
  color: var(--zu-ink-3);
  margin-top: 4px;
  line-height: 1.5;
}
.modal__sub strong { color: var(--zu-ink-2); font-weight: 500; }
.modal__head .btn--icon { align-self: flex-start; margin-left: auto; }
.modal__body { padding: 8px 20px 4px; overflow-y: auto; flex: 1; min-height: 0; }
.modal__foot {
  display: flex;
  gap: 8px;
  padding: 14px 20px 18px;
  justify-content: flex-end;
  border-top: 1px solid var(--zu-line-2);
  margin-top: 10px;
  align-items: center;
}

/* Closing preview (confirm modal) */
.closing-preview {
  background: var(--zu-bg-2);
  border-radius: var(--r-10);
  padding: 12px;
  margin-bottom: 12px;
}
.closing-preview__count {
  font-size: 12px;
  color: var(--zu-ink-3);
  margin-bottom: 10px;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.closing-preview__count strong { color: var(--zu-ink); font-weight: 600; font-size: 14px; }
.closing-preview__list {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 220px;
  overflow-y: auto;
}
.closing-preview__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 8px;
  background: var(--zu-surface);
  border-radius: 6px;
  border: 1px solid var(--zu-line-2);
}
.closing-preview__spacer { flex: 1; }

/* ID preview block */
.closing-id-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px dashed var(--zu-accent);
  background: var(--zu-accent-08);
  border-radius: var(--r-10);
}
.closing-id-preview__label {
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--zu-ink-3);
  margin-bottom: 2px;
}
.closing-id-preview__value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 500;
  color: var(--zu-accent);
  letter-spacing: 0.01em;
}
.closing-id-preview__note {
  font-size: 11px;
  color: var(--zu-ink-4);
  max-width: 140px;
  text-align: right;
  line-height: 1.4;
}

/* Add-Vorgang picker list */
.add-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 320px;
  overflow-y: auto;
}
.add-list__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--zu-line-2);
  border-radius: var(--r-8);
  background: var(--zu-surface);
  transition: border-color .12s;
}
.add-list__item:hover { border-color: var(--zu-ink-4); }
.add-list__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.add-list__plate { flex-shrink: 0; }
.add-list__btn { flex-shrink: 0; }

/* Receive-flow visual */
.receive-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 16px;
  background: var(--zu-bg-2);
  border-radius: var(--r-10);
  margin-bottom: 12px;
}
.receive-flow__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.receive-flow__count {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--zu-ink-3);
  line-height: 1;
}
.receive-flow__count--accent { color: var(--zu-status-closed); }
.receive-flow__arrow {
  font-size: 22px;
  color: var(--zu-ink-4);
  font-weight: 300;
}

/* Receive modal – "Hat alles geklappt?" redesign */
.receive-step { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.modal__icon--warning {
  background: rgba(220, 38, 38, 0.10);
  color: #b91c1c;
}
.receive-question {
  font-size: 15px;
  font-weight: 500;
  color: var(--zu-ink);
  margin: 0 0 12px;
  font-family: var(--font-display);
}
.receive-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.receive-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--r-10);
  border: 1.5px solid var(--zu-line);
  background: var(--zu-bg-2);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, background .15s;
  width: 100%;
}
.receive-option:hover { background: var(--zu-surface); border-color: var(--zu-ink-4); }
.receive-option__icon {
  width: 38px; height: 38px;
  border-radius: 9px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.receive-option--success .receive-option__icon { background: rgba(21,128,61,0.12); color: var(--zu-status-closed); }
.receive-option--success:hover { border-color: rgba(21,128,61,0.35); }
.receive-option--danger .receive-option__icon  { background: rgba(220,38,38,0.10); color: #b91c1c; }
.receive-option--danger:hover  { border-color: rgba(220,38,38,0.30); }
.receive-option__title { font-size: 13.5px; font-weight: 500; color: var(--zu-ink); }
.receive-option__sub   { font-size: 12px; color: var(--zu-ink-3); margin-top: 2px; line-height: 1.4; }
.receive-option__sub strong { color: var(--zu-ink-2); font-weight: 500; }

/* Checklist (Schritt 2) */
.receive-checklist {
  border: 1px solid var(--zu-line);
  border-radius: var(--r-10);
  overflow: hidden;
}
.receive-check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--zu-line-2);
  transition: background .1s;
}
.receive-check-row:last-child { border-bottom: none; }
.receive-check-row:hover { background: var(--zu-bg-2); }
.receive-check-row--rejected { background: rgba(220,38,38,0.05); }
.receive-check-row--rejected:hover { background: rgba(220,38,38,0.08); }
.receive-check-row__cb { flex-shrink: 0; width: 16px; height: 16px; cursor: pointer; accent-color: #dc2626; }
.receive-check-row__body { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.receive-check-row__name {
  font-size: 12px;
  color: var(--zu-ink-3);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.receive-check-row__badge { flex-shrink: 0; min-width: 90px; text-align: right; }
.receive-summary {
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--zu-bg-2);
  border-radius: var(--r-8);
  font-size: 12.5px;
  color: var(--zu-ink-3);
  text-align: center;
  line-height: 1.5;
}

/* ============================================================
   Status: Abholbereit (ready_for_pickup)
   ============================================================ */
.pill--ready {
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
  border: 1px solid rgba(217, 119, 6, 0.22);
}
.pill--ready .dot { background: #d97706; }
[data-theme="dark"] .pill--ready {
  background: rgba(251, 191, 36, 0.16);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.28);
}
.pill--rejected {
  background: rgba(220, 38, 38, 0.10);
  color: #b91c1c;
  border: 1px solid rgba(220, 38, 38, 0.20);
}
.pill--rejected .dot { background: #dc2626; }
[data-theme="dark"] .pill--rejected {
  background: rgba(220, 38, 38, 0.20);
  color: #fca5a5;
  border-color: rgba(220, 38, 38, 0.32);
}
.pill--deferred {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
  border: 1px solid rgba(100, 116, 139, 0.22);
}
.pill--deferred .dot { background: #64748b; }
[data-theme="dark"] .pill--deferred {
  background: rgba(148, 163, 184, 0.14);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.24);
}

/* ============================================================
   Tagesabschluss — Dashboard widget
   ============================================================ */
.tas-widget {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 20px;
  align-items: center;
  background: var(--zu-surface);
  border: 1px solid var(--zu-line);
  border-left: 3px solid var(--zu-status-closed);
  border-radius: var(--r-12);
  padding: 14px 18px;
  margin-bottom: 20px;
}
.tas-widget__left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.tas-widget__icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(21,128,61,0.12);
  color: var(--zu-status-closed);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.tas-widget__icon svg { width: 18px; height: 18px; }
.tas-widget__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  color: var(--zu-ink);
  letter-spacing: -0.01em;
}
.tas-widget__sub {
  font-size: 12.5px;
  color: var(--zu-ink-3);
  margin-top: 2px;
}
.tas-widget__sub strong { color: var(--zu-ink); font-weight: 500; }
.tas-widget__preview {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: nowrap;
}
.tas-widget__more {
  font-size: 11.5px;
  color: var(--zu-ink-3);
  padding: 0 6px;
}
.tas-widget__actions {
  display: flex;
  gap: 8px;
}

/* ============================================================
   Tagesabschluss — Today hero (list page)
   ============================================================ */
.tas-today {
  display: flex;
  background: var(--zu-surface);
  border: 1px solid var(--zu-line);
  border-radius: var(--r-16);
  overflow: hidden;
  margin-bottom: 24px;
}
.tas-today__stripe {
  width: 8px;
  background: linear-gradient(180deg, var(--zu-accent), var(--zu-status-closed));
  flex-shrink: 0;
}
.tas-today__body { padding: 22px 24px; flex: 1; }
.tas-today__label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--zu-ink-3);
  margin-bottom: 10px;
}
.tas-today__headline {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 14px;
}
.tas-today__num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 48px;
  line-height: 1;
  color: var(--zu-ink);
  letter-spacing: -0.02em;
}
.tas-today__text {
  font-size: 14.5px;
  color: var(--zu-ink-3);
  max-width: 420px;
}
.tas-today__chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ============================================================
   Tagesabschluss-ID pill (list)
   ============================================================ */
.tas-id {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 6px;
  background: var(--zu-ink);
  color: var(--zu-bg);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
[data-theme="dark"] .tas-id { background: var(--zu-surface); color: var(--zu-ink); border: 1px solid var(--zu-line); }

/* ============================================================
   Tagesabschluss — Detail hero
   ============================================================ */
.tas-detail-hero {
  background: var(--zu-surface);
  border: 1px solid var(--zu-line);
  border-radius: var(--r-16);
  padding: 18px 24px 22px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.tas-detail-hero::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--zu-accent);
}
.tas-detail-hero--received::before { background: var(--zu-status-closed); }
.tas-detail-hero__back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--zu-ink-3);
  background: transparent;
  border: 0;
  padding: 4px 0;
  cursor: pointer;
  font-family: var(--font-ui);
  text-decoration: none;
}
.tas-detail-hero__back svg { width: 14px; height: 14px; transform: rotate(180deg); }
.tas-detail-hero__back:hover { color: var(--zu-ink); }
.tas-detail-hero__row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-top: 8px;
}
.tas-detail-hero__main { flex: 1; }
.tas-detail-hero__label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--zu-ink-3);
  margin-bottom: 4px;
}
.tas-detail-hero__id {
  font-family: var(--font-mono);
  font-size: 44px;
  font-weight: 500;
  color: var(--zu-ink);
  letter-spacing: 0;
  line-height: 1;
  margin-bottom: 14px;
}
.tas-detail-hero__meta {
  display: flex;
  gap: 20px;
  font-size: 12.5px;
  color: var(--zu-ink-3);
  flex-wrap: wrap;
}
.tas-detail-hero__meta > div { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.tas-detail-hero__meta > div svg { width: 14px; height: 14px; color: var(--zu-ink-4); flex-shrink: 0; }
.tas-detail-hero__meta strong { color: var(--zu-ink); font-weight: 500; }
.tas-detail-hero__actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Received hint strip */
.tas-detail-hero__hint {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--zu-accent-08);
  border: 1px dashed var(--zu-accent);
  border-radius: var(--r-10);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  color: var(--zu-ink-2);
  line-height: 1.5;
}
.tas-detail-hero__hint strong { color: var(--zu-ink); font-weight: 500; display:block; margin-bottom:2px; }
.tas-detail-hero__hint em { font-style: normal; color: var(--zu-accent); font-weight: 500; }
.tas-detail-hero__hint-icon {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: var(--zu-accent);
  color: #fff;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.tas-detail-hero__hint-icon svg { width: 13px; height: 13px; }

/* ============================================================
   "Teil von Tagesabschluss" chip on Vorgang detail
   ============================================================ */
.tas-ref-chip {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--zu-bg-2);
  border: 1px solid var(--zu-line);
  font-size: 12px;
  color: var(--zu-ink-2);
  cursor: pointer;
  text-decoration: none;
  transition: border-color .12s, background .12s;
  margin-bottom: 8px;
}
.tas-ref-chip:hover {
  border-color: var(--zu-accent);
  background: var(--zu-accent-08);
  color: var(--zu-accent);
}
.tas-ref-chip strong { font-weight: 500; font-family: var(--font-mono); font-size: 11.5px; }
.tas-ref-chip svg { width: 13px !important; height: 13px !important; }

/* ============================================================
   Tagesabschluss state pills on detail hero
   ============================================================ */
.tas-state-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-left: 10px;
  vertical-align: middle;
}
.tas-state-pill .dot { width: 6px; height: 6px; border-radius: 50%; }
.tas-state-pill--submitted {
  background: rgba(30, 78, 216, 0.1);
  color: var(--zu-accent);
}
.tas-state-pill--submitted .dot { background: var(--zu-accent); }
.tas-state-pill--received {
  background: rgba(21, 128, 61, 0.12);
  color: var(--zu-status-closed);
}
.tas-state-pill--received .dot { background: var(--zu-status-closed); }

/* Hide table column on small screens in closings list */
.tas-list-hide-sm { }

/* Status pills — generic green / gray */
.pill--green      { background: #dcfce7; color: #15803d; }
.pill--green .dot { background: #15803d; }
.pill--gray       { background: var(--zu-bg-3); color: var(--zu-ink-3); }
.pill--gray .dot  { background: var(--zu-ink-4); }
[data-theme="dark"] .pill--green { background: rgba(21,128,61,.2); color: #4ade80; }
[data-theme="dark"] .pill--gray  { background: rgba(255,255,255,.07); }

/* Alert / flash messages */
.alert {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border-radius: var(--zu-radius);
  font-size: 13px; font-weight: 500;
  border: 1px solid transparent;
}
.alert--success {
  background: #dcfce7; color: #15803d; border-color: #bbf7d0;
}
.alert--error {
  background: #fee2e2; color: #dc2626; border-color: #fecaca;
}
[data-theme="dark"] .alert--success { background: rgba(21,128,61,.18); border-color: rgba(21,128,61,.3); color: #4ade80; }
[data-theme="dark"] .alert--error   { background: rgba(220,38,38,.18); border-color: rgba(220,38,38,.3); color: #f87171; }

/* Form page layout (admin/tenant-admin create/edit) */
.form-page { display: flex; justify-content: center; padding-top: 4px; }
.form-page__body { width: 100%; max-width: 680px; display: flex; flex-direction: column; gap: 12px; }
.form-page__foot {
  display: flex; justify-content: flex-end; align-items: center; gap: 10px;
  margin-top: 4px;
}

/* ==========================================================================
   RESPONSIVE — Mobile & Tablet
   ========================================================================== */

/* Mobile bottom tab bar + search icon: hidden on desktop */
.mobile-tabbar    { display: none; }
.topbar__search-mobile { display: none; }

/* ========================================================================
   TABLET: 768px – 1023px
   ======================================================================== */
@media (min-width: 768px) and (max-width: 1023px) {
  .app { grid-template-columns: 64px 1fr; }
  .app[data-sidebar="expanded"] { grid-template-columns: 232px 1fr; }

  .kpi-row { grid-template-columns: repeat(2, 1fr); }

  .cmd-hero { grid-template-columns: 1fr; gap: 16px; }
  .cmd-hero__divider { display: none; }

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

  .page { padding: 20px 24px 60px; }
  .page__title { font-size: 28px; }
}

/* ========================================================================
   MOBILE: < 768px
   ======================================================================== */
@media (max-width: 767px) {

  /* Body + app shell */
  body { overflow: auto; }

  .app,
  .app[data-sidebar="collapsed"],
  .app[data-sidebar="expanded"] {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100svh;
  }

  /* Sidebar: off-canvas overlay */
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    height: 100dvh;
    z-index: 55;
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.2,.8,.2,1);
    box-shadow: var(--sh-pop);
  }
  .app[data-sidebar="expanded"] .sidebar { transform: translateX(0); }

  /* Show scrim behind mobile sidebar */
  .app[data-sidebar="expanded"] ~ .scrim { opacity: 1; pointer-events: auto; }

  /* Main */
  .main { height: auto; min-height: 100svh; overflow: visible; }

  /* Sticky topbar on mobile */
  .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 0 12px;
    gap: 8px;
  }

  /* Hide desktop search bar; show icon instead */
  .topbar__search { display: none; }
  .topbar__search-mobile {
    display: flex;
    width: 36px; height: 36px;
    border-radius: var(--r-8);
    align-items: center; justify-content: center;
    color: var(--zu-ink-3);
    flex-shrink: 0;
    transition: background .1s, color .1s;
  }
  .topbar__search-mobile:hover { background: var(--zu-bg-2); color: var(--zu-ink); }

  /* Hide "Neuer Vorgang" accent button in topbar (use tab bar instead) */
  .topbar .btn--accent { display: none; }

  /* Show only current breadcrumb */
  .topbar__crumbs .crumb:not(.is-current),
  .topbar__crumbs .sep { display: none; }

  /* Page padding + body scrolling */
  .page {
    overflow: visible;
    height: auto;
    padding: 16px 16px 80px;
  }

  /* Page header */
  .page__header { flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
  .page__title { font-size: 26px; }

  /* Dashboard: cmd-hero */
  .cmd-hero { grid-template-columns: 1fr; padding: 16px 18px; gap: 16px; }
  .cmd-hero__divider { display: none; }

  /* Plate search: full width */
  .plate-search { width: 100%; }
  .plate-search__input { flex: 1; width: auto; min-width: 0; }

  /* KPI: 2×2 */
  .kpi-row { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 16px; }
  .kpi { padding: 12px 14px; gap: 6px; }
  .kpi__value { font-size: 24px; }
  .kpi__spark { display: none; }

  /* Dashboard grid */
  .grid-2 { grid-template-columns: 1fr; }

  /* Tables: horizontal scroll */
  .section { overflow-x: auto; }
  .tbl { min-width: 540px; }

  /* Process detail */
  .vorgang-detail__hero { grid-template-columns: 1fr; padding: 16px 18px; gap: 16px; }
  .detail-grid { grid-template-columns: 1fr; }

  /* Filter chips: horizontal scroll */
  .filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
    margin-bottom: 12px;
  }
  .filter-bar::-webkit-scrollbar { display: none; }
  .filter-bar .input { max-width: 100%; width: 100%; }

  /* Admin grid */
  .admin-grid { grid-template-columns: 1fr; }

  /* Forms */
  .form-page { padding: 0; }
  .form-page__body { max-width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: 1; }

  /* Login */
  .login-shell { grid-template-columns: 1fr; overflow-y: auto; height: auto; min-height: 100svh; }
  .login-right { display: none; }
  .login-left { padding: 28px 20px 40px; min-height: 100svh; border-right: none; justify-content: flex-start; gap: 32px; }

  /* Drawer: full-screen on mobile */
  .drawer { width: 100%; border-left: none; }
  .drawer__body { padding: 16px; }
  .drawer__head { padding: 14px 16px; }
  .drawer__foot { padding: 12px 16px; }

  /* Bulk action bar: above tab bar */
  .processes-bulk-bar { bottom: 72px !important; }

  /* Command palette: top sheet on mobile */
  .palette {
    top: 0; left: 0; right: 0;
    transform: none;
    width: 100%;
    max-width: 100%;
    border-radius: 0 0 var(--r-12) var(--r-12);
    max-height: 70svh;
  }

  /* --- Mobile bottom tab bar --- */
  .mobile-tabbar {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 60px;
    background: var(--zu-bg);
    border-top: 1px solid var(--zu-line);
    z-index: 45;
  }
  @supports (padding-bottom: env(safe-area-inset-bottom)) {
    .mobile-tabbar {
      height: calc(60px + env(safe-area-inset-bottom));
      padding-bottom: env(safe-area-inset-bottom);
    }
    .page { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  }

  .mobile-tabbar__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--zu-ink-4);
    font-size: 10px;
    font-weight: 500;
    font-family: var(--font-ui);
    text-decoration: none;
    padding: 4px 2px 2px;
    border: 0;
    background: none;
    cursor: pointer;
    transition: color .1s;
    position: relative;
  }
  .mobile-tabbar__item svg { width: 22px; height: 22px; }
  .mobile-tabbar__item > span { font-size: 10px; line-height: 1; }
  .mobile-tabbar__item.is-active { color: var(--zu-accent); }
  .mobile-tabbar__item.is-active::before {
    content: "";
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 28px; height: 2px;
    background: var(--zu-accent);
    border-radius: 0 0 2px 2px;
  }

  /* Center "New" FAB button */
  .mobile-tabbar__item--new { top: -8px; }
  .mobile-tabbar__item--new::before { display: none; }
  .mobile-tabbar__item--new .mobile-tab-new-btn {
    width: 44px; height: 44px;
    border-radius: 14px;
    background: var(--zu-accent);
    color: white;
    display: grid; place-items: center;
    box-shadow: 0 4px 16px rgba(30,78,216,0.35);
    transition: background .15s, transform .15s;
  }
  .mobile-tabbar__item--new:active .mobile-tab-new-btn { transform: scale(.95); }
  .mobile-tabbar__item--new .mobile-tab-new-btn svg { width: 22px; height: 22px; }
  .mobile-tabbar__item--new > span { color: var(--zu-accent); font-size: 9.5px; margin-top: 4px; }
  [data-theme="dark"] .mobile-tabbar__item--new .mobile-tab-new-btn {
    box-shadow: 0 4px 16px rgba(30,78,216,0.5);
  }
}

/* ============================================================
   Tagesabschluss — Tablet responsive (768px – 1023px)
   ============================================================ */
@media (max-width: 1023px) {
  .tas-detail-hero__id { font-size: 36px; }
  .tas-detail-hero__actions { flex-wrap: wrap; }
}

/* ============================================================
   Tagesabschluss — Mobile responsive (< 768px)
   ============================================================ */
@media (max-width: 767px) {
  /* Dashboard widget stacked */
  .tas-widget {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .tas-widget__preview { flex-wrap: wrap; }
  .tas-widget__actions { width: 100%; justify-content: flex-end; }

  /* Today hero */
  .tas-today__num { font-size: 36px; }
  .tas-today__headline { gap: 10px; }
  .tas-today__body { padding: 16px 18px; }

  /* Detail hero */
  .tas-detail-hero { padding: 14px 16px 18px; }
  .tas-detail-hero__row { flex-direction: column; gap: 14px; }
  .tas-detail-hero__id { font-size: 32px; margin-bottom: 10px; }
  .tas-detail-hero__meta { gap: 12px; }
  .tas-detail-hero__actions { width: 100%; flex-wrap: wrap; }
  .tas-detail-hero__actions .btn { flex: 1; justify-content: center; }

  /* Modal mobile */
  .modal__card {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 24px);
    border-radius: var(--r-12);
  }
  .modal__head { padding: 16px 16px 8px; }
  .modal__body { padding: 6px 16px 4px; }
  .modal__foot { padding: 12px 16px 16px; }

  /* Table: hide less important column */
  .tas-list-hide-sm { display: none; }
}

/* Very small phones (< 375px) */
@media (max-width: 374px) {
  .kpi-row { grid-template-columns: 1fr; }
  .page { padding: 12px 12px 80px; }
  .mobile-tabbar__item > span { display: none; }
  .mobile-tabbar__item--new > span { display: none; }
}
