/* =====================================================================
   CRM Light – Ressourcenbild (Spec `.scratch/ressourcenbild/spec.md`;
   Soll-Bild Prototyp Variante D, DESIGN #1127). Baut auf `styles.css` auf
   (Tokens, `.toolbar`, `.chip`, `.badge`, `.card`, `.modal`).

   Ein Abschnitt je Ticket (01, 02, 05, 03) — Ticket 02 und Ticket 05 bauten
   gleichzeitig und schrieben nur in ihren eigenen Abschnitt.
   ===================================================================== */

/* ---------- Seite, Toolbar, Meta-Zeile, Vorlage-Dialog (Ticket 01, DESIGN #1131) ---------- */
.rb-kopf { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rb-kopf select { padding: 6px 10px; font-size: 13px; }
.rb-trenner { width: 10px; }
.rb-stand { display: inline-flex; align-items: center; gap: 6px; }
.rb-aus { opacity: .55; }
.rb-meta { color: var(--muted); font-size: 12.5px; margin: -8px 0 14px; }
.rb-hinweis { font-size: 12.5px; color: var(--amber); margin: -6px 0 12px; }
.rb-leer { text-align: left; }
.rb-dlg-chk { display: flex; align-items: center; gap: 6px; margin-top: 8px; cursor: pointer; }
.rb-dlg-fenster { display: flex; align-items: flex-end; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.rb-dlg-zahl input { width: 72px; margin-top: 4px; display: block; }
.rb-dlg-liste { margin-top: 14px; }
.rb-dlg-loeschen { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Kacheln, Monatstabelle, Fußnoten, Legende, Drilldown (Ticket 02, DESIGN #1132) ---------- */
.rb-lade, .rb-fehler { padding: 14px 16px; }
.rb-fehler { color: var(--red); }
.rb-kpis { margin-top: 0; margin-bottom: 16px; }
.rb-tbl-karte { overflow: auto; }
table.rb-tbl { font-size: 12.5px; width: 100%; }
.rb-tbl thead th { text-align: right; padding: 6px 10px; text-transform: none; letter-spacing: 0; font-size: 11.5px; }
.rb-tbl thead th:first-child { text-align: left; }
.rb-tbl thead th.rb-rueckschau { color: var(--muted); }
.rb-tbl thead th .rb-art { display: block; font-size: 10px; font-weight: 400; color: var(--muted); }
.rb-tbl tbody td { padding: 5px 10px; text-align: right; font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.rb-tbl tbody td:first-child { text-align: left; font-weight: 600; white-space: nowrap; }
.rb-tbl tbody td:first-child .small { font-weight: 400; }
/* Laufender Monat amber abgesetzt (DESIGN #1127 (3)) */
.rb-tbl th.rb-laufend, .rb-tbl td.rb-laufend { border-left: 2px solid var(--amber);
  border-right: 2px solid var(--amber); background: var(--thead-bg); }
.rb-klapp { cursor: pointer; }
.rb-klapp:hover { color: var(--accent); }
.rb-caret { display: inline-block; width: 14px; color: var(--muted); }
.rb-tbl td[data-rbdd], .fc-kpi[data-rbdd] { cursor: pointer; }
.rb-tbl td[data-rbdd]:hover { background: var(--accent-soft); color: var(--accent); }
/* Marker an der Zelle (bis Ticket 08 der Runde „Ressourcenbild v2" die
   Fußnotennummer, DESIGN #1127 (4)); Fußnotenliste und Legende entfallen */
sup.rb-fn { color: var(--amber); font-weight: 700; font-size: 10px; margin-left: 2px; cursor: help; }
/* Drilldown-Modal (Muster DESIGN #116): innen scrollend, Kopfzeile steht */
.modal.rb-dd-modal { width: 820px; }
.rb-dd-text { margin: -8px 0 12px; }
.rb-dd table { font-size: 12.5px; }
.rb-dd tbody td { padding: 5px 10px; vertical-align: middle; }
.rb-dd tr.rb-pers[data-rbpers] td:first-child { cursor: pointer; font-weight: 600; }
.rb-dd tr.rb-proj td { background: var(--thead-bg); color: var(--muted); font-size: 11.5px; padding: 2px 10px; }
.rb-dd tr.rb-proj td:first-child { padding-left: 34px; }
.rb-dd-mitte { width: 200px; }
.rb-anteil { display: inline-block; height: 6px; max-width: 160px; background: var(--fc-h3, #7fb2d1);
  border-radius: 3px; vertical-align: middle; }
.rb-anteil-neg { background: var(--red); }


/* ---------- Top-3-Blöcke und Managemententscheidung (Ticket 05) ---------- */
/* Soll-Bild: Prototyp Variante D (DESIGN #1127 (6) „unter der Tabelle"),
   inline bearbeitbar (DESIGN #1130 (3), #1133). */
.rb-unten { display: grid; gap: 14px; margin-top: 16px; }
.rb-unten.drei { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .rb-unten.drei { grid-template-columns: 1fr; } }
.rb-top3 h3 { font-size: 13px; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .4px;
  color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rb-top3 h3 button { font-size: 11px; padding: 2px 8px; text-transform: none; letter-spacing: 0; }
.rb-top3 ol { padding-left: 22px; font-size: 13px; line-height: 1.45; margin: 0; }
.rb-top3 li { margin: 4px 0; overflow-wrap: anywhere; }
.rb-top3 li .small { display: block; }
.rb-entsch { border-left: 4px solid var(--viakom-green); }
.rb-entsch-text { font-size: 13.5px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; margin: 0; }
.rb-entsch .rb-termin { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.rb-t3-fehlt { padding: 14px 16px; margin-top: 16px; color: var(--amber); }
/* Formular eines Blocks */
.rb-t3-form li { margin: 6px 0; }
.rb-t3-form input[type="text"] { width: 100%; }
.rb-t3-zeile2 { display: flex; gap: 6px; margin-top: 4px; }
.rb-t3-zeile2 input[type="text"] { flex: 1; min-width: 0; }
.rb-t3-zeile2 input[type="date"] { flex: 0 0 auto; }
.rb-entsch textarea { width: 100%; resize: vertical; font: inherit; font-size: 13.5px; }
.rb-t3-termin { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.rb-t3-fehler { color: var(--red); font-size: 12.5px; margin-top: 8px; }
.rb-t3-knoepfe { display: flex; gap: 8px; margin-top: 10px; }

/* ---------- Laufender Monat: Ist gegen Soll (Ticket 03, DESIGN #1135) ---------- */
/* Balken = bisher ÷ Soll, Strich = Anteil der Arbeitstage bisher; amber, wenn
   „bisher" unter 90 % des anteiligen Solls liegt (Prototyp Variante D). */
.rb-balken { display: block; position: relative; height: 6px; background: var(--line-soft);
  border-radius: 3px; margin-top: 3px; overflow: visible; }
.rb-balken i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent);
  border-radius: 3px; }
.rb-balken i.rb-hinten { background: var(--amber); }
.rb-balken s { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text);
  opacity: .55; }

/* ---------- Freeze und Delta (Ticket 06, DESIGN #1138) ---------- */
/* Delta als kleine zweite Zeile unter dem Wert (DESIGN #1127 (2)); Farbe nur
   an Verfügbar und Frei, „±0" und „–" gedämpft (Prototyp Variante D). */
.rb-dsub { display: block; font-size: 10.5px; font-weight: 600; margin-top: 1px; color: var(--muted); }
.rb-dsub .rb-pos { color: var(--green); }
.rb-dsub .rb-neg { color: var(--red); }
.rb-dsub .rb-neu { color: var(--muted); font-weight: 400; }
.rb-stand-leiste { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rb-freeze-chip { background: var(--accent-soft); color: var(--accent); }
.rb-t3-stand { font-weight: 400; margin-left: 6px; }

/* ---------- Treppe (Runde „Ressourcenbild v2", Ticket 03, Spec R10, DESIGN #1222) ---------- */
/* Prototyp Variante A: Blockzeilen Geplant / Erfasst als Kopf, Töpfe
   eingerückt (Ebene 1), Unterzeilen weiter eingerückt und gedämpft
   (Ebene 2); je Zelle der Wert, darunter klein der Prozentwert. Löst den
   Block „Extern / intern · geplant gegen erfasst" (DESIGN #1148) ab. Die
   Schraffur „noch nicht beauftragt" ist die app-weite Klasse
   `.noch-nicht-beauftragt` aus `styles.css`. */
.rb-tbl tr.rb-blockkopf td { background: var(--thead-bg); font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .4px; padding-top: 8px; font-weight: 600; text-align: left; }
.rb-tbl tr.rb-ebene1 td:first-child { font-weight: 400; padding-left: 24px; }
.rb-tbl tr.rb-ebene2 td { color: var(--muted); font-size: 11.5px; padding-top: 2px; padding-bottom: 2px; }
.rb-tbl tr.rb-ebene2 td:first-child { font-weight: 400; padding-left: 42px; }
.rb-tbl .rb-zahl { white-space: nowrap; }
.rb-tbl .rb-zahl b { font-weight: 700; }
.rb-tbl .rb-pct { display: block; font-size: 10.5px; color: var(--muted); white-space: nowrap; }

/* Ziel abrechenbar (Ticket 05 der Runde „Ressourcenbild v2", Spec R4/R9):
   ▲/▼ in der zweiten Zeile von abrechenbar mit der Statusfarbe der alten
   App, der Kopf „Ziel abrechenbar z %" klickbar zur Herleitung */
.rb-tbl td.rb-ziel-ok .rb-pct { color: var(--green); font-weight: 600; }
.rb-tbl td.rb-ziel-unter .rb-pct { color: var(--red); font-weight: 600; }
.rb-zielkopf { display: inline-flex; align-items: baseline; gap: 4px; }
.rb-zielkopf-wert { font-weight: 600; }
.rb-zielkopf-wert[data-rbdd] { cursor: pointer; border-bottom: 1px dotted var(--muted); }
.rb-zielkopf-wert[data-rbdd]:hover { color: var(--accent); }
.rb-zielkopf-delta { display: inline; font-weight: 400; }

/* ---------- Kacheln und Seitenkopf (Runde „Ressourcenbild v2", Ticket 06, Spec R8/R9, DESIGN #1222) ---------- */
/* Prototyp Variante C: vier Kacheln nebeneinander, darunter die Treppe;
   der Kopf „Vorlagentitel · n Personen · x FTE · Ziel abrechenbar z %" unter
   der Toolbar. Balken: Abrechenbar mit Ziel-Strich, Intern zweigeteilt
   (Admin / Projekte) — Farben aus der Blau-Rampe des Planungsrasters
   (`--fc-h5`/`--fc-h3`, mit Dunkel-Stufen). */
.rb-seitenkopf { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  font-size: 13px; margin: 2px 0 12px; }
.rb-seitenkopf-titel { font-size: 15px; font-weight: 600; }
.rb-seitenkopf-sep { color: var(--muted); }
.rb-seitenkopf-wert[data-rbdd] { cursor: pointer; border-bottom: 1px dotted var(--muted); }
.rb-seitenkopf-wert[data-rbdd]:hover { color: var(--accent); }
.rb-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .rb-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rb-kpi .fc-kpi-v .rb-ziel-ok { color: var(--green); }
.rb-kpi .fc-kpi-v .rb-ziel-unter { color: var(--red); }
.rb-kpi-neg { color: var(--red); }
.rb-kpi-balken { display: block; position: relative; height: 8px; background: var(--line-soft);
  border-radius: 4px; margin-top: 8px; overflow: visible; }
.rb-kpi-balken i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent);
  border-radius: 4px; }
.rb-kpi-balken s { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); }
.rb-kpi-split { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; margin-top: 8px; }
.rb-kpi-split .rb-split-admin { background: var(--fc-h5); }
.rb-kpi-split .rb-split-projekte { background: var(--fc-h3); }

/* ---------- Drilldown Projekt → Personen (Runde „Ressourcenbild v2", Ticket 07, Spec R14, DESIGN #1235) ---------- */
/* Prototyp: Umschalter „nach Projekt / nach Person“ im Modalkopf unter dem
   Titel — zwei Chips mit der neutralen Wahl `.chip.sel` (eine Richtung ist
   eine Auswahl, kein Filter; Muster „Offen | Alle“, #108). Projektzeilen
   klicken wie Personenzeilen. */
.rb-dd-kopf { margin: -6px 0 12px; }
.rb-dd-kopf .rb-dd-text { margin: 0; }
.rb-dd-richtung { display: inline-flex; gap: 4px; margin-bottom: 6px; }
.rb-dd tr.rb-pers[data-rbproj] td:first-child { cursor: pointer; font-weight: 600; }
.rb-dd-mitte .badge + .badge { margin-left: 2px; }

/* ---------- Ruhige Seite (Runde „Ressourcenbild v2", Ticket 08, Spec R11–R13, DESIGN #1222) ---------- */
/* Prototyp: Hinweiszeile in Amber über den Kacheln, nur bei Bedarf, eine
   Zeile je Art; die Tabellenüberschrift trägt das ⓘ; „Δ seit Freeze“ ist
   ein Chip der Stand-Leiste (`.chip.on` = eingeschaltet). */
.rb-hinweiszeile { border: 1px solid var(--amber); border-radius: 8px; padding: 6px 10px;
  margin: 0 0 14px; font-size: 12.5px; color: var(--text);
  background: color-mix(in srgb, var(--amber) 10%, transparent); }
.rb-hinweiszeile b { color: var(--amber); font-weight: 600; }
.rb-hinweis-art + .rb-hinweis-art { margin-top: 2px; }
.rb-tbl-titel { padding: 10px 10px 2px; }
.rb-tbl-titel h3 { margin: 0; font-size: 13.5px; }
.rb-delta-chip:disabled { cursor: not-allowed; }

/* ---------- Ziel in der Kachel, prägnante Hauptzeilen (Runde „Ressourcenbild 60-%-Regel", Ticket 01) ---------- */
/* Maße aus dem Prototyp `.scratch/ressourcenbild-ziel-optik/` (Variante „a“
   und „gross“), nur Tokens aus `styles.css` — dunkles Thema über dieselben
   Variablen. Kachel Abrechenbar: das Ziel in der Wertzeile neben dem
   erreichten Wert (der bleibt 19 px / 700 aus `.fc-kpi-v`), etwas kleiner,
   fett, in Textfarbe; „/“ gedämpft. Monatsübersicht: die PT-Zahl der
   Hauptzeilen (Klasse aus `hauptzeile` der Treppe, Basis 12,5 px) fett und
   größer; im laufenden Monat bleibt „bisher“ normal, X fett über `.rb-zahl b`;
   das „–“ einer Zelle ohne Wert (`rb-ohne-wert`) bleibt in Größe und Gewicht
   der Tabelle wie im Prototyp (Sammel-Nachzug, R01-2). */
.rb-kpi .rb-ziel-in-wertzeile { font-size: 15px; font-weight: 700; color: var(--text); margin-left: 6px; }
.rb-kpi .rb-ziel-in-wertzeile .rb-sep { color: var(--muted); font-weight: 400; margin-right: 4px; }
.rb-tbl tr.rb-hauptzeile .rb-zahl { font-size: 14px; font-weight: 700; }
.rb-tbl tr.rb-hauptzeile .rb-zahl.rb-bisher { font-weight: 400; }
.rb-tbl tr.rb-hauptzeile .rb-zahl.rb-ohne-wert { font-size: inherit; font-weight: 400; }
