/* ==========================================================================
   MoveFlow – Design System & App-Layout
   --------------------------------------------------------------------------
   Aufbau:
     1. Design Tokens (Farben, Typografie, Abstände, Schatten)
     2. Reset & Basis
     3. App-Layout (Sidebar, Topbar, Content)
     4. Komponenten (Buttons, Cards, Formulare, Tabellen, Badges, ...)
     5. Overlays (Modal, Drawer, Dropdown, Toast, Command Palette)
     6. Utilities
     7. Responsive
   Modul-spezifische Styles liegen in css/modules/*.css
   ========================================================================== */

/* 1. DESIGN TOKENS ======================================================== */
:root {
  /* Flächen */
  --c-bg: #f4f6f9;
  --c-surface: #ffffff;
  --c-surface-2: #f9fafb;
  --c-surface-3: #f2f4f7;
  --c-hover: #f5f7fa;

  /* Linien */
  --c-border: #e6e9ef;
  --c-border-2: #d8dde5;
  --c-border-3: #c5ccd6;

  /* Text */
  --c-text: #0d1728;
  --c-text-2: #475467;
  --c-text-3: #7d889b;
  --c-text-4: #a3acba;

  /* Navy (Sidebar, dunkle Flächen) */
  --c-navy-950: #070d19;
  --c-navy-900: #0a1222;
  --c-navy-800: #0f1a2e;
  --c-navy-700: #17233a;
  --c-navy-600: #223049;
  --c-navy-500: #34435f;
  --c-navy-text: #9aa6bb;

  /* Primär – Premium-Blau */
  --c-primary: #2f62f5;
  --c-primary-600: #2553dc;
  --c-primary-700: #1e44b6;
  --c-primary-50: #eef3ff;
  --c-primary-100: #dde7ff;
  --c-primary-200: #bccfff;

  /* Status (dezent) */
  --c-green: #12a150;   --c-green-text: #0b7a3b;  --c-green-bg: #e9f8ef;
  --c-amber: #e59a07;   --c-amber-text: #9a5b00;  --c-amber-bg: #fff5de;
  --c-red: #e0393e;     --c-red-text: #b42328;    --c-red-bg: #fdeded;
  --c-violet: #7357f6;  --c-violet-text: #5536d6; --c-violet-bg: #f1eeff;
  --c-cyan: #0a9cc2;    --c-cyan-text: #06789a;   --c-cyan-bg: #e5f6fb;
  --c-orange: #ea6a2a;  --c-orange-text: #b24a14; --c-orange-bg: #fff0e7;
  --c-gray: #8591a3;    --c-gray-text: #475467;   --c-gray-bg: #f1f3f6;
  --c-blue: #2f62f5;    --c-blue-text: #1f4ccc;   --c-blue-bg: #edf2ff;
  --c-teal: #0f9f8f;    --c-teal-text: #0b7a6e;   --c-teal-bg: #e6f7f5;

  /* Typografie */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --fs-xs: 11.5px;
  --fs-sm: 12.5px;
  --fs-base: 14px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: 20px;
  --fs-2xl: 24px;
  --fs-3xl: 30px;

  /* Radien */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-full: 999px;

  /* Schatten */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-md: 0 6px 16px -4px rgba(16, 24, 40, .08), 0 2px 4px -2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 16px 40px -12px rgba(16, 24, 40, .18), 0 4px 10px -4px rgba(16, 24, 40, .06);
  --shadow-xl: 0 28px 70px -16px rgba(10, 18, 34, .32), 0 8px 20px -8px rgba(10, 18, 34, .10);
  --ring: 0 0 0 4px rgba(47, 98, 245, .14);

  /* Layout */
  --sidebar-w: 256px;
  --sidebar-w-collapsed: 76px;
  --topbar-h: 64px;
  --page-pad: 32px;
  --page-max: 1520px;

  /* Bewegung */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --t-fast: 120ms;
  --t: 200ms;
  --t-slow: 320ms;
}

/* 2. RESET & BASIS ======================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01", "ss03";
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
svg { flex-shrink: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-700); }
h1, h2, h3, h4, h5, p { margin: 0; }
h1, h2, h3, h4 { letter-spacing: -0.018em; font-weight: 650; color: var(--c-text); }
ul, ol { margin: 0; padding: 0; list-style: none; }
hr { border: 0; border-top: 1px solid var(--c-border); margin: 16px 0; }
::selection { background: var(--c-primary-100); }
:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

/* Scrollbar (dezent) */
* { scrollbar-width: thin; scrollbar-color: var(--c-border-2) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--c-border-2); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background-color: var(--c-border-3); }

/* 3. APP-LAYOUT =========================================================== */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns var(--t-slow) var(--ease);
}
.app.is-collapsed { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); }

/* --- Sidebar --- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(47, 98, 245, .16), transparent 55%),
    linear-gradient(180deg, var(--c-navy-900) 0%, var(--c-navy-950) 100%);
  color: var(--c-navy-text);
  border-right: 1px solid rgba(255, 255, 255, .04);
  z-index: 40;
  overflow: hidden;
}
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--topbar-h);
  padding: 0 18px;
  flex-shrink: 0;
}
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #5b8cff 0%, #2f62f5 45%, #1b3fc2 100%);
  box-shadow: 0 6px 16px -6px rgba(47, 98, 245, .8), inset 0 1px 0 rgba(255, 255, 255, .25);
  color: #fff;
  flex-shrink: 0;
}
.brand-mark svg { width: 19px; height: 19px; }
.brand-text { min-width: 0; line-height: 1.15; }
.brand-name { color: #fff; font-weight: 700; font-size: 16px; letter-spacing: -0.02em; white-space: nowrap; }
.brand-sub { font-size: 11px; color: var(--c-navy-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar__toggle {
  margin-left: auto;
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid; place-items: center;
  color: var(--c-navy-text);
  transition: background var(--t-fast), color var(--t-fast), transform var(--t);
}
.sidebar__toggle:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar__toggle svg { width: 16px; height: 16px; }

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 12px 16px;
  scrollbar-color: var(--c-navy-600) transparent;
}
.sidebar__nav::-webkit-scrollbar-thumb { background-color: var(--c-navy-600); }
.nav-group { margin-top: 14px; }
.nav-group:first-child { margin-top: 4px; }
.nav-group__label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #5d6a82;
  padding: 0 12px 6px;
  white-space: nowrap;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 38px;
  padding: 0 12px;
  border-radius: 9px;
  color: #aeb8ca;
  font-weight: 500;
  font-size: 13.5px;
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast);
}
.nav-item:hover { background: rgba(255, 255, 255, .055); color: #fff; }
.nav-item.is-active {
  background: linear-gradient(90deg, rgba(47, 98, 245, .28), rgba(47, 98, 245, .10));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(99, 140, 255, .18);
}
.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -12px; top: 9px; bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #6f95ff;
}
.nav-item__icon { width: 18px; height: 18px; opacity: .9; }
.nav-item.is-active .nav-item__icon { color: #9db8ff; opacity: 1; }
.nav-item__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-item__badge {
  min-width: 20px; height: 20px;
  padding: 0 6px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, .08);
  color: #d3dae6;
  font-size: 11px;
  font-weight: 600;
  display: grid; place-items: center;
}
.nav-item__badge.is-alert { background: var(--c-primary); color: #fff; }

.sidebar__footer {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, .06);
  flex-shrink: 0;
}
.sidebar-promo {
  border-radius: 12px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(47, 98, 245, .22), rgba(115, 87, 246, .14));
  border: 1px solid rgba(111, 149, 255, .18);
  margin-bottom: 10px;
}
.sidebar-promo__title { color: #fff; font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.sidebar-promo__title svg { width: 15px; height: 15px; color: #9db8ff; }
.sidebar-promo__text { font-size: 12px; color: #aeb8ca; margin: 4px 0 10px; line-height: 1.45; }
.sidebar-promo .btn { width: 100%; }

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: 10px;
  width: 100%;
  text-align: left;
  transition: background var(--t-fast);
}
.sidebar-user:hover { background: rgba(255, 255, 255, .06); }
.sidebar-user__name { color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; }
.sidebar-user__role { font-size: 11.5px; color: var(--c-navy-text); white-space: nowrap; }
.sidebar-user__meta { min-width: 0; flex: 1; }
.sidebar-user svg.chev { width: 16px; height: 16px; color: var(--c-navy-text); }

/* Collapsed-Zustand */
.app.is-collapsed .brand-text,
.app.is-collapsed .nav-item__label,
.app.is-collapsed .nav-item__badge,
.app.is-collapsed .nav-group__label,
.app.is-collapsed .sidebar-promo,
.app.is-collapsed .sidebar-user__meta,
.app.is-collapsed .sidebar-user svg.chev { display: none; }
.app.is-collapsed .sidebar__brand { padding: 0; justify-content: center; flex-direction: column; gap: 6px; height: auto; padding-top: 14px; padding-bottom: 8px; }
.app.is-collapsed .sidebar__toggle { margin: 0; transform: rotate(180deg); }
.app.is-collapsed .nav-item { justify-content: center; padding: 0; }
.app.is-collapsed .nav-group { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .05); }
.app.is-collapsed .nav-group:first-child { border-top: 0; padding-top: 0; }
.app.is-collapsed .nav-item.is-active::before { left: -12px; }
.app.is-collapsed .sidebar-user { justify-content: center; }
.app.is-collapsed .nav-item[data-count]::after {
  content: "";
  position: absolute; top: 8px; right: 12px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--c-primary);
  box-shadow: 0 0 0 2px var(--c-navy-900);
}

/* --- Main & Topbar --- */
.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 var(--page-pad);
  background: rgba(244, 246, 249, .82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t), background var(--t);
}
.topbar.is-scrolled { border-bottom-color: var(--c-border); background: rgba(255, 255, 255, .86); }
.topbar__menu { display: none; }
.topbar__search {
  display: flex; align-items: center; gap: 10px;
  height: 40px;
  width: min(440px, 100%);
  padding: 0 8px 0 12px;
  border-radius: var(--r-md);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  color: var(--c-text-3);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  text-align: left;
}
.topbar__search:hover { border-color: var(--c-border-2); }
.topbar__search svg { width: 17px; height: 17px; }
.topbar__search > span:not(.kbd) { flex: 1; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__spacer { flex: 1; }
.topbar__actions { display: flex; align-items: center; gap: 8px; }
.topbar__company {
  display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 12px;
  border-radius: var(--r-md);
  font-weight: 600; font-size: 13px;
  color: var(--c-text-2);
  border: 1px solid transparent;
}
.topbar__company:hover { background: var(--c-surface); border-color: var(--c-border); }
.topbar__company .company-logo {
  width: 24px; height: 24px; border-radius: 7px;
  display: grid; place-items: center;
  background: var(--c-navy-800); color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: .02em;
}
.topbar__divider { width: 1px; height: 24px; background: var(--c-border); margin: 0 4px; }
.topbar__profile { display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: var(--r-full); }
.topbar__profile:hover { background: var(--c-surface); }

.content { flex: 1; min-width: 0; }
.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 24px var(--page-pad) 64px;
  animation: pageIn var(--t-slow) var(--ease-out);
}
.page--wide { max-width: none; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Page Header */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-header__eyebrow { font-size: 12.5px; color: var(--c-text-3); font-weight: 500; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.page-header__eyebrow svg, .hero__eyebrow svg { width: 14px; height: 14px; flex-shrink: 0; }
.page-header__main { min-width: 0; }
.page-header__title { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.028em; line-height: 1.2; }
.page-header__subtitle { color: var(--c-text-2); margin-top: 4px; font-size: 14px; }
.page-header__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--c-text-3); margin-bottom: 14px; flex-wrap: wrap; }
.breadcrumb a { color: var(--c-text-3); font-weight: 500; }
.breadcrumb a:hover { color: var(--c-text); }
.breadcrumb svg { width: 14px; height: 14px; }
.breadcrumb .is-current { color: var(--c-text); font-weight: 500; }

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 32px 0 14px; }
.section-title h2 { font-size: var(--fs-lg); font-weight: 650; display: flex; align-items: center; gap: 10px; }
.section-title__meta { color: var(--c-text-3); font-size: 13px; font-weight: 500; }
.section-title:first-child { margin-top: 0; }

/* Mobile Bottom Navigation */
.bottom-nav { display: none; }
.sidebar-backdrop { display: none; }

/* 4. KOMPONENTEN ========================================================== */

/* --- Buttons --- */
.btn {
  --btn-h: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--btn-h);
  padding: 0 14px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 550;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  user-select: none;
  text-decoration: none;
}
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn--primary {
  background: var(--c-primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .12), inset 0 1px 0 rgba(255, 255, 255, .14), 0 0 0 1px var(--c-primary-600);
}
.btn--primary:hover { background: var(--c-primary-600); color: #fff; }
.btn--primary:focus-visible { box-shadow: var(--ring); outline: none; }
.btn--dark { background: var(--c-navy-800); color: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .2), inset 0 1px 0 rgba(255, 255, 255, .08); }
.btn--dark:hover { background: var(--c-navy-700); color: #fff; }
.btn--secondary {
  background: var(--c-surface);
  color: var(--c-text);
  border-color: var(--c-border-2);
  box-shadow: var(--shadow-xs);
}
.btn--secondary:hover { background: var(--c-surface-2); border-color: var(--c-border-3); color: var(--c-text); }
.btn--ghost { color: var(--c-text-2); }
.btn--ghost:hover { background: var(--c-surface-3); color: var(--c-text); }
.btn--soft { background: var(--c-primary-50); color: var(--c-primary-700); }
.btn--soft:hover { background: var(--c-primary-100); color: var(--c-primary-700); }
.btn--danger { background: var(--c-red); color: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .1); }
.btn--danger:hover { background: #c92e33; color: #fff; }
.btn--danger-ghost { color: var(--c-red-text); }
.btn--danger-ghost:hover { background: var(--c-red-bg); }
.btn--success { background: var(--c-green); color: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .1); }
.btn--success:hover { background: #0e8c45; color: #fff; }
.btn--whatsapp { background: #1fae5b; color: #fff; }
.btn--whatsapp:hover { background: #179a4f; color: #fff; }
.btn--sm { --btn-h: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 7px; gap: 6px; }
.btn--sm svg { width: 14px; height: 14px; }
.btn--xs { --btn-h: 26px; padding: 0 8px; font-size: 12px; border-radius: 6px; gap: 5px; }
.btn--xs svg { width: 13px; height: 13px; }
.btn--lg { --btn-h: 46px; padding: 0 20px; font-size: 14.5px; border-radius: var(--r-md); }
.btn--block { width: 100%; }
.btn--icon { width: var(--btn-h); padding: 0; }
.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.icon-btn {
  position: relative;
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  display: inline-grid; place-items: center;
  color: var(--c-text-2);
  border: 1px solid transparent;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.icon-btn:hover { background: var(--c-surface); color: var(--c-text); border-color: var(--c-border); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn--sm { width: 32px; height: 32px; border-radius: 8px; }
.icon-btn--sm svg { width: 16px; height: 16px; }
.icon-btn__dot {
  position: absolute; top: 7px; right: 7px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: var(--r-full);
  background: var(--c-red);
  color: #fff;
  font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--c-bg);
}

/* --- Cards --- */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  min-width: 0;
}
.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 0;
}
.card__header--bordered { padding-bottom: 16px; border-bottom: 1px solid var(--c-border); }
.card__title { font-size: 15px; font-weight: 650; letter-spacing: -0.012em; display: flex; align-items: center; gap: 8px; }
.card__title svg { width: 17px; height: 17px; color: var(--c-text-3); }
.card__subtitle { font-size: 12.5px; color: var(--c-text-3); margin-top: 2px; }
.card__actions { display: flex; align-items: center; gap: 6px; }
.card__body { padding: 18px 20px 20px; }
.card__body--flush { padding: 0; }
.card__footer { padding: 12px 20px; border-top: 1px solid var(--c-border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card--hover { transition: box-shadow var(--t), border-color var(--t), transform var(--t); }
.card--hover:hover { box-shadow: var(--shadow-md); border-color: var(--c-border-2); }
.card--clickable { cursor: pointer; }
.card--pad { padding: 20px; }
.card--dark {
  background: linear-gradient(145deg, var(--c-navy-800), var(--c-navy-950));
  border-color: var(--c-navy-700);
  color: #fff;
}
.card--dark .card__title { color: #fff; }
.card--dark .card__subtitle { color: var(--c-navy-text); }
.card-link { font-size: 13px; font-weight: 550; color: var(--c-primary); display: inline-flex; align-items: center; gap: 4px; }
.card-link svg { width: 14px; height: 14px; transition: transform var(--t-fast); }
.card-link:hover svg { transform: translateX(2px); }

/* --- KPI Cards --- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi {
  position: relative;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: box-shadow var(--t), border-color var(--t), transform var(--t);
  min-width: 0;
}
a.kpi, button.kpi { display: block; width: 100%; text-align: left; color: inherit; }
a.kpi:hover, button.kpi:hover { box-shadow: var(--shadow-md); border-color: var(--c-border-2); }
.kpi__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi__label { font-size: 13px; font-weight: 550; color: var(--c-text-2); }
.kpi__icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--c-primary-50);
  color: var(--c-primary);
}
.kpi__icon svg { width: 17px; height: 17px; }
.kpi__icon--green { background: var(--c-green-bg); color: var(--c-green); }
.kpi__icon--amber { background: var(--c-amber-bg); color: var(--c-amber-text); }
.kpi__icon--red { background: var(--c-red-bg); color: var(--c-red); }
.kpi__icon--violet { background: var(--c-violet-bg); color: var(--c-violet); }
.kpi__icon--navy { background: var(--c-navy-800); color: #fff; }
.kpi__value { font-size: 30px; font-weight: 700; letter-spacing: -0.035em; margin-top: 12px; line-height: 1.1; white-space: nowrap; }
.kpi__value small { font-size: 16px; font-weight: 600; color: var(--c-text-3); letter-spacing: -0.01em; margin-left: 2px; }
.kpi__meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12.5px; color: var(--c-text-3); flex-wrap: wrap; }
.kpi__spark { position: absolute; right: 16px; bottom: 16px; width: 96px; height: 34px; opacity: .95; }

.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-size: 12px; padding: 2px 6px; border-radius: 6px; }
.delta svg { width: 12px; height: 12px; }
.delta--up { color: var(--c-green-text); background: var(--c-green-bg); }
.delta--down { color: var(--c-red-text); background: var(--c-red-bg); }
.delta--flat { color: var(--c-gray-text); background: var(--c-gray-bg); }

/* --- Badges --- */
.badge {
  --b-c: var(--c-gray);
  --b-t: var(--c-gray-text);
  --b-bg: var(--c-gray-bg);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
  color: var(--b-t);
  background: var(--b-bg);
  line-height: 1;
}
.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--b-c);
  flex-shrink: 0;
}
.badge--nodot::before { display: none; }
.badge--sm { height: 20px; padding: 0 7px; font-size: 11px; gap: 5px; }
.badge--lg { height: 30px; padding: 0 12px; font-size: 13px; }
.badge--outline { background: var(--c-surface); box-shadow: inset 0 0 0 1px var(--c-border-2); color: var(--c-text-2); }
.badge--pulse::before { animation: pulse 1.8s infinite; }
.badge--gray   { --b-c: var(--c-gray);   --b-t: var(--c-gray-text);   --b-bg: var(--c-gray-bg); }
.badge--blue   { --b-c: var(--c-blue);   --b-t: var(--c-blue-text);   --b-bg: var(--c-blue-bg); }
.badge--green  { --b-c: var(--c-green);  --b-t: var(--c-green-text);  --b-bg: var(--c-green-bg); }
.badge--amber  { --b-c: var(--c-amber);  --b-t: var(--c-amber-text);  --b-bg: var(--c-amber-bg); }
.badge--red    { --b-c: var(--c-red);    --b-t: var(--c-red-text);    --b-bg: var(--c-red-bg); }
.badge--violet { --b-c: var(--c-violet); --b-t: var(--c-violet-text); --b-bg: var(--c-violet-bg); }
.badge--cyan   { --b-c: var(--c-cyan);   --b-t: var(--c-cyan-text);   --b-bg: var(--c-cyan-bg); }
.badge--orange { --b-c: var(--c-orange); --b-t: var(--c-orange-text); --b-bg: var(--c-orange-bg); }
.badge--teal   { --b-c: var(--c-teal);   --b-t: var(--c-teal-text);   --b-bg: var(--c-teal-bg); }
.badge--navy   { --b-c: #fff; --b-t: #fff; --b-bg: var(--c-navy-800); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--b-c) 55%, transparent); }
  70% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* Tag (neutral) */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px;
  border-radius: 6px;
  background: var(--c-surface-3);
  color: var(--c-text-2);
  font-size: 11.5px; font-weight: 550;
  white-space: nowrap;
}
.tag svg { width: 12px; height: 12px; }
.tag--primary { background: var(--c-primary-50); color: var(--c-primary-700); }

/* Farbpunkt */
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-gray); display: inline-block; flex-shrink: 0; }
.dot--blue { background: var(--c-blue); } .dot--green { background: var(--c-green); } .dot--amber { background: var(--c-amber); }
.dot--red { background: var(--c-red); } .dot--violet { background: var(--c-violet); } .dot--cyan { background: var(--c-cyan); }
.dot--orange { background: var(--c-orange); } .dot--teal { background: var(--c-teal); } .dot--gray { background: var(--c-gray); }

/* --- Avatare --- */
.avatar {
  --av: 32px;
  width: var(--av); height: var(--av);
  border-radius: 50%;
  display: inline-grid; place-items: center;
  font-size: calc(var(--av) * .38);
  font-weight: 650;
  color: #fff;
  background: linear-gradient(135deg, #6b8cff, #3a5bd9);
  flex-shrink: 0;
  letter-spacing: .01em;
  user-select: none;
  position: relative;
}
.avatar--xs { --av: 22px; }
.avatar--sm { --av: 28px; }
.avatar--md { --av: 36px; }
.avatar--lg { --av: 48px; }
.avatar--xl { --av: 64px; }
.avatar--2xl { --av: 84px; }
.avatar--square { border-radius: 28%; }
.avatar__status {
  position: absolute; right: -1px; bottom: -1px;
  width: 30%; height: 30%; min-width: 9px; min-height: 9px;
  border-radius: 50%;
  border: 2px solid var(--c-surface);
  background: var(--c-green);
}
.avatar-stack { display: inline-flex; align-items: center; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--c-surface); }
.avatar-stack .avatar + .avatar { margin-left: -8px; }
.avatar-stack__more {
  --av: 28px;
  margin-left: -8px;
  width: var(--av); height: var(--av);
  border-radius: 50%;
  background: var(--c-surface-3);
  color: var(--c-text-2);
  font-size: 11px; font-weight: 600;
  display: inline-grid; place-items: center;
  box-shadow: 0 0 0 2px var(--c-surface);
}

/* Person-Zeile */
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person__meta { min-width: 0; display: block; }
.person__name { display: block; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--c-text); }
.person__sub { display: block; font-size: 12px; color: var(--c-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- Formulare --- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 16px; }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid .field--full, .form-grid .span-full { grid-column: 1 / -1; }
.form-grid .span-2 { grid-column: span 2; }
.form-section + .form-section { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--c-border); }
.form-section__title { font-size: 13.5px; font-weight: 650; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.form-section__title svg { width: 16px; height: 16px; color: var(--c-text-3); }
.form-section__desc { font-size: 12.5px; color: var(--c-text-3); margin-bottom: 14px; }
.form-section__title + .form-grid, .form-section__title + .check-grid { margin-top: 12px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-size: 12.5px; font-weight: 600; color: var(--c-text-2); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field__label .req { color: var(--c-red); margin-left: 2px; }
.field__hint { font-size: 12px; color: var(--c-text-3); }
.field__error { font-size: 12px; color: var(--c-red-text); }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--c-red); box-shadow: 0 0 0 3px rgba(224, 57, 62, .12); }

.input, .select, .textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--c-border-2);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 14px;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--c-text-4); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--c-border-3); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--c-primary); box-shadow: var(--ring); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--c-surface-3); color: var(--c-text-3); }
.input[readonly] { background: var(--c-surface-2); }
.input--sm, .select--sm { height: 34px; font-size: 13px; padding: 0 10px; }
.textarea { height: auto; min-height: 92px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.select {
  padding-right: 34px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237d889b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.select[multiple] { height: auto; min-height: 120px; padding: 6px; background-image: none; }
input[type="date"].input, input[type="time"].input { padding-right: 8px; }
input[type="number"].input { font-variant-numeric: tabular-nums; }

.input-group { position: relative; display: flex; align-items: center; }
.input-group > svg, .input-group .input-group__icon {
  position: absolute; left: 12px;
  width: 16px; height: 16px;
  color: var(--c-text-3);
  pointer-events: none;
}
.input-group > .input { padding-left: 38px; }
.input-group__suffix {
  position: absolute; right: 12px;
  font-size: 13px; color: var(--c-text-3);
  pointer-events: none;
}
.input-group--suffix > .input { padding-right: 44px; }

/* Checkbox & Radio */
.checkbox { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; color: var(--c-text); user-select: none; }
.checkbox input {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px;
  margin: 0;
  border-radius: 5px;
  border: 1.5px solid var(--c-border-3);
  background: var(--c-surface);
  display: grid; place-items: center;
  transition: background var(--t-fast), border-color var(--t-fast);
  cursor: pointer;
  flex-shrink: 0;
}
.checkbox input[type="radio"] { border-radius: 50%; }
.checkbox input:checked { background: var(--c-primary); border-color: var(--c-primary); }
.checkbox input:checked::after {
  content: "";
  width: 10px; height: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
}
.checkbox input[type="radio"]:checked::after { background: #fff; border-radius: 50%; width: 6px; height: 6px; }
.checkbox input:focus-visible { box-shadow: var(--ring); outline: none; }

/* Switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 13.5px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  width: 36px; height: 20px;
  border-radius: var(--r-full);
  background: var(--c-border-2);
  position: relative;
  transition: background var(--t);
  flex-shrink: 0;
}
.switch__track::after {
  content: "";
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .2);
  transition: transform var(--t) var(--ease);
}
.switch input:checked + .switch__track { background: var(--c-primary); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { box-shadow: var(--ring); }

/* Auswahl-Kacheln (Checkbox-Grid) */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.check-tile {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--c-border-2);
  background: var(--c-surface);
  cursor: pointer;
  font-size: 13px; font-weight: 500;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
  user-select: none;
  min-width: 0;
}
.check-tile:hover { border-color: var(--c-border-3); }
.check-tile input { position: absolute; opacity: 0; pointer-events: none; }
.check-tile__box {
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--c-border-3);
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: all var(--t-fast);
}
.check-tile__box svg { width: 12px; height: 12px; color: #fff; opacity: 0; stroke-width: 3.2; }
.check-tile__label { flex: 1; min-width: 0; }
.check-tile__price { font-size: 12px; color: var(--c-text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.check-tile:has(input:checked) { border-color: var(--c-primary); background: var(--c-primary-50); box-shadow: 0 0 0 1px var(--c-primary) inset; }
.check-tile:has(input:checked) .check-tile__box { background: var(--c-primary); border-color: var(--c-primary); }
.check-tile:has(input:checked) .check-tile__box svg { opacity: 1; }
.check-tile:has(input:focus-visible) { box-shadow: var(--ring); }

/* Radio-Karten (z. B. Festpreis / Stundenpreis) */
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.radio-card {
  position: relative;
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--c-border-2);
  background: var(--c-surface);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-card__title { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.radio-card__title svg { width: 16px; height: 16px; color: var(--c-text-3); }
.radio-card__desc { font-size: 12px; color: var(--c-text-3); }
.radio-card:has(input:checked) { border-color: var(--c-primary); background: var(--c-primary-50); box-shadow: 0 0 0 1px var(--c-primary) inset; }
.radio-card:has(input:checked) .radio-card__title svg { color: var(--c-primary); }

/* --- Segmented Control --- */
.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: var(--r-md);
  background: var(--c-surface-3);
  border: 1px solid var(--c-border);
}
.segmented__btn {
  height: 30px;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 13px; font-weight: 550;
  color: var(--c-text-2);
  display: inline-flex; align-items: center; gap: 6px;
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
  white-space: nowrap;
}
.segmented__btn svg { width: 15px; height: 15px; }
.segmented__btn:hover { color: var(--c-text); }
.segmented__btn.is-active { background: var(--c-surface); color: var(--c-text); box-shadow: var(--shadow-sm); }

/* --- Tabs --- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--c-border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  height: 42px;
  padding: 0 12px;
  font-size: 13.5px; font-weight: 550;
  color: var(--c-text-3);
  white-space: nowrap;
  transition: color var(--t-fast);
}
.tab svg { width: 16px; height: 16px; }
.tab:hover { color: var(--c-text); }
.tab.is-active { color: var(--c-text); }
.tab.is-active::after {
  content: "";
  position: absolute; left: 8px; right: 8px; bottom: -1px;
  height: 2px; border-radius: 2px 2px 0 0;
  background: var(--c-primary);
}
.tab__count {
  min-width: 20px; height: 18px; padding: 0 6px;
  border-radius: var(--r-full);
  background: var(--c-surface-3);
  color: var(--c-text-2);
  font-size: 11px; font-weight: 600;
  display: inline-grid; place-items: center;
}
.tab.is-active .tab__count { background: var(--c-primary-50); color: var(--c-primary-700); }
.tab-panel { padding-top: 20px; animation: fadeIn var(--t) var(--ease-out); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- Chips (Filter) --- */
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border-radius: var(--r-full);
  border: 1px solid var(--c-border-2);
  background: var(--c-surface);
  font-size: 12.5px; font-weight: 550;
  color: var(--c-text-2);
  white-space: nowrap;
  transition: all var(--t-fast);
}
.chip:hover { border-color: var(--c-border-3); color: var(--c-text); }
.chip.is-active { background: var(--c-navy-800); border-color: var(--c-navy-800); color: #fff; }
.chip__count { font-size: 11px; font-weight: 600; color: var(--c-text-3); }
.chip.is-active .chip__count { color: rgba(255, 255, 255, .7); }
.chip .dot { width: 7px; height: 7px; }

/* --- Toolbar (Suche + Filter über Tabellen) --- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar__search { position: relative; flex: 1 1 260px; max-width: 360px; }
.toolbar__search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--c-text-3); pointer-events: none; }
.toolbar__search .input { padding-left: 38px; height: 38px; }
.toolbar__spacer { flex: 1; }
.toolbar .select { width: auto; height: 38px; min-width: 150px; }

/* --- Tabellen --- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--c-text-3);
  padding: 10px 16px;
  background: var(--c-surface-2);
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
  position: sticky; top: 0;
  z-index: 1;
}
.table th:first-child { padding-left: 20px; }
.table th:last-child { padding-right: 20px; }
.table th.is-sortable { cursor: pointer; user-select: none; }
.table th.is-sortable:hover { color: var(--c-text); }
.table th .sort-icon { display: inline-block; width: 12px; height: 12px; vertical-align: -2px; margin-left: 4px; opacity: .6; }
.table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--c-border);
  vertical-align: middle;
  color: var(--c-text);
}
.table td:first-child { padding-left: 20px; }
.table td:last-child { padding-right: 20px; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.is-clickable { cursor: pointer; }
.table tbody tr.is-clickable:hover, .table tbody tr:hover { background: var(--c-hover); }
.table .num, .table .text-right { text-align: right; font-variant-numeric: tabular-nums; }
.table .cell-main { font-weight: 600; color: var(--c-text); white-space: nowrap; }
.table .cell-sub { font-size: 12px; color: var(--c-text-3); margin-top: 1px; white-space: nowrap; }
.table .cell-actions { text-align: right; white-space: nowrap; width: 1%; }
.table .cell-muted { color: var(--c-text-3); }
.table--compact td { padding-top: 9px; padding-bottom: 9px; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--c-border); font-size: 12.5px; color: var(--c-text-3); }

/* Route-Darstellung */
.route { display: inline-flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; }
.route svg { width: 14px; height: 14px; color: var(--c-text-4); }
.route__from, .route__to { overflow: hidden; text-overflow: ellipsis; }

/* --- Listen --- */
.list { display: flex; flex-direction: column; }
.list__item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--c-border);
  transition: background var(--t-fast);
  min-width: 0;
}
.list__item:last-child { border-bottom: 0; }
.list__item.is-clickable { cursor: pointer; }
.list__item.is-clickable:hover { background: var(--c-hover); }
.list__icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--c-surface-3);
  color: var(--c-text-2);
  flex-shrink: 0;
}
.list__icon svg { width: 17px; height: 17px; }
.list__body { flex: 1; min-width: 0; display: block; }
.list__title { display: block; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--c-text); }
.list__sub { display: block; font-size: 12.5px; color: var(--c-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list__meta { text-align: right; flex-shrink: 0; font-size: 12.5px; color: var(--c-text-3); }
.list__item > .badge { flex-shrink: 0; }

/* Icon-Hintergründe (für list__icon, kpi__icon, etc.) */
.tone-blue { background: var(--c-blue-bg) !important; color: var(--c-blue) !important; }
.tone-green { background: var(--c-green-bg) !important; color: var(--c-green) !important; }
.tone-amber { background: var(--c-amber-bg) !important; color: var(--c-amber-text) !important; }
.tone-red { background: var(--c-red-bg) !important; color: var(--c-red) !important; }
.tone-violet { background: var(--c-violet-bg) !important; color: var(--c-violet) !important; }
.tone-cyan { background: var(--c-cyan-bg) !important; color: var(--c-cyan) !important; }
.tone-orange { background: var(--c-orange-bg) !important; color: var(--c-orange) !important; }
.tone-teal { background: var(--c-teal-bg) !important; color: var(--c-teal) !important; }
.tone-gray { background: var(--c-gray-bg) !important; color: var(--c-gray-text) !important; }
.tone-navy { background: var(--c-navy-800) !important; color: #fff !important; }

/* --- Key/Value --- */
.kv { display: flex; flex-direction: column; }
.kv__row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px dashed var(--c-border); font-size: 13.5px; }
.kv__row:last-child { border-bottom: 0; }
.kv__key { color: var(--c-text-3); display: flex; align-items: center; gap: 8px; }
.kv__key svg { width: 15px; height: 15px; }
.kv__val { font-weight: 550; text-align: right; color: var(--c-text); min-width: 0; }
.kv__row--total { border-top: 1px solid var(--c-border-2); border-bottom: 0; margin-top: 4px; padding-top: 12px; font-size: 15px; }
.kv__row--total .kv__key { color: var(--c-text); font-weight: 600; }
.kv__row--total .kv__val { font-weight: 700; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px 24px; }
.info-item__label { font-size: 12px; color: var(--c-text-3); font-weight: 500; margin-bottom: 3px; display: flex; align-items: center; gap: 6px; }
.info-item__label svg { width: 14px; height: 14px; }
.info-item__value { font-size: 14px; font-weight: 550; color: var(--c-text); word-break: break-word; }

/* --- Timeline --- */
.timeline { position: relative; display: flex; flex-direction: column; }
.timeline__item { position: relative; display: flex; gap: 14px; padding-bottom: 20px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: "";
  position: absolute; left: 15px; top: 34px; bottom: 2px;
  width: 1.5px;
  background: var(--c-border);
}
.timeline__item:last-child::before { display: none; }
.timeline__icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--c-surface-3);
  color: var(--c-text-2);
  flex-shrink: 0;
  box-shadow: 0 0 0 4px var(--c-surface);
  position: relative; z-index: 1;
}
.timeline__icon svg { width: 15px; height: 15px; }
.timeline__content { flex: 1; min-width: 0; padding-top: 5px; }
.timeline__title { font-size: 13.5px; font-weight: 550; color: var(--c-text); }
.timeline__text { font-size: 13px; color: var(--c-text-2); margin-top: 2px; }
.timeline__meta { font-size: 12px; color: var(--c-text-3); margin-top: 2px; }
.timeline__date-group { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--c-text-3); margin: 4px 0 12px; }

/* --- Hero (Entity-Header für Detailseiten) --- */
.hero {
  position: relative;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.hero__band {
  height: 84px;
  background:
    radial-gradient(90% 140% at 100% 0%, rgba(111, 149, 255, .45), transparent 60%),
    radial-gradient(60% 120% at 0% 100%, rgba(115, 87, 246, .35), transparent 60%),
    linear-gradient(120deg, var(--c-navy-900), var(--c-navy-700));
}
.hero__body { padding: 20px 24px 22px; }
.hero__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hero__identity { display: flex; align-items: center; gap: 16px; min-width: 0; }
.hero__band + .hero__body .hero__identity .avatar { margin-top: -52px; box-shadow: 0 0 0 4px var(--c-surface), var(--shadow-md); }
.hero__eyebrow { font-size: 12px; color: var(--c-text-3); font-weight: 600; letter-spacing: .02em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hero__title { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; margin-top: 2px; }
.hero__subtitle { color: var(--c-text-2); margin-top: 4px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.hero__subtitle > span { display: inline-flex; align-items: center; gap: 6px; }
.hero__subtitle svg { width: 15px; height: 15px; color: var(--c-text-3); }
.hero__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hero__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0;
  margin-top: 20px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.hero-stat { padding: 12px 16px; border-right: 1px solid var(--c-border); min-width: 0; }
.hero-stat:last-child { border-right: 0; }
.hero-stat__label { font-size: 11.5px; color: var(--c-text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.hero-stat__value { font-size: 16px; font-weight: 650; margin-top: 3px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- Layout-Helfer für Detailseiten --- */
.layout-main-side { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.layout-side-main { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
.sticky-side { position: sticky; top: calc(var(--topbar-h) + 16px); }

/* --- Progress --- */
.progress { height: 6px; border-radius: var(--r-full); background: var(--c-surface-3); overflow: hidden; }
.progress__bar { height: 100%; border-radius: inherit; background: var(--c-primary); transition: width var(--t-slow) var(--ease); }
.progress--green .progress__bar { background: var(--c-green); }
.progress--amber .progress__bar { background: var(--c-amber); }
.progress--red .progress__bar { background: var(--c-red); }

/* --- Empty State --- */
.empty { text-align: center; padding: 48px 24px; display: flex; flex-direction: column; align-items: center; }
.empty__icon {
  width: 52px; height: 52px;
  border-radius: 16px;
  display: grid; place-items: center;
  background: var(--c-surface-3);
  color: var(--c-text-3);
  margin-bottom: 14px;
  box-shadow: inset 0 0 0 1px var(--c-border);
}
.empty__icon svg { width: 24px; height: 24px; }
.empty__title { font-weight: 650; font-size: 15px; }
.empty__text { color: var(--c-text-3); font-size: 13.5px; margin-top: 4px; max-width: 360px; }
.empty .btn { margin-top: 16px; }
.empty--sm { padding: 28px 16px; }
.empty--sm .empty__icon { width: 40px; height: 40px; border-radius: 12px; margin-bottom: 10px; }
.empty--sm .empty__icon svg { width: 19px; height: 19px; }

/* --- Alerts / Callouts --- */
.callout {
  display: flex; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--c-blue-bg);
  color: var(--c-blue-text);
  font-size: 13.5px;
  border: 1px solid color-mix(in srgb, var(--c-blue) 18%, transparent);
}
.callout svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.callout__title { font-weight: 650; }
.callout--amber { background: var(--c-amber-bg); color: var(--c-amber-text); border-color: color-mix(in srgb, var(--c-amber) 25%, transparent); }
.callout--red { background: var(--c-red-bg); color: var(--c-red-text); border-color: color-mix(in srgb, var(--c-red) 20%, transparent); }
.callout--green { background: var(--c-green-bg); color: var(--c-green-text); border-color: color-mix(in srgb, var(--c-green) 20%, transparent); }
.callout--gray { background: var(--c-surface-2); color: var(--c-text-2); border-color: var(--c-border); }

/* --- Dropzone --- */
.dropzone {
  border: 1.5px dashed var(--c-border-3);
  border-radius: var(--r-lg);
  padding: 28px 20px;
  text-align: center;
  background: var(--c-surface-2);
  color: var(--c-text-2);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--c-primary); background: var(--c-primary-50); }
.dropzone svg { width: 26px; height: 26px; margin: 0 auto 8px; color: var(--c-primary); }
.dropzone__title { font-weight: 600; color: var(--c-text); }
.dropzone__text { font-size: 12.5px; color: var(--c-text-3); margin-top: 2px; }

/* --- Datei-Kacheln --- */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.file-card {
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
  overflow: hidden;
  transition: box-shadow var(--t), border-color var(--t);
  cursor: pointer;
  min-width: 0;
}
.file-card:hover { box-shadow: var(--shadow-md); border-color: var(--c-border-2); }
.file-card__thumb {
  height: 110px;
  display: grid; place-items: center;
  background: var(--c-surface-3);
  color: var(--c-text-3);
  background-size: cover; background-position: center;
}
.file-card__thumb svg { width: 30px; height: 30px; }
.file-card__body { padding: 10px 12px; }
.file-card__name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-card__meta { font-size: 11.5px; color: var(--c-text-3); margin-top: 2px; }

/* Datei-Typ-Icon */
.file-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  display: grid; place-items: center;
  font-size: 9.5px; font-weight: 800; letter-spacing: .03em;
  color: #fff;
  background: var(--c-gray);
  flex-shrink: 0;
  text-transform: uppercase;
}
.file-icon--pdf { background: #e5484d; }
.file-icon--jpg, .file-icon--png, .file-icon--jpeg, .file-icon--webp { background: #0a9cc2; }
.file-icon--doc, .file-icon--docx { background: #2f62f5; }
.file-icon--xls, .file-icon--xlsx, .file-icon--csv { background: #12a150; }
.file-icon--mp4, .file-icon--mov { background: #7357f6; }

/* Kbd */
.kbd {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 5px;
  background: var(--c-surface-3);
  border: 1px solid var(--c-border-2);
  border-bottom-width: 2px;
  color: var(--c-text-3);
  font-family: var(--font); font-size: 11px; font-weight: 600;
}

/* Tooltip */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px); left: 50%;
  transform: translate(-50%, 4px);
  padding: 6px 9px;
  border-radius: 7px;
  background: var(--c-navy-900);
  color: #fff;
  font-size: 12px; font-weight: 500; line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-fast), transform var(--t-fast);
  z-index: 100;
  box-shadow: var(--shadow-md);
}
[data-tip]:hover::after { opacity: 1; transform: translate(-50%, 0); transition-delay: .25s; }
.app.is-collapsed .nav-item[data-tip]::after { left: calc(100% + 12px); bottom: auto; top: 50%; transform: translate(4px, -50%); }
.app.is-collapsed .nav-item[data-tip]:hover::after { transform: translate(0, -50%); }
.app:not(.is-collapsed) .nav-item[data-tip]::after { display: none; }

/* Mini-Statistiken */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat-box { padding: 14px 16px; border-radius: var(--r-md); background: var(--c-surface-2); border: 1px solid var(--c-border); min-width: 0; }
.stat-box__label { font-size: 12px; color: var(--c-text-3); font-weight: 550; display: flex; align-items: center; gap: 6px; }
.stat-box__label .dot { width: 7px; height: 7px; }
.stat-box__label svg { width: 14px; height: 14px; flex-shrink: 0; }
.stat-box__value { font-size: 20px; font-weight: 700; letter-spacing: -0.025em; margin-top: 4px; white-space: nowrap; }
.stat-box__sub { font-size: 12px; color: var(--c-text-3); margin-top: 2px; }

/* Summen-Box */
.totals { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.totals__row { display: flex; justify-content: space-between; gap: 12px; color: var(--c-text-2); font-variant-numeric: tabular-nums; }
.totals__row strong { color: var(--c-text); font-weight: 600; }
.totals__row--grand { padding-top: 10px; margin-top: 4px; border-top: 1px solid var(--c-border); color: var(--c-text); font-size: 16px; font-weight: 700; }
.totals__row--grand strong { font-weight: 750; font-size: 20px; letter-spacing: -0.02em; }

/* Charts (Basis) */
.chart { position: relative; width: 100%; }
.chart svg { overflow: visible; }
.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--c-navy-900);
  color: #fff;
  border-radius: 9px;
  padding: 8px 11px;
  font-size: 12px;
  line-height: 1.4;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
  z-index: 5;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 10px));
  transition: opacity var(--t-fast);
}
.chart-tooltip.is-visible { opacity: 1; }
.chart-tooltip__title { font-weight: 600; color: #c9d3e6; font-size: 11.5px; margin-bottom: 2px; }
.chart-tooltip__value { font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.chart-tooltip__row { display: flex; align-items: center; gap: 8px; }
.chart-tooltip__row .sw { width: 8px; height: 8px; border-radius: 2px; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--c-text-2); }
.chart-legend__item { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend__swatch { width: 10px; height: 10px; border-radius: 3px; }
.chart-axis text { font-size: 11px; fill: var(--c-text-3); font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart-grid line { stroke: var(--c-border); stroke-width: 1; shape-rendering: crispEdges; }

/* 5. OVERLAYS ============================================================= */

/* --- Modal --- */
.modal-backdrop {
  position: fixed; inset: 0;
  z-index: 200;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 20px 20px;
  background: rgba(10, 18, 34, .42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  overflow-y: auto;
  animation: fadeIn var(--t) var(--ease-out);
}
.modal-backdrop.is-closing { animation: fadeOut var(--t) var(--ease) forwards; }
@keyframes fadeOut { to { opacity: 0; } }
.modal {
  width: 100%;
  max-width: 560px;
  background: var(--c-surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  display: flex; flex-direction: column;
  max-height: calc(100vh - 12vh);
  animation: modalIn var(--t-slow) var(--ease-out);
  margin-bottom: 20px;
}
.modal-backdrop.is-closing .modal { animation: modalOut var(--t) var(--ease) forwards; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes modalOut { to { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal--sm { max-width: 420px; }
.modal--md { max-width: 640px; }
.modal--lg { max-width: 820px; }
.modal--xl { max-width: 1080px; }
.modal__header {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}
.modal__header-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--c-primary-50);
  color: var(--c-primary);
  flex-shrink: 0;
}
.modal__header-icon svg { width: 19px; height: 19px; }
.modal__heading { flex: 1; min-width: 0; }
.modal__title { font-size: 17px; font-weight: 650; letter-spacing: -0.015em; }
.modal__subtitle { font-size: 13px; color: var(--c-text-3); margin-top: 2px; }
.modal__close { margin: -4px -8px 0 0; }
.modal__body { padding: 20px 24px 24px; overflow-y: auto; flex: 1; }
.modal__footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 14px 24px;
  border-top: 1px solid var(--c-border);
  background: var(--c-surface-2);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.modal__footer .spacer { flex: 1; }
.modal--confirm .modal__body { padding-top: 24px; }
.confirm__icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--c-red-bg); color: var(--c-red); margin-bottom: 14px; }
.confirm__icon svg { width: 20px; height: 20px; }
.confirm__title { font-size: 16px; font-weight: 650; }
.confirm__text { color: var(--c-text-2); margin-top: 6px; font-size: 13.5px; }

/* --- Drawer (Seitenpanel) --- */
.drawer-backdrop {
  position: fixed; inset: 0;
  z-index: 190;
  background: rgba(10, 18, 34, .28);
  animation: fadeIn var(--t) var(--ease-out);
}
.drawer-backdrop.is-closing { animation: fadeOut var(--t) forwards; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(480px, 100vw);
  background: var(--c-surface);
  box-shadow: var(--shadow-xl);
  z-index: 191;
  display: flex; flex-direction: column;
  animation: drawerIn var(--t-slow) var(--ease-out);
}
.drawer--lg { width: min(640px, 100vw); }
.drawer.is-closing { animation: drawerOut var(--t) var(--ease) forwards; }
@keyframes drawerIn { from { transform: translateX(100%); } to { transform: none; } }
@keyframes drawerOut { to { transform: translateX(100%); } }
.drawer__header { display: flex; align-items: flex-start; gap: 12px; padding: 20px 24px 16px; border-bottom: 1px solid var(--c-border); }
.drawer__title { font-size: 17px; font-weight: 650; letter-spacing: -0.015em; }
.drawer__subtitle { font-size: 13px; color: var(--c-text-3); margin-top: 2px; }
.drawer__body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.drawer__footer { padding: 14px 24px; border-top: 1px solid var(--c-border); display: flex; gap: 8px; flex-wrap: wrap; background: var(--c-surface-2); }

/* --- Dropdown / Menü --- */
.menu {
  position: fixed;
  z-index: 300;
  min-width: 200px;
  max-width: 320px;
  padding: 6px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  animation: menuIn var(--t) var(--ease-out);
  max-height: 70vh;
  overflow-y: auto;
}
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.menu__label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--c-text-3); padding: 8px 10px 4px; }
.menu__item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 13.5px; font-weight: 500;
  color: var(--c-text);
  text-align: left;
  transition: background var(--t-fast);
}
.menu__item:hover, .menu__item.is-focused { background: var(--c-surface-3); }
.menu__item svg { width: 16px; height: 16px; color: var(--c-text-3); }
.menu__item .menu__hint { margin-left: auto; font-size: 12px; color: var(--c-text-3); }
.menu__item.is-selected { font-weight: 600; }
.menu__item.is-selected .menu__check { margin-left: auto; color: var(--c-primary); }
.menu__item--danger { color: var(--c-red-text); }
.menu__item--danger svg { color: var(--c-red); }
.menu__item--danger:hover { background: var(--c-red-bg); }
.menu__divider { height: 1px; background: var(--c-border); margin: 6px -6px; }

/* Popover (Benachrichtigungen, Schnellaktionen) */
.popover {
  position: fixed;
  z-index: 300;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  animation: menuIn var(--t) var(--ease-out);
  overflow: hidden;
}
.popover__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--c-border); }
.popover__title { font-weight: 650; font-size: 14.5px; }

/* Schnellaktionen */
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 8px; width: 380px; max-width: calc(100vw - 24px); }
.quick-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  border-radius: var(--r-md);
  text-align: left;
  transition: background var(--t-fast);
}
.quick-item:hover { background: var(--c-surface-3); }
.quick-item__icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.quick-item__icon svg { width: 17px; height: 17px; }
.quick-item__title { font-size: 13px; font-weight: 600; }
.quick-item__sub { font-size: 11.5px; color: var(--c-text-3); }

/* Benachrichtigungen */
.notif-panel { width: 400px; max-width: calc(100vw - 24px); }
.notif-list { max-height: 440px; overflow-y: auto; }
.notif {
  display: flex; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
  cursor: pointer;
  transition: background var(--t-fast);
  position: relative;
}
.notif:last-child { border-bottom: 0; }
.notif:hover { background: var(--c-hover); }
.notif.is-unread { background: #fafbff; }
.notif.is-unread::after { content: ""; position: absolute; right: 16px; top: 18px; width: 7px; height: 7px; border-radius: 50%; background: var(--c-primary); }
.notif__icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.notif__icon svg { width: 16px; height: 16px; }
.notif__body { flex: 1; min-width: 0; padding-right: 14px; }
.notif__text { font-size: 13px; color: var(--c-text); line-height: 1.45; }
.notif__time { font-size: 11.5px; color: var(--c-text-3); margin-top: 2px; }
.popover__footer { padding: 10px 16px; border-top: 1px solid var(--c-border); background: var(--c-surface-2); display: flex; justify-content: space-between; align-items: center; }

/* --- Command Palette (Globale Suche) --- */
.cmdk-backdrop {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(10, 18, 34, .45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; justify-content: center; align-items: flex-start;
  padding: 12vh 16px 16px;
  animation: fadeIn var(--t) var(--ease-out);
}
.cmdk {
  width: 100%; max-width: 640px;
  background: var(--c-surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: modalIn var(--t-slow) var(--ease-out);
  display: flex; flex-direction: column;
  max-height: 72vh;
}
.cmdk__search { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--c-border); }
.cmdk__search svg { width: 19px; height: 19px; color: var(--c-text-3); }
.cmdk__input { flex: 1; height: 58px; border: 0; outline: none; font-size: 16px; background: transparent; }
.cmdk__input::placeholder { color: var(--c-text-4); }
.cmdk__results { overflow-y: auto; padding: 8px; }
.cmdk__group { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--c-text-3); padding: 10px 10px 6px; }
.cmdk__item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
.cmdk__item.is-active { background: var(--c-primary-50); }
.cmdk__item.is-active .cmdk__item-title { color: var(--c-primary-700); }
.cmdk__item-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--c-surface-3); color: var(--c-text-2); flex-shrink: 0; }
.cmdk__item-icon svg { width: 16px; height: 16px; }
.cmdk__item-body { flex: 1; min-width: 0; }
.cmdk__item-title { font-size: 13.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk__item-sub { font-size: 12px; color: var(--c-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk__item-meta { font-size: 12px; color: var(--c-text-3); }
.cmdk__footer { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--c-border); background: var(--c-surface-2); font-size: 12px; color: var(--c-text-3); }
.cmdk__footer span { display: inline-flex; align-items: center; gap: 6px; }
.cmdk__empty { padding: 36px 16px; text-align: center; color: var(--c-text-3); font-size: 13.5px; }
mark { background: #fff2b8; color: inherit; border-radius: 3px; padding: 0 1px; }

/* --- Toasts --- */
.toast-stack {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 500;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
  width: min(380px, calc(100vw - 32px));
}
.toast {
  pointer-events: auto;
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 14px 14px 16px;
  border-radius: var(--r-md);
  background: var(--c-navy-900);
  color: #fff;
  box-shadow: var(--shadow-xl);
  animation: toastIn var(--t-slow) var(--ease-out);
  border: 1px solid rgba(255, 255, 255, .06);
}
.toast.is-leaving { animation: toastOut var(--t) var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px); } }
.toast__icon { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--c-green); }
.toast__icon svg { width: 13px; height: 13px; color: #fff; stroke-width: 3; }
.toast--error .toast__icon { background: var(--c-red); }
.toast--warning .toast__icon { background: var(--c-amber); }
.toast--info .toast__icon { background: var(--c-primary); }
.toast__content { flex: 1; min-width: 0; padding-top: 1px; }
.toast__title { font-weight: 600; font-size: 13.5px; }
.toast__msg { font-size: 12.5px; color: #b6c0d2; margin-top: 2px; }
.toast__action { font-size: 12.5px; font-weight: 600; color: #9db8ff; padding: 2px 4px; border-radius: 5px; margin-top: 1px; }
.toast__action:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.toast__close { color: #7f8aa0; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; }
.toast__close:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.toast__close svg { width: 14px; height: 14px; }

/* 6. UTILITIES ============================================================ */
.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid-1-1 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.row--start { align-items: flex-start; }
.row--wrap { flex-wrap: wrap; }
.gap-xs { gap: 4px; } .gap-sm { gap: 8px; } .gap-md { gap: 16px; } .gap-lg { gap: 24px; }
.flex-1 { flex: 1; min-width: 0; }
.mt-xs { margin-top: 4px; } .mt-sm { margin-top: 8px; } .mt-md { margin-top: 16px; } .mt-lg { margin-top: 24px; } .mt-xl { margin-top: 32px; }
.mb-sm { margin-bottom: 8px; } .mb-md { margin-bottom: 16px; } .mb-lg { margin-bottom: 24px; }
.text-muted { color: var(--c-text-3); }
.text-soft { color: var(--c-text-2); }
.text-xs { font-size: 12px; } .text-sm { font-size: 13px; } .text-md { font-size: 15px; } .text-lg { font-size: 17px; }
.text-right { text-align: right; } .text-center { text-align: center; }
.text-green { color: var(--c-green-text); } .text-red { color: var(--c-red-text); } .text-amber { color: var(--c-amber-text); } .text-primary { color: var(--c-primary); }
.fw-500 { font-weight: 500; } .fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.w-full { width: 100%; }
.divider { height: 1px; background: var(--c-border); margin: 16px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.show-mobile { display: none !important; }
.link-plain { color: inherit; }
.link-plain:hover { color: var(--c-primary); }
.clickable { cursor: pointer; }

/* Ressourcen-Auswahl (Mitarbeiter / Fahrzeuge) */
.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.pick-item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--c-border-2);
  border-radius: var(--r-md);
  background: var(--c-surface);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
  min-width: 0;
  user-select: none;
}
.pick-item:hover { border-color: var(--c-border-3); }
.pick-item input { position: absolute; opacity: 0; pointer-events: none; }
.pick-item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pick-item__title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-item__sub { font-size: 11.5px; color: var(--c-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-item__sub.is-warn { color: var(--c-amber-text); font-weight: 550; }
.pick-item__check {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--c-border-3);
  display: grid; place-items: center; flex-shrink: 0;
  color: #fff;
  transition: all var(--t-fast);
}
.pick-item__check svg { width: 12px; height: 12px; opacity: 0; stroke-width: 3; }
.pick-item:has(input:checked) { border-color: var(--c-primary); background: var(--c-primary-50); box-shadow: inset 0 0 0 1px var(--c-primary); }
.pick-item:has(input:checked) .pick-item__check { background: var(--c-primary); border-color: var(--c-primary); }
.pick-item:has(input:checked) .pick-item__check svg { opacity: 1; }
.pick-item:has(input:focus-visible) { box-shadow: var(--ring); }
.pick-item.is-disabled { opacity: .55; cursor: not-allowed; }
.pick-item.is-disabled:has(input:checked) { opacity: 1; }

/* Donut */
.donut { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.donut__center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.donut__value { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.donut__label { font-size: 11.5px; color: var(--c-text-3); }
.donut__legend { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 2px; }
.donut__item { display: grid; grid-template-columns: 10px 1fr auto 44px; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 7px; font-size: 13px; cursor: default; }
.donut__item:hover { background: var(--c-surface-3); }
.donut__item-label { color: var(--c-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.donut__item-value { font-weight: 600; }
.donut__item-pct { color: var(--c-text-3); text-align: right; font-size: 12px; }

/* Horizontale Balken */
.hbars { display: flex; flex-direction: column; gap: 14px; }
.hbar__top { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin-bottom: 6px; }
.hbar__label { color: var(--c-text-2); font-weight: 500; }
.hbar__value { font-weight: 650; }
.hbar__sub { color: var(--c-text-3); font-weight: 500; margin-left: 8px; font-size: 12px; }
.hbar__track { height: 8px; border-radius: var(--r-full); background: var(--c-surface-3); overflow: hidden; }
.hbar__fill { height: 100%; border-radius: var(--r-full); transition: width var(--t-slow) var(--ease-out); }

.page.no-anim { animation: none; }

/* Split-Button (Topbar: Neuer Auftrag + Schnellaktionen) */
.split-btn { display: inline-flex; align-items: stretch; }
.split-btn > .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.split-btn > .split-btn__caret { border-top-left-radius: 0; border-bottom-left-radius: 0; padding: 0 9px; margin-left: 1px; }
.cmdk__enter { width: 15px; height: 15px; color: var(--c-text-4); opacity: 0; }
.cmdk__item.is-active .cmdk__enter { opacity: 1; color: var(--c-primary); }

/* Button-Ladezustand */
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
.btn--secondary.is-loading::after { border-color: var(--c-border-2); border-top-color: var(--c-text-2); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Fehler-/404-Seite */
.page-error { max-width: 520px; margin: 10vh auto; text-align: center; }

/* 7. RESPONSIVE =========================================================== */
@media (max-width: 1360px) {
  .layout-main-side { grid-template-columns: minmax(0, 1fr) 320px; }
}

@media (max-width: 1180px) {
  :root { --page-pad: 24px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2-1, .layout-main-side, .layout-side-main { grid-template-columns: minmax(0, 1fr); }
  .sticky-side { position: static; }
  .topbar__company span { display: none; }
}

/* Tablet: Sidebar als Off-Canvas */
@media (max-width: 1023px) {
  .app, .app.is-collapsed { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform var(--t-slow) var(--ease-out), box-shadow var(--t-slow);
    box-shadow: none;
    visibility: hidden;
  }
  .app.is-mobile-open .sidebar { transform: none; box-shadow: var(--shadow-xl); visibility: visible; }
  .app.is-mobile-open .sidebar-backdrop {
    display: block;
    position: fixed; inset: 0;
    z-index: 35;
    background: rgba(10, 18, 34, .45);
    animation: fadeIn var(--t) var(--ease-out);
  }
  /* Im Off-Canvas immer volle Sidebar zeigen */
  .app.is-collapsed .brand-text, .app.is-collapsed .nav-item__label, .app.is-collapsed .nav-item__badge,
  .app.is-collapsed .nav-group__label, .app.is-collapsed .sidebar-promo, .app.is-collapsed .sidebar-user__meta,
  .app.is-collapsed .sidebar-user svg.chev { display: revert; }
  .app.is-collapsed .nav-item { justify-content: flex-start; padding: 0 12px; }
  .app.is-collapsed .sidebar__brand { flex-direction: row; padding: 0 18px; height: var(--topbar-h); }
  .sidebar__toggle { display: none; }
  .topbar__menu { display: inline-grid; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-1-1 { grid-template-columns: minmax(0, 1fr); }
}

/* Smartphone */
@media (max-width: 680px) {
  :root { --page-pad: 16px; --topbar-h: 58px; }
  body { font-size: 14px; }
  .page { padding-top: 16px; padding-bottom: 110px; }
  .page-header { margin-bottom: 18px; align-items: flex-start; }
  .page-header__title { font-size: 21px; }
  .page-header__actions { width: 100%; }
  .page-header__actions > .btn { flex: 1; }
  .kpi-grid { gap: 10px; }
  .kpi { padding: 14px; }
  .kpi__value { font-size: 22px; margin-top: 8px; }
  .kpi__spark { display: none; }
  .kpi__icon { width: 30px; height: 30px; }
  .grid-2, .grid-3, .grid-4, .form-grid, .form-grid--3, .form-grid--4 { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: auto; }
  .topbar { gap: 6px; }
  .topbar__search { width: 40px; padding: 0; justify-content: center; flex: 0 0 auto; }
  .topbar__search span, .topbar__search .kbd { display: none; }
  .topbar__company, .topbar__divider, .topbar-new-label { display: none !important; }
  .topbar__spacer { flex: 1; }
  .hide-mobile { display: none !important; }
  .show-mobile { display: revert !important; }
  .card__header { padding: 16px 16px 0; }
  .card__body { padding: 16px; }
  .table th:first-child, .table td:first-child { padding-left: 16px; }
  .table th:last-child, .table td:last-child { padding-right: 16px; }
  .hero__body { padding: 16px; }
  .hero__title { font-size: 21px; }
  .hero-stat { border-right: 0; border-bottom: 1px solid var(--c-border); }
  .hero__stats { grid-template-columns: repeat(2, 1fr); }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal { max-width: 100% !important; border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 92vh; margin: 0; animation: sheetIn var(--t-slow) var(--ease-out); }
  .modal__header, .modal__body { padding-left: 18px; padding-right: 18px; }
  .modal__footer { padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-radius: 0; }
  .modal__footer .btn { flex: 1; }
  @keyframes sheetIn { from { transform: translateY(100%); } to { transform: none; } }
  .toast-stack { right: 16px; left: 16px; bottom: 84px; width: auto; }
  .section-title { margin-top: 26px; }

  /* Tabellen als Karten */
  .table--responsive thead { display: none; }
  .table--responsive, .table--responsive tbody, .table--responsive tr, .table--responsive td { display: block; width: 100%; }
  .table--responsive tr { padding: 12px 16px; border-bottom: 1px solid var(--c-border); }
  .table--responsive tbody tr:last-child { border-bottom: 0; }
  .table--responsive td { border: 0; padding: 3px 0 !important; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table--responsive td::before { content: attr(data-label); color: var(--c-text-3); font-size: 12px; font-weight: 500; text-align: left; flex-shrink: 0; }
  .table--responsive td[data-label=""]::before, .table--responsive td:not([data-label])::before { display: none; }
  .table--responsive td.cell-primary { display: block; text-align: left; padding-bottom: 6px !important; }
  .table--responsive td.cell-primary::before { display: none; }
  .table--responsive td.cell-actions { width: 100%; justify-content: flex-end; padding-top: 8px !important; }
  .table--responsive .cell-main, .table--responsive .cell-sub { white-space: normal; }

  /* Bottom Navigation */
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 45;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-top: 1px solid var(--c-border);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav__item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    height: 52px;
    border-radius: 12px;
    color: var(--c-text-3);
    font-size: 10.5px; font-weight: 600;
  }
  .bottom-nav__item svg { width: 21px; height: 21px; }
  .bottom-nav__item.is-active { color: var(--c-primary); }
  .bottom-nav__item--primary .bottom-nav__fab {
    width: 44px; height: 44px; border-radius: 14px;
    background: var(--c-primary); color: #fff;
    display: grid; place-items: center;
    box-shadow: 0 8px 18px -6px rgba(47, 98, 245, .7);
  }
}

/* Druck */
@media print {
  .sidebar, .topbar, .bottom-nav, .toast-stack, .page-header__actions { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
}

/* Reduzierte Bewegung */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Pfeil am Ende eines Listeneintrags (z. B. Verknüpfungen in der Anfrage) */
.list__item > svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--c-text-3); }

/* Neue Version verfügbar (js/core/version.js) – unten mittig, unter Toasts und Dialogen */
.app-update { position: fixed; z-index: 490; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100vw - 32px); padding: 10px 10px 10px 14px; border-radius: 14px; background: var(--c-text); color: var(--c-surface); box-shadow: 0 14px 36px rgba(10, 18, 34, .28); animation: appUpdateIn .25s ease-out; }
.app-update__icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: color-mix(in srgb, var(--c-surface) 14%, transparent); flex-shrink: 0; }
.app-update__icon svg { width: 16px; height: 16px; }
.app-update__text { display: flex; flex-direction: column; min-width: 0; font-size: 13px; line-height: 1.35; }
.app-update__text small { font-size: 12px; opacity: .72; }
.app-update .btn { flex-shrink: 0; }
@keyframes appUpdateIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (max-width: 680px) { .app-update { left: 12px; right: 12px; width: auto; transform: none; bottom: calc(76px + env(safe-area-inset-bottom)); } .app-update__text small { display: none; } @keyframes appUpdateIn { from { opacity: 0; } to { opacity: 1; } } }
@media print { .app-update { display: none !important; } }
