/* Modul risiko – nur CSS-Variablen aus style.css verwenden (Dark Mode) */
.rk-gap { margin-top: 1rem; }
.rk-top { align-items: start; }
.rk-tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; flex-wrap: wrap; }
.rk-tabs a { padding: .5rem .9rem; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.rk-tabs a.on { color: var(--text); border-bottom-color: var(--brand); font-weight: 600; }
.rk-mhead { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.rk-seg { display: inline-flex; }
.rk-seg button { border-radius: 0; }
.rk-seg button:first-child { border-radius: 6px 0 0 6px; }
.rk-seg button:last-child { border-radius: 0 6px 6px 0; margin-left: -1px; }
.rk-seg button.on { background: var(--brand-soft); border-color: var(--brand); color: var(--text); font-weight: 600; }
.rk-ov { display: flex; gap: .75rem; align-items: center; padding: .3rem 0; border-bottom: 1px solid var(--line); }
.rk-ov .pill { min-width: 5.5rem; text-align: center; }
.rk-matrix { border-collapse: separate; border-spacing: 4px; width: 100%; table-layout: fixed; }
.rk-matrix th { font-size: .75rem; font-weight: 600; color: var(--muted); background: none; border: 0; padding: .2rem; text-align: center; }
.rk-matrix tbody th { text-align: right; padding-right: .5rem; width: 5.5rem; }
.rk-matrix .corner { width: 5.5rem; font-size: .65rem; }
.rk-matrix td { padding: 0; border: 0; }
.rk-cell { width: 100%; min-height: 3.6rem; flex-direction: column; justify-content: center; gap: .1rem; border: 2px solid transparent; border-radius: 6px; color: var(--text); }
.rk-cell .n { font-size: 1.25rem; font-weight: 700; line-height: 1; }
.rk-cell .k { font-size: .68rem; opacity: .85; }
.rk-cell.k0 { background: var(--s1-soft); }
.rk-cell.k1 { background: var(--warn-soft); }
.rk-cell.k2 { background: var(--s2-soft); border-color: var(--s2); }
.rk-cell.k3 { background: var(--s3-soft); border-color: var(--s3); }
.rk-cell:hover { filter: brightness(.95); }
.rk-cell.sel { outline: 3px solid var(--brand); outline-offset: 1px; }
.rk-cell:disabled { cursor: default; opacity: 1; }
.rk-anf { display: inline-block; padding: 0 .35rem; border-radius: 4px; border: 1px solid var(--line); font-size: .72rem; font-family: var(--mono); }
.rk-anf.ja, .rk-anf.entbehrlich { background: var(--ok-soft); color: var(--ok); }
.rk-anf.nein { background: var(--bad-soft); color: var(--bad); }
.rk-anf.teilweise { background: var(--warn-soft); color: var(--warn); }
.rk-prev { text-align: center; font-size: .8rem; color: var(--muted); }
.rk-btns { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.rk-dialog { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); width: min(680px, calc(100vw - 32px)); max-height: 90vh; padding: 1.25rem; }
.rk-dialog::backdrop { background: rgb(0 0 0 / .45); }
.rk-dialog label { display: block; margin-top: .6rem; font-size: .85rem; color: var(--muted); }
.rk-dialog label > * { margin-top: .2rem; }
.pl-t td { vertical-align: top; }
.pl-t tr.done td:first-child b { text-decoration: line-through; color: var(--muted); }
.pl-w { width: 0; }
.pl-gantt { width: 100%; height: auto; display: block; }
.pl-gantt text { fill: var(--text); font-size: 11px; }
.pl-gantt .g-ax { fill: var(--muted); font-size: 10px; }
.pl-gantt .g-grid { stroke: var(--line); stroke-width: 1; }
.pl-gantt .g-today { stroke: var(--bad); stroke-width: 1.5; stroke-dasharray: 4 3; }
.pl-gantt .g-bar { fill: var(--brand); }
.pl-gantt .g-bar.in_umsetzung { fill: var(--warn); }
.pl-gantt .g-bar.umgesetzt { fill: var(--ok); }
/* Realisierungsplan: aufklappbare Details */
.pl-t { table-layout: fixed; width: 100%; }
.pl-t col.c-tg { width: 2.2rem; } .pl-t col.c-m { width: auto; } .pl-t col.c-ro { width: 11rem; } .pl-t col.c-te { width: 9.5rem; }
.pl-t col.c-k { width: 7rem; } .pl-t col.c-s { width: 8.5rem; } .pl-t col.c-x { width: 5rem; }
.pl-t td input[type="number"], .pl-t td input[type="date"], .pl-t td select { width: 100%; min-width: 0; }
.pl-tog { padding: 0 .3rem; font-size: 1rem; }
.pl-d > td { background: var(--panel-2); padding: .8rem 1rem; }
.pl-dg { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1.2rem; }
.pl-dg h4 { margin: .6rem 0 .2rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.pl-dg h4:first-child { margin-top: 0; }
.pl-dg p { margin: .2rem 0; }
@media (max-width: 900px) { .pl-dg { grid-template-columns: 1fr; } .pl-t col.c-ro, .pl-t col.c-te { width: 8rem; } }
.print-head, .print-only { display: none; }

/* ---------- Druck: nur Inhalt, Kopfzeile je Seite, Tabellen sauber umbrochen, schwarz-weiß lesbar ---------- */
@page { size: A4; margin: 20mm 12mm 14mm; }
@media print {
    .nav, .noprint, .rk-print .head .actions, .rk-tabs, .rk-print .filters, .toast, .nav-toggle, .rk-print button:not(.rk-cell) { display: none !important; }
    .rk-print .pl-d { display: table-row; }
  .rk-print .pl-t col.c-tg, .rk-print .pl-t col.c-x { display: none; }
    .app { display: block; }
    .main { padding: 0 !important; max-width: none !important; margin: 0 !important; }
    body { background: #fff !important; color: #000 !important; font-size: 9pt; }
    .rk-print .panel { border: 0 !important; box-shadow: none !important; padding: 0 !important; background: none !important; margin-top: 6mm; }
    .rk-print .head { margin-bottom: 3mm; }
    .rk-print .head h1 { font-size: 15pt; }
    .rk-print .head .crumb, .rk-print .muted { color: #333 !important; }
    .print-head { display: none; }
    .print-only { display: block; margin: 0 0 3mm; }
    .rk-print .grid.c4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3mm; }
    .rk-print .grid.c4 .panel, .rk-print .grid.c2 > div { break-inside: avoid; border: .5pt solid #000 !important; padding: 2mm !important; }
    .rk-print .kpi { font-size: 14pt; }
    .rk-print .bar { border: .5pt solid #000; background: #fff !important; }
    .rk-print .bar span { background: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .rk-print .tablewrap { overflow: visible !important; }
    .rk-print table { width: 100% !important; border-collapse: collapse; table-layout: fixed; }
    .rk-print thead { display: table-header-group; }
    .rk-print tfoot { display: table-footer-group; }
    .rk-print tr, .rk-print .rk-matrix { break-inside: avoid; page-break-inside: avoid; }
    .rk-print th, .rk-print td { border: .4pt solid #666 !important; padding: 1.2mm 1.6mm !important; vertical-align: top; overflow-wrap: anywhere; word-break: normal; background: none !important; color: #000 !important; font-size: 8.5pt; }
    .rk-print th { font-weight: 700; background: #e8e8e8 !important; text-align: left; }
    .rk-print .pl-t col.c-m { width: auto; }   .rk-print .pl-t col.c-ro { width: 32mm; }   .rk-print .pl-t col.c-te { width: 20mm; }   .rk-print .pl-t col.c-k { width: 20mm; }   .rk-print .pl-t col.c-s { width: 22mm; }
    .rk-print .pl-t tr.done td:first-child b { color: #555; }
    .rk-print .pl-d > td { background: #f4f4f4 !important; }
    .rk-print .pl-dg { display: block; }
    .rk-print .pl-grp { break-before: auto; }
    .rk-print .pl-grp h3 { break-after: avoid; }
    .rk-print .pill { background: none !important; color: #000 !important; border: .5pt solid #000 !important; padding: 0 1.2mm !important; }
    .rk-print a { color: #000; text-decoration: none; }
  /* Risikomatrix: Beschriftung statt Farbe */
    .rk-print .rk-cell { border: .6pt solid #000 !important; color: #000 !important; background: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .rk-print .rk-cell.k1 { background: #ececec !important; }   .rk-print .rk-cell.k2 { background: #c8c8c8 !important; }   .rk-print .rk-cell.k3 { background: #9a9a9a !important; }
    .rk-print .rk-matrix { border-spacing: 1mm; }
    .rk-print .rk-matrix .corner { font-size: 7pt; white-space: normal; overflow-wrap: anywhere; }
  /* Zeitstrahl: auf Seitenbreite skaliert, Graustufen */
    .rk-print .pl-zs { break-inside: avoid; }
    .rk-print .pl-gantt { width: 100% !important; max-width: 100%; height: auto; max-height: 150mm; }
    .rk-print .pl-gantt text, .rk-print .pl-gantt .g-ax { fill: #000 !important; }
    .rk-print .pl-gantt .g-grid { stroke: #999; }
    .rk-print .pl-gantt .g-today { stroke: #000; }
    .rk-print .pl-gantt .g-bar { fill: #777 !important; stroke: #000; stroke-width: .6; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .rk-print .pl-gantt .g-bar.in_umsetzung { fill: #bbb !important; }
    .rk-print .pl-gantt .g-bar.umgesetzt { fill: #000 !important; }
}
