/* ============================================================
   PLUTOZ PORTAL – CSS – exakt aus src/index.css (TSX Design-System)
   Alle Variablen 1:1 aus dem TSX-Portal übernommen.
   ============================================================ */

:root {
  /* ── Basis (aus TSX :root) ── */
  --background:     hsl(210 40% 98%);
  --foreground:     hsl(222 47% 11%);
  --border-color:   hsl(214 32% 91%);

  /* ── Cards ── */
  --card:           hsl(0 0% 100%);
  --card-foreground:hsl(222 47% 11%);

  /* ── Sidebar ── */
  --sidebar:        hsl(0 0% 100%);
  --sidebar-fg:     hsl(215 25% 27%);
  --sidebar-border-color: hsl(214 32% 91%);
  --sidebar-primary:hsl(189 72% 37%);
  --sidebar-accent: hsl(210 40% 96%);
  --sidebar-accent-fg: hsl(222 47% 11%);

  /* ── Primary: Plutoz Teal ── */
  --primary-hsl:    189 72% 37%;
  --primary:        hsl(189 72% 37%);
  --primary-fg:     hsl(0 0% 100%);

  /* ── Muted ── */
  --muted:          hsl(210 40% 96.1%);
  --muted-fg:       hsl(215.4 16.3% 46.9%);

  /* ── Destructive ── */
  --destructive:    hsl(0 84.2% 60.2%);

  /* ── Aliases für bestehende Komponenten ── */
  --bg:             hsl(210 40% 98%);
  --surface:        hsl(0 0% 100%);
  --border:         hsl(214 32% 91%);
  --text:           hsl(222 47% 11%);
  --text-muted:     hsl(215.4 16.3% 46.9%);
  --text-subtle:    hsl(215 20% 65%);
  --primary-faint:  hsl(189 72% 37% / 0.1);
  --primary-ring:   hsl(189 72% 37% / 0.25);
  --sidebar-bg:     hsl(0 0% 100%);
  --sidebar-text:   hsl(215 25% 27%);
  --sidebar-muted:  hsl(215 20% 60%);
  --sidebar-hover:  hsl(210 40% 96%);
  --sidebar-active: hsl(189 72% 37% / 0.1);
  --sidebar-border: hsl(214 32% 91%);

  /* ── Shadows (exakt aus TSX index.css) ── */
  --shadow-2xs: 0px 1px 2px 0px hsl(222 47% 11% / 0.02);
  --shadow-xs:  0px 1px 3px 0px hsl(222 47% 11% / 0.03);
  --shadow-sm:  0px 1px 3px 0px hsl(222 47% 11% / 0.04), 0px 1px 2px -1px hsl(222 47% 11% / 0.02);
  --shadow:     0px 2px 4px 0px hsl(222 47% 11% / 0.04), 0px 1px 2px -1px hsl(222 47% 11% / 0.03);
  --shadow-md:  0px 4px 8px 0px hsl(222 47% 11% / 0.04), 0px 2px 4px -1px hsl(222 47% 11% / 0.03);
  --shadow-lg:  0px 8px 16px 0px hsl(222 47% 11% / 0.04), 0px 4px 6px -1px hsl(222 47% 11% / 0.03);
  --shadow-xl:  0px 16px 24px 0px hsl(222 47% 11% / 0.04), 0px 8px 10px -1px hsl(222 47% 11% / 0.03);
  --shadow-2xl: 0px 24px 40px 0px hsl(222 47% 11% / 0.06);

  /* ── Radius (aus TSX --radius: 0.75rem) ── */
  --radius:     0.75rem;
  --radius-sm:  calc(0.75rem - 4px);   /* 0.5rem  */
  --radius-md:  calc(0.75rem - 2px);   /* 0.625rem */
  --radius-lg:  0.75rem;
  --radius-xl:  calc(0.75rem + 4px);   /* 1rem    */

  /* ── Typography (--tracking-normal: -0.015em aus TSX) ── */
  --tracking-normal: -0.015em;
  --transition: .18s ease;
}

.dark {
  /* ── Aus TSX .dark ── */
  --background:     hsl(222 47% 8%);
  --foreground:     hsl(210 25% 92%);
  --border-color:   hsl(222 35% 20%);
  --card:           hsl(222 44% 11%);
  --card-foreground:hsl(210 25% 92%);
  --sidebar:        hsl(222 50% 6%);
  --sidebar-fg:     hsl(210 25% 88%);
  --sidebar-border-color: hsl(222 40% 15%);
  --sidebar-primary:hsl(189 72% 42%);
  --sidebar-accent: hsl(222 40% 15%);
  --sidebar-accent-fg: hsl(210 25% 88%);
  --primary:        hsl(189 72% 45%);
  --primary-fg:     hsl(222 47% 8%);
  --muted:          hsl(222 35% 15%);
  --muted-fg:       hsl(215 20% 55%);
  --destructive:    hsl(0 65% 52%);

  /* ── Aliases ── */
  --bg:             hsl(222 47% 8%);
  --surface:        hsl(222 44% 11%);
  --border:         hsl(222 35% 20%);
  --text:           hsl(210 25% 92%);
  --text-muted:     hsl(215 20% 55%);
  --text-subtle:    hsl(215 16% 35%);
  --primary-faint:  hsl(189 72% 45% / 0.15);
  --primary-ring:   hsl(189 72% 45% / 0.3);
  --sidebar-bg:     hsl(222 50% 6%);
  --sidebar-text:   hsl(210 25% 88%);
  --sidebar-muted:  hsl(215 16% 35%);
  --sidebar-hover:  hsl(222 40% 15%);
  --sidebar-active: hsl(189 72% 42% / 0.15);
  --sidebar-border: hsl(222 40% 15%);
  --shadow-sm:      0 1px 3px rgba(0,0,0,.4);
  --shadow-md:      0 4px 12px rgba(0,0,0,.5);
}

/* --- Reset --- */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
/* [hidden] must always win, even against classes like .form-group that set their own
   display (flex/grid/etc.) — otherwise toggling the hidden attribute via JS has no visual
   effect on elements carrying such a class (found via the Mitteilungen Person/Produkt fields). */
[hidden] { display: none !important; }
html {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--foreground);
  background: var(--background);
  letter-spacing: var(--tracking-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body { min-height: 100vh; background: var(--background); color: var(--foreground); }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, h5, h6 { letter-spacing: -0.025em; font-weight: 600; }

/* --- App layout --- */
#app { display: flex; height: 100vh; overflow: hidden; background: var(--bg); }
#sidebar-root { display: contents; }
.main-content { flex: 1; overflow-y: auto; background: var(--bg); display: flex; flex-direction: column; }
.page { padding: 36px 40px; max-width: 1280px; margin: 0 auto; width: 100%; box-sizing: border-box; }

/* --- Sidebar --- */
.sidebar {
  width: 260px;
  height: 100vh;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.sidebar-logo { padding: 24px 24px 16px; }
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  padding: 0 12px 6px;
  opacity: 0.55;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 450;
  color: hsl(215 20% 46%);
  transition: all .15s ease;
  cursor: pointer;
  user-select: none;
  letter-spacing: -0.01em;
}
.nav-link:hover { background: var(--sidebar-hover); color: var(--text); }
.nav-link.active {
  background: var(--primary-faint);
  color: var(--primary);
  font-weight: 550;
}
.nav-link svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.45; }
.nav-link:hover svg { opacity: 0.75; }
.nav-link.active svg { opacity: 1; }
.sidebar-footer { padding: 12px 14px; border-top: 1px solid var(--sidebar-border); }
.sidebar-notif {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: 13.5px;
  color: hsl(215 20% 46%);
  cursor: pointer;
  transition: all .15s ease;
  margin-bottom: 4px;
}
.sidebar-notif:hover { background: var(--sidebar-hover); color: var(--text); }
.notif-badge {
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.sidebar-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px 0;
  margin-top: 8px;
  border-top: 1px solid var(--sidebar-border);
}
.sidebar-user-info .name { font-size: 13px; font-weight: 550; color: var(--sidebar-text); }
.sidebar-user-info .role { font-size: 11px; color: var(--sidebar-muted); text-transform: capitalize; margin-top: 2px; }
.sidebar-actions { display: flex; gap: 2px; }
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-muted);
  transition: all .15s ease;
}
.icon-btn:hover { background: var(--sidebar-hover); color: var(--sidebar-text); }
.icon-btn.primary:hover { color: var(--primary); }

/* --- Topbar (sticky header inside .main-content: search, notifications, profile) --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar-search-form { display: flex; flex: 1; max-width: 360px; }
.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  background: var(--bg);
}
.topbar-search svg { flex-shrink: 0; opacity: .6; }
.topbar-search input { flex: 1; border: 0; background: none; font: inherit; color: var(--text); outline: none; }
.topbar-search input::placeholder { color: var(--text-subtle); }
.topbar-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.topbar-icon-btn { position: relative; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: all .15s ease; }
.topbar-icon-btn:hover { background: var(--sidebar-hover); color: var(--text); }
.topbar-icon-btn .notif-badge { position: absolute; top: 2px; right: 2px; min-width: 15px; height: 15px; padding: 0 3px; font-size: 9px; display: flex; align-items: center; justify-content: center; }
.topbar-profile { position: relative; }
.topbar-profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  transition: background .15s ease;
}
.topbar-profile-btn:hover { background: var(--sidebar-hover); }
.topbar-profile-name { font-size: 13px; font-weight: 600; color: var(--text); }
.topbar-profile-btn .chev { color: var(--text-subtle); transition: transform .15s ease; }
.topbar-profile.open .chev { transform: rotate(180deg); }
.topbar-profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
  z-index: 60;
}
.topbar-profile.open .topbar-profile-dropdown { display: block; }
.topbar-profile-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
}
.topbar-profile-dropdown a:hover { background: var(--sidebar-hover); }
.topbar-profile-dropdown a.text-danger { color: var(--destructive); }
.topbar-profile-dropdown-divider { height: 1px; background: var(--border); margin: 6px 4px; }

/* --- Topbar notification dropdown (see portal.js bindNotifMenu) --- */
.topbar-notif { position: relative; }
.topbar-notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  max-width: 90vw;
  max-height: 420px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 60;
}
.topbar-notif.open .topbar-notif-dropdown { display: block; }
.topbar-notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  position: sticky;
  top: 0;
  background: var(--surface);
}
.topbar-notif-empty { padding: 24px 14px; text-align: center; font-size: 13px; color: var(--text-muted); }
.topbar-notif-item { display: block; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.topbar-notif-item:last-child { border-bottom: 0; }
.topbar-notif-item:hover { background: var(--sidebar-hover); }
.topbar-notif-item.unread { background: var(--primary-faint); }
.topbar-notif-title { font-size: 13px; font-weight: 600; color: var(--text); }
.topbar-notif-message { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.link-btn { color: var(--primary); font-size: 11px; font-weight: 500; background: none; border: 0; padding: 0; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* --- Typography --- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}
.page-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.2;
}
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 5px; line-height: 1.4; }
.section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* --- Cards --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, border-color .2s ease;
}
.card:hover { box-shadow: var(--shadow); }
.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.015em;
}
.card-body { padding: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media(max-width:900px) {
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  letter-spacing: 0;
}
.badge-green   { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.badge-red     { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }
.badge-blue    { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.badge-orange  { background: #ffedd5; color: #c2410c; border-color: #fed7aa; }
.badge-amber   { background: #fef9c3; color: #92400e; border-color: #fde68a; }
.badge-slate   { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.badge-violet  { background: #ede9fe; color: #7c3aed; border-color: #ddd6fe; }
.badge-teal    { background: #ccfbf1; color: #0f766e; border-color: #99f6e4; }
.badge-primary { background: var(--primary-faint); color: var(--primary); border-color: var(--primary-ring); }
.dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.dark .badge-green  { background: rgba(22,163,74,.15); border-color: rgba(22,163,74,.3); color: #4ade80; }
.dark .badge-red    { background: rgba(220,38,38,.15); border-color: rgba(220,38,38,.3); color: #f87171; }
.dark .badge-blue   { background: rgba(29,78,216,.15); border-color: rgba(29,78,216,.3); color: #93c5fd; }
.dark .badge-orange { background: rgba(194,65,12,.15); border-color: rgba(194,65,12,.3); color: #fb923c; }
.dark .badge-amber  { background: rgba(180,83,9,.15);  border-color: rgba(180,83,9,.3);  color: #fbbf24; }
.dark .badge-slate  { background: rgba(71,85,105,.2);  border-color: rgba(71,85,105,.3); color: #94a3b8; }
.dark .badge-violet { background: rgba(124,58,237,.15);border-color: rgba(124,58,237,.3);color: #c4b5fd; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s ease;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 2px 8px hsl(189 72% 37% / 0.25); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--sidebar-hover); border-color: hsl(214 32% 82%); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--sidebar-hover); color: var(--text); }
.btn-danger { background: #ef4444; color: #fff; border-color: #ef4444; }
.btn-danger:hover { background: #dc2626; box-shadow: 0 2px 8px rgba(239,68,68,.25); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-xs { padding: 4px 10px; font-size: 11px; border-radius: var(--radius-sm); }
.btn-full { width: 100%; justify-content: center; }
.btn-lg { padding: 12px 26px; font-size: 15px; font-weight: 600; border-radius: var(--radius); }
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

/* --- Forms --- */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-2 .form-group { margin-bottom: 16px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text); }
.form-input {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 13px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.form-select {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: border-color .15s ease;
}
.form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.form-textarea {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 13px;
  resize: vertical;
  min-height: 88px;
  outline: none;
  transition: border-color .15s ease;
}
.form-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.search-wrap { position: relative; display: flex; align-items: center; }
.search-wrap svg { position: absolute; left: 12px; width: 15px; height: 15px; color: var(--text-muted); pointer-events: none; }
.search-wrap input {
  padding: 9px 14px 9px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 13px;
  outline: none;
  min-width: 240px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-wrap input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.filter-row select {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 12px;
  cursor: pointer;
  outline: none;
  transition: border-color .15s ease;
}

/* --- Table --- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--muted);
}
td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s ease; cursor: pointer; }
tbody tr:hover { background: hsl(210 40% 97%); }
.dark tbody tr:hover { background: var(--sidebar-hover); }

/* --- Avatar --- */
.avatar { border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; flex-shrink: 0; }
.avatar-sm { width: 26px; height: 26px; font-size: 10px; }
.avatar-md { width: 34px; height: 34px; font-size: 12px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }
.avatar-xl { width: 60px; height: 60px; font-size: 20px; }

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.45);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }
#confirmDeleteModal { z-index: 200; }
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .2s cubic-bezier(.22,1,.36,1);
}
@keyframes modalIn { from { transform: scale(.96) translateY(8px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.modal-sm { max-width: 440px; }
.modal-md { max-width: 600px; }
.modal-lg { max-width: 780px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 17px; font-weight: 700; letter-spacing: -0.025em; }
.modal-body { padding: 26px; }
.modal-footer {
  padding: 18px 26px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all .15s ease;
}
.close-btn:hover { background: var(--sidebar-hover); color: var(--text); }

.modal-alert {
  display: flex; align-items: flex-start; gap: 12px;
  border-radius: var(--radius); padding: 14px 16px; font-size: 13px; line-height: 1.5;
}
.modal-alert svg { flex-shrink: 0; margin-top: 1px; }
.modal-alert-warning { background: #fef9c3; color: #713f12; border: 1px solid #fde68a; }
.dark .modal-alert-warning { background: rgba(180,83,9,.12); color: #fde68a; border-color: rgba(180,83,9,.3); }
.modal-alert-error { background: #fee2e2; color: #7f1d1d; border: 1px solid #fca5a5; }
.dark .modal-alert-error { background: rgba(220,38,38,.12); color: #fca5a5; border-color: rgba(220,38,38,.3); }

/* --- Tabs --- */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* --- Pagination (außerhalb der Table-Card) --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 14px;
}
.page-btns { display: flex; gap: 4px; }
.page-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all .15s ease;
}
.page-btn:hover:not(:disabled) { background: var(--sidebar-hover); border-color: hsl(214 32% 82%); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn:disabled { opacity: .35; cursor: default; }

/* --- Toast --- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 18px;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  pointer-events: all;
  animation: slideIn .25s cubic-bezier(.22,1,.36,1);
}
@keyframes slideIn { from { transform: translateX(24px) translateY(4px); opacity: 0; } to { transform: translateX(0) translateY(0); opacity: 1; } }
.toast-success { border-left: 3px solid #22c55e; }
.toast-error   { border-left: 3px solid #ef4444; }
.toast-info    { border-left: 3px solid var(--primary); }

/* --- Settings page toggles --- */
.settings-section { margin-bottom: 28px; }
.toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-info { flex: 1; }
.toggle-label { font-size: 13px; font-weight: 500; }
.toggle-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.toggle {
  position: relative;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s;
}
.toggle input:checked ~ .toggle-track { background: var(--primary); }
.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: var(--shadow-xs);
  transition: transform .2s;
  pointer-events: none;
}
.toggle input:checked ~ .toggle-thumb { transform: translateX(16px); }

/* --- Chat --- */
.chat-wrap { display: flex; flex-direction: column; height: calc(100vh - 220px); min-height: 400px; max-height: 680px; }
.chat-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.msg { display: flex; gap: 10px; max-width: 80%; }
.msg.agent { align-self: flex-end; flex-direction: row-reverse; }
.msg.kunde { align-self: flex-start; }
.msg-bubble { padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.msg.kunde .msg-bubble { background: var(--sidebar-hover); color: var(--text); border-radius: 2px 12px 12px 12px; }
.msg.agent .msg-bubble { background: var(--primary); color: #fff; border-radius: 12px 2px 12px 12px; }
.msg-meta { font-size: 10px; color: var(--text-subtle); margin-top: 4px; }
.msg.agent .msg-meta { text-align: right; }
.msg.system {
  align-self: center;
  max-width: 100%;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.msg-system-line { flex: 1; height: 1px; background: var(--border); }
.msg-system-text {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  padding: 3px 12px;
  background: var(--muted);
  border-radius: 999px;
  font-weight: 500;
  letter-spacing: 0;
}
.chat-input-row { border-top: 1px solid var(--border); padding: 12px 16px; display: flex; gap: 8px; }
.chat-input { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); font-size: 13px; outline: none; resize: none; }
.chat-input:focus { border-color: var(--primary); }

/* --- Timer --- */
.timer-display { font-size: 40px; font-weight: 700; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.timer-running { color: var(--primary); }

/* --- Profile --- */
.profile-header { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.profile-meta { flex: 1; min-width: 200px; }
.profile-name { font-size: 22px; font-weight: 700; letter-spacing: -0.025em; }
.profile-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.profile-badges { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.info-item label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); display: flex; align-items: center; gap: 5px; margin-bottom: 4px; }
.info-item label svg { width: 13px; height: 13px; }
.info-item span { font-size: 13px; }

/* --- Misc utilities --- */
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; }
.empty-state { text-align: center; padding: 60px 24px; color: var(--text-muted); }
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 16px; opacity: .2; }
.empty-state h3 { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid transparent;
}

/* --- App footer (legal links) --- */
.app-footer {
  margin-top: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 24px;
  padding: 16px 40px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  color: var(--text-muted);
}
.app-footer-links { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.app-footer a { color: var(--text-muted); }
.app-footer a:hover { color: var(--primary); text-decoration: underline; }
@media (max-width: 768px) { .app-footer { padding: 14px 20px; justify-content: center; text-align: center; } }

.footer-cookie-btn { background: none; border: none; padding: 0; font: inherit; color: var(--text-muted); cursor: pointer; }
.footer-cookie-btn:hover { color: var(--primary); text-decoration: underline; }

/* --- Cookie consent banner --- */
#cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 300; transform: translateY(100%); transition: transform .3s ease; }
#cookie-banner.open { transform: translateY(0); }
.cookie-banner-inner { max-width: 900px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-bottom: none; border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: var(--shadow-lg); padding: 20px 24px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.cookie-banner-text { flex: 1; min-width: 240px; color: var(--text-muted); font-size: 13px; line-height: 1.5; margin: 0; }
.cookie-banner-text a { color: var(--primary); text-decoration: underline; }
.cookie-banner-actions { display: flex; gap: 10px; flex-shrink: 0; }
@media (max-width: 480px) {
  .cookie-banner-inner { flex-direction: column; align-items: stretch; }
  .cookie-banner-text { min-width: 0; }
  .cookie-banner-actions { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { #cookie-banner { transition: none; } }

/* --- Login page --- */
.login-wrap { display: flex; min-height: 100vh; }
.login-left {
  flex: 0 0 50%;
  background: #0f172a;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  position: relative;
  overflow: hidden;
}
.login-left::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: hsl(189 72% 37% / 0.10);
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
}
.login-left::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: rgba(20,184,166,.08);
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
}
.login-tagline { position: relative; z-index: 1; }
.login-tagline h1 {
  font-size: clamp(28px,4vw,40px);
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin-bottom: 16px;
}
.login-tagline h1 span { color: hsl(189 72% 50%); }
.login-tagline p { color: #94a3b8; font-size: 16px; max-width: 340px; line-height: 1.65; }
.login-features { margin-top: 28px; display: flex; flex-direction: column; gap: 12px; }
.login-feature { display: flex; align-items: center; gap: 12px; color: #cbd5e1; font-size: 13px; }
.login-feature svg { color: hsl(189 72% 50%); flex-shrink: 0; width: 18px; height: 18px; }
.login-copyright { color: #334155; font-size: 12px; position: relative; z-index: 1; }
.login-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--bg);
}
.login-form-box { width: 100%; max-width: 360px; }
.login-form-box h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 4px;
}
.login-form-box .sub { font-size: 13px; color: var(--text-muted); margin-bottom: 28px; }
.link-primary { color: var(--primary); }
.link-primary:hover { text-decoration: underline; }
.link-primary-bold { color: var(--primary); font-weight: 600; }
.link-primary-bold:hover { text-decoration: underline; }
.login-options-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; font-size: 13px; }
.login-remember { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.login-remember input[type="checkbox"] { accent-color: var(--primary); width: 15px; height: 15px; cursor: pointer; }
.terms-label { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; margin-bottom: 24px; font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.terms-checkbox { accent-color: var(--primary); width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; cursor: pointer; }
.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.role-card {
  padding: 18px;
  border-radius: var(--radius-xl);
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: all .15s ease;
}
.role-card:hover { border-color: hsl(189 72% 37% / 0.4); box-shadow: var(--shadow-sm); }
.role-card.selected {
  border-color: var(--primary);
  background: var(--primary-faint);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.role-card-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--sidebar-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}
.role-card.selected .role-card-icon { background: hsl(189 72% 37% / 0.12); }
.role-card-title { font-size: 13px; font-weight: 600; }
.role-card.selected .role-card-title { color: var(--primary); }
.role-card-sub { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.demo-box {
  background: var(--sidebar-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 18px;
  font-size: 12px;
  color: var(--text-muted);
}
.demo-box strong { color: var(--text); }
.login-switch-text { text-align: center; font-size: 13px; margin-top: 24px; }
.login-fineprint { text-align: center; font-size: 11px; color: var(--text-muted); margin-top: 16px; }
.login-legal { text-align: center; font-size: 11px; color: var(--text-muted); margin-top: 8px; }
.login-legal a { color: var(--text-muted); }
.login-legal a:hover { color: var(--primary); text-decoration: underline; }
@media(max-width: 768px) { .login-left { display: none; } .login-right { padding: 24px; } }

/* --- Registrierung: Schritt-für-Schritt-Wizard --- */
.reg-steps { display: flex; align-items: center; margin-bottom: 26px; }
.reg-step-dot {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  background: var(--sidebar-hover); border: 1px solid var(--border);
  transition: all var(--transition);
}
.reg-step-dot.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.reg-step-dot.done { background: var(--primary-faint); border-color: var(--primary); color: var(--primary); }
.reg-step-dot.done span { display: none; }
.reg-step-dot.done::after { content: "✓"; }
.reg-step-line { flex: 1; height: 2px; background: var(--border); margin: 0 6px; transition: background var(--transition); }
.reg-step-line.done { background: var(--primary); }

.reg-step { display: none; }
.reg-step.active { display: block; }
.reg-step-title { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 16px; }
.reg-step-nav { display: flex; gap: 10px; }
.reg-step-nav .btn-outline { flex-shrink: 0; }
.reg-step-nav .btn-full { flex: 1; }

/* --- Produktverwaltung --- */
.prod-row { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; margin-bottom: 10px; transition: box-shadow .15s; }
.prod-row:hover { box-shadow: 0 2px 8px rgba(0,0,0,.07); }
.prod-row.expanded { box-shadow: 0 0 0 2px var(--primary); border-color: var(--primary); }
.prod-row-head { display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer; }
.prod-row-name { flex: 1; min-width: 0; }
.prod-row-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.prod-row-sub { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-row-price { font-size: 13px; font-weight: 600; min-width: 90px; text-align: right; }
.prod-row-count { display: flex; flex-direction: column; align-items: center; min-width: 56px; }
.prod-row-count .big { font-size: 18px; font-weight: 700; color: var(--primary); }
.prod-row-count .small { font-size: 10px; color: var(--text-muted); }
.prod-edit-panel { border-top: 1px solid var(--border); background: var(--bg); padding: 16px; display: none; }
.prod-row.expanded .prod-edit-panel { display: block; }
.prod-edit-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.prod-edit-panel-title { font-size: 13px; font-weight: 600; }

/* --- Benutzerrollen --- */
.dsgvo-box { background: #fef9c3; border: 1px solid #fde68a; border-radius: 7px; padding: 10px 12px; margin-bottom: 12px; }
.dsgvo-label { font-size: 11px; font-weight: 700; color: #92400e; margin-bottom: 2px; text-transform: uppercase; letter-spacing: .04em; }
.dsgvo-text { font-size: 12px; color: #a16207; line-height: 1.4; }
.perm-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.perm-chip { font-size: 11px; padding: 2px 9px; border-radius: 99px; border: 1px solid; font-weight: 600; }
.perm-chip.granted { background: var(--primary-faint); color: var(--primary); border-color: color-mix(in srgb, var(--primary) 25%, transparent); }
.perm-chip.denied { background: var(--bg); color: var(--text-muted); border-color: var(--border); text-decoration: line-through; opacity: .5; }
.perm-label { font-size: 11px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.cb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.cb-item { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.cb-item input[type=checkbox], .cb-item input[type=radio] { accent-color: var(--primary); width: 14px; height: 14px; }
.cb-item label { font-size: 13px; color: var(--text-muted); cursor: pointer; }
.role-card-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.role-icon { width: 36px; height: 36px; border-radius: 9px; background: var(--primary-faint); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.role-icon svg { width: 18px; height: 18px; color: var(--primary); }
.role-title { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.role-sub { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.role-edit-btn { opacity: 0; transition: opacity .15s; }
.role-card:hover .role-edit-btn { opacity: 1; }

/* --- Stat card --- */
.stat-card { padding: 22px; }
.stat-card .label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.stat-card .value { font-size: 32px; font-weight: 700; line-height: 1; letter-spacing: -0.03em; }
.stat-card .sub { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* --- System status dots (like TSX Dashboard) --- */
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.status-dot.ok { background: #22c55e; }
.status-dot.err { background: #ef4444; }

/* ============================================================
   UTILITY CLASSES — no inline style="" allowed anywhere
   ============================================================ */

/* Text colours */
.text-muted     { color: var(--text-muted); }
.text-primary   { color: var(--primary); }
.text-red       { color: #ef4444; }
.text-red-dark  { color: #dc2626; }
.text-blue      { color: #3b82f6; }

/* Font sizes */
.text-xs        { font-size: 11px; }
.text-sm        { font-size: 13px; }
.text-md        { font-size: 14px; }
.text-xs-muted  { font-size: 11px; color: var(--text-muted); }
.text-sm-muted  { font-size: 13px; color: var(--text-muted); }

/* Font weights */
.fw-medium      { font-weight: 500; }
.fw-semibold    { font-weight: 600; }
.fw-bold        { font-weight: 700; }

/* Text misc */
.text-right     { text-align: right; }
.text-center    { text-align: center; }
.nowrap         { white-space: nowrap; }
.font-mono      { font-family: monospace; }

/* Spacing — margin-top */
.mt-2           { margin-top: 2px; }
.mt-3           { margin-top: 3px; }
.mt-4           { margin-top: 4px; }

/* Spacing — margin-bottom */
.mb-0           { margin-bottom: 0; }
.mb-2           { margin-bottom: 2px; }
.mb-3           { margin-bottom: 3px; }
.mb-14          { margin-bottom: 14px; }
.mb-16          { margin-bottom: 16px; }
.mb-20          { margin-bottom: 20px; }
.mb-22          { margin-bottom: 22px; }
.p-20           { padding: 20px; }

/* Flex helpers */
.row            { display: flex; align-items: center; }
.row-6          { display: flex; align-items: center; gap: 6px; }
.row-8          { display: flex; align-items: center; gap: 8px; }
.row-10         { display: flex; align-items: center; gap: 10px; }
.row-12         { display: flex; align-items: center; gap: 12px; }
.col-3          { display: flex; flex-direction: column; gap: 3px; }
.flex-1         { flex: 1; }
.flex-shrink-0  { flex-shrink: 0; }
.items-start    { align-items: flex-start !important; }
.items-end      { align-items: flex-end !important; }
.row-sep        { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.sidebar-notif-label { display: flex; align-items: center; gap: 8px; }

/* Grid */
.grid-2-sm      { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3         { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }

/* Table cell presets */
.cell-num       { font-weight: 600; color: var(--text-muted); }
.cell-subject   { font-weight: 500; max-width: 260px; }
.cell-date      { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.cell-meta      { color: var(--text-muted); font-size: 12px; }

/* Status dot colours (used inside badges) */
.dot-red        { background: #ef4444; }
.dot-green      { background: #22c55e; }
.dot-blue       { background: #3b82f6; }
.dot-amber      { background: #f59e0b; }

/* Avatar colour variants */
.av-teal        { background: #1a8fa3; }
.av-purple      { background: #7c3aed; }
.av-teal-d      { background: #0f766e; }
.av-orange      { background: #c2410c; }
.av-blue        { background: #3b82f6; }
.av-green       { background: #16a34a; }
.av-slate       { background: #64748b; }

/* Icon wrapper shapes */
.icon-circle    { width: 26px; height: 26px; border-radius: 50%; background: var(--sidebar-hover); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-circle-md { width: 28px; height: 28px; border-radius: 50%; background: var(--sidebar-hover); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-box       { width: 36px; height: 36px; border-radius: var(--radius); background: var(--primary-faint); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Label above a value */
.meta-label     { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 3px; }
.label-primary  { font-weight: 600; font-size: 14px; color: var(--primary); }

/* Badge size override */
.badge-xs       { font-size: 10px !important; padding: 1px 6px !important; }

/* More dot/avatar colours */
.dot-slate      { background: #94a3b8; }
.av-pink        { background: #db2777; }
.av-amber-d     { background: #b45309; }

/* Avatar colour picker (Profil) */
.color-picker { display: flex; flex-wrap: wrap; gap: 10px; }
.color-swatch-label { position: relative; cursor: pointer; line-height: 0; }
.color-swatch-label input { position: absolute; opacity: 0; width: 0; height: 0; }
.color-swatch { display: block; width: 30px; height: 30px; border-radius: 50%; transition: transform .15s ease, box-shadow .15s ease; }
.color-swatch-label:hover .color-swatch { transform: scale(1.1); }
.color-swatch-label input:checked + .color-swatch { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary); }

/* More text colours */
.text-green     { color: #22c55e; }
.text-orange    { color: #f97316; }
.text-default   { color: var(--text); }

/* More flex / column helpers */
.flex-col       { display: flex; flex-direction: column; }
.col-6          { display: flex; flex-direction: column; gap: 6px; }
.col-12         { display: flex; flex-direction: column; gap: 12px; }
.col-14         { display: flex; flex-direction: column; gap: 14px; }
.col-16         { display: flex; flex-direction: column; gap: 16px; }
.irow-8         { display: inline-flex; align-items: center; gap: 8px; }
.row-8-start    { display: flex; align-items: flex-start; gap: 8px; }
.self-end       { align-self: flex-end; }
.overflow-hidden { overflow: hidden; }

/* More spacing */
.mt-6           { margin-top: 6px; }
.mt-20          { margin-top: 20px; }
.mb-6           { margin-bottom: 6px; }
.mb-8           { margin-bottom: 8px; }
.mb-12          { margin-bottom: 12px; }
.max-800        { max-width: 800px; }

/* Dividers */
.divider        { height: 1px; background: var(--border); }
.divider-12     { height: 1px; background: var(--border); margin: 12px 0; }

/* Textarea resize variants */
.textarea-fixed { min-height: 72px; resize: none; }

/* Stat/summary grid */
.summary-grid   { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; margin-bottom: 24px; }
.stat-label     { font-size: 13px; font-weight: 500; color: var(--text-muted); margin-bottom: 8px; }
.stat-value-red { font-size: 30px; font-weight: 700; color: #dc2626; letter-spacing: -0.03em; }

/* Ticket layout */
.ticket-layout  { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }

/* Meta label with larger bottom margin */
.meta-label-6   { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }

/* More spacing */
.mb-24          { margin-bottom: 24px; }
.mb-6           { margin-bottom: 6px; }
.col-10         { display: flex; flex-direction: column; gap: 10px; }

/* Display */
.block          { display: block; }
.w-full         { width: 100%; }

/* Row between (space-between) */
.row-between              { display: flex; justify-content: space-between; }
.row-between-center-mb16  { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.row-between-start-mb12   { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }

/* Grid variants */
.grid-3-14      { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 20px; }
.grid-4-sm      { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; font-size: 12px; }

/* KPI / heading sizes */
.kpi-num        { font-size: 22px; font-weight: 700; }
.heading-sm     { font-size: 15px; font-weight: 600; }

/* Tiny muted text */
.text-2xs-muted { font-size: 10px; color: var(--text-muted); }
.unit-label     { font-size: 11px; font-weight: 400; color: var(--text-muted); }

/* Timer layout */
.timer-actions  { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }

/* Chart grid layout */
.chart-grid         { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.chart-title        { font-size: 14px; font-weight: 600; color: var(--text); }
.chart-wrap         { overflow: hidden; }
.chart-cols         { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding: 0 4px; }
.chart-col          { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.chart-bar          { width: 100%; border-radius: 4px 4px 0 0; flex-shrink: 0; }
.chart-xlabel       { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.bar-group          { display: flex; align-items: flex-end; gap: 3px; width: 100%; }
.bar-group-bar      { flex: 1; border-radius: 3px 3px 0 0; }

/* Chart legend */
.chart-legend        { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 11px; color: var(--text-muted); }
.chart-legend-multi  { display: flex; align-items: center; gap: 16px; margin-top: 8px; font-size: 11px; color: var(--text-muted); }
.legend-swatch       { display: inline-block; width: 12px; height: 3px; border-radius: 2px; flex-shrink: 0; }
.legend-swatch-primary { background: var(--primary); }
.legend-swatch-dark    { background: hsl(222 47% 30%); }

/* Chart bar colours */
.bar-primary    { background: var(--primary); opacity: 0.85; }
.bar-primary-s  { background: var(--primary); }
.bar-dark       { background: hsl(222 47% 30%); }

/* Chart bar heights (data-driven static values) */
.h-69  { height: 69px; }
.h-86  { height: 86px; }
.h-90  { height: 90px; }
.h-95  { height: 95px; }
.h-104 { height: 104px; }
.h-114 { height: 114px; }
.h-121 { height: 121px; }
.h-130 { height: 130px; }
.h-132 { height: 132px; }
.h-143 { height: 143px; }
.h-155 { height: 155px; }
.h-164 { height: 164px; }
.h-166 { height: 166px; }
.h-173 { height: 173px; }
.h-190 { height: 190px; }

/* Dashboard stat-icon colour variants */
.stat-icon-orange  { background: #fff7ed; border-color: #fed7aa; }
.stat-icon-green   { background: #f0fdf4; border-color: #bbf7d0; }
.stat-icon-red     { background: #fff1f2; border-color: #fda4af; }
.stat-icon-primary { background: var(--primary-faint); border-color: var(--primary-ring); }

/* More text colours */
.text-orange-d  { color: #ea580c; }
.text-green-d   { color: #16a34a; }
.text-rose      { color: #e11d48; }
.text-amber     { color: #f59e0b; }
.text-violet    { color: #8b5cf6; }

/* Dashboard main grid */
.grid-2-1       { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }

/* Dashboard status footer */
.status-footer  { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-top: 12px; }

/* Settings layout */
.col-20         { display: flex; flex-direction: column; gap: 20px; }
.card-header-col { flex-direction: column; align-items: flex-start; gap: 2px; }
.grid-2-16      { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.w-120          { width: 120px; }
.label-sm       { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.flex-end       { display: flex; justify-content: flex-end; }

/* Kalender legend */
.cal-legend      { display: flex; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.cal-legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.cal-dot-blue    { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: hsl(217 91% 60% / .3); flex-shrink: 0; }
.cal-dot-purple  { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: hsl(270 70% 55% / .3); flex-shrink: 0; }
.cal-dot-orange  { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: hsl(32 95% 44% / .3); flex-shrink: 0; }

/* Divider with 14px margin */
.divider-14     { height: 1px; background: var(--border); margin: 14px 0; }

/* Grid span */
.col-span-full  { grid-column: 1 / -1; }

/* Autocomplete */
.ac-wrap        { position: relative; width: 100%; }
.ac-wrap input  { width: 100%; }
.ac-list        { position: absolute; top: calc(100% + 4px); left: 0; right: 0; list-style: none; margin: 0; padding: 4px 0;
                  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
                  box-shadow: 0 6px 20px rgba(0,0,0,.10); z-index: 300; max-height: 220px; overflow-y: auto; }
.ac-list[hidden] { display: none; }
.ac-list li     { padding: 8px 14px; font-size: 14px; cursor: pointer; color: var(--text); border-radius: 5px; margin: 2px 4px; }
.ac-list li:hover,
.ac-list li.ac-hi { background: var(--primary-faint); color: var(--primary); }

/* --- Dashboard hero: greeting + quick-start search + action pills --- */
.hero-box {
  background: linear-gradient(135deg, hsl(var(--primary-hsl) / .16), hsl(var(--primary-hsl) / .04));
  border: 1px solid var(--primary-ring);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  margin-bottom: 24px;
  text-align: center;
}
.hero-title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 20px; }
.hero-search {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 560px;
  margin: 0 auto 18px;
  padding: 12px 10px 12px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.hero-search input { flex: 1; border: 0; background: none; font: inherit; font-size: 14px; color: var(--text); outline: none; }
.hero-search input::placeholder { color: var(--text-subtle); }
.hero-search-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: var(--primary);
  color: var(--primary-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity .15s ease;
}
.hero-search-btn:hover { opacity: .85; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  transition: all .15s ease;
}
.hero-pill:hover { border-color: var(--primary-ring); color: var(--primary); }
.hero-pill svg { width: 14px; height: 14px; opacity: .7; }

/* --- Toasts: temporary alerts, bottom-right, auto-dismiss --- */
.toast-viewport {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 500;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  max-width: 360px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  color: var(--text);
  pointer-events: auto;
  animation: toastIn .25s cubic-bezier(.22,1,.36,1);
}
.toast.closing { animation: toastOut .2s ease forwards; }
.toast.success { border-left-color: #22c55e; }
.toast.error   { border-left-color: #ef4444; }
.toast.warning { border-left-color: #f59e0b; }
.toast.info    { border-left-color: #3b82f6; }
.toast-icon { flex-shrink: 0; margin-top: 1px; }
.toast.success .toast-icon { color: #22c55e; }
.toast.error   .toast-icon { color: #ef4444; }
.toast.warning .toast-icon { color: #f59e0b; }
.toast.info    .toast-icon { color: #3b82f6; }
.toast-message { flex: 1; line-height: 1.4; }
.toast-close { flex-shrink: 0; color: var(--text-subtle); line-height: 0; cursor: pointer; }
.toast-close:hover { color: var(--text); }
@keyframes toastIn { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes toastOut { from { transform: translateY(0); opacity: 1; } to { transform: translateY(8px); opacity: 0; } }
@media (max-width: 480px) {
  .toast-viewport { left: 16px; right: 16px; max-width: none; }
}

/* --- Freundlicher Hinweis-Banner (z.B. "Daten ergaenzen", dashboard.php) --- */
.hint-banner { border-color: var(--primary); background: hsla(189, 72%, 45%, .07); }
.hint-banner-text { font-size: 13px; color: var(--primary); }
.hint-banner-link { font-weight: 600; text-decoration: underline; color: inherit; }

/* --- Profil-Seite (profile.php): statische Zusammenfassungskarte oben, Formulare direkt editierbar --- */
.profile-summary-card { text-align: center; }
.profile-summary-card .avatar { margin: 0 auto 14px; }
.profile-summary-name { font-size: 20px; font-weight: 700; }
.profile-summary-email { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.profile-summary-badges { display: flex; gap: 6px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.profile-summary-created { font-size: 12px; color: var(--text-muted); margin-top: 12px; }
.profile-summary-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border);
  border-top: 1px solid var(--border); margin: 16px -22px -22px; border-radius: 0 0 var(--radius-lg) var(--radius-lg); overflow: hidden;
}
.profile-summary-stat { background: var(--surface); padding: 14px 8px; }
.profile-summary-stat .value { font-size: 18px; font-weight: 700; }
.profile-summary-stat .label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* --- Dokumentvorlagen-Editor (document_view.php): reines HTML-Textfeld, kein
   Block-/Drag-and-Drop-Editor mehr --- */
.doc-hint { font-size: 12px; color: var(--text-muted); margin: 10px 0; }

.email-editor-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.email-editor-body {
  min-height: 360px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: #111;
  font-size: 14px;
  line-height: 1.5;
}
.email-editor-body:focus { outline: none; box-shadow: 0 0 0 1px var(--primary); }

/* --- Team-Reihenfolge (Drag-and-Drop-Reorder, staff.php) --- */
.staff-order-list { display: flex; flex-direction: column; gap: 6px; }
.staff-order-item {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 8px 12px;
}
.staff-order-item.dragging { opacity: .4; }
.staff-order-item.drag-over { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.staff-order-drag { color: var(--text-muted); cursor: grab; flex-shrink: 0; display: flex; }
.staff-order-drag:active { cursor: grabbing; }
.staff-order-name { font-weight: 600; font-size: 13px; flex: 1; }

/* --- Mobile Responsive (<=768px): off-canvas sidebar, single-column layouts --- */
.topbar-hamburger { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 768px) {
  .topbar-hamburger { display: flex; }

  #app { position: relative; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 300;
    box-shadow: var(--shadow-xl);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.45);
    z-index: 290;
  }
  .sidebar-backdrop.open { display: block; }

  .page { padding: 20px 16px; }
  .topbar { padding: 10px 14px; gap: 10px; }
  .topbar-search-form { max-width: none; }
  .topbar-profile-name { display: none; }

  .page-header { flex-wrap: wrap; }
  .grid-2-1 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .info-grid { grid-template-columns: 1fr; }

  .modal-overlay { padding: 12px; }
  .modal-box { max-height: 95vh; }
}

@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
}
