/* ============================================================
   TrialStudio – Design-System
   Farb-Tokens nach Dataviz-Referenzpalette (validiert)
   ============================================================ */

:root {
  color-scheme: light;
  /* Flächen & Tinte */
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f3f2ee;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --ink-muted: #898781;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  /* Kategorial (feste Reihenfolge, nie zyklisch) */
  --series-1: #2a78d6;
  --series-2: #1baf7a;
  --series-3: #eda100;
  --series-4: #008300;
  --series-5: #4a3aa7;
  --series-6: #e34948;
  /* Status (reserviert) */
  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-serious: #ec835a;
  --status-critical: #d03b3b;
  --good-text: #006300;
  --crit-text: #b02a2a;
  /* Akzent (UI) */
  --accent: #2a78d6;
  --accent-ink: #ffffff;
  --accent-soft: rgba(42, 120, 214, 0.10);
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(11,11,11,.05), 0 4px 14px rgba(11,11,11,.05);
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #232322;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --ink-muted: #898781;
    --grid: #2c2c2a;
    --baseline: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --series-1: #3987e5;
    --series-2: #199e70;
    --series-3: #c98500;
    --series-4: #008300;
    --series-5: #9085e9;
    --series-6: #e66767;
    --good-text: #0ca30c;
    --crit-text: #e66767;
    --accent: #3987e5;
    --accent-soft: rgba(57, 135, 229, 0.16);
    --shadow: none;
  }
}

/* expliziter Theme-Toggle (data-theme) gewinnt in beide Richtungen */
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #232322;
  --ink: #ffffff;
  --ink-2: #c3c2b7;
  --ink-muted: #898781;
  --grid: #2c2c2a;
  --baseline: #383835;
  --border: rgba(255, 255, 255, 0.10);
  --series-1: #3987e5;
  --series-2: #199e70;
  --series-3: #c98500;
  --series-4: #008300;
  --series-5: #9085e9;
  --series-6: #e66767;
  --good-text: #0ca30c;
  --crit-text: #e66767;
  --accent: #3987e5;
  --accent-soft: rgba(57, 135, 229, 0.16);
  --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--page);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.45;
}

/* ---------- Layout ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
}
.brand {
  font-weight: 700; font-size: 15px; letter-spacing: .2px;
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.topbar .brand { cursor: pointer; }
.brand .logo {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--accent); color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800;
}
.topbar .crumbs { color: var(--ink-2); font-size: 13.5px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.topbar .crumbs a { color: var(--ink-2); text-decoration: none; }
.topbar .crumbs a:hover { color: var(--accent); }
.topbar .crumbs .sep { color: var(--ink-muted); }
.topbar .crumbs .current { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .spacer { flex: 1; }

.main { flex: 1; width: 100%; }
.container { max-width: 1200px; margin: 0 auto; padding: 26px 20px 60px; }

/* ---------- Fusszeile (fix am unteren Rand) ---------- */
.appfooter {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 5px 20px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--ink-2);
}
.appfooter .credit { white-space: nowrap; }
.appfooter .spacer { flex: 1; }
.appfooter .footactions { display: inline-flex; gap: 6px; }
.appfooter a.btn { text-decoration: none; }
/* Platz, damit die fixe Fusszeile keinen Inhalt verdeckt */
.app { padding-bottom: 46px; }

/* ---------- Buttons ---------- */
.btn {
  font: inherit; font-size: 13.5px; font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: background .12s ease, border-color .12s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--crit-text); }
.btn.small { padding: 4px 10px; font-size: 12.5px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }

/* ---------- Sync-Badge ---------- */
.syncbadge { gap: 6px; }
.syncbadge .syncdot { width: 8px; height: 8px; border-radius: 50%; background: var(--baseline); flex: none; }
.syncbadge .syncdot.t-good { background: var(--status-good); }
.syncbadge .syncdot.t-warning { background: var(--status-warning); }
.syncbadge .syncdot.t-critical { background: var(--status-critical); }

/* ---------- Login-Gate ---------- */
.gate {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: var(--page);
}
.gate-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 32px 26px;
  width: 100%; max-width: 380px;
  text-align: center;
}
.gate-card .gate-sub { color: var(--ink-muted); font-size: 12.5px; margin: 0 0 20px; }
.gate-card h2 { font-size: 17px; margin: 0 0 14px; }
.gate-card form { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.gate-card input { padding: 9px 11px; font-size: 14px; }
.gate-error { color: var(--crit-text); font-size: 12.5px; min-height: 16px; }
.gate-success { color: var(--good-text); font-size: 12.5px; }
.gate-toggle {
  display: inline-block; margin-top: 16px; font-size: 12.5px;
  color: var(--ink-2); text-decoration: none;
}
.gate-toggle:hover { color: var(--accent); }

/* ---------- Sichtbarkeits-Chip ---------- */
.vischip {
  flex: none; font-size: 11px; font-weight: 700; letter-spacing: .3px;
  padding: 2px 9px; border-radius: 99px; white-space: nowrap;
}
.vischip.v-public { background: var(--accent-soft); color: var(--accent); }
.vischip.v-private { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--border); }

/* ---------- Cards / Listen ---------- */
.page-title { font-size: 22px; font-weight: 750; margin: 0 0 4px; }
.page-sub { color: var(--ink-2); margin: 0 0 22px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.card.clickable { cursor: pointer; transition: border-color .12s ease, transform .12s ease; }
.card.clickable:hover { border-color: var(--accent); }
.card h3 { margin: 0 0 4px; font-size: 15.5px; }
.card .meta { color: var(--ink-muted); font-size: 12.5px; }
.card .desc { color: var(--ink-2); font-size: 13.5px; margin: 6px 0 0; }
.card .cardactions { display: flex; gap: 8px; margin-top: 12px; }

.empty-hint {
  border: 1.5px dashed var(--baseline);
  border-radius: var(--radius);
  padding: 34px 20px; text-align: center; color: var(--ink-muted);
}

/* ---------- Ansicht-Umschalter (Kacheln/Liste) ---------- */
.toolbar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.viewtoggle {
  display: inline-flex; border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden; flex: none;
}
.viewtoggle .vt-btn {
  font: inherit; font-size: 12.5px; font-weight: 600;
  padding: 6px 12px; background: var(--surface); border: none; cursor: pointer;
  color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center;
}
.viewtoggle .vt-btn + .vt-btn { border-left: 1px solid var(--border); }
.viewtoggle .vt-btn:hover { background: var(--surface-2); }
.viewtoggle .vt-btn.active { background: var(--accent-soft); color: var(--accent); }

/* ---------- Listen-Ansicht ---------- */
.listwrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
table.listtable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.listtable th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: var(--ink-muted);
  padding: 10px 14px; border-bottom: 1.5px solid var(--baseline);
  white-space: nowrap;
}
.listtable td { padding: 9px 14px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
.listtable tbody tr:last-child td { border-bottom: none; }
.listtable tbody tr.rowlink { cursor: pointer; }
.listtable tbody tr.rowlink:hover { background: var(--surface-2); }
.listtable td.num { text-align: right; font-variant-numeric: tabular-nums; }
.listtable .rowname { font-weight: 650; }
.listtable .rowsub { color: var(--ink-muted); font-size: 12px; }
.listtable td.actions { text-align: right; white-space: nowrap; }

/* ---------- Workspace (Datensatz) ---------- */
.workspace { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 0; flex: 1; min-height: 0; }
.sidenav {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 14px 10px 40px;
  overflow-y: auto;
  position: sticky; top: 47px;
  height: calc(100vh - 47px);
}
.sidenav .navgroup { margin: 14px 6px 5px; font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--ink-muted); }
.sidenav a {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: var(--radius-sm);
  color: var(--ink-2); text-decoration: none; font-size: 13.5px;
  margin-bottom: 1px;
}
.sidenav a:hover { background: var(--surface-2); color: var(--ink); }
.sidenav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.sidenav a .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--baseline); flex: none; }
.sidenav a .dot.filled { background: var(--status-good); }
.study-panel { padding: 24px 26px 80px; min-width: 0; max-width: 1060px; }

.study-header { margin-bottom: 16px; }
.study-header h2 { margin: 0 0 2px; font-size: 19px; font-weight: 750; }
.study-header .sub { color: var(--ink-2); font-size: 13.5px; }

.infobox {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  margin: 0 0 18px;
  font-size: 13.5px;
}
.infobox summary {
  cursor: pointer; padding: 9px 14px; font-weight: 650; color: var(--ink-2);
  list-style: none; display: flex; align-items: center; gap: 8px;
}
.infobox summary::before { content: "▸"; transition: transform .15s ease; color: var(--ink-muted); }
.infobox[open] summary::before { transform: rotate(90deg); }
.infobox .body { padding: 0 16px 12px; color: var(--ink-2); }
.infobox .body ol { margin: 6px 0 0; padding-left: 20px; }
.infobox .body li { margin: 2px 0; }

.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.section > h3 {
  margin: 0 0 12px; font-size: 14px; font-weight: 700;
  color: var(--ink); letter-spacing: .1px;
}
.section > h3 .hint { font-weight: 400; color: var(--ink-muted); font-size: 12.5px; margin-left: 8px; }

/* ---------- Formulare ---------- */
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px 14px; }
.fgrid.wide { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.frow { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.frow > label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.frow .unit-wrap { display: flex; align-items: center; gap: 6px; }
.frow .unit-wrap > * { min-width: 0; }
.frow .unit { color: var(--ink-muted); font-size: 12.5px; white-space: nowrap; }
.frow.span2 { grid-column: span 2; }

input[type="text"], input[type="date"], textarea, select {
  font: inherit; font-size: 13.5px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--baseline);
  border-radius: var(--radius-sm);
  padding: 6px 9px;
  width: 100%;
}
input[type="text"]:focus, input[type="date"]:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent-soft); border-color: var(--accent);
}
input.num { text-align: right; font-variant-numeric: tabular-nums; }
input.computed, .computedcell {
  background: var(--surface-2); border-style: dashed; color: var(--ink-2);
}
textarea { resize: vertical; min-height: 54px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 15px; height: 15px; }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 4px 0; }

/* ---------- Tabellen ---------- */
.tablewrap { overflow-x: auto; }
table.etable { border-collapse: collapse; width: 100%; font-size: 13px; }
.etable th {
  text-align: left; font-size: 11.5px; font-weight: 700; color: var(--ink-2);
  padding: 6px 8px; border-bottom: 1.5px solid var(--baseline);
  white-space: nowrap; vertical-align: bottom;
}
.etable th .u { display: block; font-weight: 400; color: var(--ink-muted); }
.etable td { padding: 3px 4px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
.etable td input[type="text"] { padding: 4px 7px; font-size: 13px; }
.etable td.num, .etable td .num { text-align: right; font-variant-numeric: tabular-nums; }
.etable td.computedcell { background: transparent; border-bottom: 1px solid var(--grid); color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; padding-right: 10px; }
.etable td.rowidx { color: var(--ink-muted); font-variant-numeric: tabular-nums; width: 34px; text-align: right; padding-right: 8px; }
.etable td.ctl { width: 30px; text-align: center; }
.etable .rowdel {
  border: none; background: none; color: var(--ink-muted); cursor: pointer;
  font-size: 15px; padding: 2px 6px; border-radius: 4px;
}
.etable .rowdel:hover { color: var(--crit-text); background: var(--surface-2); }
.tableactions { margin-top: 8px; display: flex; gap: 8px; }

/* Read-only Tabellen (Bericht) */
table.rtable { border-collapse: collapse; width: 100%; font-size: 12px; }
.rtable th { text-align: left; font-size: 10.5px; font-weight: 700; color: var(--ink-2); padding: 4px 7px; border-bottom: 1.2px solid var(--baseline); white-space: nowrap; }
.rtable td { padding: 3px 7px; border-bottom: 0.7px solid var(--grid); font-variant-numeric: tabular-nums; }
.rtable td.num { text-align: right; }
.rtable tr.sel td { background: var(--accent-soft); font-weight: 650; }

/* ---------- KPI / Stat-Tiles ---------- */
.kpirow { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0 6px; }
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px 11px;
  min-width: 150px; flex: 0 1 auto;
}
.kpi .klabel { font-size: 11.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 2px; }
.kpi .kvalue { font-size: 21px; font-weight: 650; letter-spacing: -.2px; }
.kpi .kvalue .kunit { font-size: 12.5px; font-weight: 500; color: var(--ink-muted); margin-left: 4px; }
.kpi .kstatus { font-size: 11.5px; margin-top: 3px; display: flex; align-items: center; gap: 5px; font-weight: 600; }
.kpi .kstatus .sdot { width: 8px; height: 8px; border-radius: 50%; }
.kpi.s-good .kstatus { color: var(--good-text); }
.kpi.s-good .sdot { background: var(--status-good); }
.kpi.s-warning .kstatus { color: #8a6100; }
.kpi.s-warning .sdot { background: var(--status-warning); }
.kpi.s-critical .kstatus { color: var(--crit-text); }
.kpi.s-critical .sdot { background: var(--status-critical); }
.kpi.s-neutral .kstatus { color: var(--ink-muted); }
.kpi.s-neutral .sdot { background: var(--baseline); }

/* ---------- Mängelliste ---------- */
.mangel-card .mangel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.mangel-card .mangel-head h3 { margin: 0; }
.mangel-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(220px, 1fr); gap: 16px; }
@media (max-width: 760px) { .mangel-grid { grid-template-columns: 1fr; } }
.mangel-grid .frow { margin-bottom: 10px; }
.mimg img {
  max-width: 100%; max-height: 220px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); display: block;
}
.mimg-meta { font-size: 12px; color: var(--ink-muted); margin: 6px 0; display: flex; align-items: center; gap: 10px; }
.mimg-error { font-size: 12px; color: var(--crit-text); margin-top: 6px; }
.mimg input[type="file"] { font-size: 12.5px; max-width: 100%; }
.vischip.d-hoch { background: rgba(208,59,59,.12); color: var(--crit-text); }
.vischip.d-mittel { background: rgba(250,178,25,.16); color: #8a6100; }
.vischip.d-niedrig { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--border); }

/* Mängel-Bericht (Querformat): Übersicht + eine Seite pro Mangel */
.report.landscape { width: 297mm; min-height: 210mm; }
@media (max-width: 1200px) { .report.landscape { width: 100%; } }
.report .mrep-table { font-size: 8.5pt; }
.report .mrep-table th { font-size: 7.5pt; padding: 1mm 1.6mm; }
.report .mrep-table td { padding: 1mm 1.6mm; vertical-align: top; }
.report .mrep-detail-grid {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 8mm; align-items: start;
}
.report .mrep-detail-grid.noimg { grid-template-columns: 1fr; }
.report .mrep-text { white-space: pre-wrap; font-size: 9.5pt; margin: 0 0 2mm; }
.report .facts.facts2 { grid-template-columns: 1fr 1fr; }
.report .mrep-photo img {
  max-width: 100%; max-height: 148mm; border: .5pt solid #c9c8c0; display: block;
}
.report .mrep-photo .capsub { font-size: 7.5pt; color: var(--r-ink2); margin-top: 1.5mm; }

/* ---------- Charts ---------- */
.chartblock { margin-top: 14px; }
.chartblock .ctitle { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.chartblock .csub { font-size: 12px; color: var(--ink-muted); margin-bottom: 6px; }
.chartrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.chart-svg { display: block; width: 100%; height: auto; font-family: var(--font); }
.chart-svg text { font-family: var(--font); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.chart-legend .li { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .sw { width: 14px; height: 4px; border-radius: 2px; }
.chart-legend .sw.dotsw { width: 9px; height: 9px; border-radius: 50%; }

.chart-tooltip {
  position: fixed; z-index: 90; pointer-events: none;
  background: var(--ink); color: var(--page);
  font-size: 12px; line-height: 1.4;
  border-radius: 6px; padding: 6px 9px;
  box-shadow: 0 3px 12px rgba(0,0,0,.25);
  max-width: 260px;
}
.chart-tooltip .tt-title { font-weight: 700; margin-bottom: 2px; }
.chart-tooltip .tt-row { display: flex; gap: 8px; justify-content: space-between; }
.chart-tooltip .tt-row .v { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- Dialog ---------- */
dialog.modal {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  padding: 22px 24px; max-width: 460px; width: calc(100vw - 40px);
  box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
dialog.modal::backdrop { background: rgba(11,11,11,.35); backdrop-filter: blur(2px); }
dialog.modal h3 { margin: 0 0 14px; font-size: 16px; }
dialog.modal .frow { margin-bottom: 12px; }
dialog.modal .dactions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- Bericht (Bildschirm) ---------- */
.report-toolbar {
  position: sticky; top: 47px; z-index: 30;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 10px 20px; display: flex; gap: 10px; align-items: center;
}
.report-page-wrap { background: var(--page); padding: 26px 0 80px; }
.report {
  background: #ffffff; color: #0b0b0b;
  width: 210mm; min-height: 297mm;
  margin: 0 auto 20px; padding: 15mm 14mm;
  box-shadow: 0 2px 20px rgba(0,0,0,.14);
}
@media (max-width: 860px) { .report { width: 100%; padding: 20px; } }

/* Berichts-Typografie – immer hell, druckt schwarz auf weiss.
   Chart-Tokens werden hier lokal auf helle Werte gezwungen,
   damit SVGs im Bericht auch im Dark-Mode korrekt sind. */
.report {
  --r-ink: #0b0b0b; --r-ink2: #494845; --r-muted: #8a8880; --r-grid: #dddcd4;
  font-size: 10.5pt;
  --page: #ffffff; --surface: #ffffff; --surface-2: #f3f2ee;
  --ink: #0b0b0b; --ink-2: #52514e; --ink-muted: #898781;
  --grid: #e1e0d9; --baseline: #c3c2b7; --border: rgba(11,11,11,.12);
  --series-1: #2a78d6; --series-2: #1baf7a; --series-3: #eda100;
  --series-4: #008300; --series-5: #4a3aa7; --series-6: #e34948;
  --status-good: #0ca30c; --status-warning: #fab219; --status-critical: #d03b3b;
  --good-text: #006300; --crit-text: #b02a2a;
  --accent: #2a78d6; --accent-soft: rgba(42,120,214,.10);
}
.report h1 { font-size: 19pt; margin: 0 0 2mm; letter-spacing: -.3px; }
.report h2 {
  font-size: 12.5pt; margin: 7mm 0 2.5mm; padding-bottom: 1mm;
  border-bottom: 1.4pt solid #0b0b0b;
  break-after: avoid;
}
.report h3 { font-size: 10.5pt; margin: 4mm 0 1.5mm; break-after: avoid; }
.report .rmeta { color: var(--r-ink2); font-size: 9.5pt; }
.report .rsection { break-inside: avoid; }
.report .rkpis { display: flex; flex-wrap: wrap; gap: 3mm; margin: 2mm 0; }
.report .rkpi { border: .7pt solid #c9c8c0; border-radius: 2mm; padding: 1.6mm 3mm; min-width: 26mm; }
.report .rkpi .l { font-size: 7.5pt; color: var(--r-ink2); font-weight: 600; }
.report .rkpi .v { font-size: 12pt; font-weight: 700; }
.report .rkpi .v .u { font-size: 8pt; color: var(--r-muted); font-weight: 500; }
.report .rkpi .s { font-size: 7.5pt; font-weight: 700; }
.report .rkpi.s-good .s { color: #006300; }
.report .rkpi.s-warning .s { color: #8a6100; }
.report .rkpi.s-critical .s { color: #b02a2a; }
.report table.rtable { font-size: 8.5pt; }
.report .rtable th { font-size: 7.5pt; padding: 1mm 1.8mm; border-bottom-color: #0b0b0b; color: var(--r-ink2); }
.report .rtable td { padding: .8mm 1.8mm; border-bottom: .5pt solid var(--r-grid); }
.report .rtable tr.sel td { background: #eaf1fb; }
.report .rgrid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 5mm; align-items: start; }
.report .facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1mm 6mm; font-size: 9pt; }
.report .facts .f { display: flex; justify-content: space-between; gap: 4mm; border-bottom: .5pt solid var(--r-grid); padding: .7mm 0; }
.report .facts .f .fl { color: var(--r-ink2); }
.report .facts .f .fv { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.report .chartblock { margin-top: 2mm; }
.report .ctitle { font-size: 9pt; }
.report .csub { font-size: 8pt; }
.report .footer-note { color: var(--r-muted); font-size: 8pt; margin-top: 6mm; }

/* ---------- Druck ---------- */
@page { size: A4; margin: 13mm 12mm 14mm; }
@media print {
  body { background: #fff; }
  .topbar, .appfooter, .report-toolbar, .sidenav, .no-print { display: none !important; }
  .report-page-wrap { padding: 0; background: #fff; }
  .report {
    width: auto; min-height: 0; margin: 0; padding: 0;
    box-shadow: none;
  }
  .report h2 { margin-top: 5mm; }
  .rsection, .chartblock, .rkpi, table { break-inside: avoid; }
  .pagebreak { break-before: page; }
  a { color: inherit; text-decoration: none; }
}
