/* PBAvault Bausteine — Produktions-CSS für den Frontend-Neubau (S10-M1).
   Maße und Farben aus frontend/tokens/token-tabelle.md (gemessen am Prototyp 10.08.).
   Grundschrift und Grundflächen: */
body.pv {
  margin: 0;
  background: var(--pv-grund);
  color: var(--pv-text);
  font-family: var(--pv-schrift-ui);
  font-size: 12px;
}
/* h2 stand hier bis zum 17.09.2026 mit. Gemessen am Prototyp 10.08.: 30
   Elemente in Playfair, KEINES unter 12px -- die Schrift gehoert dem
   Seitentitel (21px, 20x) und der Marke, nicht den Zwischentiteln. Die
   Regel traegt Element UND Klasse (0-1-1) und schlug damit lokale
   Angaben mit blosser Klasse (0-1-0): screen_index setzt fuer
   .idx-tafel__titel ausdruecklich --pv-schrift-ui und bekam trotzdem
   Playfair. Wer h2 in Serifen will, setzt es am Schirm (Befund 1.380, 6). */
.pv h1, .pv .marke { font-family: var(--pv-schrift-serif); }
.pv a { color: var(--pv-marke); text-decoration: none; }
.pv a:hover { color: var(--pv-marke-dunkel); text-decoration: underline; }

/* ---------- BTN Schaltfläche ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 14px;
  border: 1px solid var(--pv-marke); border-radius: var(--pv-radius);
  background: var(--pv-marke); color: var(--pv-weiss);
  font: 600 11.5px var(--pv-schrift-ui); letter-spacing: 0.3px;
  cursor: pointer;
}
.btn:hover { background: var(--pv-marke-dunkel); border-color: var(--pv-marke-dunkel); }
.btn:disabled { background: var(--pv-flaeche-2); border-color: var(--pv-rand); color: var(--pv-text-aus); cursor: not-allowed; }
.btn--zweit { background: var(--pv-weiss); color: var(--pv-marke-dunkel); border-color: var(--pv-rand); }
.btn--zweit:hover { background: var(--pv-marke-soft); color: var(--pv-marke-dunkel); }
.btn--gefahr { background: var(--pv-gefahr); border-color: var(--pv-gefahr); }
.btn--gefahr:hover { background: #8d3333; border-color: #8d3333; }
.btn--leise { background: transparent; border-color: transparent; color: var(--pv-text-2); }
.btn--leise:hover { background: var(--pv-flaeche-2); }

/* ---------- BDG Abzeichen (Status, Typ) ---------- */
.abz {
  display: inline-block; padding: 2px 8px;
  border-radius: var(--pv-radius);
  /* 9,5px und 0,8px Laufweite: die Abzeichenform des Prototyps
     (Befund 1.380, 3). Schirm 08 trug sie ueber .dr-karte .abz schon,
     jetzt gilt sie ueberall. Gewicht 600 bleibt -- der Entwurf streut
     dort zwischen 600 und 700. Rand bleibt weg: 19 der 21 Abzeichen im
     10.08.-Entwurf haben keinen (der 1px-Rand stammt aus der
     31.08.-Quelle und gilt nur fuer deren drei Schirme). */
  font: 600 9.5px var(--pv-schrift-ui); letter-spacing: 0.8px; text-transform: uppercase;
  background: var(--pv-flaeche-2); color: var(--pv-text-2);
}
.abz--eingereicht { background: var(--pv-flaeche-2); color: var(--pv-text-2); }
.abz--pruefung    { background: var(--pv-warn-grund); color: var(--pv-warn-text); }
.abz--freigabe    { background: var(--pv-info-grund-2); color: var(--pv-info); }
.abz--beantwortet { background: var(--pv-marke-tint); color: var(--pv-marke-dunkel); }
.abz--verkaeufer  { background: var(--pv-marke-tint); color: var(--pv-marke-dunkel); }
.abz--bieter      { background: var(--pv-info-grund); color: var(--pv-info); }
.abz--berater     { background: var(--pv-berater-grund); color: var(--pv-warn-text); }
.abz--assessor    { background: var(--pv-assessor-grund); color: var(--pv-assessor); }
.abz--gefahr      { background: var(--pv-gefahr-grund); color: var(--pv-gefahr); }
.abz--warn        { background: var(--pv-warn-grund); color: var(--pv-warn-text); }
.abz--ok          { background: var(--pv-marke-tint); color: var(--pv-marke-dunkel); }
/* Datenraum-Status "Archiviert": bewusst KEINE Rollenfarbe (verkaeufer,
   bieter, berater, assessor) zweitverwenden - eine Rollenfarbe fuer einen
   Zustand waeren zwei Bedeutungen fuer dieselbe Flaeche. Stattdessen ein
   eigener, ausgegrauter Ton aus den vorhandenen Neutralwerten. */
.abz--archiv      { background: var(--pv-flaeche-4); color: var(--pv-text-3); }

/* ---------- BDG-P Schutzstufen-Abzeichen (sechs Stufen der Engine) ---------- */
.stufe { display: inline-block; padding: 2px 8px; border-radius: var(--pv-radius);
  font: 600 9.5px var(--pv-schrift-ui); letter-spacing: 0.6px; text-transform: uppercase;
  border: 1px solid transparent; }
.stufe--none   { background: var(--pv-stufe-none-bg);  color: var(--pv-stufe-none-fg); }
.stufe--fence  { background: var(--pv-stufe-fence-bg); color: var(--pv-stufe-fence-fg); }
.stufe--view   { background: var(--pv-stufe-view-bg);  color: var(--pv-stufe-view-fg); }
.stufe--print  { background: var(--pv-stufe-print-bg); color: var(--pv-stufe-print-fg); }
.stufe--dlpdf  { background: var(--pv-stufe-dlpdf-bg); color: var(--pv-stufe-dlpdf-fg); }
.stufe--dlorig { background: var(--pv-stufe-dlorig-bg); color: var(--pv-stufe-dlorig-fg);
  border-color: var(--pv-stufe-dlorig-rand); box-shadow: inset 0 0 0 1px var(--pv-stufe-dlorig-rand); }

/* ---------- KPI Kennzahlkachel ---------- */
.kpi { background: var(--pv-weiss); border: 1px solid var(--pv-rand);
  border-radius: var(--pv-radius); padding: 12px 14px; min-width: 140px; }
.kpi__label { font: 600 10px var(--pv-schrift-ui); letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--pv-text-3); }
/* Ohne eigene Farbe: der Entwurf setzt am KPI-Wert keine
   (font-size:16px;font-weight:600;font-variant-numeric:tabular-nums) und
   laesst ihn die Koerpertinte #23272B erben (Befund 1.380, 1). */
.kpi__wert { font: 700 21px var(--pv-schrift-ui); margin-top: 4px; }
.kpi__zusatz { font-size: 10.5px; color: var(--pv-text-2); margin-top: 2px; }
.kpi--gefahr .kpi__wert { color: var(--pv-gefahr); }
.kpi--marke .kpi__wert { color: var(--pv-marke); }

/* ---------- TBL Datentabelle ---------- */
.tbl { width: 100%; border-collapse: collapse; background: var(--pv-weiss);
  border: 1px solid var(--pv-rand); border-radius: var(--pv-radius); font-size: 11.5px; }
/* Gewicht, Tinte und Flaeche am Entwurf ausgerichtet (Befund 1.380, 2):
   die haeufigste Spaltenkopfform des Prototyps ist 10px ohne font-weight
   (also 400), color:#7A7F83, letter-spacing:0.6px und OHNE Hintergrund.
   Der Innenabstand bleibt bei 8/10px -- dort streut der Entwurf zwischen
   keinem, 7/14 und 8/16px, und ohne ihn stuenden Kopf und Zelle
   verschieden. */
.tbl th { background: transparent; color: var(--pv-text-leise); text-align: left;
  font: 400 10px var(--pv-schrift-ui); letter-spacing: 0.6px; text-transform: uppercase;
  padding: 8px 10px; border-bottom: 1px solid var(--pv-rand); }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--pv-linie); color: var(--pv-text); }
.tbl tr:hover td { background: var(--pv-marke-soft); }
.tbl tr.tbl--gewaehlt td { background: var(--pv-marke-soft); }
.tbl__meta { color: var(--pv-text-3); font-size: 10.5px; }

/* ---------- MTX Matrix-Zelle (Rechtekatalog 49×8) ---------- */
.mtx { border-collapse: collapse; font-size: 10.5px; background: var(--pv-weiss); }
.mtx th, .mtx td { border: 1px solid var(--pv-linie); padding: 4px 6px; text-align: center; }
.mtx th { font: 600 9.5px var(--pv-schrift-ui); letter-spacing: 0.5px; text-transform: uppercase; color: var(--pv-text-3); }
.mtx .mtx__bereich { text-align: left; font-weight: 600; color: var(--pv-text-2);
  background: var(--pv-flaeche); text-transform: none; letter-spacing: 0; }
.mtx .mtx__recht { text-align: left; font-weight: 400; color: var(--pv-text); text-transform: none; letter-spacing: 0; }
.mtx-zelle { width: 26px; height: 20px; display: inline-block; line-height: 20px; }
.mtx td.g1        { background: var(--pv-matrix-g1); color: var(--pv-marke-dunkel); font-weight: 700; }
.mtx td.g1--aus   { background: var(--pv-matrix-g1-aus); color: var(--pv-text-aus); }
.mtx td.g2        { background: var(--pv-matrix-g2); color: var(--pv-warn-text); font-weight: 700; }
.mtx td.g2--aus   { background: var(--pv-matrix-g2-aus); color: var(--pv-text-aus); }
.mtx td.krit      { outline: 2px solid var(--pv-gefahr); outline-offset: -2px; }
.mtx td.vier      { outline: 2px solid var(--pv-info); outline-offset: -2px; }

/* ---------- GRID Statusraster (Document Status) ---------- */
.raster { display: grid; gap: 3px; }
.raster__zelle { height: 22px; border-radius: var(--pv-radius); border: 1px solid var(--pv-rand);
  display: flex; align-items: center; justify-content: center;
  font: 600 9.5px var(--pv-schrift-ui); }
.raster__zelle--final    { background: var(--pv-marke); color: var(--pv-weiss); border-color: var(--pv-marke); }
.raster__zelle--pruefung { background: var(--pv-marke-blass); color: var(--pv-marke-dunkel); }
.raster__zelle--entwurf  { background: var(--pv-marke-zart); color: var(--pv-marke-dunkel); }
.raster__zelle--fehlt    { background: var(--pv-flaeche-2); color: var(--pv-text-aus); }
.raster__balken { height: 6px; border-radius: var(--pv-radius); background: var(--pv-flaeche-2); overflow: hidden; }
.raster__balken > i { display: block; height: 100%; background: var(--pv-marke); }

/* ---------- FRM Formularfelder ---------- */
.feld { display: block; margin-bottom: 12px; }
/* Die Beschriftungsform des Entwurfs, 67x gezaehlt: 10,5px/600 #5C6165,
   gemischte Schreibung, keine Laufweite (Befund 1.380, 5). Die
   Zugangskarte trug sie seit dem 03.09. lokal; damit galt sie fuer zwei
   Schirme und fuer die Datenraum-Schirme nicht. Jetzt steht sie hier,
   und die lokale Fassung in zugang_basis.html ist nur noch Wiederholung. */
.feld__label { display: block; font: 600 10.5px var(--pv-schrift-ui); letter-spacing: normal;
  text-transform: none; color: var(--pv-text-2); margin-bottom: 4px; }
.feld__label .pflicht { color: var(--pv-gefahr); }
.feld input[type="text"], .feld input[type="password"], .feld input[type="email"],
.feld input[type="number"], .feld input[type="date"], .feld select, .feld textarea {
  width: 100%; height: 32px; box-sizing: border-box;
  border: 1px solid var(--pv-linie); border-radius: var(--pv-radius);
  padding: 0 10px; font: 400 12px var(--pv-schrift-ui); color: var(--pv-text);
  background: var(--pv-weiss); }
.feld textarea { height: auto; padding: 8px 10px; }
.feld input:focus, .feld select:focus, .feld textarea:focus {
  outline: none; border-color: var(--pv-marke); box-shadow: 0 0 0 2px var(--pv-marke-tint); }
.feld--fehler input, .feld--fehler select, .feld--fehler textarea {
  border-color: var(--pv-gefahr); background: var(--pv-gefahr-grund); }
.feld__fehler { color: var(--pv-gefahr); font-size: 10.5px; margin-top: 3px; }
.feld input:disabled, .feld select:disabled { background: var(--pv-flaeche-2); color: var(--pv-text-aus); }
.schalter { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 11.5px; }
.schalter__bahn { width: 30px; height: 16px; border-radius: 8px; background: var(--pv-linie); position: relative; transition: background .15s; }
.schalter__bahn::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--pv-weiss); transition: left .15s; }
.schalter input { display: none; }
.schalter input:checked + .schalter__bahn { background: var(--pv-marke); }
.schalter input:checked + .schalter__bahn::after { left: 16px; }

/* ---------- MOD Modal ---------- */
.modal-grund { position: fixed; inset: 0; background: rgba(20, 25, 24, 0.45);
  display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: var(--pv-weiss); border-radius: var(--pv-radius-2);
  box-shadow: var(--pv-schatten-modal); width: 440px; max-width: 92vw; }
.modal__kopf { padding: 14px 16px; border-bottom: 1px solid var(--pv-rand);
  font: 600 13px var(--pv-schrift-ui); }
.modal__rumpf { padding: 16px; font-size: 12px; color: var(--pv-text-2); }
.modal__fuss { padding: 12px 16px; border-top: 1px solid var(--pv-rand);
  display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- TAB Registerkarten ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--pv-rand); }
.tabs__tab { padding: 8px 14px; font: 600 11.5px var(--pv-schrift-ui);
  color: var(--pv-text-2); cursor: pointer; border: 0; background: none;
  border-bottom: 2px solid transparent; }
.tabs__tab:hover { color: var(--pv-text); }
.tabs__tab--aktiv { color: var(--pv-marke-dunkel); border-bottom-color: var(--pv-marke); }

/* ---------- TML Zeitleiste ---------- */
.zeitleiste { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--pv-linie); }
.zeitleiste li { position: relative; padding: 0 0 14px 12px; font-size: 11.5px; }
.zeitleiste li::before { content: ""; position: absolute; left: -21px; top: 3px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--pv-marke);
  border: 2px solid var(--pv-weiss); box-shadow: 0 0 0 1px var(--pv-linie); }
.zeitleiste li.warn::before { background: var(--pv-warn); }
.zeitleiste li.gefahr::before { background: var(--pv-gefahr); }
.zeitleiste__zeit { color: var(--pv-text-3); font-size: 10px; letter-spacing: 0.3px; }

/* ---------- BAN Hinweisbanner ---------- */
.banner { display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--pv-rand); border-radius: var(--pv-radius);
  padding: 10px 12px; font-size: 11.5px; background: var(--pv-flaeche-6); color: var(--pv-text-2); }
.banner--gefahr { background: var(--pv-gefahr-grund); border-color: var(--pv-gefahr-rand); color: var(--pv-gefahr); }
.banner--warn { background: var(--pv-warn-grund); border-color: var(--pv-warn-rand); color: var(--pv-warn-text); }
.banner--info { background: var(--pv-info-grund); border-color: var(--pv-info-grund-2); color: var(--pv-info); }
.banner--ok { background: var(--pv-marke-tint); border-color: var(--pv-marke-blass); color: var(--pv-marke-dunkel); }

/* ---------- EMP Leerzustand ---------- */
.leer { text-align: center; padding: 40px 20px; background: var(--pv-weiss);
  border: 1px dashed var(--pv-linie); border-radius: var(--pv-radius); }
.leer__titel { font: 600 12.5px var(--pv-schrift-ui); color: var(--pv-text-2); }
.leer__text { font-size: 11.5px; color: var(--pv-text-3); margin: 6px 0 14px; }

/* ---------- Ladezustand (Skeleton) ---------- */
.skelett { position: relative; overflow: hidden; background: var(--pv-flaeche-2);
  border-radius: var(--pv-radius); min-height: 12px; }
.skelett::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.7), transparent);
  animation: pv-schimmer 1.4s infinite; }
@keyframes pv-schimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ---------- TREE-IDX Index-Baum (Baustein zu static/app/js/index-baum.js) ----------
   Eigener Baustein neben TREE (spv-tree): Der Index-Baum traegt title,
   stable_number und Schutzstufe, nicht die Beteiligungsstruktur. Begruendung
   steht im Kopf von index-baum.js und in frontend/doku/screen-12-index-bauplan.md. */
/* scrollbar-width:thin holt 15 Pixel zurueck, die sonst der Rollbalken frisst.
   GEMESSEN (Pruefung 18.09.2026, von mir nachgefahren, 1280px Fensterbreite):
   der Rahmen ist aussen 272px und innen 257 - und er rollt WIRKLICH
   (scrollHeight > clientHeight), der Balken ist also keine Zierde.

       wie gebaut          Titel 137px   37 von 41 gekuerzt
       scrollbar-width thin Titel 141px   34 gekuerzt
       scrollbar-width none Titel 152px   29 gekuerzt

   NICHT `none`, obwohl es mehr braechte: der Balken ist die einzige Anzeige,
   dass unterhalb der Klappe noch Knoten stehen. Ihn zu entfernen waere ein
   Entscheid ueber eine BEDIENHILFE und keiner ueber ein Mass - dieselbe
   Grenze, an der auch die Stufen-Marke stehenbleibt.
   Wo der Browser die Eigenschaft nicht kennt (Safari vor 18.2), bleibt der
   normale Rollbalken: der Rueckfall ist der heutige Zustand, nicht ein
   kaputter. Der Entwurf sagt ueber Rollbalken nichts, das ist also kein
   Widerspruch zu ihm. */
.idxb { font-size: 11.5px; color: var(--pv-text); scrollbar-width: thin; }
.idxb__liste { list-style: none; margin: 0; padding: 0; }
/* Die Einrueckung sitzt auf der Unterliste, nicht auf dem Eintrag: So bleibt die
   Trefferflaeche einer Zeile ueber die volle Breite klickbar, und die Linie der
   Ebene laeuft durch. */
.idxb__liste .idxb__liste { margin-left: 15px; border-left: 1px solid var(--pv-linie); padding-left: 6px; }
.idxb__eintrag { margin: 0; }
/* gap:7px nach dem Entwurf (20260917_dc_template.html, Zeichen 199243 ff.:
   `display:flex;align-items:center;gap:7px`). */
.idxb__zeile { display: flex; align-items: center; gap: 7px; padding: 3px 6px;
  border-radius: var(--pv-radius); }
.idxb__zeile:hover { background: var(--pv-marke-soft); }
.idxb__zeile--gewaehlt { background: var(--pv-marke-tint); }
/* 10px nach dem Entwurf (`<span style="width:10px;...;flex-shrink:0">` fuer
   tn.caret). Waren 16px - das sind 6px je Zeile, die dem Titel fehlten. */
.idxb__klapp { width: 10px; height: 16px; flex: 0 0 10px; padding: 0; line-height: 1;
  border: 0; background: transparent; cursor: pointer; color: var(--pv-text-3);
  font-size: 10px; border-radius: var(--pv-radius); }
.idxb__klapp:hover { color: var(--pv-marke-dunkel); background: var(--pv-marke-zart); }
.idxb__klapp--leer { cursor: default; visibility: hidden; }
/* KEIN min-width - der Entwurf hat keins. Hier standen 42px mit der
   Begruendung "die Gliederungsnummern stehen damit untereinander". Die
   Begruendung beschreibt eine Zutat, die der Entwurf nicht kennt: dort steht
   `font-variant-numeric:tabular-nums;color:#0E7C74;font-weight:600;
   flex-shrink:0` und sonst nichts - die Nummern stehen also gar nicht
   untereinander.
   GEMESSEN, was die 42px kosteten: die Nummern sind tatsaechlich 7 bis 23px
   breit. Bei der schmalsten verschenkte das min-width 35px an jeder Zeile,
   und zwar an die einzige dehnbare Spalte - den Titel. */
.idxb__nummer { flex: 0 0 auto; color: var(--pv-text-3);
  font-variant-numeric: tabular-nums; letter-spacing: 0.2px; }
.idxb__titel { flex: 1 1 auto; text-align: left; padding: 0; border: 0;
  background: transparent; cursor: pointer; color: inherit;
  font: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idxb__titel:hover { color: var(--pv-marke-dunkel); }
.idxb__stufe { flex: 0 0 auto; margin-left: 6px; }
.idxb__mehr { padding: 4px 0 4px 22px; }
.idxb__mehr .btn { height: 22px; font-size: 10.5px; }
