/* Verwaltung: übersichtlichere Navigation und Einstellungen. Nur Bildschirm. */
@media screen {
  /* Einklappbare Navigationsgruppen */
  body[data-experience="workspace"] .calm-nav-section h2[data-nav-toggle] { display:flex; align-items:center; justify-content:space-between; gap:8px; cursor:pointer; user-select:none; border-radius:6px; padding:6px 10px; margin:6px 0 4px; }
  body[data-experience="workspace"] .calm-nav-section h2[data-nav-toggle]:hover { background:rgba(255,255,255,.08); }
  body[data-experience="workspace"] .calm-nav-section h2[data-nav-toggle]:focus-visible { outline:2px solid #d9b3e8; outline-offset:1px; }
  body[data-experience="workspace"] .calm-nav-section h2[data-nav-toggle] svg { width:13px; height:13px; transform:rotate(90deg); transition:transform .18s; opacity:.7; }
  body[data-experience="workspace"] .calm-nav-section.collapsed h2[data-nav-toggle] svg { transform:rotate(0deg); }
  body[data-experience="workspace"] .calm-nav-section.collapsed > :not(h2) { display:none !important; }
  body[data-experience="workspace"] .calm-nav-section.collapsed { margin-bottom:6px; }
  html[data-workspace-look="sanft"] body[data-experience="workspace"] .calm-nav-section h2[data-nav-toggle]:hover { background:#efe6f5; }

  /* Einstellungen: linke Bereichsliste statt umbrechender Registerkartenzeile */
  body[data-experience="workspace"] .settings-layout { display:grid; grid-template-columns:272px minmax(0,1fr); gap:22px; align-items:start; }
  body[data-experience="workspace"] .settings-nav { position:sticky; top:84px; display:grid; gap:14px; padding:12px; background:var(--compact-surface,#fff); border:1px solid var(--compact-line,#e6dfeb); border-radius:10px; max-height:calc(100dvh - 100px); overflow:auto; }
  body[data-experience="workspace"] .settings-nav-filter { display:flex; align-items:center; gap:8px; padding:0 10px; height:38px; border:1px solid var(--compact-line,#e6dfeb); border-radius:8px; background:var(--compact-soft,#faf8fc); }
  body[data-experience="workspace"] .settings-nav-filter svg { width:15px; height:15px; color:var(--compact-muted,#756c7c); flex-shrink:0; }
  body[data-experience="workspace"] .settings-nav-filter input { flex:1; min-width:0; border:0; background:transparent; outline:0; font:inherit; font-size:13px; color:inherit; }
  body[data-experience="workspace"] .settings-nav-group { display:grid; gap:2px; }
  body[data-experience="workspace"] .settings-nav-group h2 { margin:6px 8px 4px; font-size:10.5px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--compact-muted,#756c7c); }
  body[data-experience="workspace"] .settings-nav-item { display:grid; gap:2px; width:100%; padding:8px 10px; border:0; border-radius:8px; background:transparent; text-align:left; color:inherit; cursor:pointer; transition:background .15s; }
  body[data-experience="workspace"] .settings-nav-item strong { font-size:13.5px; font-weight:600; }
  body[data-experience="workspace"] .settings-nav-item span { font-size:11.5px; line-height:1.4; color:var(--compact-muted,#756c7c); }
  body[data-experience="workspace"] .settings-nav-item:hover { background:var(--compact-tint,#f2ebf7); }
  body[data-experience="workspace"] .settings-nav-item.active { background:#643182; color:#fff; box-shadow:0 8px 18px rgba(100,49,130,.22); }
  body[data-experience="workspace"] .settings-nav-item.active span { color:#e9daf2; }
  body[data-experience="workspace"] .settings-nav-item[hidden], body[data-experience="workspace"] .settings-nav-group[hidden] { display:none; }
  body[data-experience="workspace"] .settings-content { min-width:0; }
  body[data-experience="workspace"] .settings-content > .panel:first-child { margin-top:0; }
  html[data-workspace-theme="dark"] body[data-experience="workspace"] .settings-nav-item:hover { background:#3a2f42; }
  @media (max-width: 1100px) {
    body[data-experience="workspace"] .settings-layout { grid-template-columns:1fr; }
    body[data-experience="workspace"] .settings-nav { position:static; max-height:none; }
    body[data-experience="workspace"] .settings-nav-group { display:flex; flex-wrap:wrap; gap:4px; }
    body[data-experience="workspace"] .settings-nav-group h2 { flex-basis:100%; }
    body[data-experience="workspace"] .settings-nav-item { width:auto; }
    body[data-experience="workspace"] .settings-nav-item span { display:none; }
  }

  /* Globale Suche: Bereichs-Treffer */
  body[data-experience="workspace"] .global-search-results section h3 { letter-spacing:.06em; }
}

@media screen {
  /* Zuletzt geöffnete Akten */
  body[data-experience="workspace"] .recent-records { margin:0 0 22px; }
  body[data-experience="workspace"] .recent-records h2 { margin:0 0 10px; font-size:12px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--compact-muted,#756c7c); }
  body[data-experience="workspace"] .recent-records-list { display:flex; flex-wrap:wrap; gap:8px; }
  body[data-experience="workspace"] .recent-record { display:inline-flex; align-items:center; gap:9px; max-width:280px; padding:7px 12px 7px 9px; border:1px solid var(--compact-line,#e6dfeb); border-radius:999px; background:var(--compact-surface,#fff); color:inherit; text-align:left; cursor:pointer; transition:border-color .15s, box-shadow .15s, transform .15s; }
  body[data-experience="workspace"] .recent-record:hover { border-color:#c9b0d8; box-shadow:0 6px 16px rgba(100,49,130,.12); transform:translateY(-1px); }
  body[data-experience="workspace"] .recent-record svg { width:16px; height:16px; color:#643182; flex-shrink:0; }
  body[data-experience="workspace"] .recent-record span { display:grid; line-height:1.2; min-width:0; }
  body[data-experience="workspace"] .recent-record strong { font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  body[data-experience="workspace"] .recent-record small { font-size:11px; color:var(--compact-muted,#756c7c); }

  /* Direktaktionen in der Fallliste */
  body[data-experience="workspace"] .data-table td.row-actions { white-space:nowrap; text-align:right; padding-right:10px; }
  body[data-experience="workspace"] .data-table th.row-actions-head { width:1%; }
  body[data-experience="workspace"] .row-action { display:inline-grid; place-items:center; width:30px; height:30px; margin-left:2px; border:1px solid transparent; border-radius:8px; background:transparent; color:#7b6f86; vertical-align:middle; cursor:pointer; transition:background .15s, color .15s, border-color .15s; }
  body[data-experience="workspace"] .row-action svg { width:15px; height:15px; }
  body[data-experience="workspace"] .row-action:hover, body[data-experience="workspace"] .row-action:focus-visible { background:#f2ebf7; color:#643182; border-color:#dccbe6; }
  body[data-experience="workspace"] .data-table tbody tr:not(:hover):not(:focus-within) .row-action { opacity:.55; }
  body[data-experience="workspace"] .sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

  /* Arbeitskorb-Register */
  body[data-experience="workspace"] .workbench-tabs { margin:-4px 0 18px; }
  body[data-experience="workspace"] .workbench-tabs .tab { display:inline-flex; align-items:center; gap:7px; }
  body[data-experience="workspace"] .workbench-tabs .tab-badge { min-width:18px; padding:1px 6px; border-radius:999px; background:#f0e6f5; color:#643182; font-size:11px; font-weight:700; text-align:center; }
  body[data-experience="workspace"] .workbench-tabs .tab.active .tab-badge { background:#ffffff33; color:#fff; }

  /* Aktennavigation: „Weitere Bereiche“ einklappbar */
  body[data-experience="workspace"] .lila-nav-group.lila-nav-more { margin-top:14px; padding-top:12px; border-top:1px solid var(--lila-border,#d8c8e2); }
  body[data-experience="workspace"] button.lila-nav-caption { display:flex; align-items:center; justify-content:space-between; width:100%; border:0; background:transparent; cursor:pointer; font:inherit; font-size:10px; font-weight:650; text-transform:uppercase; color:var(--compact-muted); padding:4px 10px; border-radius:6px; }
  body[data-experience="workspace"] button.lila-nav-caption:hover { background:rgba(100,49,130,.08); }
  body[data-experience="workspace"] button.lila-nav-caption svg { width:12px; height:12px; transform:rotate(90deg); transition:transform .18s; }
  body[data-experience="workspace"] .lila-nav-more.collapsed button.lila-nav-caption svg { transform:rotate(0deg); }
  body[data-experience="workspace"] .lila-nav-more.collapsed > :not(.lila-nav-caption) { display:none !important; }
}

@media screen {
  /* E-Mail: Herkunft INTERN / EXTERN */
  body[data-experience="workspace"] .mail-origin { display:inline-block; margin-right:6px; padding:1px 6px; border-radius:4px; font-size:10.5px; font-weight:700; letter-spacing:.04em; vertical-align:middle; }
  body[data-experience="workspace"] .mail-origin.intern { background:#e6f2ea; color:#2f6a4c; }
  body[data-experience="workspace"] .mail-origin.extern { background:#fbecd9; color:#8a5a12; }
  body[data-experience="workspace"] .mail-origin-banner { display:flex; gap:10px; align-items:flex-start; margin:0 0 14px; padding:10px 14px; border-radius:8px; font-size:13px; line-height:1.5; }
  body[data-experience="workspace"] .mail-origin-banner svg { width:18px; height:18px; flex-shrink:0; margin-top:1px; }
  body[data-experience="workspace"] .mail-origin-banner.intern { background:#e6f2ea; color:#2f5a45; }
  body[data-experience="workspace"] .mail-origin-banner.extern { background:#fbf1e3; color:#6d4a10; border:1px solid #f0d9b3; }

  /* To-do-Wichtigkeit */
  body[data-experience="workspace"] .todo-priority { display:inline-block; margin-right:8px; padding:2px 8px; border-radius:999px; font-size:11px; font-weight:700; vertical-align:middle; }
  body[data-experience="workspace"] .todo-priority.high { background:#fbe4e2; color:#9b2f2a; }
  body[data-experience="workspace"] .todo-priority.low { background:#eceef2; color:#5d6068; }

  /* Fahrkarten mit hoher Dringlichkeit */
  body[data-experience="workspace"] #dispatch-inbox article.dispatch-urgent { border-left:4px solid #b4322c; background:#fff5f4; }
  body[data-experience="workspace"] .dispatch-urgent-badge { display:inline-block; padding:2px 8px; border-radius:999px; background:#b4322c; color:#fff; font-size:11px; font-weight:700; letter-spacing:.04em; vertical-align:middle; }

  /* Erbenerklärung im Rechnungsdialog */
  body[data-experience="workspace"] .billing-attach-heir { display:flex; gap:10px; align-items:flex-start; margin:10px 0 4px; padding:12px 14px; border:1px solid var(--compact-line,#e6dfeb); border-radius:8px; background:var(--compact-soft,#faf8fc); cursor:pointer; }
  body[data-experience="workspace"] .billing-attach-heir input { margin-top:3px; }
  body[data-experience="workspace"] .billing-attach-heir strong { display:block; font-size:13.5px; }
  body[data-experience="workspace"] .billing-attach-heir small { display:block; color:var(--compact-muted,#756c7c); font-size:12px; line-height:1.45; }
}
@media screen {
  body[data-experience="workspace"] .billing-include-external { display:flex; gap:10px; align-items:flex-start; margin-top:10px; padding:10px 12px; border:1px solid var(--compact-line,#e6dfeb); border-radius:8px; background:#fff; cursor:pointer; font-weight:400; }
  body[data-experience="workspace"] .billing-include-external input { margin-top:3px; }
  body[data-experience="workspace"] .billing-include-external strong { display:block; font-size:13px; }
  body[data-experience="workspace"] .billing-include-external small { display:block; color:var(--compact-muted,#756c7c); font-size:12px; line-height:1.45; }
}

/* Herkunft eines Sterbefalls (Ordnungsamt, Kriminalpolizei, Notüberführung) in Fallübersichten */
.case-origin { display:flex; flex-direction:column; align-items:flex-start; gap:3px; margin-top:6px; }
.case-origin b { display:inline-flex; align-items:center; gap:5px; padding:2px 8px; border-radius:999px; font-size:11px; font-weight:700; line-height:1.4; white-space:nowrap; }
.case-origin b svg { width:12px; height:12px; }
.case-origin small { font-size:11px; color:var(--muted, #6a6072); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:220px; }
.case-origin-authority b { background:#fbefd9; color:#7a4a0f; }
.case-origin-police b { background:#e6edf5; color:#213a5c; }
.case-origin-emergency b { background:#fbe9e7; color:#8a2b22; }
