:root {
  --bg: #f4f6f9; --surface: #fff; --text: #1d2733; --muted: #66727f; --line: #dfe4ea;
  --primary: #1f4e79; --primary-2: #2d6aa3; --danger: #c0392b; --warn: #d68910; --ok: #1e8449;
  --red-bg: #fdecea; --yellow-bg: #fef5e1; --green-bg: #e8f6ee; --grey-bg: #eef1f4;
  --radius: 10px; --side: 230px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #11161c; --surface: #1a2129; --text: #e4e9ee; --muted: #93a0ad; --line: #2b3540;
    --primary: #4a90d9; --primary-2: #6aa6e3; --red-bg: #3a1d1b; --yellow-bg: #3a2e14; --green-bg: #15301f; --grey-bg: #222b35; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .mt { margin-top: 1rem; } .right { text-align: right; }
.pre { white-space: pre-wrap; }

/* Layout */
.topbar { position: fixed; inset: 0 0 auto 0; height: 56px; background: var(--primary); color: #fff; display: flex; align-items: center; gap: .75rem; padding: 0 1rem; z-index: 30; }
.brand { color: #fff; font-weight: 700; display: flex; align-items: center; gap: .5rem; font-size: 1.05rem; }
.brand img { width: 28px; height: 28px; }
.brand:hover { text-decoration: none; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .75rem; }
.menu-btn { display: none; background: none; border: 0; color: #fff; font-size: 1.4rem; cursor: pointer; }
.sidebar { position: fixed; top: 56px; bottom: 0; left: 0; width: var(--side); background: var(--surface); border-right: 1px solid var(--line); padding: .75rem .5rem; overflow-y: auto; z-index: 25; display: flex; flex-direction: column; }
.sidebar a { display: flex; gap: .6rem; align-items: center; padding: .55rem .75rem; border-radius: 8px; color: var(--text); }
.sidebar a:hover { background: var(--grey-bg); text-decoration: none; }
.sidebar a.active { background: var(--primary); color: #fff; }
.sidebar .ico { width: 1.3rem; text-align: center; }
.sidebar-foot { margin-top: auto; padding: .75rem; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: .3rem; }
.sidebar-foot a { padding: 0; }
.main { margin-left: var(--side); padding: 76px 1.5rem 2rem; max-width: 1300px; }
.main-plain { padding: 1rem; }
.nav-backdrop, .bottombar { display: none; }

@media (max-width: 900px) {
  .menu-btn { display: block; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; background: #0006; z-index: 20; }
  .main { margin-left: 0; padding: 68px 1rem 90px; }
  .hide-sm { display: none; }
  .bottombar { display: flex; position: fixed; inset: auto 0 0 0; background: var(--surface); border-top: 1px solid var(--line); z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
  .bottombar a { flex: 1; display: flex; flex-direction: column; align-items: center; padding: .4rem 0; font-size: .72rem; color: var(--muted); }
  .bottombar a span { font-size: 1.25rem; line-height: 1.3; }
  .bottombar a.active { color: var(--primary-2); }
  .bottombar a.report span { background: var(--danger); color: #fff; border-radius: 50%; width: 2.2rem; height: 2.2rem; display: grid; place-items: center; margin-top: -.9rem; box-shadow: 0 2px 6px #0004; }
  .bottombar a:hover { text-decoration: none; }
}

/* Komponenten */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; }
.actions-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; }
.cards .card { margin-bottom: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem 1rem; color: var(--text); display: block; border-left: 4px solid var(--line); }
.kpi:hover { text-decoration: none; border-color: var(--primary-2); }
.kpi .n { font-size: 1.7rem; font-weight: 700; line-height: 1.2; }
.kpi .l { color: var(--muted); font-size: .85rem; }
.kpi.red { border-left-color: var(--danger); } .kpi.yellow { border-left-color: var(--warn); } .kpi.green { border-left-color: var(--ok); }

.btn { display: inline-flex; align-items: center; gap: .35rem; padding: .55rem 1rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; border-color: var(--primary-2); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-sm { padding: .3rem .7rem; font-size: .88rem; }
.btn-block { width: 100%; justify-content: center; padding: .85rem; font-size: 1.05rem; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--primary-2); font: inherit; cursor: pointer; text-align: left; }

form label { display: flex; flex-direction: column; gap: .25rem; font-weight: 600; font-size: .9rem; }
input, select, textarea { font: inherit; font-weight: 400; padding: .55rem .65rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); width: 100%; }
input[type=checkbox], input[type=radio] { width: auto; }
label.check { flex-direction: row; align-items: center; gap: .5rem; font-weight: 400; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; }
.span2 { grid-column: span 2; } .span3 { grid-column: 1 / -1; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } .span2, .span3 { grid-column: auto; } }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.filters input, .filters select { width: auto; min-width: 150px; flex: 1; max-width: 260px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .2rem .9rem; font-weight: 400; max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: .5rem .75rem; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .55rem .6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
dl.props { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.25rem; margin: 0; }
dl.props dt { color: var(--muted); } dl.props dd { margin: 0; }
@media (max-width: 640px) { dl.props { grid-template-columns: 1fr; } dl.props dd { margin-bottom: .4rem; } }

.badge { display: inline-block; padding: .1rem .55rem; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--grey-bg); white-space: nowrap; }
.badge.red, .st-neu, .st-offen, .st-gesperrt, .st-nicht_ok, .st-abweichung { background: var(--red-bg); color: var(--danger); }
.badge.yellow, .st-in_bearbeitung, .st-in_arbeit, .st-mangel, .st-pruefung, .st-entwurf, .st-nebenabweichung, .st-geplant { background: var(--yellow-bg); color: var(--warn); }
.badge.green, .st-ok, .st-abgeschlossen, .st-erledigt, .st-wirksam, .st-freigegeben, .st-positiv, .st-durchgefuehrt { background: var(--green-bg); color: var(--ok); }
.dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 50%; margin-right: .4rem; background: var(--muted); }
.dot.red { background: var(--danger); } .dot.yellow { background: var(--warn); } .dot.green { background: var(--ok); }
.flash { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.flash-ok { background: var(--green-bg); color: var(--ok); } .flash-err { background: var(--red-bg); color: var(--danger); }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: .5rem 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.list li > :last-child { flex-shrink: 0; }
.list li:last-child { border-bottom: 0; }

/* Prozesslandkarte */
.pmap { display: grid; gap: 1rem; }
.pmap .band { border-radius: var(--radius); padding: 1rem; border: 1px solid var(--line); }
.pmap .band h2 { font-size: .9rem; text-transform: uppercase; letter-spacing: .05em; }
.band.fuehrung { background: var(--yellow-bg); } .band.kern { background: var(--green-bg); } .band.unterstuetzung { background: var(--grey-bg); }
.pmap .procs { display: flex; flex-wrap: wrap; gap: .75rem; }
.proc { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .7rem 1rem; min-width: 180px; color: var(--text); }
.band.kern .proc { clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%); padding-right: 1.8rem; }
.proc:hover { text-decoration: none; border-color: var(--primary-2); }

/* Risikomatrix */
.matrix { border-collapse: separate; border-spacing: 3px; width: auto; }
.matrix td, .matrix th { width: 46px; height: 38px; text-align: center; padding: 0; border: 0; border-radius: 4px; font-weight: 700; }
.matrix td.green { background: var(--green-bg); } .matrix td.yellow { background: var(--yellow-bg); } .matrix td.red { background: var(--red-bg); }

/* Schulungs-Quiz */
.quiz-q { border: 1px solid var(--line); border-radius: 8px; padding: .9rem; margin-bottom: .75rem; }
.quiz-q.wrong { border-color: var(--danger); background: var(--red-bg); }
.quiz-q label { font-weight: 400; flex-direction: row; gap: .5rem; padding: .35rem 0; }
.course-content { font-size: 1.02rem; }
.video { position: relative; padding-top: 56.25%; margin: 1rem 0; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 8px; }

/* Matrix Schulungen */
.tmatrix th.rot { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; height: 160px; text-transform: none; vertical-align: bottom; }
.tmatrix td.c { text-align: center; font-size: .78rem; }
.tmatrix td.c.red { background: var(--red-bg); } .tmatrix td.c.yellow { background: var(--yellow-bg); } .tmatrix td.c.green { background: var(--green-bg); }

.login-box { max-width: 380px; margin: 10vh auto; }
.big-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.big-actions a { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; text-align: center; color: var(--text); font-weight: 600; }
.big-actions a span { display: block; font-size: 1.8rem; }
.big-actions a:hover { text-decoration: none; border-color: var(--primary-2); }
.big-actions a.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.type-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem; }
.type-pick label { min-width: 0; overflow-wrap: anywhere; hyphens: auto; border: 2px solid var(--line); border-radius: 8px; padding: .7rem; flex-direction: row; align-items: center; gap: .5rem; cursor: pointer; font-weight: 600; }
.type-pick label:has(input:checked) { border-color: var(--primary-2); background: var(--grey-bg); }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
.photo { max-width: 100%; max-height: 380px; border-radius: 8px; border: 1px solid var(--line); }

@media print {
  .topbar, .sidebar, .bottombar, .no-print, .flash { display: none !important; }
  .main { margin: 0; padding: 0; }
  body { background: #fff; color: #000; }
  .card { border: 0; padding: 0; }
}

/* GHS-Piktogramm (vereinfacht: rote Raute mit Nummer) */
.ghs { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; margin: .15rem .35rem .15rem .15rem; transform: rotate(45deg); border: 2px solid #c0392b; background: #fff; vertical-align: middle; }
.ghs b { transform: rotate(-45deg); font-size: .7rem; color: #000; }
.ghs.big { width: 2.2rem; height: 2.2rem; font-size: .85rem; }
.nav-group { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .9rem .75rem .25rem; font-weight: 600; }
.sidebar a { padding: .42rem .75rem; }
.sidebar-foot a { padding: 0; }
.kpi .l { overflow-wrap: anywhere; hyphens: auto; }

/* Plattform-Verwaltung */
.ptop { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; background: var(--primary); color: #fff; padding: .7rem 1rem; margin: -1rem -1rem 1.25rem; }
.ptop .brand { color: #fff; }
.pwrap { max-width: 1200px; margin: 0 auto; }
.ptop .btn-primary { background: #fff; color: var(--primary); border-color: #fff; font-weight: 600; }

/* Organigramm (Baum von oben nach unten, Linien per CSS) */
.org-wrap { overflow-x: auto; }
.org ul { display: flex; justify-content: center; padding: 18px 0 0; margin: 0; position: relative; list-style: none; }
.org > ul { padding-top: 0; }
.org li { display: flex; flex-direction: column; align-items: center; position: relative; padding: 18px 6px 0; }
.org li::before, .org li::after { content: ''; position: absolute; top: 0; right: 50%; width: 50%; height: 18px; border-top: 2px solid var(--line); }
.org li::after { right: auto; left: 50%; border-left: 2px solid var(--line); }
.org li:only-child::before, .org li:only-child::after { display: none; }
.org li:only-child { padding-top: 0; }
.org li:first-child::before, .org li:last-child::after { border: 0 none; }
.org li:last-child::before { border-right: 2px solid var(--line); border-radius: 0 6px 0 0; }
.org li:first-child::after { border-radius: 6px 0 0 0; }
.org ul ul::before { content: ''; position: absolute; top: 0; left: 50%; height: 18px; border-left: 2px solid var(--line); }
.org > ul > li:only-child { padding-top: 0; }
.onode { display: flex; flex-direction: column; gap: .1rem; min-width: 150px; max-width: 210px; padding: .55rem .7rem; border-radius: 8px; background: var(--surface);
  border: 1px solid var(--line); border-top: 4px solid var(--muted); color: var(--text); font-size: .85rem; text-align: center; }
.onode:hover { text-decoration: none; border-color: var(--primary-2); }
.onode strong { font-size: .92rem; }
.onode .ounit, .onode .orole { color: var(--muted); font-size: .75rem; }
.onode .oholders { font-weight: 600; color: var(--primary-2); }
.onode.vacant { opacity: .6; } .onode.vacant .oholders { color: var(--danger); font-weight: 400; }
.onode.staff { border-style: dashed; border-top-style: solid; }
.role-admin { border-top-color: #8e44ad; } .role-qhse { border-top-color: var(--ok); } .role-fuehrung { border-top-color: var(--primary-2); } .role-mitarbeiter { border-top-color: var(--muted); }
.onode-mini { display: inline-block; width: 1rem; height: .6rem; border-top-width: 4px; border-top-style: solid; margin: 0 .2rem 0 .6rem; vertical-align: middle; }
.org-legend { margin: -0.5rem 0 1.25rem; }
.org-list { display: none; padding-left: 1rem; } .org-list ul { padding-left: 1.1rem; border-left: 2px solid var(--line); margin: .2rem 0; }
.org-list li { list-style: none; padding: .25rem 0; }
@media (max-width: 900px) { .org { display: none; } .org-list { display: block; } }
@media print { .org-wrap { overflow: visible; } .org { display: block !important; } .org-list { display: none !important; } }
.tmatrix td.c.grey { background: var(--grey-bg); color: var(--muted); }
.badge.grey { background: var(--grey-bg); color: var(--muted); }
.tmatrix th.rot { height: 210px; max-width: 2.6rem; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) { .org-legend { display: none; } }

/* Formatierte Inhalte (Editor und Anzeige) */
.editor-wrap { background: var(--surface); border-radius: 8px; }
.editor-wrap .ql-toolbar { border-radius: 8px 8px 0 0; border-color: var(--line); background: var(--grey-bg); }
.editor-wrap .ql-container { border-radius: 0 0 8px 8px; border-color: var(--line); font: inherit; font-size: 1rem; }
.editor-wrap .ql-editor { min-height: inherit; }
.editor-wrap .ed-table, .editor-wrap .ed-row, .editor-wrap .ed-col, .editor-wrap .ed-del { width: auto !important; font-size: .8rem; font-weight: 700; color: #444; }
.editor-area { min-height: 320px; }
.rich { line-height: 1.6; }
.rich h1 { font-size: 1.45rem; margin: 1.4rem 0 .5rem; } .rich h2 { font-size: 1.2rem; margin: 1.2rem 0 .4rem; } .rich h3 { font-size: 1.05rem; margin: 1rem 0 .3rem; }
.rich img { max-width: 100%; border-radius: 6px; }
.rich table { border-collapse: collapse; margin: .8rem 0; width: auto; }
.rich td, .rich th { border: 1px solid var(--line); padding: .35rem .6rem; }
.rich blockquote { border-left: 4px solid var(--primary-2); margin: .8rem 0; padding: .3rem .9rem; background: var(--grey-bg); }
.rich .ql-align-center { text-align: center; } .rich .ql-align-right { text-align: right; } .rich .ql-align-justify { text-align: justify; }
.rich .ql-indent-1 { padding-left: 2em; } .rich .ql-indent-2 { padding-left: 4em; } .rich .ql-indent-3 { padding-left: 6em; }
.rich li[data-list="bullet"] { list-style-type: disc; } .rich ol li[data-list="bullet"] { list-style-type: disc; }
.rich ol:has(> li[data-list="bullet"]) { list-style-type: disc; }
.toc { font-size: .9rem; } .toc a { display: block; padding: .15rem 0; } .toc .l2 { padding-left: 1rem; } .toc .l3 { padding-left: 2rem; }
.st-ersetzt, .st-verworfen { background: var(--grey-bg); color: var(--muted); }
.doc-layout { display: grid; grid-template-columns: 1fr 240px; gap: 1.25rem; align-items: start; }
.doc-layout .toc { position: sticky; top: 76px; }
@media (max-width: 1100px) { .doc-layout { grid-template-columns: 1fr; } .doc-layout .toc { position: static; order: -1; } }
.diff { white-space: pre-wrap; line-height: 1.7; }
.diff ins { background: var(--green-bg); color: var(--ok); text-decoration: none; border-bottom: 2px solid var(--ok); }
.diff del { background: var(--red-bg); color: var(--danger); }
.workflow { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; font-size: .85rem; margin: .4rem 0 .8rem; }
.workflow span { padding: .2rem .6rem; border-radius: 99px; background: var(--grey-bg); color: var(--muted); }
.workflow span.done { background: var(--green-bg); color: var(--ok); } .workflow span.now { background: var(--primary); color: #fff; }
.news-card { display: block; color: var(--text); }
.news-card:hover { text-decoration: none; border-color: var(--primary-2); }
.news-card.unread { border-left: 4px solid var(--warn); }
.news-important { border: 2px solid var(--danger); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; align-items: center; }
.news-list li > span:first-child { min-width: 0; flex-shrink: 1; overflow-wrap: anywhere; }

/* Prozesse: Landkarte, Editor, Diagramm */
.pmap-io { display: flex; justify-content: space-between; gap: .5rem; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.proc.draft { border-style: dashed; }
.proc-add { color: var(--muted); border-style: dashed; display: flex; align-items: center; justify-content: center; }
.diagram-wrap { overflow-x: auto; }
.diagram-wrap svg { max-width: none; height: auto; display: block; border-radius: 6px; border: 1px solid var(--line); }
.diagram-wrap svg a:hover rect, .diagram-wrap svg a:hover polygon, .diagram-wrap svg a:hover path { stroke-width: 2.6; }
.peditor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.ppreview { position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow: auto; }
@media (max-width: 1150px) { .peditor { grid-template-columns: 1fr; } .ppreview { position: static; max-height: none; } }
.pstep { border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: 8px; padding: .6rem .7rem; background: var(--surface); }
.pstep.st-start { border-left-color: var(--ok); } .pstep.st-end { border-left-color: var(--danger); } .pstep.st-decision { border-left-color: var(--warn); }
.pstep.st-doc { border-left-color: var(--muted); } .pstep.st-sub { border-left-color: var(--primary-2); }
.pstep-head { display: flex; gap: .4rem; align-items: center; }
.pstep-head select { width: 150px; flex: none; } .pstep-head input { flex: 1; min-width: 0; }
.pnr { font-weight: 700; min-width: 1.6rem; text-align: center; color: var(--muted); }
.pbtns { display: flex; gap: .15rem; } .pbtns button { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: .3rem .5rem; cursor: pointer; color: var(--text); }
.pstep-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.pstep-row label { flex: 1; min-width: 150px; font-size: .8rem; }
.pstep details { margin-top: .4rem; } .pstep summary { color: var(--primary-2); }
.pinsert { display: block; margin: .25rem auto; border: 1px dashed var(--line); background: none; border-radius: 99px; padding: .1rem .8rem; font-size: .75rem; color: var(--muted); cursor: pointer; }
.pinsert:hover { color: var(--primary-2); border-color: var(--primary-2); }
.step-type { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.steps-table tr:target { background: var(--yellow-bg); }
@media (max-width: 640px) { .pstep-head { flex-wrap: wrap; } .pstep-head select { width: auto; } }
.aprog th.c, .aprog td.c { text-align: center; padding: .35rem .2rem; min-width: 2.6rem; }
.achip { display: inline-block; padding: .1rem .35rem; border-radius: 6px; font-size: .78rem; font-weight: 600; margin: 1px; background: var(--grey-bg); color: var(--text); }
.achip:hover { text-decoration: none; outline: 2px solid var(--primary-2); }
.achip.st-geplant { background: #e3eefa; color: var(--primary); } .achip.st-durchgefuehrt { background: var(--yellow-bg); color: var(--warn); } .achip.st-abgeschlossen { background: var(--green-bg); color: var(--ok); }
.aplus { display: inline-block; width: 1.6rem; color: var(--line); font-weight: 700; border-radius: 6px; }
.aprog tr:hover .aplus { color: var(--muted); } .aplus:hover { background: var(--grey-bg); color: var(--primary-2) !important; text-decoration: none; }
.ppreview .diagram-wrap svg { width: 100%; max-width: 100%; }

/* Dokumente: Ordnerbaum, Export-Menü, Rechte */
.doc-browser { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.folder-tree { padding: .5rem; position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow: auto; }
.folder-tree a { display: flex; justify-content: space-between; gap: .5rem; padding: .35rem .6rem; border-radius: 6px; color: var(--text); text-decoration: none; font-size: .9rem; }
.folder-tree a:hover { background: var(--grey-bg); }
.folder-tree a.active { background: var(--primary); color: #fff; }
.folder-tree a.active .muted { color: #fff; }
@media (max-width: 900px) { .doc-browser { grid-template-columns: minmax(0, 1fr); } .folder-tree { position: static; max-height: 240px; } }
tr.group-row td { background: var(--grey-bg); font-weight: 600; font-size: .85rem; }
.nowrap { white-space: nowrap; }
details.menu { position: relative; }
details.menu > .menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 300px; padding: .4rem; display: flex; flex-direction: column; margin: 0; }
details.menu > .menu-list a { padding: .45rem .6rem; border-radius: 6px; text-decoration: none; color: var(--text); }
details.menu > .menu-list a:hover { background: var(--grey-bg); }
.access-box { border-top: 1px solid var(--line); padding-top: .75rem; }
.access-box details { margin: .3rem 0; }
.access-box .checks { max-height: 180px; }
@media (max-width: 640px) { details.menu > .menu-list { left: 0; right: auto; min-width: 260px; } }

/* Berechtigungsgruppen */
.perm-matrix th { vertical-align: top; min-width: 150px; text-transform: none; }
.perm-matrix th input { width: 100%; }
.perm-matrix td.c { text-align: center; }
.perm-matrix .new-col { background: var(--grey-bg); }
.perm-matrix td:first-child { white-space: nowrap; }
#zuordnung select { min-width: 150px; }
