/* EDU App – Oberfläche nach docs/design-system.md (Tokens in Abschnitt 11). Eigenes CSS, kein Framework. */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter/Inter-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter/Inter-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

:root {
  --ink: #1C2626;
  --ink-deep: #0C1212;
  --ink-border: #657168;
  --ink-accent: #3F4941;
  --paper: #FAF5F0;
  --paper-input: #F6F6F4;
  --lime: #F1FCA4;
  --cta-green: #0A6B3D;
  --status-success: #1B7A4B;
  --status-error: #B3261E;
  --status-warning: #9A5B00;
  /* Text auf den 12-%-Flächen der Statusmarken: etwas dunkler, damit 4,5:1 erreicht wird */
  --status-success-text: #186E44;
  --status-warning-text: #8B5200;
  --surface-subtle: #EFEBE6;
  --surface-hover: #F3EFEA;
  --hairline: #DFDCD8;

  --font-sans: "PP Neue Montreal", "Inter", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --fs-xs: 12px; --lh-xs: 16px;
  --fs-sm: 14px; --lh-sm: 20px;
  --fs-md: 16px; --lh-md: 1.45;
  --fs-lg: 20px; --lh-lg: 26px;
  --fs-xl: 28px; --lh-xl: 34px;
  --fw-regular: 400;
  --fw-medium: 500;

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;

  --radius-field: 8px;
  --radius-panel: 8px;
  --radius-pill: 60px;
  --border: 1px solid var(--ink-border);

  --h-btn-compact: 32px;
  --h-btn: 40px;
  --h-btn-touch: 48px;
  --h-row-compact: 32px;
  --h-row-comfort: 44px;
  --h-topbar: 56px;
  --w-sidebar: 224px;
  --w-sidebar-collapsed: 56px;

  --transition: 150ms ease;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-md);
  font-weight: var(--fw-regular);
  letter-spacing: 0.01em; /* wie die Website: 0,01 em */
}
h1, h2, h3 { margin: 0 0 var(--sp-3); font-weight: var(--fw-medium); color: var(--ink); }
h1 { font-size: 32px; line-height: 38px; letter-spacing: 0.01em; }
h2 { font-size: var(--fs-lg); line-height: var(--lh-lg); }
h3 { font-size: var(--fs-md); line-height: 22px; }
p { margin: 0 0 var(--sp-3); }
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
.muted { color: #5F6463; }
.small { font-size: var(--fs-xs); line-height: var(--lh-xs); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Fokus: immer sichtbar bei Tastaturbedienung */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sidebar :focus-visible, .sysbar :focus-visible { outline-color: var(--lime); }

.skip {
  position: absolute; left: var(--sp-3); top: -64px; z-index: 100;
  background: var(--ink); color: var(--paper-input); padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-field);
}
.skip:focus { top: var(--sp-2); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Systemleiste (Test-/Parallelbetrieb) */
.sysbar {
  background: var(--ink); color: var(--lime); font-size: var(--fs-xs); line-height: var(--lh-xs);
  min-height: 32px; display: flex; align-items: center; justify-content: center;
  padding: var(--sp-2) var(--sp-4); text-align: center; font-weight: var(--fw-medium);
}

/* Aufbau */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--w-sidebar); flex: none; background: var(--ink); color: var(--lime);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  transition: width var(--transition);
}
.sidebar a { color: var(--lime); text-decoration: none; }
.brand { display: flex; align-items: center; min-height: var(--h-topbar); padding: 0 var(--sp-4); }
.brand a { display: inline-flex; align-items: center; }
.brand-logo { display: block; height: 26px; width: auto; }
.shell[data-collapsed="true"] .brand a { width: 20px; overflow: hidden; } /* nur das „E“ */
.auth-logo .brand-logo { height: 32px; color: var(--ink); }
.nav { list-style: none; margin: 0; padding: var(--sp-2) 0; flex: 1; }
.nav li { margin: 0; }
.nav a, .nav .nav-off {
  display: flex; align-items: center; gap: var(--sp-3); min-height: 40px;
  padding: 0 var(--sp-4); font-size: var(--fs-sm); line-height: var(--lh-sm);
  border-left: 2px solid transparent; transition: background var(--transition);
}
.nav a:hover { background: var(--ink-accent); }
.nav a[aria-current="page"] { font-weight: var(--fw-medium); border-left-color: var(--lime); background: var(--ink-accent); }
.nav .nav-off { opacity: 0.7; cursor: default; }
.nav-icon {
  width: 24px; height: 24px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid currentColor; border-radius: 6px; font-size: 11px; font-weight: var(--fw-medium);
}
.nav-soon { margin-left: auto; font-size: var(--fs-xs); }
.sidebar-foot { padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--ink-accent); }
.sidebar-toggle {
  background: transparent; border: 1px solid var(--ink-accent); color: var(--lime);
  border-radius: var(--radius-field); min-height: 32px; padding: 0 var(--sp-3); font: inherit;
  font-size: var(--fs-xs); cursor: pointer;
}
.shell[data-collapsed="true"] .sidebar { width: var(--w-sidebar-collapsed); }
.shell[data-collapsed="true"] .nav-label, .shell[data-collapsed="true"] .nav-soon,
.shell[data-collapsed="true"] .brand-text { display: none; }
.shell[data-collapsed="true"] .nav a, .shell[data-collapsed="true"] .nav .nav-off { padding: 0 15px; }
.shell[data-collapsed="true"] .brand { padding: 0 var(--sp-3); }
.toggle-min { display: none; }
.shell[data-collapsed="true"] .toggle-full { display: none; }
.shell[data-collapsed="true"] .toggle-min { display: inline; }
.shell[data-collapsed="true"] .sidebar-foot { padding: var(--sp-3) var(--sp-2); text-align: center; }
.shell[data-collapsed="true"] .sidebar-toggle { padding: 0; width: 100%; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--h-topbar); display: flex; align-items: center; gap: var(--sp-3);
  padding: 0 var(--sp-5); border-bottom: 1px solid var(--hairline); background: var(--paper);
}
.topbar-spacer { flex: 1; }
.btn.menu-btn { display: none; }
.user { font-size: var(--fs-sm); line-height: var(--lh-sm); }
.content { width: 100%; max-width: 1440px; padding: var(--sp-6) var(--sp-6) var(--sp-7); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.page-head h1 { margin: 0; }
.stack > * + * { margin-top: var(--sp-5); }

/* Schaltflächen */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--h-btn); padding: 0 var(--sp-5); border-radius: var(--radius-pill);
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper-input);
  font: inherit; font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: var(--fw-medium);
  text-decoration: none; cursor: pointer; transition: background var(--transition), border-color var(--transition);
}
.btn:hover { background: var(--ink-accent); border-color: var(--ink-accent); text-decoration: none; }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--ink-border); }
.btn-secondary:hover { background: var(--surface-hover); border-color: var(--ink); }
.btn-tertiary { background: transparent; border-color: transparent; color: var(--ink-deep); min-height: 24px; padding: 0 var(--sp-1); border-radius: var(--radius-field); }
.btn-tertiary:hover { background: transparent; border-color: transparent; text-decoration: underline; }
.btn-confirm { background: var(--cta-green); border-color: var(--cta-green); color: #fff; }
.btn-confirm:hover { background: #085a33; border-color: #085a33; }
.btn-danger { background: var(--status-error); border-color: var(--status-error); color: #fff; }
.btn-danger:hover { background: #8f1f19; border-color: #8f1f19; }
.btn-sm { min-height: var(--h-btn-compact); padding: 0 var(--sp-4); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* Formulare */
.field { margin-bottom: var(--sp-4); }
.field label { display: block; font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: var(--fw-medium); margin-bottom: var(--sp-1); }
.field input[type="text"], .field input[type="email"], .field input[type="password"],
.field input[type="number"], .field input[type="search"], .field input[type="date"], .field select, .field textarea, .input {
  width: 100%; min-height: var(--h-btn); padding: var(--sp-2) var(--sp-3);
  background: var(--paper-input); color: var(--ink); border: var(--border);
  border-radius: var(--radius-field); font: inherit; font-size: var(--fs-sm); line-height: var(--lh-sm);
}
.field .help { font-size: var(--fs-xs); line-height: var(--lh-xs); color: #5F6463; margin-top: var(--sp-1); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--status-error); }
.field-error { color: var(--status-error); font-size: var(--fs-xs); line-height: var(--lh-xs); margin-top: var(--sp-1); font-weight: var(--fw-medium); }
.field-error::before { content: "⚠ "; }
.errorlist { list-style: none; margin: var(--sp-1) 0 0; padding: 0; color: var(--status-error); font-size: var(--fs-xs); font-weight: var(--fw-medium); }
.errorlist li::before { content: "⚠ "; }

/* Panels, Hinweise */
.panel { border: 1px solid var(--hairline); border-radius: var(--radius-panel); padding: var(--sp-4); background: var(--paper); }
.panel h2 { font-size: var(--fs-md); line-height: 22px; }
.notice { border: 1px solid var(--ink-border); border-radius: var(--radius-panel); padding: var(--sp-3) var(--sp-4); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.notice-error { border-color: var(--status-error); color: var(--status-error); }
.notice-warning { border-color: var(--status-warning); color: var(--status-warning); }
.notice-success { border-color: var(--status-success); color: var(--status-success); }
.notice strong { font-weight: var(--fw-medium); }
.grid-2 { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* Statusmarken */
.badge {
  display: inline-block; padding: 2px var(--sp-2); border-radius: var(--radius-pill);
  font-size: var(--fs-xs); line-height: var(--lh-xs); font-weight: var(--fw-medium);
  letter-spacing: 0.02em; background: rgba(28, 38, 38, 0.12); color: var(--ink); white-space: nowrap;
}
.badge-success { background: rgba(27, 122, 75, 0.12); color: var(--status-success-text); }
.badge-error { background: rgba(179, 38, 30, 0.12); color: var(--status-error); }
.badge-warning { background: rgba(154, 91, 0, 0.12); color: var(--status-warning-text); }

/* Tabellen */
.table-tools { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-2); flex-wrap: wrap; }
.density { display: inline-flex; gap: var(--sp-1); }
.density button { min-height: 32px; }
.density button[aria-pressed="true"] { background: var(--ink); color: var(--paper-input); border-color: var(--ink); }
.table-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--hairline); border-radius: var(--radius-panel); }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); line-height: var(--lh-sm); }
table.data th {
  position: sticky; top: 0; z-index: 2; background: var(--surface-subtle); text-align: left;
  font-size: var(--fs-xs); line-height: var(--lh-xs); font-weight: var(--fw-medium); letter-spacing: 0.02em;
  padding: 8px var(--sp-3); border-bottom: 1px solid var(--ink-border); white-space: nowrap;
}
table.data td { padding: 6px var(--sp-3); border-bottom: 1px solid var(--hairline); vertical-align: middle; height: var(--h-row-compact); }
table.data tbody tr:hover td { background: var(--surface-hover); }
table.data tbody tr[aria-selected="true"] td { background: rgba(28, 38, 38, 0.08); }
table.data tbody tr[aria-selected="true"] td:first-child { box-shadow: inset 2px 0 0 var(--ink); }
table.data th.num, table.data td.num { text-align: right; }
table.data .col-id { position: sticky; left: 0; z-index: 1; background: var(--paper); white-space: nowrap; font-weight: var(--fw-medium); }
table.data th.col-id { z-index: 3; background: var(--surface-subtle); }
table.data tbody tr:hover td.col-id { background: var(--surface-hover); }
table.data .truncate { max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }
table.data tfoot td { position: sticky; bottom: 0; background: var(--paper); border-top: 1px solid var(--ink); font-weight: var(--fw-medium); }
.table-wrap[data-density="comfort"] table.data td { padding: 12px var(--sp-3); height: var(--h-row-comfort); }
.table-empty { padding: var(--sp-5); text-align: center; color: #5F6463; }

/* Smartphone: Tabellen als Kartenliste */
@media (max-width: 767px) {
  .btn.menu-btn { display: inline-flex; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); width: min(280px, 85vw); transition: transform var(--transition); }
  .shell[data-drawer="open"] .sidebar { transform: translateX(0); }
  .shell[data-collapsed="true"] .sidebar { width: min(280px, 85vw); }
  .shell[data-collapsed="true"] .nav-label, .shell[data-collapsed="true"] .brand-text { display: inline; }
  .sidebar-foot { display: none; }
  .scrim { display: none; }
  .shell[data-drawer="open"] .scrim { display: block; position: fixed; inset: 0; background: rgba(12, 18, 18, 0.5); z-index: 40; }
  .topbar { padding: 0 var(--sp-4); height: 48px; }
  .content { padding: var(--sp-4); }
  .nav a, .nav .nav-off { min-height: 48px; }
  .btn { min-height: var(--h-btn-touch); }
  .density { display: none; }
  .table-wrap { overflow: visible; max-height: none; border: 0; }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.data tbody tr { border: 1px solid var(--hairline); border-radius: var(--radius-panel); padding: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-3); background: var(--paper); }
  table.data td { border: 0; padding: 4px 0; height: auto; display: flex; justify-content: space-between; gap: var(--sp-3); min-height: 28px; }
  table.data td::before { content: attr(data-label); color: #5F6463; font-size: var(--fs-xs); flex: none; }
  table.data .col-id { position: static; background: transparent; font-size: var(--fs-md); }
  table.data .col-id::before { content: none; }
  table.data .truncate { max-width: none; white-space: normal; }
  table.data tfoot { display: block; }
  table.data tfoot td { position: static; }
  table.data tfoot td:empty { display: none; }
}
@media (min-width: 768px) { .scrim { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}


/* ---- Version 0.3: näher an eduardteas.com (Tinte, Papier, Lime; großzügige Abstände) ---- */
.btn { letter-spacing: 0.02em; }
.panel { padding: var(--sp-5); }
.eyebrow { margin: 0 0 var(--sp-2); font-size: var(--fs-sm); line-height: var(--lh-sm); color: #5F6463; letter-spacing: 0.02em; }
.crumb { margin: 0 0 var(--sp-3); font-size: var(--fs-xs); line-height: var(--lh-xs); color: #5F6463; }
.crumb a { color: #5F6463; }
.hero { padding: var(--sp-5) 0 var(--sp-6); }
.hero h1 { font-size: 48px; line-height: 52px; letter-spacing: 0; margin: 0 0 var(--sp-3); }
.hero-text { max-width: 62ch; margin: 0; font-size: 18px; line-height: 1.4; color: var(--ink-accent); }
.page-count { margin: 0; text-align: right; font-size: var(--fs-md); }
.page-count strong { font-size: var(--fs-xl); line-height: var(--lh-xl); font-weight: var(--fw-medium); margin-right: var(--sp-1); }
.page-total { margin: 0; text-align: right; }
.page-total strong { font-size: 32px; line-height: 38px; font-weight: var(--fw-medium); }
.badges { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-3) 0 0; }
.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--sp-2) var(--sp-4); margin-bottom: var(--sp-3); }
.panel-head h2 { margin: 0; }
.panel-head p { margin: 0; }

/* Kennzahlen */
.kpi-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(236px, 1fr)); }
.kpi {
  display: flex; flex-direction: column; gap: var(--sp-1); min-height: 152px; padding: var(--sp-5);
  border: 1px solid var(--hairline); border-radius: var(--radius-panel); background: transparent;
  color: var(--ink); text-decoration: none; transition: background var(--transition), border-color var(--transition);
}
a.kpi:hover { background: var(--surface-hover); border-color: var(--ink-border); text-decoration: none; }
.kpi-label { font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: var(--fw-medium); }
.kpi-value { margin-top: auto; font-size: 44px; line-height: 48px; font-weight: var(--fw-medium); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.kpi-value-money { font-size: 34px; line-height: 44px; white-space: nowrap; }
.kpi-sub { font-size: var(--fs-xs); line-height: var(--lh-xs); color: #4B514F; }
.kpi-lime { background: var(--lime); border-color: var(--lime); }
a.kpi-lime:hover { background: #E9F58E; border-color: #E9F58E; }
.kpi-lime .kpi-sub { color: var(--ink-accent); }
.kpi-ink { background: var(--ink); border-color: var(--ink); color: var(--lime); }
a.kpi-ink:hover { background: var(--ink-accent); border-color: var(--ink-accent); }
.kpi-ink .kpi-sub { color: rgba(241, 252, 164, 0.85); }
.kpi-alert { border-color: var(--status-warning); box-shadow: inset 4px 0 0 var(--status-warning); }

/* Listen und Filter */
.filters {
  display: grid; gap: var(--sp-3) var(--sp-4); grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  align-items: end; margin-bottom: var(--sp-5); padding: var(--sp-4); border: 1px solid var(--hairline); border-radius: var(--radius-panel);
}
.filters .field { margin: 0; }
.filter-search { grid-column: span 2; }
.filter-actions { display: flex; gap: var(--sp-2); align-items: center; }
.chip-row { margin: 0 0 var(--sp-3); }
.chip { display: inline-block; padding: 2px var(--sp-3); border-radius: var(--radius-pill); background: var(--lime); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.pager { display: flex; justify-content: center; align-items: center; gap: var(--sp-4); margin-top: var(--sp-5); }
.table-wrap td .badge + .badge { margin-left: var(--sp-1); }

/* Detailseite */
.grid-3 { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--sp-2) var(--sp-4); margin: 0; }
.facts dt { color: #5F6463; font-size: var(--fs-sm); line-height: var(--lh-sm); }
.facts dd { margin: 0; font-size: var(--fs-sm); line-height: var(--lh-sm); }
.address { line-height: 1.5; margin: 0; }
.line-title { font-weight: var(--fw-medium); }
tfoot td { font-variant-numeric: tabular-nums; }

@media (max-width: 767px) {
  .content { padding: var(--sp-4); }
  .hero { padding: var(--sp-3) 0 var(--sp-4); }
  .hero h1 { font-size: 36px; line-height: 40px; }
  .kpi { min-height: 120px; padding: var(--sp-4); }
  .kpi-value { font-size: 36px; line-height: 40px; }
  .kpi-value-money { font-size: 26px; line-height: 40px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-search { grid-column: 1 / -1; }
  .page-head { flex-direction: column; }
  .page-count, .page-total { text-align: left; }
}

/* Filter: Suche immer sichtbar, weitere Filter einklappbar */
.filters { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.filter-main-actions { display: flex; gap: var(--sp-2); }
.filter-search { grid-column: auto; }
.filter-more { grid-column: 1 / -1; }
.filter-more summary { cursor: pointer; font-size: var(--fs-sm); line-height: var(--lh-sm); padding: var(--sp-1) 0; }
.filter-grid { display: grid; gap: var(--sp-3) var(--sp-4); grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); margin-top: var(--sp-3); }
.filter-grid .field { margin: 0; }
.table-wrap.table-flat { max-height: none; }
@media (max-width: 767px) {
  .topbar .user { display: none; }
  .filters { grid-template-columns: 1fr; }
  .filter-search { grid-column: 1 / -1; }
}

/* ---- Designregel 13 (09.11.2026): kompakt, möglichst viel Inhalt auf 20 bis 23 Zoll ---- */
.content { padding: var(--sp-3) var(--sp-4) var(--sp-5); max-width: none; }
.stack > * + * { margin-top: var(--sp-4); }
h1 { font-size: 24px; line-height: 30px; margin-bottom: var(--sp-2); }
h2 { font-size: 17px; line-height: 22px; margin-bottom: var(--sp-2); }
.page-head { margin-bottom: var(--sp-3); }
.panel { padding: var(--sp-3) var(--sp-4); }
.eyebrow { margin-bottom: 2px; font-size: var(--fs-xs); line-height: var(--lh-xs); }
.hero { padding: var(--sp-2) 0 var(--sp-3); }
.hero h1 { font-size: 36px; line-height: 40px; margin-bottom: var(--sp-1); }
.hero-text { font-size: 15px; line-height: 1.35; }
.kpi-grid { gap: var(--sp-3); grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.kpi { min-height: 96px; padding: var(--sp-3) var(--sp-4); }
.kpi-value { font-size: 32px; line-height: 36px; }
.kpi-value-money { font-size: 28px; line-height: 36px; }
.page-count strong { font-size: 20px; line-height: 26px; }
.page-total strong { font-size: 24px; line-height: 30px; }
.badge { padding: 0 6px; }
.btn-sm { min-height: 26px; padding: 0 var(--sp-3); font-size: 13px; }
.filters { padding: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-3); gap: var(--sp-2) var(--sp-3); }
.filters .field label, .filters label { font-size: var(--fs-xs); line-height: var(--lh-xs); }
.filters .field input, .filters .field select { min-height: 28px; font-size: 13px; padding: 2px 8px; }

/* Tabellen */
.grid-tools { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-bottom: 4px; flex-wrap: wrap; }
.grid-actions { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.grid-actions .density button { min-height: 26px; }
.grid-wrap { max-height: calc(100vh - 200px); background: var(--paper); }
table.data.grid-table { table-layout: fixed; width: 100%; font-size: 13px; line-height: 18px; }
table.data.grid-table [hidden] { display: none !important; }
table.data.grid-table th.grid-fill, table.data.grid-table td.grid-fill, table.data.grid-table col[data-fill] { width: auto; padding: 0; }
table.data.grid-table th {
  position: sticky; top: 0; z-index: 2; background: var(--surface-subtle); color: #4B514F;
  font-size: 11.5px; line-height: 16px; font-weight: 400; letter-spacing: 0.01em;
  padding: 3px 6px; border-bottom: 1px solid var(--ink-border); white-space: nowrap; overflow: hidden;
}
table.data.grid-table thead tr.filter-row th { top: var(--head-h, 24px); z-index: 2; background: var(--paper); padding: 2px 4px; border-bottom: 1px solid var(--ink-border); font-weight: 400; }
table.data.grid-table td { padding: 2px 6px; vertical-align: top; height: auto; border-bottom: 1px solid var(--hairline); overflow-wrap: anywhere; }
table.data.grid-table td.num, table.data.grid-table td.col-id, table.data.grid-table td.nowrap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.data.grid-table td.col-id { font-weight: var(--fw-regular); }
table.data.grid-table th.col-id, table.data.grid-table td.col-id { position: static; }
table.data.grid-table th.num { text-align: right; }
table.data.grid-table tbody tr:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
table.data.grid-table tbody tr[aria-selected="true"] td { background: var(--lime); }
table.data.grid-table tbody tr[aria-selected="true"] td:first-child { box-shadow: inset 3px 0 0 var(--ink); }
table.data.grid-table .badge { font-size: 11.5px; line-height: 16px; padding: 0 6px; }
.grid[data-density="comfort"] table.data.grid-table td { padding: 7px 8px; }
.grid[data-density="comfort"] table.data.grid-table th { padding: 6px 8px; }
.th-label { cursor: grab; display: block; overflow: hidden; text-overflow: ellipsis; padding-right: 6px; }
.th-label:active { cursor: grabbing; }
.sortlink { color: inherit; background: none; border: 0; padding: 0; font: inherit; letter-spacing: inherit; text-decoration: none; cursor: pointer; }
.sortlink:hover { text-decoration: underline; }
.col-resize { position: absolute; top: 0; right: -3px; width: 8px; height: 100%; cursor: col-resize; z-index: 4; touch-action: none; }
.col-resize::after { content: ""; position: absolute; top: 4px; bottom: 4px; left: 3px; width: 1px; background: var(--ink-border); opacity: 0.45; }
.col-resize:hover::after, .col-resize:focus-visible::after, .col-resize.is-dragging::after { opacity: 1; width: 2px; left: 3px; background: var(--ink); }
.drop-target { box-shadow: inset 3px 0 0 var(--ink); }
.filter-row input, .filter-row select {
  width: 100%; min-width: 0; height: 24px; padding: 0 4px; font: inherit; font-size: 12px; color: var(--ink);
  background: var(--paper-input); border: 1px solid var(--hairline); border-radius: 4px;
}
.filter-row .is-active { border-color: var(--ink); background: var(--lime); font-weight: var(--fw-medium); }
.date-pair { display: flex; flex-direction: column; gap: 1px; }
.date-pair input { height: 20px; font-size: 11px; padding: 0 2px; }
.col-menu-wrap { position: relative; }
.col-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 240px; max-height: 60vh; overflow: auto; padding: 6px; background: var(--paper); border: 1px solid var(--ink-border); border-radius: 8px; box-shadow: 0 8px 20px rgba(12, 18, 18, 0.18); }
.col-menu[hidden] { display: none; }
.col-menu ul { list-style: none; margin: 0; padding: 0; }
.col-menu li { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: 2px 4px; font-size: 13px; }
.col-menu label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.btn-icon { width: 24px; height: 24px; padding: 0; background: transparent; border: 1px solid var(--hairline); border-radius: 4px; cursor: pointer; color: var(--ink); }
.btn-icon:hover { background: var(--surface-hover); border-color: var(--ink-border); }
.grid-help { margin: 4px 0 0; }

@media (max-width: 767px) {
  .content { padding: var(--sp-3); }
  .grid-actions, .col-resize, table.data.grid-table .filter-row, .grid-help, th.grid-fill, td.grid-fill, table.data.grid-table colgroup { display: none !important; }
  .grid-wrap { max-height: none; }
  table.data.grid-table td[data-mobile="0"] { display: none; }
  table.data.grid-table td { padding: 2px 0; overflow-wrap: normal; }
  table.data.grid-table tbody tr[aria-selected="true"] td { background: transparent; }
}
.searchbar { display: flex; gap: var(--sp-2); align-items: center; margin-bottom: var(--sp-2); }
.searchbar input[type="search"] { flex: 1; max-width: 560px; min-height: 28px; font: inherit; font-size: 13px; padding: 2px 8px; background: var(--paper-input); border: 1px solid var(--ink-border); border-radius: var(--radius-field); }
.chip-row { margin: 0 0 var(--sp-2); }
.chip { text-decoration: none; font-size: 12px; line-height: 18px; padding: 1px 8px; }
.chip:hover { background: #E9F58E; }
.pager { margin-top: var(--sp-3); }
.tabs { display: flex; gap: var(--sp-1); margin-bottom: var(--sp-3); border-bottom: 1px solid var(--hairline); }
.tabs a { padding: 4px var(--sp-3); font-size: 13px; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { border-bottom-color: var(--ink); font-weight: var(--fw-medium); }
.tab-count { color: #5F6463; font-size: 11.5px; }
.actions { margin: var(--sp-2) 0 0; }
.notice { padding: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-3); font-size: 13px; }

/* Bedienung (G3): Formulare in Feldern, kompakt */
.actform { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: flex-end; margin: var(--sp-2) 0; }
.actform .field { margin: 0; }
.actform label { display: block; font-size: var(--fs-xs); line-height: var(--lh-xs); color: #5F6463; }
.actform input, .actform select, .actform textarea { min-height: 28px; font: inherit; font-size: 13px; padding: 2px 8px; background: var(--paper-input); border: 1px solid var(--ink-border); border-radius: var(--radius-field); }
.actform input[type="number"], .actform input[type="text"].narrow { width: 90px; }
.actform .wide { min-width: 240px; }
.actform .btn { align-self: flex-end; }
.inline { display: inline; margin: 0; }
.flash { margin-bottom: var(--sp-3); }
.lines-form { width: 100%; border-collapse: collapse; font-size: 13px; }
.lines-form td, .lines-form th { padding: 2px 6px; text-align: left; font-weight: normal; border-bottom: 1px solid var(--hairline); }
.lines-form input { width: 80px; }

/* ---- Rückmeldung Sven 10.11.2026: extra kompakt (Designregel 13), Startzeile, feste Tabellenköpfe ---- */
:root { --h-topbar: 36px; --w-sidebar: 232px; }
body { font-size: 14px; line-height: 20px; }
.sysbar { min-height: 22px; padding: 2px var(--sp-3); font-size: 12px; line-height: 16px; }
/* Die Testleiste bleibt immer sichtbar; Seitenleiste und Seite rechnen ihre Höhe ohne sie (Höhe setzt ui.js) */
.sysbar { position: sticky; top: 0; z-index: 60; }
.shell { min-height: calc(100vh - var(--sysbar-h, 0px)); }
.sidebar { top: var(--sysbar-h, 0px); height: calc(100vh - var(--sysbar-h, 0px)); }
.brand { min-height: 38px; padding: 0 var(--sp-3); }
.brand-logo { height: 22px; }
.nav { padding: 2px 0; }
.nav a, .nav .nav-off { min-height: 28px; padding: 0 var(--sp-3); gap: 7px; font-size: 12.5px; line-height: 18px; }
.nav-icon { width: 20px; height: 20px; font-size: 10px; border-radius: 5px; }
.sidebar-foot { padding: var(--sp-2) var(--sp-3); }
.shell[data-collapsed="true"] .nav a, .shell[data-collapsed="true"] .nav .nav-off { padding: 0 10px; }
.topbar { padding: 0 var(--sp-4); gap: var(--sp-2); }
.topbar .btn-sm { min-height: 22px; font-size: 12px; padding: 0 var(--sp-3); }
.user { font-size: 13px; line-height: 18px; }
.content { padding: 6px var(--sp-4) var(--sp-4); }
h1 { font-size: 20px; line-height: 26px; margin: 0; }
h2 { font-size: 15px; line-height: 20px; margin-bottom: 6px; }
h3 { font-size: 14px; line-height: 20px; margin-bottom: 4px; }
p { margin-bottom: var(--sp-2); }
.stack > * + * { margin-top: var(--sp-2); }
.btn { min-height: 32px; padding: 0 var(--sp-4); font-size: 13px; }
.btn-sm { min-height: 24px; padding: 0 var(--sp-3); font-size: 12.5px; }
.field { margin-bottom: var(--sp-2); }
.field label { font-size: 13px; line-height: 18px; margin-bottom: 2px; }
.field input[type="text"], .field input[type="email"], .field input[type="password"],
.field input[type="number"], .field input[type="search"], .field input[type="date"], .field select, .field textarea, .input {
  min-height: 28px; padding: 2px var(--sp-2); font-size: 13px; line-height: 20px;
}
.panel { padding: var(--sp-2) var(--sp-3); }
.panel h2 { font-size: 15px; line-height: 20px; }
.notice { padding: 3px var(--sp-3); margin-bottom: var(--sp-2); line-height: 18px; }
.flash { margin-bottom: var(--sp-2); }
.grid-2, .grid-3 { gap: var(--sp-2); }
.facts { gap: 2px var(--sp-3); }
.facts dt, .facts dd { font-size: 13px; line-height: 18px; }
.crumb { margin-bottom: 2px; }
.actions { margin: 4px 0 0; }

/* Seitenkopf: Bereich, Titel und Marken in einer Zeile */
.page-head { align-items: baseline; gap: 2px var(--sp-4); margin-bottom: 6px; }
.page-head > div:first-child { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--sp-2); min-width: 0; }
.page-head .eyebrow { margin: 0; font-size: 12px; line-height: 18px; }
.page-head .eyebrow:not(.eyebrow-end)::after { content: "/"; margin-left: var(--sp-2); color: var(--ink-border); }
.page-head .badges { margin: 0; gap: var(--sp-1); }
.page-count, .page-total { font-size: 13px; line-height: 20px; }
.page-count strong { font-size: 15px; line-height: 20px; }
.page-total strong { font-size: 18px; line-height: 24px; }

/* Startseite */
.statusline { overflow: hidden; white-space: nowrap; margin-bottom: var(--sp-2); padding: 3px var(--sp-3); border: 1px solid var(--hairline); border-radius: var(--radius-panel); font-size: 13px; line-height: 20px; }
.statusline-track { display: inline-flex; }
.statusline-text { display: inline-block; padding-right: 48px; }
.sl-group + .sl-group::before { content: "·"; margin: 0 var(--sp-3); color: #5F6463; }
.sl-group strong { font-weight: var(--fw-medium); }
.sl-test strong { background: var(--lime); padding: 0 var(--sp-2); border-radius: var(--radius-pill); }
.statusline.is-running .statusline-track { animation: statusline-run var(--ticker-duration, 40s) linear infinite; }
.statusline.is-running:hover .statusline-track, .statusline.is-running:focus-within .statusline-track { animation-play-state: paused; }
@keyframes statusline-run { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .statusline.is-running .statusline-track { animation: none; }
  .statusline { overflow-x: auto; }
}
.kpi-grid { display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--sp-2); margin-bottom: var(--sp-2); }
.kpi { min-height: 0; padding: 5px var(--sp-3); gap: 0; }
.kpi-label { font-size: 12px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value { margin-top: 0; font-size: 22px; line-height: 28px; }
.kpi-value-money { font-size: 20px; line-height: 28px; }
.kpi-sub { font-size: 11px; line-height: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modules { padding: 4px var(--sp-3); }
.modules summary { cursor: pointer; font-size: 13px; line-height: 22px; }
.modules[open] summary { margin-bottom: var(--sp-1); }
.foot-line { margin: var(--sp-2) 0 0; }

/* Tabellen: Werkzeugzeile mit Suche, drei Dichten, sichtbare Ziehgriffe, feste Köpfe */
.grid-tools { margin-bottom: 3px; gap: var(--sp-2); flex-wrap: wrap; }
.grid-lead { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; min-width: 0; flex: 1 1 auto; }
.grid-search { width: 300px; max-width: 100%; min-height: 24px; padding: 1px var(--sp-2); font: inherit; font-size: 13px; background: var(--paper-input); color: var(--ink); border: 1px solid var(--ink-border); border-radius: var(--radius-field); }
.grid-hint { cursor: help; color: #4B514F; }
.grid-actions .btn-sm, .grid-actions .density button { min-height: 24px; padding: 0 var(--sp-2); font-size: 12px; }
.grid-wrap { max-height: var(--fit-h, calc(100vh - 130px)); }
.chip-row { margin: 0 0 4px; }
.chip-reset { background: transparent; border: 1px solid var(--ink-border); }
.pager { margin-top: var(--sp-2); }

.grid[data-density="dense"] table.data.grid-table { font-size: 12.5px; line-height: 16px; }
.grid[data-density="dense"] table.data.grid-table td { padding: 1px 6px; }
.grid[data-density="dense"] table.data.grid-table th { padding: 2px 6px; font-size: 11px; line-height: 14px; }
.grid[data-density="dense"] table.data.grid-table thead tr.filter-row th { padding: 1px 3px; }
.grid[data-density="dense"] .filter-row input, .grid[data-density="dense"] .filter-row select { height: 20px; font-size: 11.5px; }
.grid[data-density="dense"] table.data.grid-table .badge { font-size: 11px; line-height: 14px; padding: 0 5px; }
.grid[data-density="dense"] .date-pair input { height: 18px; font-size: 10.5px; }

/* Fehler „merkwürdig beim Scrollen“: Der Kopf der ersten Spalte war nicht angeheftet und wurde von den Zeilen überdeckt */
table.data.grid-table th { overflow: visible; }
table.data.grid-table th.col-id { position: sticky; top: 0; left: auto; z-index: 4; background: var(--surface-subtle); }
table.data.grid-table thead tr.head-row th { z-index: 4; } /* über der Filterzeile, damit der Hinweis der Ziehgriffe sichtbar bleibt */
table.data.grid-table thead tr.filter-row th { background-clip: padding-box; }

/* Ziehgriffe der Spaltenköpfe: deutlich sichtbar, Hinweis beim Darüberfahren */
.col-resize { right: 0; width: 9px; }
.col-resize::after { top: 2px; bottom: 2px; left: 5px; width: 2px; border-radius: 1px; background: var(--ink-border); opacity: 0.7; }
.col-resize:hover::after, .col-resize:focus-visible::after, .col-resize.is-dragging::after { opacity: 1; left: 3px; width: 4px; background: var(--ink); }
.col-resize:hover::before, .col-resize:focus-visible::before {
  content: "↔ ziehen: Breite ändern · Doppelklick: Standard"; position: absolute; top: calc(100% + 3px); right: 0; z-index: 20;
  padding: 2px 8px; border-radius: 4px; background: var(--ink); color: var(--lime); font-size: 11px; line-height: 16px;
  font-weight: 400; white-space: nowrap; pointer-events: none;
}

@media (max-width: 1100px) {
  .kpi-grid { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .sysbar { min-height: 0; font-size: 11px; line-height: 14px; padding: 2px var(--sp-2); }
  .sidebar { top: 0; height: 100%; z-index: 70; }
  .topbar { height: 40px; }
  .content { padding: var(--sp-2); }
  .page-head { margin-bottom: 4px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-1) var(--sp-2); }
  .kpi { padding: 4px var(--sp-2); }
  .kpi-value { font-size: 20px; line-height: 24px; }
  .grid-lead { width: 100%; }
  .grid-search { flex: 1 1 140px; width: auto; min-height: 36px; font-size: 14px; }
  .grid-hint, .statusline-text .sl-group { font-size: 13px; }
  .grid-hint { display: none; }
  .grid-lead .btn-sm { min-height: 36px; }
  /* Kartenliste: Beleg in der ersten Zeile, die übrigen Angaben laufen darunter weiter */
  table.data.grid-table tbody tr { display: flex; flex-wrap: wrap; gap: 0 var(--sp-3); padding: 5px var(--sp-3); margin-bottom: 6px; }
  .grid-wrap { max-height: none; }
  table.data.grid-table td { display: inline-flex; width: auto; min-height: 0; padding: 0; gap: 4px; align-items: baseline; font-size: 13px; line-height: 20px; border-bottom: 0; }
  table.data.grid-table td::before { content: attr(data-label); font-size: 11px; }
  table.data.grid-table td.col-id { flex: 1 1 100%; font-size: 15px; font-weight: var(--fw-medium); }
  table.data.grid-table td.col-id::before { content: none; }
  table.data.grid-table td.num { margin-left: auto; }
}

/* ---- Navigation in Gruppen (Rückmeldung Sven 10.11.2026; Muster Brightpearl und GZL) ---- */
.sidebar { overflow: hidden; }
.nav-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; padding-bottom: var(--sp-2); }
.nav { flex: none; padding: 0; margin: 0; }
.nav-top { padding: 2px 0 var(--sp-1); }
.nav-group { border-top: 1px solid var(--ink-accent); margin-top: var(--sp-1); }
.nav-group-system { margin-top: auto; }
.nav-group-head {
  display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 5px var(--sp-3) 2px;
  background: transparent; border: 0; color: var(--lime); font: inherit; font-size: 11px; line-height: 16px;
  letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.8; cursor: pointer; text-align: left;
}
.nav-group-head:hover { opacity: 1; }
.nav-chevron { width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform var(--transition); margin-right: 3px; }
.nav-group-head[aria-expanded="false"] .nav-chevron { transform: rotate(-45deg); }
.nav a { position: relative; }
.nav-badge { margin-left: auto; min-width: 18px; padding: 0 6px; border-radius: 9px; background: var(--lime); color: var(--ink); font-size: 11px; line-height: 16px; font-weight: var(--fw-medium); text-align: center; }
.nav .nav-off { min-height: 24px; opacity: 0.5; font-size: 12.5px; }
.nav .nav-off .nav-icon { opacity: 0.8; }
.nav-soon { font-size: 10.5px; letter-spacing: 0.04em; }

/* Wortmarke: Eduard/ App; eingeklappt nur E/ */
.brand a { display: inline-flex; align-items: center; }
.brand-full { display: inline-flex; align-items: flex-end; gap: 5px; }
.brand-app { font-size: 12.5px; line-height: 1; margin-bottom: 1px; letter-spacing: 0.01em; font-weight: var(--fw-regular); }
.brand-short { display: none; }
.brand-mark { display: block; height: 22px; width: auto; }

@media (min-width: 768px) {
  /* Schmale Icon-Leiste */
  .shell[data-collapsed="true"] .brand a { width: auto; overflow: visible; }
  .shell[data-collapsed="true"] .brand { justify-content: center; padding: 0; }
  .shell[data-collapsed="true"] .brand-full { display: none; }
  .shell[data-collapsed="true"] .brand-short { display: inline-flex; }
  .shell[data-collapsed="true"] .nav-group-head { display: none; }
  .shell[data-collapsed="true"] .nav-group .nav { display: block !important; }
  .shell[data-collapsed="true"] .nav-off { display: none; }
  .shell[data-collapsed="true"] .nav-group { margin-top: 3px; padding-top: 3px; }
  .shell[data-collapsed="true"] .nav-badge { position: absolute; top: 2px; right: 6px; min-width: 0; width: 8px; height: 8px; padding: 0; font-size: 0; border: 1px solid var(--ink); }
  .shell[data-collapsed="true"] .nav a { padding: 0 15px; }
}
@media (max-width: 767px) {
  .shell[data-collapsed="true"] .brand a { width: auto; overflow: visible; }
  .shell[data-collapsed="true"] .brand { padding: 0 var(--sp-3); justify-content: flex-start; }
  .shell[data-collapsed="true"] .nav-soon { display: inline; }
  .nav-scroll { overflow-y: auto; }
  .nav-group-head { padding-top: 8px; min-height: 36px; }
}

/* ---- Werkzeugzeile der Tabellen: Suche, Marken und Zähler links, ein Dropdown „Ansicht“ rechts ---- */
.grid-tools { flex-wrap: nowrap; align-items: center; }
.grid-lead { flex-wrap: wrap; row-gap: 3px; }
.grid-lead .chip { margin: 0; white-space: nowrap; }
.grid-count { white-space: nowrap; }
.view-btn { gap: 5px; }
.view-btn svg { flex: none; }
.grid-actions { flex: none; }
.col-menu { min-width: 280px; padding: 8px 10px; }
.menu-head { margin: 6px 0 3px; font-size: 11px; line-height: 16px; letter-spacing: 0.08em; text-transform: uppercase; color: #5F6463; }
.menu-head:first-child { margin-top: 0; }
.col-menu .density { display: flex; gap: 4px; flex-wrap: wrap; }
.col-menu .density .btn { min-height: 24px; padding: 0 8px; font-size: 12px; }
.col-menu .menu-reset { width: 100%; }
.menu-note { margin: 6px 0 0; }
@media (max-width: 767px) {
  .grid-tools { flex-wrap: wrap; }
  .grid-lead .chip-reset { display: none; }
}

.nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nav .nav-off .nav-soon { margin-left: auto; flex: none; }

/* Reiter über Listen dürfen auf dem Handy seitlich wischen statt abgeschnitten zu werden */
.tabs { overflow-x: auto; white-space: nowrap; scrollbar-width: thin; }

/* ---- Navigation H2 (Rückmeldung Sven 10.11.2026): Icon-Leiste als Standard, Überlagerung beim Darüberfahren,
   Burger mit Bereichsübersicht, Modus je Benutzer ---- */
:root { --nav-open: 232px; --nav-rail: 56px; }
.shell[data-nav-mode="open"] { --nav-cur: var(--nav-open); }
.shell[data-nav-mode="auto"], .shell[data-nav-mode="closed"] { --nav-cur: var(--nav-rail); }
.sidebar-slot { flex: none; width: var(--nav-cur); position: relative; z-index: 30; transition: width var(--transition); }
.shell .sidebar {
  position: fixed; left: 0; top: var(--sysbar-h, 0px); height: calc(100vh - var(--sysbar-h, 0px));
  width: var(--nav-cur); transform: none; z-index: 40; overflow: hidden;
  transition: width 160ms ease, box-shadow 160ms ease;
}
.shell[data-peek="true"] .sidebar { width: var(--nav-open); box-shadow: 8px 0 24px rgba(12, 18, 18, 0.35); }
.topbar .user { font-size: 13px; }
.burger { width: 32px; height: 26px; display: inline-flex; align-items: center; justify-content: center; padding: 0; background: transparent; border: 1px solid var(--ink-border); border-radius: var(--radius-field); color: var(--ink); cursor: pointer; }
.burger:hover { background: var(--surface-hover); border-color: var(--ink); }
.burger span { display: grid; gap: 3px; }
.burger i { display: block; width: 14px; height: 2px; background: currentColor; border-radius: 1px; }
.topbar-brand { display: none; color: var(--ink); text-decoration: none; }
.topbar-brand .brand-short { display: none !important; }
.topbar-brand .brand-full { display: inline-flex; }

/* Icon-Leiste (Standard und „Immer eingeklappt“), solange nicht aufgeklappt */
.shell[data-rail="true"]:not([data-peek="true"]) .sidebar .brand { justify-content: center; padding: 0; }
.shell[data-rail="true"]:not([data-peek="true"]) .sidebar .brand a { width: auto; overflow: visible; }
.shell[data-rail="true"]:not([data-peek="true"]) .sidebar .brand-full { display: none; }
.shell[data-rail="true"]:not([data-peek="true"]) .sidebar .brand-short { display: inline-flex; }
.shell[data-rail="true"]:not([data-peek="true"]) .sidebar .nav-group-head { display: none; }
.shell[data-rail="true"] .sidebar .nav-group .nav { display: block !important; }
.shell[data-rail="true"] .sidebar .nav-group-head { pointer-events: none; }
.shell[data-rail="true"] .sidebar .nav-chevron { display: none; }
.shell[data-rail="true"]:not([data-peek="true"]) .sidebar .nav-label,
.shell[data-rail="true"]:not([data-peek="true"]) .sidebar .nav-soon,
.shell[data-rail="true"]:not([data-peek="true"]) .sidebar .nav-off { display: none; }
.shell[data-rail="true"]:not([data-peek="true"]) .sidebar .nav a { padding: 0 15px; }
.shell[data-rail="true"]:not([data-peek="true"]) .sidebar .nav-group { margin-top: 3px; padding-top: 3px; }
.shell[data-rail="true"]:not([data-peek="true"]) .sidebar .nav-badge {
  position: absolute; top: 1px; right: 3px; min-width: 14px; height: 14px; padding: 0 3px; font-size: 10px; line-height: 12px;
  border: 1px solid var(--ink); margin: 0;
}
.sidebar-foot { display: none; }

/* Bereichsübersicht (Burger) */
.navpanel {
  position: fixed; left: 0; top: var(--sysbar-h, 0px); bottom: 0; width: min(320px, 92vw); z-index: 90;
  background: var(--ink); color: var(--lime); display: flex; flex-direction: column; box-shadow: 8px 0 24px rgba(12, 18, 18, 0.4);
}
.navpanel[hidden] { display: none; }
.navpanel a { color: var(--lime); text-decoration: none; }
.navpanel-scroll { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: var(--sp-3); }
.nav-group-title { margin: 0; padding: 5px var(--sp-3) 2px; font-size: 11px; line-height: 16px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.8; border-top: 1px solid var(--ink-accent); }
.navpanel .nav a:hover { background: var(--ink-accent); }
.navpanel .nav a[aria-current="page"] { font-weight: var(--fw-medium); border-left-color: var(--lime); background: var(--ink-accent); }
.shell[data-panel="open"] .scrim { display: block; position: fixed; inset: 0; background: rgba(12, 18, 18, 0.5); z-index: 80; }

/* Benutzermenü */
.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 2px 6px; border-radius: var(--radius-field); }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover { background: var(--surface-hover); }
.usermenu .nav-chevron { margin-right: 0; }
.usermenu[open] .nav-chevron { transform: rotate(-135deg); }
.usermenu-panel { position: absolute; right: 0; top: calc(100% + 4px); z-index: 70; min-width: 270px; padding: 8px 10px; background: var(--paper); border: 1px solid var(--ink-border); border-radius: 8px; box-shadow: 0 8px 20px rgba(12, 18, 18, 0.18); }
.seg { display: flex; gap: 4px; flex-wrap: wrap; margin: 0; }
.seg .btn[aria-pressed="true"] { background: var(--ink); color: var(--paper-input); border-color: var(--ink); }
.usermenu-panel .menu-reset { width: 100%; }

@media (max-width: 767px) {
  .sidebar-slot { display: none; }
  .topbar-brand { display: inline-flex; }
  .topbar-brand .brand-app { font-size: 12px; }
  .topbar .user { display: none; }
  .usermenu summary { min-height: 32px; }
  .usermenu-panel { right: -8px; min-width: min(300px, 92vw); }
  .usermenu .seg .btn { min-height: 36px; }
  .burger { width: 40px; height: 32px; }
}
@media (min-width: 768px) {
  .shell[data-panel="open"] .scrim { display: block !important; }
}
@media (prefers-reduced-motion: reduce) {
  .shell .sidebar, .sidebar-slot { transition: none; }
}

/* Morgenbriefing (Startseite) */
.briefing { display: grid; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.briefing h3 { margin: var(--sp-2) 0 0; color: #5F6463; font-weight: var(--fw-medium); }
.briefing-sentences { margin: 0; padding-left: var(--sp-4); display: grid; gap: 2px; }
.system-state { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); }
