/* Fallakte · Kopfkarte, Phasenleiste und Kennzahlen-Chips (Entwurf A „Ruhige Akte“). Nur Bildschirm.
   Lila-Tokens (--compact-*, --lila-*); Serife (Cardo) nur für den Namen; Dark Mode über html[data-workspace-theme="dark"]. */
@media screen {
  .case-record-header { --cf-serif:'Cardo',Georgia,"Times New Roman",serif; --cf-lilac:#7a5697; --cf-ok:#2f6a4c; --cf-ok-bg:#e6f2ea; --cf-warn:#8a5a12; --cf-warn-bg:#fbf1e3; --cf-danger:#9b2f2a; --cf-danger-bg:#fbe4e2; }
  html[data-workspace-theme="dark"] .case-record-header { --cf-lilac:#c9aee0; --cf-ok:#99d5b3; --cf-ok-bg:#24402f; --cf-warn:#e9c27b; --cf-warn-bg:#403728; --cf-danger:#f19b96; --cf-danger-bg:#4b2e2d; }
  html body[data-workspace-skin="lila"] .record-workspace-head.case-record-header { grid-template-columns:36px minmax(0,1fr) auto; grid-template-areas:"back identity actions" "routing routing routing"; gap:12px 16px; align-items:start; padding:16px 20px 0; }
  html body[data-workspace-skin="lila"] .case-record-header .record-back { margin-top:4px; border-radius:10px; color:var(--compact-accent); }
  .case-record-header .case-header-identity { display:grid; gap:0; align-content:start; }
  .cockpit-eyebrow { display:block; font-size:10.5px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--cf-lilac); margin-bottom:3px; }
  html body[data-workspace-skin="lila"] .case-record-header h1 { font-family:var(--cf-serif); font-weight:400; font-size:28px; line-height:1.15; letter-spacing:.01em; color:var(--compact-text); }
  html body[data-workspace-skin="lila"] .case-record-header .case-header-identity > .cockpit-meta { display:flex; flex-wrap:wrap; align-items:center; gap:6px 14px; margin:8px 0 0; font-size:12.5px; color:var(--compact-muted); }
  .cockpit-meta > span { display:inline-flex; align-items:center; gap:5px; min-width:0; overflow-wrap:anywhere; }
  .cockpit-meta > span svg { width:14px; height:14px; flex:none; color:var(--compact-accent); }
  .cockpit-meta b { color:var(--compact-text); font-weight:600; }
  .cockpit-meta > .status { background:#643182; color:#fff; font-size:11.5px; min-height:22px; }
  .cockpit-origin { margin-top:8px; }
  .cockpit-head-actions { grid-area:actions; display:grid; gap:8px; justify-items:end; align-self:start; max-width:100%; min-width:0; }
  .cockpit-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; }
  .cockpit-actions .button { min-height:34px; border-radius:9px; text-decoration:none; }
  html body[data-workspace-skin="lila"] .cockpit-head-actions .case-data-sheet-toolbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:6px 10px; width:auto; max-width:100%; margin:0; padding:6px 10px; border:1px dashed var(--lila-border); border-radius:9px; background:var(--compact-soft); }
  .cockpit-head-actions .case-data-sheet-toolbar .case-data-sheet-icon, .cockpit-head-actions .case-data-sheet-toolbar p { display:none; }
  .cockpit-head-actions .case-data-sheet-toolbar > div { display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 8px; min-width:0; }
  html body[data-workspace-skin="lila"] .cockpit-head-actions .case-data-sheet-toolbar small { font-size:9.5px; letter-spacing:.08em; color:var(--cf-lilac); }
  html body[data-workspace-skin="lila"] .cockpit-head-actions .case-data-sheet-toolbar strong { margin:0; font-size:12.5px; color:var(--compact-text); }
  .cockpit-head-actions .case-data-sheet-toolbar > .status { font-size:10.5px; min-height:20px; }
  .cockpit-head-actions .case-data-sheet-actions { display:flex; flex-wrap:wrap; gap:6px; }
  .cockpit-head-actions .case-data-sheet-actions .button { min-height:30px; font-size:12px; }
  .case-record-header .cockpit-summary-retired { display:none !important; }
  html body[data-workspace-skin="lila"] .case-header-routing .record-routing { border-radius:0 0 12px 12px; padding:10px 20px; }

  /* Phasenleiste und Kennzahlen */
  .case-cockpit { padding:0; background:transparent; border:0; }
  .cockpit-stages { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:6px; }
  .cockpit-stage { position:relative; overflow:hidden; display:grid; gap:1px; min-width:0; padding:8px 10px 8px 14px; border:1px solid var(--compact-line); border-radius:9px; background:var(--compact-surface); }
  .cockpit-stage::before { content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--lila-border); }
  .cockpit-stage.done::before { background:#5c9b78; }
  .cockpit-stage.active { border-color:#b394cc; background:linear-gradient(90deg,var(--compact-tint),var(--compact-surface)); }
  .cockpit-stage.active::before { background:#643182; }
  .cockpit-stage b { display:flex; align-items:center; gap:6px; font-size:12.5px; color:var(--compact-text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .cockpit-stage b svg { width:13px; height:13px; flex:none; color:#2f6a4c; }
  .cockpit-stage small { display:block; font-size:11px; color:var(--compact-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .cockpit-kpis { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
  .cockpit-kpi { display:inline-flex; align-items:center; gap:8px; min-height:38px; padding:5px 12px 5px 6px; border:1px solid var(--compact-line); border-radius:999px; background:var(--compact-surface); font:inherit; font-size:12.5px; line-height:1.3; color:var(--compact-muted); cursor:pointer; text-align:left; }
  .cockpit-kpi:hover { border-color:#b394cc; }
  .cockpit-kpi:focus-visible { outline:2px solid var(--compact-accent); outline-offset:2px; }
  .cockpit-kpi > b { display:inline-grid; place-items:center; min-width:26px; height:26px; padding:0 7px; border-radius:999px; background:var(--compact-tint); color:var(--compact-accent); font-size:13px; font-weight:700; font-variant-numeric:tabular-nums; }
  .cockpit-kpi > b svg { width:14px; height:14px; }
  .cockpit-kpi.warn > b { background:#fbf1e3; color:#8a5a12; }
  .cockpit-kpi.danger > b { background:#fbe4e2; color:#9b2f2a; }
  .cockpit-kpi.ok > b { background:#e6f2ea; color:#2f6a4c; }
  .cockpit-kpi.plain { cursor:default; }
  .cockpit-kpi.plain:hover { border-color:var(--compact-line); }
  html[data-workspace-theme="dark"] .cockpit-kpi.warn > b { background:#403728; color:#e9c27b; }
  html[data-workspace-theme="dark"] .cockpit-kpi.danger > b { background:#4b2e2d; color:#f19b96; }
  html[data-workspace-theme="dark"] .cockpit-kpi.ok > b { background:#24402f; color:#99d5b3; }
  html[data-workspace-theme="dark"] .cockpit-stage b svg { color:#99d5b3; }
  html[data-workspace-theme="dark"] .cockpit-meta > .status { background:#643182; color:#fff; }

  @media (max-width:1250px) {
    html body[data-workspace-skin="lila"] .record-workspace-head.case-record-header { grid-template-columns:36px minmax(0,1fr); grid-template-areas:"back identity" "actions actions" "routing routing"; }
    .cockpit-head-actions { justify-items:start; }
    .cockpit-actions { justify-content:flex-start; }
    html body[data-workspace-skin="lila"] .cockpit-head-actions .case-data-sheet-toolbar { justify-content:flex-start; }
  }
  @media (max-width:760px) {
    .cockpit-stages { grid-template-columns:repeat(5,minmax(132px,1fr)); overflow-x:auto; scrollbar-width:none; margin-inline:-14px; padding-inline:14px; padding-bottom:2px; }
    .cockpit-kpi { min-height:34px; font-size:12px; }
  }
  @media (max-width:680px) {
    html body[data-workspace-skin="lila"] .record-workspace-head.case-record-header { padding:14px 14px 0; gap:10px 12px; }
    html body[data-workspace-skin="lila"] .case-record-header h1 { font-size:23px; }
    html body[data-workspace-skin="lila"] .case-header-routing .record-routing { padding:10px 14px; }
  }
}
