/* =========================================================
   Teamwerk Vertragsmanagement — Redesign
   Modernes, professionelles SaaS UI — auf Teamwerk-Brand aufbauend
   ========================================================= */

:root {
  /* Brand */
  --brand-blue: #0E4E81;
  --brand-blue-600: #0a3d66;
  --brand-blue-50: #e8f0f7;
  --brand-green: #078562;
  --brand-green-50: #e5f4ef;

  /* Neutrals — cool, professional */
  --n-0:  #ffffff;
  --n-25: #fafbfc;
  --n-50: #f4f6f8;
  --n-100: #edeff2;
  --n-150: #e3e6ea;
  --n-200: #d6dadf;
  --n-300: #b8bec6;
  --n-400: #8a919b;
  --n-500: #6b727c;
  --n-600: #4f555d;
  --n-700: #373c42;
  --n-800: #24282d;
  --n-900: #16191d;

  /* Semantic */
  --success: #078562;
  --success-bg: #e5f4ef;
  --warning: #c97a0d;
  --warning-bg: #fdf3e3;
  --danger: #b4351f;
  --danger-bg: #fbe9e4;
  --info: #0E4E81;
  --info-bg: #e8f0f7;

  /* Typo scale */
  --ff-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ff-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ff-display: 'Inter', -apple-system, sans-serif;

  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-md: 13px;
  --fs-base: 15px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 28px;
  --fs-3xl: 36px;
  --fs-4xl: 48px;

  /* Spacing */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  --sh-sm: 0 1px 2px rgba(20,25,33,0.06);
  --sh-md: 0 2px 6px rgba(20,25,33,0.06), 0 1px 2px rgba(20,25,33,0.04);
  --sh-lg: 0 10px 30px rgba(20,25,33,0.08), 0 2px 6px rgba(20,25,33,0.05);

  /* Layout */
  --sidebar-w: 260px;
  --header-h: 60px;
  --container-max: 1600px;
}

/* ========================================================= */
/* VARIANTE 2 — MUTIG: Editorial, große Typo, Serif-Akzent    */
/* ========================================================= */
.variant-bold {
  --ff-display: 'Fraunces', 'Canela', Georgia, serif;
  --fs-3xl: 44px;
  --fs-4xl: 64px;
  --n-25: #faf8f3;
  --n-50: #f2efe7;
  --brand-blue: #0E4E81;
}
.variant-bold .v-display {
  font-family: var(--ff-display);
  font-weight: 400;
  letter-spacing: -0.02em;
}

/* ========================================================= */
/* VARIANTE 3 — EXPERIMENTELL: dense, mono, technisch         */
/* ========================================================= */
.variant-dense {
  --fs-base: 13px;
  --fs-md: 12px;
  --fs-sm: 11px;
  --n-25: #0f1115;
  --n-50: #16191d;
  --n-100: #1c2026;
  --n-150: #24292f;
  --n-200: #2e333a;
  --n-300: #3e454d;
  --n-400: #6b727c;
  --n-500: #8a919b;
  --n-600: #b8bec6;
  --n-700: #d6dadf;
  --n-800: #edeff2;
  --n-900: #fafbfc;
  --n-0: #0a0c0f;
  --brand-blue: #5ba3e6;
  --brand-blue-50: rgba(91,163,230,0.12);
  --brand-green: #4ed1a4;
  --brand-green-50: rgba(78,209,164,0.12);
  --success: #4ed1a4;
  --success-bg: rgba(78,209,164,0.12);
  --warning: #e8b65c;
  --warning-bg: rgba(232,182,92,0.12);
  --danger: #e8796b;
  --danger-bg: rgba(232,121,107,0.12);
  --sh-sm: 0 0 0 1px rgba(255,255,255,0.04);
  --sh-md: 0 0 0 1px rgba(255,255,255,0.06);
  --sh-lg: 0 0 0 1px rgba(255,255,255,0.08);
}
.variant-dense body { background: var(--n-25); }
.variant-dense .ticker { font-family: var(--ff-mono); text-transform: uppercase; letter-spacing: 0.06em; }

/* ========================================================= */
/* GLOBAL                                                      */
/* ========================================================= */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--ff-sans);
  font-size: var(--fs-base);
  color: var(--n-800);
  background: var(--n-25);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: var(--brand-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--ff-mono); font-size: 0.92em; }

.mono { font-family: var(--ff-mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ========================================================= */
/* APP LAYOUT                                                  */
/* ========================================================= */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--n-0);
  border-right: 1px solid var(--n-150);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--n-100);
}
.sidebar-brand img { height: 24px; display: block; }
.sidebar-brand-text {
  font-weight: 600;
  font-size: var(--fs-md);
  color: var(--n-800);
  line-height: 1.1;
}
.sidebar-brand-text small {
  display: block;
  font-weight: 400;
  font-size: var(--fs-xs);
  color: var(--n-500);
}

.sidebar-search {
  padding: 12px 14px;
  position: relative;
}
.sidebar-search input {
  width: 100%;
  padding: 7px 10px 7px 30px;
  border: 1px solid var(--n-150);
  border-radius: var(--r-sm);
  background: var(--n-25);
  font-size: var(--fs-md);
  color: var(--n-800);
  outline: none;
  transition: border-color 0.12s;
}
.sidebar-search input:focus { border-color: var(--brand-blue); background: var(--n-0); }
.sidebar-search svg {
  position: absolute;
  left: 24px;
  top: 19px;
  color: var(--n-400);
}
.sidebar-search kbd {
  position: absolute;
  right: 22px;
  top: 18px;
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--n-400);
  background: var(--n-50);
  border: 1px solid var(--n-150);
  border-radius: 3px;
  padding: 1px 4px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px 12px;
}
.sidebar-section {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--n-400);
  padding: 14px 8px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: var(--r-sm);
  color: var(--n-700);
  font-size: var(--fs-md);
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s, color 0.1s;
}
.nav-item:hover { background: var(--n-50); color: var(--n-800); }
.nav-item.active { background: var(--brand-blue-50); color: var(--brand-blue); font-weight: 600; }
.nav-item svg { flex: 0 0 16px; color: currentColor; opacity: 0.82; }
.nav-item .count {
  margin-left: auto;
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  color: var(--n-400);
  font-weight: 400;
}
.nav-item.active .count { color: var(--brand-blue); }

.nav-sub {
  padding-left: 10px;
  border-left: 1px solid var(--n-100);
  margin: 2px 0 6px 15px;
}
.nav-sub .nav-item {
  padding: 5px 8px;
  font-weight: 400;
  font-size: var(--fs-md);
  color: var(--n-600);
}
.nav-sub .nav-item.active { background: transparent; color: var(--brand-blue); font-weight: 600; }
.nav-sub .nav-item.active::before {
  content: '';
  position: absolute;
  margin-left: -11px;
  width: 2px;
  height: 16px;
  background: var(--brand-blue);
}
.nav-sub .nav-item { position: relative; }

/* Expandierbare Kategorien (UX-Polish P3, 2026-05-07) */
.sidebar-kategorie {
  margin: 0;
}
.sidebar-kategorie > summary {
  list-style: none;        /* Default-Marker (Firefox) verstecken */
  cursor: pointer;
  position: relative;
}
.sidebar-kategorie > summary::-webkit-details-marker {
  display: none;           /* Default-Marker (Chrome/Safari) verstecken */
}
/* Eigener Pfeil-Marker — klein, dezent, dreht beim Aufklappen */
.sidebar-kategorie > summary::after {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--n-400);
  border-bottom: 1.5px solid var(--n-400);
  transform: rotate(-45deg);    /* zu: zeigt nach rechts */
  transition: transform 0.15s ease;
  margin-left: 6px;
  flex: 0 0 auto;
  opacity: 0.7;
}
.sidebar-kategorie[open] > summary::after {
  transform: rotate(45deg);     /* offen: zeigt nach unten */
}
.sidebar-kategorie > summary .kat-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Sub-Liste: Listen-Defaults entfernen, Verträge eingerückt */
.sidebar-vertraege {
  list-style: none;
  padding: 0;
  margin: 2px 0 4px 15px;
}
.sidebar-vertraege li { margin: 0; }
.sidebar-vertraege .nav-item {
  padding: 4px 8px;
  font-weight: 400;
  font-size: var(--fs-md);
  color: var(--n-600);
  text-decoration: none;
}
.sidebar-vertraege .nav-item:hover {
  background: var(--n-50);
  color: var(--n-800);
}
.sidebar-vertraege .nav-item.active {
  background: var(--brand-blue-50);
  color: var(--brand-blue);
  font-weight: 600;
}
.sidebar-vertraege .vertrag-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  max-width: 100%;
}
.sidebar-vertraege .nav-item-alle {
  font-style: italic;
  color: var(--n-500);
  font-size: var(--fs-xs);
}

.sidebar-user {
  border-top: 1px solid var(--n-100);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-blue);
  color: white;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: var(--fs-md); font-weight: 600; color: var(--n-800); line-height: 1.2; }
.sidebar-user-meta { font-size: var(--fs-xs); color: var(--n-500); line-height: 1.3; }

/* ========================================================= */
/* MAIN CONTENT                                                */
/* ========================================================= */
.main {
  background: var(--n-25);
  min-width: 0;
}
.topbar {
  height: var(--header-h);
  border-bottom: 1px solid var(--n-150);
  background: var(--n-0);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-md);
  color: var(--n-500);
}
.breadcrumb a { color: var(--n-500); }
.breadcrumb a:hover { color: var(--n-800); text-decoration: none; }
.breadcrumb .sep { color: var(--n-300); }
.breadcrumb .current { color: var(--n-800); font-weight: 500; }
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.content {
  padding: 28px 32px 60px;
  max-width: var(--container-max);
}

/* ========================================================= */
/* BUTTONS                                                     */
/* ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: var(--fs-md);
  font-weight: 500;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  transition: background 0.12s, border 0.12s, color 0.12s, box-shadow 0.12s;
  white-space: nowrap;
  line-height: 1.3;
}
.btn:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 1px; }
.btn-primary { background: var(--brand-blue); color: white; }
.btn-primary:hover { background: var(--brand-blue-600); }
.btn-secondary { background: var(--n-0); color: var(--n-800); border-color: var(--n-200); }
.btn-secondary:hover { background: var(--n-50); border-color: var(--n-300); }
.btn-ghost { background: transparent; color: var(--n-700); }
.btn-ghost:hover { background: var(--n-100); }
.btn-success { background: var(--brand-green); color: white; }
.btn-success:hover { background: #066b4f; }
.btn-danger-ghost { background: transparent; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-bg); }
.btn-sm { padding: 4px 9px; font-size: var(--fs-sm); }
.btn-icon {
  padding: 6px;
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
}

/* ========================================================= */
/* CARDS / PANELS                                              */
/* ========================================================= */
.card {
  background: var(--n-0);
  border: 1px solid var(--n-150);
  border-radius: var(--r-md);
  box-shadow: var(--sh-sm);
}
.card-pad { padding: 20px; }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--n-100);
  font-weight: 600;
  font-size: var(--fs-base);
  color: var(--n-800);
}
.card-header .card-title-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.card-body { padding: 18px; }

.panel {
  background: var(--n-0);
  border: 1px solid var(--n-150);
  border-radius: var(--r-md);
}

/* ========================================================= */
/* STATUS DOT & CHIPS                                          */
/* ========================================================= */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 7px;
  border-radius: 999px;
  font-size: var(--fs-sm);
  font-weight: 500;
  background: var(--n-100);
  color: var(--n-700);
  line-height: 1.3;
}
.chip-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.chip-status-aktiv { background: var(--success-bg); color: var(--success); }
.chip-status-auslaufend { background: var(--warning-bg); color: var(--warning); }
.chip-status-ausgelaufen { background: var(--danger-bg); color: var(--danger); }
.chip-status-option_gezogen { background: var(--info-bg); color: var(--info); }

.chip-type {
  background: var(--n-50);
  color: var(--n-600);
  border: 1px solid var(--n-150);
  font-weight: 500;
}

/* ========================================================= */
/* TABLES                                                       */
/* ========================================================= */
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-md);
}
table.data th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--n-500);
  padding: 10px 14px;
  border-bottom: 1px solid var(--n-150);
  background: var(--n-25);
}
table.data td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--n-100);
  vertical-align: middle;
}
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--n-25); cursor: pointer; }
table.data tr.selected { background: var(--brand-blue-50); }

/* Dense variant: kompaktere Tabelle, Mono überall */
.variant-dense table.data th { font-family: var(--ff-mono); background: var(--n-50); color: var(--n-500); }
.variant-dense table.data td { padding: 8px 12px; border-color: var(--n-150); }

/* ========================================================= */
/* KPI TILES                                                   */
/* ========================================================= */
.kpi {
  background: var(--n-0);
  border: 1px solid var(--n-150);
  border-radius: var(--r-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--sh-sm);
}
.kpi-label {
  font-size: var(--fs-xs);
  color: var(--n-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.kpi-value {
  font-size: var(--fs-2xl);
  font-weight: 600;
  color: var(--n-900);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.kpi-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-xs);
  color: var(--n-500);
}
.kpi-trend-up { color: var(--success); }
.kpi-trend-down { color: var(--danger); }

.variant-bold .kpi-value { font-family: var(--ff-display); font-weight: 400; font-size: var(--fs-3xl); }

/* ========================================================= */
/* TIMELINE — Laufzeit-Visualisierung                          */
/* ========================================================= */
.timeline {
  position: relative;
  height: 40px;
  margin: 8px 0 16px;
}
.timeline-bar {
  position: absolute;
  top: 16px;
  left: 0;
  right: 0;
  height: 8px;
  background: var(--n-100);
  border-radius: 4px;
  overflow: hidden;
}
.timeline-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--brand-blue);
  border-radius: 4px 0 0 4px;
}
.timeline-fill.ok { background: var(--success); }
.timeline-fill.warn { background: var(--warning); }
.timeline-today {
  position: absolute;
  top: 10px;
  width: 2px;
  height: 20px;
  background: var(--n-900);
}
.timeline-today::after {
  content: 'heute';
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--n-700);
  font-weight: 600;
  white-space: nowrap;
}
.timeline-marker {
  position: absolute;
  top: 14px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--n-0);
  border: 2px solid var(--brand-blue);
  transform: translateX(-6px);
}
.timeline-marker.option { border-color: var(--warning); }
.timeline-marker-label {
  position: absolute;
  top: 30px;
  font-size: var(--fs-xs);
  color: var(--n-600);
  transform: translateX(-50%);
  white-space: nowrap;
}

/* ========================================================= */
/* TABS                                                        */
/* ========================================================= */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--n-150);
  margin-bottom: 20px;
}
.tab {
  padding: 10px 16px;
  font-size: var(--fs-md);
  font-weight: 500;
  color: var(--n-500);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: color 0.12s, border-color 0.12s;
}
.tab:hover { color: var(--n-800); }
.tab.active { color: var(--brand-blue); border-bottom-color: var(--brand-blue); font-weight: 600; }
.tab .tab-count {
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  color: var(--n-400);
  background: var(--n-100);
  padding: 1px 6px;
  border-radius: 3px;
}
.tab.active .tab-count { color: var(--brand-blue); background: var(--brand-blue-50); }

/* ========================================================= */
/* FORMS                                                       */
/* ========================================================= */
.input, .select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--n-200);
  border-radius: var(--r-sm);
  font-size: var(--fs-md);
  color: var(--n-800);
  background: var(--n-0);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.input:focus, .select:focus { border-color: var(--brand-blue); box-shadow: 0 0 0 3px var(--brand-blue-50); }
.input-sm { padding: 4px 8px; font-size: var(--fs-sm); }
.label-sm {
  display: block;
  font-size: var(--fs-xs);
  color: var(--n-500);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

/* ========================================================= */
/* SLIDER — für PGK-Simulator                                  */
/* ========================================================= */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--n-150);
  border-radius: 2px;
  outline: none;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--brand-blue);
  cursor: pointer;
  border: 2px solid var(--n-0);
  box-shadow: 0 0 0 1px var(--n-200);
}
.slider::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--brand-blue);
  cursor: pointer;
  border: 2px solid var(--n-0);
  box-shadow: 0 0 0 1px var(--n-200);
}

/* ========================================================= */
/* HIGHLIGHT BOXES                                             */
/* ========================================================= */
.callout {
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-size: var(--fs-md);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.callout-info { background: var(--brand-blue-50); color: var(--brand-blue); }
.callout-warn { background: var(--warning-bg); color: var(--warning); }
.callout-success { background: var(--success-bg); color: var(--success); }
.callout-danger { background: var(--danger-bg); color: var(--danger); }
.callout svg { flex-shrink: 0; margin-top: 1px; }
.callout strong { color: inherit; font-weight: 600; }

/* ========================================================= */
/* TIMELINE / TERMINE                                          */
/* ========================================================= */
.termin-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--n-100);
  align-items: center;
}
.termin-row:last-child { border-bottom: none; }
.termin-datum {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--n-800);
  font-size: var(--fs-md);
  line-height: 1.1;
}
.termin-datum small {
  display: block;
  font-weight: 400;
  font-size: 10px;
  color: var(--n-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}
.termin-title { font-size: var(--fs-md); color: var(--n-800); }
.termin-sub { font-size: var(--fs-xs); color: var(--n-500); margin-top: 2px; }

/* Dot for termin type */
.termin-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: middle;
}
.termin-dot-optionsfrist { background: var(--warning); }
.termin-dot-vertragsende { background: var(--danger); }
.termin-dot-index_update { background: var(--brand-green); }
.termin-dot-custom { background: var(--brand-blue); }

/* ========================================================= */
/* TWEAK PANEL                                                 */
/* ========================================================= */
.tweaks-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--n-0);
  border: 1px solid var(--n-200);
  border-radius: var(--r-md);
  box-shadow: var(--sh-lg);
  padding: 14px 16px;
  font-size: var(--fs-md);
  z-index: 100;
  min-width: 240px;
  display: none;
}
.tweaks-panel.visible { display: block; }
.tweaks-panel h4 {
  margin: 0 0 10px;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--n-500);
  font-weight: 600;
}
.tweak-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.tweak-row:last-child { margin-bottom: 0; }
.tweak-row label { font-size: var(--fs-sm); color: var(--n-600); font-weight: 500; }

.segmented {
  display: inline-flex;
  background: var(--n-100);
  border-radius: var(--r-sm);
  padding: 2px;
  gap: 2px;
}
.segmented button {
  padding: 5px 10px;
  font-size: var(--fs-sm);
  color: var(--n-600);
  border-radius: 4px;
  font-weight: 500;
}
.segmented button.on { background: var(--n-0); color: var(--n-900); box-shadow: var(--sh-sm); }

/* Dark-mode scrollbar */
.variant-dense ::-webkit-scrollbar { width: 10px; height: 10px; }
.variant-dense ::-webkit-scrollbar-thumb { background: var(--n-150); border-radius: 5px; }
.variant-dense ::-webkit-scrollbar-track { background: var(--n-25); }

/* Utility */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.grid { display: grid; }
.w-full { width: 100%; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.text-mute { color: var(--n-500); }
.text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.text-lg { font-size: var(--fs-lg); }
.text-xl { font-size: var(--fs-xl); }
.fw-6 { font-weight: 600; }
.fw-5 { font-weight: 500; }
.uppercase { text-transform: uppercase; letter-spacing: 0.05em; }

h1, h2, h3, h4 { color: var(--n-900); font-weight: 600; }
h1 { font-size: var(--fs-3xl); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 4px; font-weight: 600; }
h2 { font-size: var(--fs-2xl); margin: 0 0 6px; letter-spacing: -0.01em; }
h3 { font-size: var(--fs-xl); margin: 0 0 4px; }
h4 { font-size: var(--fs-lg); margin: 0 0 4px; }

.variant-bold h1 { font-family: var(--ff-display); font-weight: 400; font-size: var(--fs-4xl); letter-spacing: -0.03em; }
.variant-bold h2 { font-family: var(--ff-display); font-weight: 400; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; gap: 20px; flex-wrap: wrap; }
.page-head .lede { color: var(--n-500); font-size: var(--fs-md); max-width: 560px; margin-top: 2px; }

/* ========================================================= */
/* AVATAR-DROPDOWN — Topbar Konto-Menue (Sprint 2026-05-08)   */
/* ========================================================= */
.avatar-dropdown { position: relative; }
.avatar-dropdown > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.avatar-dropdown > summary::-webkit-details-marker { display: none; }
.avatar-dropdown > summary.avatar-trigger {
  /* nutzt die existing .avatar-Definition fuer die Optik */
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--brand-blue);
  color: white;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.avatar-dropdown > summary.avatar-trigger:hover { background: var(--brand-blue-600); }
.avatar-dropdown > summary.avatar-trigger:focus { outline: 3px solid var(--brand-blue-50); outline-offset: 1px; }
.avatar-dropdown .avatar-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--n-0);
  border: 1px solid var(--n-200);
  border-radius: var(--r-md);
  box-shadow: var(--sh-lg);
  padding: 6px;
  z-index: 50;
}
.avatar-dropdown .avatar-menu-head { padding: 10px 12px 8px; }
.avatar-dropdown .avatar-menu-name { font-weight: 600; color: var(--n-900); font-size: var(--fs-md); line-height: 1.2; }
.avatar-dropdown .avatar-menu-mail { color: var(--n-500); font-size: var(--fs-sm); margin-top: 2px; }
.avatar-dropdown .avatar-menu-rolle { color: var(--n-500); font-size: var(--fs-xs); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500; }
.avatar-dropdown .avatar-menu-divider { height: 1px; background: var(--n-150); margin: 4px 0; }
.avatar-dropdown .avatar-menu-item {
  display: block;
  padding: 8px 12px;
  color: var(--n-700);
  text-decoration: none;
  font-size: var(--fs-md);
  border-radius: var(--r-sm);
}
.avatar-dropdown .avatar-menu-item:hover { background: var(--n-50); color: var(--n-900); }
