:root {
  --primary: #0f4c81;
  --accent: #e8a33d;
  --bg: #f4f6f9;
  --card-bg: #ffffff;
  --text: #1c2733;
  --muted: #6b7885;
  --border: #e1e6ec;
  --danger: #c0392b;
  --success: #1e8449;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Roboto, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px;
  background: var(--sidebar-bg, #ffffff);
  color: var(--sidebar-text, #4b5563);
  padding: 18px 0;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  transition: width .18s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.sidebar.collapsed { width: 64px; }
.sidebar.collapsed .nav-label { display: none; }
.sidebar.collapsed nav a, .sidebar.collapsed .sidebar-nav-btn-link { justify-content: center; }
.sidebar.collapsed .brand { justify-content: center; }
.sidebar.collapsed .sidebar-caret { display: none; }
.sidebar-top { display: flex; align-items: center; gap: 10px; padding: 0 18px 18px; }
.sidebar-toggle {
  background: var(--bg); border: 1px solid var(--border); color: var(--text); width: 32px; height: 32px;
  border-radius: 8px; cursor: pointer; font-size: 1rem; flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--border); }
.brand { font-size: 1.15rem; font-weight: 700; letter-spacing: .3px; display: flex; align-items: center; overflow: hidden; white-space: nowrap; color: var(--text); }
.brand-logo { max-height: 30px; max-width: 140px; }
.sidebar nav { flex: 1; padding: 0 10px; }
.sidebar nav a, .sidebar-nav-btn-link {
  display: flex; align-items: center; gap: 12px;
  color: var(--sidebar-text, #4b5563);
  padding: 9px 12px;
  margin-bottom: 2px;
  border-radius: 8px;
  border-left: 3px solid transparent;
  white-space: nowrap;
  font-size: .92rem;
}
.sidebar nav a svg, .sidebar-nav-btn-link svg { flex-shrink: 0; }
.sidebar nav a:hover, .sidebar nav a.active, .sidebar-nav-btn-link:hover, .sidebar-nav-btn-link.active {
  background: color-mix(in srgb, var(--primary) 10%, white);
  border-left-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.sidebar-nav-pair { display: flex; align-items: center; gap: 2px; }
.sidebar-nav-pair .sidebar-nav-btn-link { flex: 1; }
.sidebar-caret {
  background: none; border: none; color: var(--sidebar-text, #9aa3af); cursor: pointer;
  padding: 6px 8px; font-size: .8rem; border-radius: 6px; flex-shrink: 0;
}
.sidebar-caret:hover { background: var(--bg); }
.sidebar-divider { border-top: 1px solid var(--border); margin: 10px 16px; }
.sidebar-section-label { font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #9aa3af; padding: 10px 22px 4px; }
.sidebar .user-box { padding: 16px 22px; font-size: .82rem; color: var(--sidebar-text, #6b7280); border-top: 1px solid var(--border); }
.sidebar .user-box a { color: var(--primary); }

.main { flex: 1; padding: 24px 32px; max-width: 1200px; }
.main h1 { margin-top: 0; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(16,24,40,.04), 0 1px 2px rgba(16,24,40,.03);
}

table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--border); font-size: .92rem; }
th { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: .72rem; letter-spacing: .04em; }
tr:hover td { background: #fafbfd; }

label { display: block; margin-bottom: 12px; font-size: .88rem; color: var(--muted); }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  margin-top: 4px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
textarea { min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent); }

.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: .95rem;
  cursor: pointer;
  transition: transform .05s ease, opacity .1s ease;
}
.btn:hover { opacity: .92; text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn.secondary { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 6px 12px; font-size: .82rem; }

.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 200px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.badge.geplant { background: #fdf1d8; color: #9a6b0b; }
.badge.bestellt { background: #dbe9fb; color: var(--primary); }
.badge.archiviert { background: #e6e9ec; color: var(--muted); }
.badge.abgerechnet { background: #dcf1e2; color: var(--success); }

.hinweis { background: #fff8e6; border: 1px solid #f1d78c; padding: 10px 14px; border-radius: 8px; font-size: .88rem; margin-top: 8px; }
.error-box { background: #fdeceb; border: 1px solid #f2b8b2; color: var(--danger); padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.ok-box { background: #e9f7ee; border: 1px solid #a9dcbb; color: var(--success); padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }

.checklist { list-style: none; padding: 0; }
.checklist li.ok { color: var(--success); }
.checklist li.fail { color: var(--danger); }

.install-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--primary); }
.install-card { background: #fff; padding: 32px 40px; border-radius: var(--radius); width: 480px; max-width: 92vw; }

.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, var(--primary), #123); background-size: cover; background-position: center; }
.login-card { background: #fff; padding: 36px 40px; border-radius: var(--radius); width: 360px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.login-card h1 { text-align: center; margin-top: 0; font-size: 1.4rem; }

.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.locked-row td { opacity: .6; }
.tag-check { display: flex; align-items: center; gap: 6px; }
.tag-check input { width: auto; margin: 0; }

.muted, .muted-inline { color: var(--muted); font-size: .82rem; font-weight: normal; }
.muted-inline { margin-left: 4px; }

/* Platzhalter-Chips (Mailtext) */
.placeholder-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 14px; }
.chip {
  display: inline-block;
  background: #eef2f7;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: .76rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Icon-Toggle-Buttons (Dienststelle/Heimat) */
.icon-toggle-row { align-items: flex-start; }
.icon-toggle-input { display: none; }
.icon-toggle-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; margin: 4px 8px 0 0;
  border: 1px solid var(--border); border-radius: 20px;
  background: #fff; color: var(--muted); font-size: .85rem; cursor: pointer;
  width: auto;
}
.icon-toggle-input:checked + .icon-toggle-btn {
  border-color: var(--primary); background: #eaf1f8; color: var(--primary); font-weight: 600;
}

/* Von/Bis-Felder mit direkt zugeordneten Dienststelle/Heimat-Buttons */
.von-bis-feld { flex: 1 1 240px; min-width: 180px; }
.von-bis-feld label { margin-bottom: 4px; }
.inline-toggles { display: flex; gap: 6px; }
.inline-toggles .icon-toggle-btn { padding: 6px 10px; margin: 0; }

/* Startseiten-Widgets */
.widget-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.widget-wide { grid-column: 1 / -1; }
.widget h3 { margin-top: 0; }
.shortcut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 12px; }
.shortcut-tile {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 8px; color: var(--text); text-decoration: none; text-align: center; font-size: .82rem;
  transition: transform .1s ease, box-shadow .1s ease;
}
.shortcut-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.08); text-decoration: none; }
.shortcut-tile svg { color: var(--primary); }
.shortcut-tile.shortcut-highlight { background: #fdf0c8; border-color: #e0b23e; }
.shortcut-tile.shortcut-highlight svg { color: #8a6100; }
.shortcut-tile.shortcut-highlight-blau { background: #dce9fa; border-color: #7fa8dd; }
.shortcut-tile.shortcut-highlight-blau svg { color: #0b4a8a; }
.link-widget {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  text-decoration: none; color: var(--text); min-height: 110px; text-align: center;
}
.link-widget svg { color: var(--accent); }
.link-widget:hover { text-decoration: none; box-shadow: 0 6px 16px rgba(0,0,0,.08); }

/* Tortendiagramm (reines CSS, ohne externe Bibliothek) */
.pie-chart { width: 200px; height: 200px; border-radius: 50%; margin: 0 auto 16px; }
.pie-legend { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; }
.pie-legend-item { display: flex; align-items: center; gap: 8px; }
.pie-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* Budget-Balken */
.budget-bar { background: var(--border); border-radius: 6px; height: 10px; overflow: hidden; margin-top: 4px; }
.budget-bar-fill { height: 100%; border-radius: 6px; }

/* Overlay ("Neue Bestellung" schwebend über der Liste) */
.overlay {
  display: none;
  position: fixed; inset: 0; background: rgba(15,23,33,.55);
  z-index: 100; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto;
}
.overlay.open { display: flex; }
.overlay-panel {
  background: var(--bg); border-radius: var(--radius); padding: 18px;
  width: 620px; max-width: 100%; box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.overlay-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }

/* E-Mail-Log Status */
.badge.versendet { background: #dcf1e2; color: var(--success); }
.badge.fehler { background: #fdeceb; color: var(--danger); }

/* Sidebar: Stammdaten-Untermenü */
.sidebar-nav-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: none; border: none; color: var(--sidebar-text, #4b5563); padding: 9px 12px;
  border-radius: 8px; border-left: 3px solid transparent; cursor: pointer; font-size: .92rem; white-space: nowrap;
}
.sidebar-nav-btn:hover, .sidebar-nav-btn.active { background: color-mix(in srgb, var(--primary) 10%, white); border-left-color: var(--primary); color: var(--primary); font-weight: 600; }
.sidebar-submenu { padding-left: 14px; }
.sidebar-submenu a { display: block; padding: 6px 12px; color: var(--sidebar-text, #6b7280); font-size: .85rem; border-radius: 6px; }
.sidebar-submenu a:hover { color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, white); text-decoration: none; }

/* Topbar-Layout (Alternative zur Seitenleiste) */
.topbar { background: var(--sidebar-bg, #ffffff); color: var(--sidebar-text, #4b5563); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 60; }
.topbar-inner { display: flex; align-items: center; gap: 18px; padding: 12px 28px; }
.topbar .brand { font-weight: 700; font-size: 1.15rem; flex-shrink: 0; color: var(--text); }
.topbar .brand-logo { max-height: 30px; }
.topbar-nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; align-items: center; }
.topbar-nav a, .topbar-nav-btn {
  display: flex; align-items: center; gap: 6px;
  color: var(--sidebar-text, #4b5563); padding: 8px 12px; border-radius: 8px;
  background: none; border: none; font-size: .85rem; cursor: pointer;
}
.topbar-nav a:hover, .topbar-nav a.active, .topbar-nav-btn:hover, .topbar-nav-btn.active {
  background: color-mix(in srgb, var(--primary) 10%, white); color: var(--primary); text-decoration: none; font-weight: 600;
}
.topbar-nav-pair { display: flex; align-items: center; border-radius: 8px; }
.topbar-nav-pair.active { background: color-mix(in srgb, var(--primary) 10%, white); }
.topbar-nav-pair .topbar-nav-btn { padding-right: 4px; }
.topbar-caret { padding: 8px 8px !important; font-size: .7rem !important; color: #9aa3af !important; }
.topbar-caret:hover { color: var(--primary) !important; }
.topbar-user { font-size: .82rem; color: var(--sidebar-text, #6b7280); white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.topbar-user a { color: var(--primary); text-decoration: underline; }
.topbar-submenu { display: flex; gap: 6px; flex-wrap: wrap; background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px 28px; }
.topbar-submenu a { color: var(--sidebar-text, #4b5563); font-size: .85rem; padding: 5px 10px; border-radius: 6px; }
.topbar-submenu a:hover { color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, white); text-decoration: none; }
.main-topbar { max-width: 1200px; margin: 0 auto; padding: 24px 32px; }

/* Zweite Menüebene (Gruppen innerhalb Einstellungen) */
.topbar-group-btn {
  background: none; border: none; color: var(--sidebar-text, #6b7280); padding: 6px 10px;
  font-size: .82rem; cursor: pointer; border-radius: 6px;
}
.topbar-group-btn:hover, .topbar-group-btn.active { background: color-mix(in srgb, var(--primary) 8%, white); color: var(--primary); }
.topbar-subsubmenu { background: var(--card-bg); }
.sidebar-group-btn {
  display: block; width: 100%; text-align: left; background: none; border: none;
  color: var(--sidebar-text, #9aa3af); padding: 6px 12px; cursor: pointer; font-size: .82rem; border-radius: 6px;
}
.sidebar-group-btn:hover, .sidebar-group-btn.active { color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, white); }
.sidebar-subsubmenu { padding-left: 10px; }
.sidebar-subsubmenu a { font-size: .8rem; }
.nav-highlight { color: #8a6100 !important; font-weight: 700; }
.nav-highlight-blau { color: #0b4a8a !important; font-weight: 700; }

/* Bestellformular: einspaltig vs. zweispaltig */
#bestellform.form-1col .row > * { flex-basis: 100%; }
#bestellform.form-2col .row > * { flex-basis: 45%; }

/* Bestellformular kompakter (ca. 80% der ursprünglichen Größe) */
#bestellform { padding: 16px; font-size: .88rem; }
#bestellform label { margin-bottom: 8px; font-size: .8rem; }
#bestellform input, #bestellform select, #bestellform textarea { padding: 7px 9px; font-size: .85rem; margin-top: 3px; }
#bestellform textarea { min-height: 56px; }
#bestellform .row { gap: 10px; }
#bestellform h3 { font-size: .95rem; margin: 10px 0 6px; }
#bestellform .icon-toggle-btn { padding: 5px 10px; font-size: .78rem; }
#bestellform .btn { padding: 8px 16px; font-size: .85rem; }

/* Rich-Text-Editor (Mailtext) */
.richtext-toolbar { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.richtext-toolbar button {
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  padding: 5px 10px; cursor: pointer; font-size: .85rem;
}
.richtext-toolbar button:hover { background: #f2f5f8; }
.richtext-toolbar select { width: auto; margin: 0; padding: 5px 8px; }
.richtext-editor {
  border: 1px solid var(--border); border-radius: 8px; padding: 12px;
  min-height: 160px; background: #fff; margin-top: 6px; font-size: .95rem;
}
.richtext-editor:focus { outline: 2px solid var(--accent); border-color: var(--accent); }

.pflicht-stern { color: var(--danger); font-weight: 700; }
.pflicht-stern-v { color: var(--primary); font-weight: 700; }

/* Sortierbare Spaltenüberschriften */
.sort-link { color: var(--muted); text-decoration: none; }
.sort-link:hover { color: var(--primary); text-decoration: none; }
th:has(.sort-link) { cursor: pointer; }

/* Kleiner Icon-Button (z.B. E-Mail erneut senden) */
.icon-btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 6px; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center;
}
.icon-btn:hover { color: var(--primary); border-color: var(--primary); }
.icon-btn.danger-icon { color: var(--danger); font-weight: 700; }
.icon-btn.danger-icon:hover { border-color: var(--danger); }
.icon-btn.send-icon { color: var(--primary); }
.icon-btn.send-icon:hover { background: var(--primary); color: #fff; }
.btn.abbestellen-btn { background: #fff; color: var(--muted); border: 1px solid var(--border); font-weight: 600; }
.btn.abbestellen-btn:hover { color: var(--danger); border-color: var(--danger); }
.btn.abbestellen-btn.dringend { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.abbestellen-btn.dringend:hover { opacity: .88; }

/* ============================================================
   Responsive – Tablet und Smartphone
   ============================================================ */

/* Tabellen auf kleinen Bildschirmen horizontal scrollbar machen, damit sie
   das Layout nicht sprengen (Karten sind die Scroll-Container). */
@media (max-width: 900px) {
  .card { overflow-x: auto; }
  table { min-width: 560px; }
}

/* --- Tablet --- */
@media (max-width: 900px) {
  .main, .main-topbar { padding: 18px 16px; }

  /* Seitenleiste wird zur oberen Leiste, damit der Inhalt die volle Breite bekommt */
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100% !important;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
  }
  .sidebar.collapsed { width: 100% !important; }
  .sidebar.collapsed .nav-label { display: inline; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 10px; }
  .sidebar nav a, .sidebar-nav-btn-link { border-left: none; border-radius: 8px; padding: 8px 10px; }
  .sidebar-nav-pair { flex: 0 0 auto; }
  .sidebar-submenu { padding-left: 8px; width: 100%; }
  .sidebar .user-box { padding: 12px 16px; }
  .sidebar-divider, .sidebar-section-label { display: none; }

  /* Topbar-Modus: Menüpunkte umbrechen lassen */
  .topbar-inner { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .topbar-nav { gap: 2px; }
  .topbar-nav a, .topbar-nav-btn { padding: 7px 9px; font-size: .82rem; }
  .topbar-submenu { padding: 8px 16px; }
  .topbar-user { align-items: flex-start; }

  /* Formularzeilen brechen früher um */
  .row > * { min-width: 160px; }
  .widget-grid { grid-template-columns: 1fr; }
  .overlay { padding: 16px 10px; }
  .overlay-panel { width: 100%; padding: 16px; }
}

/* --- Smartphone --- */
@media (max-width: 600px) {
  body { font-size: .95rem; }
  h1 { font-size: 1.45rem; }
  h2 { font-size: 1.2rem; }
  .main, .main-topbar { padding: 14px 10px; }
  .card { padding: 14px; border-radius: 10px; }

  /* Alle Formularzeilen einspaltig */
  .row { gap: 10px; }
  .row > * { flex: 1 1 100%; min-width: 0; }
  #bestellform.form-2col .row > * { flex-basis: 100%; }

  /* Eingabefelder mit 16px Schriftgröße, damit iOS beim Fokus nicht heranzoomt */
  input, select, textarea { font-size: 16px; }

  /* Buttons: volle Breite und größere Tap-Fläche */
  .btn { padding: 11px 16px; }
  .btn.small { padding: 8px 12px; }
  form .btn, .card > .btn { width: auto; }

  /* Von/Bis: Eingabefeld und Arbeit/Haus-Buttons dürfen umbrechen */
  .von-bis-feld { min-width: 0; }
  .inline-toggles { flex-wrap: wrap; }

  /* Tabellen kompakter */
  th, td { padding: 7px 6px; font-size: .85rem; }
  table { min-width: 480px; }

  /* Startseiten-Kacheln zweispaltig statt gequetscht */
  .shortcut-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }

  /* Tabs (Stammdaten etc.) horizontal scrollbar statt umbrechend */
  .tabs { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .tabs a { display: inline-block; float: none; }

  /* Menü-Untermenüs auf voller Breite */
  .topbar-submenu { flex-direction: column; gap: 2px; }
  .topbar-submenu a { padding: 8px 10px; }

  .overlay { padding: 8px 6px; }
  .overlay-panel { padding: 12px; border-radius: 10px; }
  .overlay-head h2 { font-size: 1.1rem; }
}

/* Von/Bis-Zeile im Bestellformular: auf sehr schmalen Bildschirmen darf die
   Zeile umbrechen (Eingabefeld über den Arbeit/Haus-Buttons), sonst läuft
   das Formular seitlich aus dem Bildschirm. Die Inline-Styles im Formular
   erzwingen sonst "nowrap" auf jeder Breite. */
@media (max-width: 480px) {
  #bestellform div[style*="flex-wrap:nowrap"] { flex-wrap: wrap !important; }
  #bestellform .inline-toggles[style*="white-space:nowrap"] { white-space: normal !important; }
}


/* v30 – modernisierte Oberfläche */
.sidebar .user-box { padding: 14px 14px 16px; background: color-mix(in srgb, var(--sidebar-bg) 92%, var(--primary) 8%); }
.user-box-meta { display:flex; flex-direction:column; gap:2px; padding:0 4px 10px; color:var(--sidebar-text); line-height:1.35; }
.user-box-kicker { font-size:.72rem; opacity:.72; text-transform:uppercase; letter-spacing:.05em; }
.user-box-actions { display:grid; gap:7px; }
.sidebar .user-box .user-box-btn { display:flex; align-items:center; justify-content:center; min-height:36px; padding:8px 10px; border:1px solid color-mix(in srgb, var(--primary) 22%, #d7dde5); border-radius:9px; background:var(--card-bg,#fff); color:var(--primary) !important; text-decoration:none !important; font-weight:650; box-shadow:0 1px 2px rgba(15,23,42,.04); }
.sidebar .user-box .user-box-btn:hover { background:color-mix(in srgb,var(--primary) 8%,#fff); transform:translateY(-1px); }
.sidebar .user-box .user-box-btn-danger { color:#a61b1b !important; border-color:#efcaca; background:#fff8f8; }

.settings-head { display:flex; align-items:flex-end; justify-content:space-between; gap:18px; margin-bottom:18px; }
.settings-head h1 { margin:0; }
.settings-breadcrumb { font-size:.9rem; color:var(--muted,#6b7280); margin-top:4px; }
.settings-section-title { display:flex; align-items:center; gap:10px; margin:4px 0 16px; }
.settings-section-title:after { content:""; height:1px; flex:1; background:var(--border); }
body .card { border:1px solid color-mix(in srgb,var(--border) 88%,transparent); box-shadow:0 6px 18px rgba(15,23,42,.045); border-radius:14px; }
body .card h3 { margin-top:0; letter-spacing:-.01em; }
body input, body select, body textarea { border-radius:9px; }
body input:focus, body select:focus, body textarea:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 13%,transparent); }
.settings-grid-2 { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.settings-grid-3 { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.settings-card-intro { color:var(--muted,#64748b); margin-top:-4px; margin-bottom:16px; }
.hinweis { background:#f8fafc; border-color:#dbe3ec; color:#52606d; }
.richtext-toolbar { display:flex; flex-wrap:wrap; gap:6px; padding:8px; border:1px solid var(--border); border-bottom:0; border-radius:10px 10px 0 0; background:#f8fafc; }
.richtext-toolbar button, .richtext-toolbar select { width:auto; margin:0; min-height:34px; padding:6px 9px; }
.richtext-editor { min-height:180px; padding:14px; border:1px solid var(--border); border-radius:0 0 10px 10px; background:#fff; }
.richtext-editor:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 12%,transparent); }
.news-item { border:1px solid var(--border); border-radius:12px; padding:14px 16px; background:#fff; }
.news-item + .news-item { margin-top:10px; }
.news-meta { color:#64748b; font-size:.8rem; margin-bottom:5px; }
.news-title { font-weight:750; font-size:1rem; margin-bottom:5px; }
@media(max-width:900px){ .settings-grid-2,.settings-grid-3{grid-template-columns:1fr;} }


/* ============================================================
   DispoGrid v31 – ruhigeres Branding, feste Sidebar & Darkmode
   ============================================================ */
:root {
  --primary: #1469a8;
  --accent: #31a8a0;
  --bg: #f7f9fc;
  --card-bg: #ffffff;
  --text: #172235;
  --muted: #697789;
  --border: #e3e8ef;
  --sidebar-bg: #fbfcfe;
  --sidebar-text: #526173;
  --surface-soft: #f1f5f9;
  --shadow-soft: 0 8px 24px rgba(24,39,75,.055);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --primary: #65b7eb;
  --accent: #62c9c1;
  --bg: #101722;
  --card-bg: #17212d;
  --text: #edf4fb;
  --muted: #9eb0c3;
  --border: #2a3848;
  --sidebar-bg: #111b27;
  --sidebar-text: #c4d0dc;
  --surface-soft: #1d2937;
  --danger: #ff7d7d;
  --success: #69d391;
}

html[data-theme="dark"] body { background: var(--bg); color: var(--text); }
html[data-theme="dark"] body .card,
html[data-theme="dark"] .settings-card,
html[data-theme="dark"] .overlay-panel { background: var(--card-bg); border-color: var(--border); box-shadow: none; }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea { background: #111a25; color: var(--text); border-color: var(--border); }
html[data-theme="dark"] .btn.secondary { background: var(--surface-soft); color: var(--text); border-color: var(--border); }
html[data-theme="dark"] .sidebar nav a:hover,
html[data-theme="dark"] .sidebar nav a.active,
html[data-theme="dark"] .sidebar-nav-btn-link:hover,
html[data-theme="dark"] .sidebar-nav-btn-link.active,
html[data-theme="dark"] .sidebar-nav-btn:hover,
html[data-theme="dark"] .sidebar-nav-btn.active,
html[data-theme="dark"] .sidebar-group-btn:hover,
html[data-theme="dark"] .sidebar-group-btn.active { background: color-mix(in srgb, var(--primary) 14%, var(--sidebar-bg)); color: var(--primary); }
html[data-theme="dark"] .sidebar .user-box { background: color-mix(in srgb, var(--sidebar-bg) 92%, var(--primary) 8%); }
html[data-theme="dark"] .sidebar .user-box .user-box-btn { background: #172331; color: var(--text) !important; border-color: var(--border); }
html[data-theme="dark"] .sidebar .user-box .user-box-btn:hover { background: #1e2c3b; }
html[data-theme="dark"] .sidebar .user-box .user-box-btn-danger { color: #ff8c8c !important; background: #291d22; border-color: #60313b; }
html[data-theme="dark"] .shortcut-tile { background: var(--surface-soft); }
html[data-theme="dark"] .hinweis { background: #18293b; border-color: #294661; color: #c6d7e8; }

/* Desktop: die Navigation bleibt stehen, nur der Inhaltsbereich scrollt. */
@media (min-width: 901px) {
  body.layout-sidebar { overflow: hidden; }
  .layout-sidebar .app-shell { height: 100vh; min-height: 0; overflow: hidden; }
  .layout-sidebar .sidebar { height: 100vh; min-height: 0; position: sticky; top: 0; overflow: hidden; }
  .layout-sidebar .sidebar nav { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  .layout-sidebar .sidebar .user-box { flex: 0 0 auto; }
  .layout-sidebar .main { height: 100vh; overflow-y: auto; overscroll-behavior: contain; max-width: none; width: 100%; }
}

.brand { gap: 8px; }
.brand-logo-full { width: 170px; max-width: 100%; max-height: 58px; object-fit: contain; object-position: left center; }
.brand-logo-icon { display: none; width: 34px; height: 34px; object-fit: contain; }
.sidebar.collapsed .brand-logo-full { display: none; }
.sidebar.collapsed .brand-logo-icon { display: block; }
.sidebar-top { min-height: 68px; }
.topbar .brand-logo-full { width: 155px; max-height: 48px; }
.brand-app-name { font-size: .82rem; color: var(--muted); font-weight: 650; }

.theme-toggle { cursor: pointer; font: inherit; }
.sidebar .user-box .theme-toggle { width: 100%; }
.theme-toggle-icon { margin-right: 7px; }
.theme-toggle-top { border: 1px solid var(--border); background: var(--surface-soft); color: var(--text); border-radius: 8px; padding: 5px 8px; }

/* Weniger bunte Flächen: Farbe dient überwiegend zur Orientierung, nicht als Dekoration. */
body .card { box-shadow: var(--shadow-soft); }
.settings-card, .setting-tile, .shortcut-tile { transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.setting-tile:hover, .shortcut-tile:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); box-shadow: 0 8px 22px rgba(24,39,75,.07); }

.design-brand-preview { display:flex; align-items:center; gap:18px; padding:16px 18px; background:var(--surface-soft); border:1px solid var(--border); border-radius:12px; margin-bottom:18px; }
.design-brand-preview img { width:180px; max-width:42%; height:auto; }
.design-brand-preview div { display:flex; flex-direction:column; gap:4px; }
.design-brand-preview strong { font-size:1.05rem; }
.design-brand-preview span { color:var(--muted); font-size:.88rem; }
.app-name-input { display:flex; align-items:stretch; max-width:420px; }
.app-name-input input { border-radius:9px 0 0 9px; margin:0; }
.app-name-input span { display:flex; align-items:center; padding:0 12px; border:1px solid var(--border); border-left:0; border-radius:0 9px 9px 0; background:var(--surface-soft); color:var(--text); font-weight:700; }
.login-brand { display:flex; flex-direction:column; align-items:center; gap:8px; margin-bottom:18px; }
.login-brand img { width:220px; max-width:80%; height:auto; }
.login-brand strong { color:var(--text); font-size:1.15rem; }

@media (max-width: 900px) {
  body.layout-sidebar { overflow: auto; }
  .brand-logo-full { width: 150px; }
  .brand-logo-icon { display:none !important; }
}


/* ============================================================
   DispoGrid v32 – Einstellungsübersicht & Darkmode-Kontrast
   ============================================================ */

/* Die Einstellungsübersicht orientiert sich an der kompakten Schnellzugriff-Logik:
   klare Piktogramme, kurze Beschreibungen und große klickbare Flächen. */
.settings-title-wrap { display:flex; align-items:center; gap:14px; }
.settings-title-icon {
  width:54px; height:54px; display:grid; place-items:center; flex:0 0 54px;
  border-radius:14px; background:#e7f2ff; color:#126ec0;
}
.settings-current-path {
  display:inline-flex; align-items:center; gap:7px; margin:-7px 0 16px;
  padding:6px 10px; border:1px solid var(--border); border-radius:999px;
  background:var(--surface-soft); color:var(--muted); font-size:.8rem;
}
.settings-overview { display:grid; gap:16px; padding-bottom:24px; }
.settings-overview-section {
  background:var(--card-bg); border:1px solid var(--border); border-radius:15px;
  padding:18px 20px 20px; box-shadow:var(--shadow-soft);
}
.settings-overview-section-head { display:flex; align-items:center; gap:12px; margin-bottom:15px; }
.settings-overview-section-head h2 { margin:0 0 3px; font-size:1.08rem; letter-spacing:-.015em; }
.settings-overview-section-head p { margin:0; color:var(--muted); font-size:.86rem; }
.settings-section-picto { width:38px; height:38px; display:grid; place-items:center; flex:0 0 38px; color:var(--primary); }
.settings-tile-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:11px; }
.setting-tile {
  min-height:94px; display:grid; grid-template-columns:50px minmax(0,1fr) 20px;
  align-items:center; gap:12px; padding:13px 14px; border:1px solid var(--border);
  border-radius:12px; background:var(--card-bg); color:var(--text); text-decoration:none !important;
  box-shadow:0 1px 2px rgba(15,23,42,.025);
}
.setting-tile:hover {
  transform:translateY(-1px); border-color:color-mix(in srgb,var(--primary) 36%,var(--border));
  box-shadow:0 8px 20px rgba(15,23,42,.07); color:var(--text);
}
.setting-tile-icon {
  width:50px; height:50px; border-radius:12px; display:grid; place-items:center;
  background:var(--surface-soft); color:var(--primary);
}
.setting-tile-copy { min-width:0; display:flex; flex-direction:column; gap:4px; }
.setting-tile-copy strong { font-size:.9rem; line-height:1.2; color:var(--text); }
.setting-tile-copy small { color:var(--muted); font-size:.78rem; line-height:1.35; }
.setting-tile-arrow { color:#76879a; font-size:1.7rem; line-height:1; text-align:right; }
.tone-blue { background:#e5f1ff; color:#0f6fc5; }
.tone-purple { background:#f0eaff; color:#6840ce; }
.tone-green { background:#e1f7ef; color:#159466; }
.tone-orange { background:#fff0df; color:#cf6500; }
.tone-red { background:#ffe7e7; color:#d73535; }
.tone-cyan { background:#e3f7fb; color:#1686a4; }
.tone-slate { background:#e9eff6; color:#47627e; }

/* Dunkle Sidebar wie im gewünschten Entwurf; Inhalt bleibt im Hellmodus sehr hell. */
@media (min-width:901px) {
  .layout-sidebar .sidebar { box-shadow:8px 0 26px rgba(15,23,42,.06); }
}

/* Darkmode: Inhaltsfläche bewusst etwas heller als die feste, dunkle Sidebar. */
html[data-theme="dark"] {
  --bg:#172230;
  --card-bg:#202d3b;
  --text:#f2f6fb;
  --muted:#b5c2d0;
  --border:#344557;
  --sidebar-bg:#0d1824;
  --sidebar-text:#d5e0ea;
  --surface-soft:#273748;
}
html[data-theme="dark"] .main { background:#172230; }
html[data-theme="dark"] .sidebar { background:#0d1824; border-right-color:#263646; }
html[data-theme="dark"] .settings-overview-section,
html[data-theme="dark"] .setting-tile { background:#202d3b; }
html[data-theme="dark"] .setting-tile:hover { background:#253547; border-color:#4d6c88; box-shadow:none; }
html[data-theme="dark"] .settings-title-icon { background:#233b52; color:#70c2ff; }
html[data-theme="dark"] .setting-tile-arrow { color:#91a6b9; }
html[data-theme="dark"] .tone-blue { background:#233e58; color:#79c8ff; }
html[data-theme="dark"] .tone-purple { background:#382f55; color:#c5a8ff; }
html[data-theme="dark"] .tone-green { background:#203f39; color:#78ddb7; }
html[data-theme="dark"] .tone-orange { background:#483822; color:#ffd078; }
html[data-theme="dark"] .tone-red { background:#4a2b31; color:#ff919b; }
html[data-theme="dark"] .tone-cyan { background:#213e48; color:#79d7ea; }
html[data-theme="dark"] .tone-slate { background:#2b3949; color:#b9ccdf; }

/* Tabellen: niemals mehr weiße Hover-Zeilen im Darkmode. */
html[data-theme="dark"] tr:hover td { background:#2a3b4d; color:var(--text); }
html[data-theme="dark"] tr:hover td a { color:#83cfff; }
html[data-theme="dark"] th { color:#c4d0dc; }
html[data-theme="dark"] td { border-bottom-color:#344557; }

/* Schnellzugriff: Taxi-Icon und Hervorhebung im Darkmode klar sichtbar. */
html[data-theme="dark"] .shortcut-tile svg { color:#72c9ff; }
html[data-theme="dark"] .shortcut-tile.shortcut-highlight {
  background:#3a3421; border-color:#9a7b25; color:#fff7d6;
}
html[data-theme="dark"] .shortcut-tile.shortcut-highlight svg { color:#ffd85b; }
html[data-theme="dark"] .shortcut-tile.shortcut-highlight-blau {
  background:#213a55; border-color:#3f6f9d; color:#e8f4ff;
}
html[data-theme="dark"] .shortcut-tile.shortcut-highlight-blau svg { color:#78c6ff; }

/* Weitere harte Weißwerte aus älteren Komponenten im Darkmode abfangen. */
html[data-theme="dark"] .richtext-toolbar { background:#263646; border-color:var(--border); }
html[data-theme="dark"] .richtext-toolbar button,
html[data-theme="dark"] .richtext-editor,
html[data-theme="dark"] .news-item,
html[data-theme="dark"] .icon-toggle-btn { background:#1a2735; color:var(--text); border-color:var(--border); }
html[data-theme="dark"] .chip { background:#29394a; color:#c5d2df; border-color:var(--border); }
html[data-theme="dark"] .badge.archiviert { background:#344354; color:#d7e1eb; }

@media (max-width:1100px) { .settings-tile-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:700px) {
  .settings-tile-grid { grid-template-columns:1fr; }
  .settings-overview-section { padding:15px; }
  .setting-tile { min-height:84px; }
  .settings-title-icon { width:46px; height:46px; flex-basis:46px; }
}

/* ============================================================
   DispoGrid v33 – UI polish, editor, logs & darkmode
   ============================================================ */
.icon-action-btn {
  width:40px; height:40px; display:inline-grid; place-items:center; flex:0 0 40px;
  border:1px solid var(--border); border-radius:10px; background:var(--card-bg);
  color:var(--primary); text-decoration:none !important; vertical-align:middle;
  transition:background .15s ease,border-color .15s ease,transform .15s ease;
}
.icon-action-btn:hover { background:var(--surface-soft); border-color:color-mix(in srgb,var(--primary) 40%,var(--border)); transform:translateY(-1px); }
.form-actions { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-top:16px; }
.settings-section-title { justify-content:space-between; }
.settings-section-title > div > h3 { margin:0 0 3px; }
.settings-section-title > div > p { margin:0; color:var(--muted); font-size:.84rem; }
.settings-section-title:after { display:none; }
.editor-settings-card { overflow:visible; }
.editor-placeholders { display:flex; flex-wrap:wrap; gap:6px; margin:8px 0 12px; }
.editor-placeholders .chip { cursor:pointer; font:inherit; }
.rte-wrap { margin-top:8px; }
.richtext-toolbar { position:sticky; top:0; z-index:4; align-items:center; }
.richtext-toolbar button,.richtext-toolbar select { min-height:36px; border:1px solid var(--border); background:var(--card-bg); color:var(--text); border-radius:7px; }
.richtext-toolbar button:hover { border-color:var(--primary); background:var(--surface-soft); }
.rte-color { display:flex; align-items:center; gap:4px; width:auto; margin:0; padding:3px 7px; min-height:36px; border:1px solid var(--border); border-radius:7px; background:var(--card-bg); }
.rte-color input { width:28px; min-width:28px; height:25px; padding:0; border:0; box-shadow:none !important; }
.richtext-editor { line-height:1.55; overflow:auto; }
.richtext-editor h1,.richtext-editor h2,.richtext-editor h3 { margin:.65em 0 .35em; }
.editor-paper {
  width:min(100%, 820px); min-height:760px; margin:0 auto; padding:54px 62px;
  background:#fff !important; color:#172235 !important; border:1px solid #d9e0e8 !important;
  box-shadow:0 12px 34px rgba(15,23,42,.12); border-radius:2px;
  font-family:Arial,Helvetica,sans-serif; line-height:1.45;
}
.editor-paper img { max-width:100%; height:auto; }
.compact-test-card { padding-top:15px; padding-bottom:15px; }
.budget-editor-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.budget-item-card { border:1px solid var(--border); border-radius:12px; padding:14px; background:var(--surface-soft); }
.budget-item-card > strong { display:block; margin-bottom:10px; }
.budget-amounts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.audit-count,.log-category { display:inline-flex; align-items:center; min-height:26px; padding:4px 9px; border-radius:999px; background:var(--surface-soft); color:var(--muted); font-size:.76rem; font-weight:700; }
.log-filter-bar { display:grid; grid-template-columns:180px 220px minmax(230px,1fr) auto; gap:10px; align-items:end; margin-bottom:14px; }
.log-filter-actions { display:flex; gap:7px; align-items:center; }
.table-scroll { width:100%; overflow:auto; }
.audit-table { min-width:930px; }
.audit-table td { vertical-align:top; font-size:.82rem; }
.audit-table td:nth-child(1),.audit-table td:nth-child(2),.audit-table td:nth-child(3),.audit-table td:nth-child(6) { white-space:nowrap; }
.empty-state { color:var(--muted); text-align:center; padding:18px !important; }

/* Darkmode: Sidebar etwas heller als bisher, Inhaltsfläche noch einen Tick heller. */
html[data-theme="dark"] {
  --bg:#24364a;
  --card-bg:#2c4055;
  --text:#f3f7fb;
  --muted:#bdcad7;
  --border:#465b70;
  --sidebar-bg:#1a2a3b;
  --sidebar-text:#e0e8f0;
  --surface-soft:#354b61;
  --primary:#7dcbff;
  --accent:#72d9d0;
}
html[data-theme="dark"] .main { background:#24364a; }
html[data-theme="dark"] .sidebar { background:#1a2a3b; border-right-color:#34485b; }
html[data-theme="dark"] .settings-overview-section,
html[data-theme="dark"] .setting-tile,
html[data-theme="dark"] body .card { background:#2c4055; border-color:#465b70; }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea { background:#203145; border-color:#4a6076; color:#f4f8fc; }
html[data-theme="dark"] tr:hover td { background:#3b536a !important; color:#fff !important; }
html[data-theme="dark"] tr:hover td a { color:#9dd8ff !important; }
html[data-theme="dark"] .btn:not(.secondary):not(.danger) { background:#7dcbff; border-color:#7dcbff; color:#07131f !important; }
html[data-theme="dark"] .btn:not(.secondary):not(.danger) svg { color:#07131f !important; }
html[data-theme="dark"] .btn:not(.secondary):not(.danger):hover { background:#9edaff; border-color:#9edaff; }
html[data-theme="dark"] .btn.secondary { background:#d8e5ef; border-color:#d8e5ef; color:#102132 !important; }
html[data-theme="dark"] .btn.secondary svg { color:#102132 !important; }
html[data-theme="dark"] .btn.secondary:hover { background:#eef5fa; border-color:#eef5fa; }
html[data-theme="dark"] .icon-action-btn { background:#d8e5ef; border-color:#d8e5ef; color:#102132 !important; }
html[data-theme="dark"] .icon-action-btn svg { color:#102132 !important; }
html[data-theme="dark"] .icon-action-btn:hover { background:#f0f6fa; }
html[data-theme="dark"] .shortcut-tile svg { color:#a8ddff; }
html[data-theme="dark"] .shortcut-tile.shortcut-highlight svg { color:#ffe17a; filter:brightness(1.15); }
html[data-theme="dark"] .richtext-toolbar { background:#203145; border-color:#465b70; }
html[data-theme="dark"] .richtext-toolbar button,
html[data-theme="dark"] .richtext-toolbar select,
html[data-theme="dark"] .rte-color { background:#dfeaf2; border-color:#dfeaf2; color:#102132; }
html[data-theme="dark"] .richtext-editor:not(.editor-paper) { background:#203145; color:#f4f8fc; border-color:#465b70; }
html[data-theme="dark"] .budget-item-card { background:#354b61; }
html[data-theme="dark"] .log-category,html[data-theme="dark"] .audit-count { background:#3b536a; color:#e8f1f8; }

@media(max-width:1000px){ .log-filter-bar{grid-template-columns:repeat(2,minmax(0,1fr));}.budget-editor-grid{grid-template-columns:1fr;} }
@media(max-width:700px){ .log-filter-bar,.budget-amounts{grid-template-columns:1fr;}.editor-paper{padding:28px 24px;min-height:600px;} }

/* Statistik v33 */
.statistik-page { padding-bottom:28px; }
.stats-head { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:16px; }
.stats-head-title { display:flex; align-items:center; gap:14px; }
.stats-head h1 { margin:0 0 3px; }
.stats-head p { margin:0; color:var(--muted); font-size:.9rem; }
.stats-filter-card { padding:14px 16px; }
.stats-filter-grid { display:grid; grid-template-columns:220px 220px auto; gap:12px; align-items:end; }
.stats-kpi-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin:14px 0; }
.stats-kpi { display:flex; align-items:center; gap:13px; margin:0; min-height:102px; }
.stats-kpi-icon { width:46px; height:46px; border-radius:12px; display:grid; place-items:center; background:var(--surface-soft); color:var(--primary); flex:0 0 46px; }
.stats-kpi div { display:flex; flex-direction:column; gap:5px; }
.stats-kpi small { color:var(--muted); font-weight:650; }
.stats-kpi strong { font-size:1.45rem; letter-spacing:-.025em; }
.statistik-page > .row { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; align-items:start; }
.statistik-page > .row > .card { min-width:0; width:100%; }
.statistik-page .card h3 { display:flex; align-items:center; justify-content:space-between; }
.statistik-page table { font-size:.88rem; }
.statistik-page .budget-bar { height:9px; border-radius:99px; overflow:hidden; background:var(--surface-soft); }
.statistik-page .budget-bar-fill { height:100%; border-radius:99px; }
@media(max-width:850px){ .stats-kpi-grid{grid-template-columns:1fr}.stats-filter-grid{grid-template-columns:1fr}.statistik-page>.row{grid-template-columns:1fr}.stats-head{align-items:flex-start;flex-direction:column} }

/* ============================================================
   DispoGrid v34 – kompakte obere Navigation
   ============================================================ */
body.layout-topbar .topbar-inner {
  min-height: 36px;
  padding: 3px 14px;
  gap: 8px;
}
body.layout-topbar .topbar .brand { font-size:.92rem; }
body.layout-topbar .topbar .brand-logo-full { width:108px; max-height:24px; }
body.layout-topbar .topbar-nav { gap:2px; }
body.layout-topbar .topbar-nav a,
body.layout-topbar .topbar-nav-btn { min-height:26px; padding:3px 7px; font-size:.78rem; border-radius:7px; }
body.layout-topbar .topbar-user {
  display:flex;
  flex-direction:row;
  align-items:center;
  justify-content:center;
  gap:4px;
  font-size:.76rem;
  white-space:nowrap;
}
body.layout-topbar .topbar-user-name {
  max-width:170px;
  overflow:hidden;
  text-overflow:ellipsis;
  font-weight:700;
  color:var(--text);
  padding:4px 7px;
}
body.layout-topbar .topbar-user .topbar-user-action {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  min-height:24px;
  padding:3px 6px;
  border:1px solid var(--border);
  border-radius:7px;
  background:var(--surface-soft);
  color:var(--text);
  text-decoration:none;
  line-height:1;
}
body.layout-topbar .topbar-user .topbar-user-action:hover { border-color:var(--primary); color:var(--primary); }
body.layout-topbar .topbar-user .topbar-user-logout { color:#a61b1b; background:#fff7f7; border-color:#efcaca; }
body.layout-topbar .topbar-user .theme-toggle-icon { margin-right:0; }
html[data-theme="dark"] body.layout-topbar .topbar-user .topbar-user-action { background:#dfeaf2; color:#102132; border-color:#dfeaf2; }
html[data-theme="dark"] body.layout-topbar .topbar-user .topbar-user-action:hover { background:#f2f7fa; color:#0b3555; }
html[data-theme="dark"] body.layout-topbar .topbar-user .topbar-user-logout { background:#f5dede; color:#7d1111; border-color:#f5dede; }
@media(max-width:1150px){
  body.layout-topbar .topbar-inner{flex-wrap:wrap}
  body.layout-topbar .topbar-user{margin-left:auto}
}
@media(max-width:760px){
  body.layout-topbar .topbar-user{width:100%;justify-content:flex-start;overflow-x:auto;padding-bottom:2px}
  body.layout-topbar .topbar-user-name{max-width:130px}
}
