/* Farbiges, sachliches Layout. Jedes Modul hat eine Akzentfarbe; Status sind farbcodiert
   und zusätzlich beschriftet (nicht nur über Farbe unterscheidbar). */
:root {
  --text: #1d2433;
  --text-2: #586174;
  --linie: #d9dee7;
  --flaeche: #f4f6fa;
  --weiss: #fff;
  --kopf: #17233b;
  --primaer: #1f5fa8;
  --m-projekt: #1f5fa8;
  --m-personalkosten: #0f7b6c;
  --m-fragenkatalog: #6247aa;
  --m-kln: #c25e00;
  --m-fehler: #b42318;
  --m-neutral: #455066;
  --gruen: #18794e;   --gruen-h: #e3f4ea;
  --blau: #1f5fa8;    --blau-h: #e5eefa;
  --gelb: #9a6100;    --gelb-h: #fdf1d8;
  --rot: #b42318;     --rot-h: #fde8e6;
  --grau: #586174;    --grau-h: #eef0f4;
  --akzent: var(--m-neutral);
}
body.modul-projekt { --akzent: var(--m-projekt); }
body.modul-personalkosten { --akzent: var(--m-personalkosten); }
body.modul-fragenkatalog { --akzent: var(--m-fragenkatalog); }
body.modul-kln { --akzent: var(--m-kln); }
body.modul-fehler { --akzent: var(--m-fehler); }

* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif; color: var(--text); background: var(--flaeche); line-height: 1.45; }
a { color: var(--akzent); }
code { font-family: Menlo, Consolas, monospace; font-size: .85em; background: var(--grau-h); padding: 0 .25em; border-radius: 3px; }
h1 { font-size: 1.5rem; margin: .2rem 0 1rem; font-weight: 700; }
h1 small { font-weight: 400; font-size: .9rem; color: var(--text-2); }
h2 { font-size: 1.08rem; margin: 1.6rem 0 .6rem; padding-bottom: .25rem; border-bottom: 2px solid var(--akzent); }
h3 { font-size: .95rem; margin: 1.2rem 0 .4rem; }

/* Kopf und Navigation */
.kopf { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .55rem 1.5rem; background: var(--kopf); color: #fff; }
.marke { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-size: .95rem; }
.marke-zeichen { background: #fff; color: var(--kopf); font-weight: 800; border-radius: 6px; padding: .15rem .4rem; font-size: .8rem; }
.werkzeuge { display: flex; align-items: center; gap: .9rem; font-size: .82rem; flex-wrap: wrap; }
.werkzeuge a, .werkzeuge button.link { color: #cfd8ea; text-decoration: none; }
.werkzeuge a:hover, .werkzeuge button.link:hover { color: #fff; text-decoration: underline; }
.benutzer { color: #fff; }
.rollen { color: #9fb0cf; margin-left: .3rem; }
.module { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--weiss); border-bottom: 1px solid var(--linie); }
.modul-tab { display: flex; align-items: center; gap: .55rem; padding: .7rem 1rem; text-decoration: none; color: var(--text); border-bottom: 4px solid transparent; font-size: .9rem; font-weight: 600; }
.modul-tab:hover { background: var(--flaeche); }
.modul-nr { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; color: #fff; font-size: .8rem; flex: none; }
.tab-projekt .modul-nr { background: var(--m-projekt); }
.tab-personalkosten .modul-nr { background: var(--m-personalkosten); }
.tab-fragenkatalog .modul-nr { background: var(--m-fragenkatalog); }
.tab-kln .modul-nr { background: var(--m-kln); }
.tab-fehler .modul-nr { background: var(--m-fehler); }
.tab-projekt.aktiv { border-color: var(--m-projekt); color: var(--m-projekt); }
.tab-personalkosten.aktiv { border-color: var(--m-personalkosten); color: var(--m-personalkosten); }
.tab-fragenkatalog.aktiv { border-color: var(--m-fragenkatalog); color: var(--m-fragenkatalog); }
.tab-kln.aktiv { border-color: var(--m-kln); color: var(--m-kln); }
.tab-fehler.aktiv { border-color: var(--m-fehler); color: var(--m-fehler); }
.unternavigation { display: flex; flex-wrap: wrap; gap: .3rem; padding: .45rem 1.5rem; background: var(--akzent); }
.unternavigation a { color: #fff; text-decoration: none; padding: .3rem .75rem; border-radius: 999px; font-size: .86rem; opacity: .9; }
.unternavigation a:hover { background: rgba(255,255,255,.15); opacity: 1; }
.unternavigation a.aktiv { background: #fff; color: var(--akzent); font-weight: 700; opacity: 1; }

main { padding: 1.3rem 1.5rem 3rem; max-width: 1440px; }
.fuss { border-top: 1px solid var(--linie); padding: .6rem 1.5rem; font-size: .75rem; color: var(--text-2); }
.titelzeile { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.aktionen { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .5rem 0; }
.inline, .inline-formular { display: inline-flex; gap: .3rem; margin: 0; align-items: center; }

/* Schaltflächen */
button, .knopf { font: inherit; font-size: .88rem; padding: .42rem .9rem; border: 1px solid var(--linie); background: var(--weiss); color: var(--text); cursor: pointer; text-decoration: none; display: inline-block; border-radius: 6px; }
button:hover, .knopf:hover { border-color: var(--akzent); color: var(--akzent); }
button.primaer, .knopf.primaer { background: var(--akzent); border-color: var(--akzent); color: #fff; }
button.primaer:hover, .knopf.primaer:hover { filter: brightness(1.1); color: #fff; }
button.gefahr { border-color: var(--rot); color: var(--rot); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.link { border: 0; padding: 0; background: none; text-decoration: underline; font-size: inherit; }
button.klein { font-size: .75rem; padding: .15rem .5rem; }

/* Karten und Tabellen */
.karte { background: var(--weiss); border: 1px solid var(--linie); border-radius: 10px; padding: 1rem 1.1rem; margin-bottom: 1rem; }
table { border-collapse: collapse; width: 100%; }
table.liste { margin: .4rem 0 1rem; font-size: .88rem; background: var(--weiss); border: 1px solid var(--linie); border-radius: 8px; overflow: hidden; }
table.liste th { text-align: left; background: var(--grau-h); border-bottom: 1px solid var(--linie); padding: .45rem .55rem; font-weight: 600; vertical-align: bottom; color: var(--text-2); font-size: .82rem; }
table.liste td { border-bottom: 1px solid var(--linie); padding: .42rem .55rem; vertical-align: top; }
table.liste tr:last-child td { border-bottom: 0; }
table.liste tbody tr:hover td { background: #fafbfd; }
table.liste.klein { font-size: .78rem; }
table.liste tr.summe td { font-weight: 700; border-top: 2px solid var(--linie); }
table.liste tr.ueberfaellig td { background: var(--rot-h); }
table.kv { background: var(--weiss); border: 1px solid var(--linie); margin: .4rem 0 1rem; font-size: .88rem; }
table.kv th { background: var(--grau-h); text-align: left; width: 17%; padding: .4rem .55rem; border: 1px solid var(--linie); vertical-align: top; font-weight: 600; color: var(--text-2); }
table.kv td { padding: .4rem .55rem; border: 1px solid var(--linie); vertical-align: top; }
.zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pfad { font-family: Menlo, Consolas, monospace; font-size: .76rem; word-break: break-all; }
.details { font-size: .75rem; word-break: break-word; max-width: 40rem; }
.textblock { background: var(--weiss); border-left: 4px solid var(--akzent); border-radius: 0 6px 6px 0; padding: .5rem .9rem; margin: .3rem 0 .8rem; }

/* Status (Farbe + Text) */
.status { display: inline-block; padding: .08rem .5rem; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.status-offen, .rw-ausser_kraft { background: var(--grau-h); color: var(--grau); }
.status-in_bearbeitung { background: var(--blau-h); color: var(--blau); }
.status-zur_pruefung, .rw-offen, .tb-entwurf, .ms-gemeldet, .imp-importiert { background: var(--gelb-h); color: var(--gelb); }
.status-nacharbeit, .np-nicht_erreichbar, .np-ausserhalb, .np-abweichend, .ml-ueberfaellig, .imp-verworfen { background: var(--rot-h); color: var(--rot); }
.status-freigegeben { background: var(--gruen-h); color: var(--gruen); }
.status-gueltig, .np-bestaetigt, .rw-bestaetigt, .ms-abgenommen, .tb-freigegeben, .ml-erreicht, .imp-bestaetigt { background: var(--gruen); color: #fff; }
.status-integritaet { background: var(--rot); color: #fff; }
.np-nicht_geprueft, .ms-offen, .ml-offen { background: var(--grau-h); color: var(--grau); }

/* Meldungen */
.meldungen { list-style: none; padding: 0; margin: 0 0 1rem; }
.meldung { border-radius: 8px; padding: .6rem .9rem; margin-bottom: .45rem; background: var(--weiss); border: 1px solid var(--linie); border-left-width: 5px; }
.meldung.success { border-left-color: var(--gruen); background: var(--gruen-h); }
.meldung.info { border-left-color: var(--blau); background: var(--blau-h); }
.meldung.warning { border-left-color: var(--gelb); background: var(--gelb-h); }
.meldung.error { border-left-color: var(--rot); background: var(--rot-h); color: #7a1610; }
.meldung ul, .hinweis ul { margin: .3rem 0 0 1.1rem; padding: 0; }
.hinweis { border: 1px solid var(--linie); border-left: 5px solid var(--akzent); background: var(--weiss); border-radius: 8px; padding: .65rem .9rem; margin: .5rem 0 1rem; font-size: .9rem; }
.hilfe { color: var(--text-2); font-size: .8rem; display: block; margin-top: .15rem; }
.warntext { color: var(--rot); font-weight: 600; }
.fehlertext { color: var(--rot); font-size: .82rem; font-weight: 600; }
.fehlerzeile td { background: var(--rot-h); }

/* Formulare */
.formular { max-width: 900px; background: var(--weiss); border: 1px solid var(--linie); border-radius: 10px; padding: 1rem 1.2rem; }
.formular.kompakt { max-width: none; display: flex; flex-direction: column; gap: .3rem; margin-bottom: .4rem; padding: .5rem; }
.feld { margin-bottom: .85rem; display: flex; flex-direction: column; }
.feld label { font-weight: 600; font-size: .85rem; margin-bottom: .25rem; }
.feld.fehlerhaft input, .feld.fehlerhaft select, .feld.fehlerhaft textarea { border-color: var(--rot); box-shadow: 0 0 0 1px var(--rot); }
input[type=text], input[type=password], input[type=date], input[type=number], input[type=file], input:not([type]), select, textarea {
  font: inherit; font-size: .9rem; padding: .42rem .55rem; border: 1px solid #c3cad6; background: #fff; border-radius: 6px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--akzent); outline-offset: 0; border-color: var(--akzent); }
.feld ul { list-style: none; padding: 0; margin: 0; columns: 2; }
.feld ul li label { font-weight: 400; }
.checkbox input, .feld ul input { width: auto; }
.filter { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .2rem 0 .8rem; }
.filter input, .filter select { width: auto; }
.filter label.checkbox { font-size: .85rem; }

/* Rechenweg-Eingabe */
.tabellenrahmen { overflow-x: auto; }
table.eingabe td { padding: .25rem; }
table.eingabe input, table.eingabe select { font-size: .8rem; padding: .25rem .35rem; min-width: 4.5rem; }
table.eingabe td.breit input { min-width: 11rem; }
table.eingabe input[type=checkbox] { min-width: 0; width: auto; }
table.eingabe tr.importzeile td { background: #f2f9f7; border-bottom: 2px solid var(--linie); font-size: .8rem; }
table.eingabe tr.importzeile label { color: var(--m-personalkosten); font-weight: 600; margin-right: .3rem; }

/* Vier-Augen-Block */
.workflow { background: var(--weiss); border: 1px solid var(--linie); border-top: 4px solid var(--akzent); border-radius: 10px; padding: .3rem 1.1rem 1rem; margin: 1.5rem 0; }
.workflow h2 { margin-top: .8rem; border: 0; }
details summary { cursor: pointer; font-weight: 600; margin: .6rem 0; color: var(--akzent); }

/* Dashboard und Modulübersichten */
.modulkarten { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .9rem; margin: .6rem 0 1.4rem; }
.modulkarte { background: var(--weiss); border: 1px solid var(--linie); border-top: 5px solid var(--m-neutral); border-radius: 10px; padding: .85rem 1rem; text-decoration: none; color: var(--text); display: block; }
.modulkarte:hover { box-shadow: 0 3px 12px rgba(23,35,59,.12); }
.modulkarte.mk-projekt { border-top-color: var(--m-projekt); }
.modulkarte.mk-personalkosten { border-top-color: var(--m-personalkosten); }
.modulkarte.mk-fragenkatalog { border-top-color: var(--m-fragenkatalog); }
.modulkarte.mk-kln { border-top-color: var(--m-kln); }
.modulkarte.mk-fehler { border-top-color: var(--m-fehler); }
.modulkarte h3 { margin: 0 0 .5rem; font-size: .95rem; }
.modulkarte .gross { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.modulkarte .klein { font-size: .8rem; color: var(--text-2); }
.balken { height: 8px; background: var(--grau-h); border-radius: 99px; overflow: hidden; margin: .45rem 0 .2rem; }
.balken span { display: block; height: 100%; background: var(--gruen); }
.b0 { width: 0; } .b10 { width: 10%; } .b20 { width: 20%; } .b30 { width: 30%; } .b40 { width: 40%; } .b50 { width: 50%; }
.b60 { width: 60%; } .b70 { width: 70%; } .b80 { width: 80%; } .b90 { width: 90%; } .b100 { width: 100%; }
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .8rem; margin: .6rem 0 1.2rem; }
.kachel { background: var(--weiss); border: 1px solid var(--linie); border-radius: 10px; padding: .75rem .9rem; }
.kachel.warnung { border-color: var(--rot); background: var(--rot-h); }
.kachel-titel { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); font-weight: 600; }
.kachel-wert { font-size: 1.5rem; font-weight: 700; margin: .2rem 0; font-variant-numeric: tabular-nums; }
.kachel-text { font-size: .78rem; color: var(--text-2); }
.zweispaltig { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.anmeldung { max-width: 440px; margin: 2.5rem auto; }
.leer { color: var(--text-2); font-style: italic; }

@media (max-width: 1100px) { .module { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 860px) {
  .module { grid-template-columns: 1fr 1fr; }
  .zweispaltig { grid-template-columns: 1fr; }
  main { padding: 1rem; }
  .feld ul { columns: 1; }
  table.liste { display: block; overflow-x: auto; }
}
@media print {
  .module, .unternavigation, .werkzeuge, .aktionen, form, .fuss { display: none !important; }
  body { background: #fff; }
}
td.ebene-1 { padding-left: 1.4rem; } td.ebene-2 { padding-left: 2.4rem; } td.ebene-3 { padding-left: 3.4rem; }
.organisation { margin-left: .5rem; padding: .1rem .45rem; border: 1px solid #5b6b8c; border-radius: 4px; font-size: .78rem; color: #dfe6f3; }
