/* Portfolio (Projekttabelle nach ByD-Status, Board, Performance), Projektdetail, Durchführung und die Topbar-Teile
   Suche und eigene Stunden. Regeln übernommen aus dem <style> von public_html/index.html des Ist. */

/* ---------- Topbar: Zurück, Suche, eigene Stunden ---------- */
.back-link{background:none; border:1px solid var(--border); color:var(--text-secondary); font-size:12.5px; padding:6px 11px; border-radius:var(--radius-sm); cursor:pointer;}
.back-link:hover{border-color:var(--accent); color:var(--accent);}
.search-box{flex:1; max-width:320px; display:flex; align-items:center; gap:8px; background:var(--page); border:1px solid var(--border); border-radius:var(--radius-sm); padding:7px 11px; color:var(--text-secondary);}
.search-box input{border:none; background:none; outline:none; color:var(--text-primary); width:100%; font-size:13px;}
.search-box{position:relative;}
.search-box:focus-within{border-color:var(--accent);}
.search-suggest{position:absolute; left:-1px; right:-1px; top:calc(100% + 4px); z-index:30; margin:0; padding:4px 0; list-style:none; background:var(--surface-1); border:1px solid var(--border); border-radius:var(--radius-sm); box-shadow:0 4px 16px rgba(0,0,0,.16); max-height:min(60vh, 420px); overflow-y:auto;}
.search-suggest[hidden]{display:none;}
.search-suggest-item{display:flex; flex-direction:column; gap:1px; padding:7px 12px; cursor:pointer; min-width:0;}
.search-suggest-item[aria-selected="true"]{background:var(--page);}
@media (hover: hover) and (pointer: fine){ .search-suggest-item:hover{background:var(--page);} }
.search-suggest-item .ss-haupt{font-size:13px; color:var(--text-primary); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.search-suggest-item .ss-neben{font-size:12px; color:var(--text-secondary); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.search-suggest-item mark{background:none; color:inherit; font-weight:var(--fw-semibold);}
.my-hours-slot{display:contents;}
.my-hours{display:flex; flex-direction:column; gap:3px; font-size:12px; color:var(--text-secondary); font-variant-numeric:tabular-nums; white-space:nowrap; padding:2px 4px;}
.my-hours strong{color:var(--text-primary); font-weight:var(--fw-semibold);}
.my-hours .my-hours-bar{height:3px; border-radius:2px; background:color-mix(in srgb, var(--text-primary) 10%, transparent); overflow:hidden;}
.my-hours .my-hours-fill{display:block; height:100%; background:var(--accent);}
.my-hours .my-hours-fill.ok{background:var(--status-good);}
.my-hours.is-stale, .my-hours.is-stale strong{color:var(--text-muted);}
.my-hours.is-stale .my-hours-fill{background:var(--text-muted);}
.my-hours[data-tooltip]:focus-visible::after, .my-hours[data-tooltip]:hover::after{bottom:auto; top:130%; left:auto; right:0; white-space:normal; width:max-content; max-width:280px;}
.my-hours:focus-visible{outline:2px solid var(--accent); outline-offset:2px; border-radius:var(--radius-sm);}
@media (max-width: 980px){
  .my-hours .my-hours-kw, .my-hours .my-hours-stand{display:none;}
  .search-box{order:3; max-width:none; flex-basis:100%;}
}

/* ---------- Kacheln, Hinweis ---------- */
.kpi-tile.is-active{border-color:var(--accent);}
.kpi-value.status-good{color:var(--success-text);}
.kpi-value.status-warning{color:var(--status-warning-text);}
/* #156: ein Eingabefeld in der Kachel (Nächste Schritte am) steht in Feldgröße, nicht in der Größe der Kennzahl */
.kpi-tile .kpi-value.kpi-value--feld{font-size:16px; font-weight:var(--fw-semibold); letter-spacing:normal;}
.scope-hint{font-size:12px; color:var(--text-muted); padding-bottom:24px;}

/* ---------- Filter ---------- */
.filter-row{display:flex; gap:8px; flex-wrap:wrap; align-items:center; padding:2px 18px 14px;}
.filter-row .btn-primary{height:var(--ctl-h); display:inline-flex; align-items:center; align-self:center; padding-top:0; padding-bottom:0;}  /* gleiche Höhe wie die Bausteine, bleibt eckig (ADR-006) */
.filter-row .reset-btn{font-size:12px; color:var(--text-secondary); background:none; border:none; cursor:pointer; text-decoration:underline; margin-left:auto;}
/* #180: am Telefon liegen die Filter hinter dem Knopf „Filter“ (Zahl = gesetzte Filter); „+ Neues Projekt“ bleibt sichtbar */
.filter-toggle{display:none; align-items:center; gap:6px; font:inherit; font-size:var(--fs-sm); font-weight:var(--fw-semibold); height:var(--ctl-h); padding:0 var(--ctl-px); border-radius:var(--radius-pill);
  border:1px solid var(--border); background:var(--page); color:var(--text-primary); cursor:pointer;}
.filter-toggle[aria-expanded="true"]{border-color:var(--accent);}
.filter-toggle .filter-zahl{min-width:18px; padding:0 5px; border-radius:999px; background:var(--accent-soft-bg); color:var(--accent-soft-text); font-size:11px; line-height:18px; text-align:center; font-variant-numeric:tabular-nums;}
@media (max-width: 600px){
  .filter-toggle{display:inline-flex;}
  .filter-row:has(> .filter-toggle):not(.is-offen) > :not(.filter-toggle):not(.btn-primary){display:none;}
  .filter-row:has(> .filter-toggle) .btn-primary{margin-left:auto;}
}
.legend-row{display:flex; gap:14px; flex-wrap:wrap; font-size:12px; color:var(--text-secondary);}
.legend-item{display:flex; align-items:center; gap:6px;}
.legend-swatch{width:9px; height:9px; border-radius:50%;}
.chip-toggle{display:inline-flex; align-items:center; gap:5px; font-size:12px; border:1px solid var(--border); border-radius:999px; padding:4px 10px; margin:2px 4px 2px 0; cursor:pointer; background:var(--page); color:var(--text-secondary);}
.chip-toggle.on{border-color:var(--accent); background:var(--accent-soft-bg); color:var(--accent-soft-text); font-weight:var(--fw-semibold);}
/* ByD-Status-Chips (Mehrfachauswahl) */
.byd-filter{display:flex; flex-wrap:wrap; gap:6px; align-items:center;}
.byd-filter-btn[aria-pressed="true"]{border-color:var(--sec); background:color-mix(in srgb, var(--sec) 16%, var(--page));}
.byd-filter-btn .byd-section-dot{margin-right:0;}
/* Panels „Teilprojekt“ und „Mitarbeiter“ (Mehrfachauswahl) */
.type-dropdown{position:relative; display:inline-block; vertical-align:middle;}
.type-dropdown-panel{position:absolute; top:calc(100% + 4px); left:0; z-index:20; background:var(--surface-1); border:1px solid var(--card-border);
  border-radius:8px; box-shadow:0 4px 16px rgba(0,0,0,.24); padding:6px; min-width:240px; display:flex; flex-direction:column; gap:2px; color:var(--text-primary);}
.type-dropdown-item{display:flex; align-items:center; gap:7px; font-size:12.5px; padding:5px 6px; border-radius:5px; cursor:pointer; white-space:nowrap; color:var(--text-primary);}
.type-dropdown-item:hover{background:var(--page);}
.type-dropdown-item.is-empty{opacity:.5;}
.type-dropdown-trenner{border:none; border-top:1px solid var(--grid); margin:3px 0; width:100%;}

/* ---------- Tabelle ---------- */
.table-scroll{overflow-x:auto; margin:0 -2px; padding:0 2px;}
table.proj-table{width:100%; border-collapse:collapse; font-size:13px;}
table.proj-table thead th{text-align:left; border-bottom:1px solid var(--grid); padding:0 10px 10px;}
table.proj-table tbody tr.proj-row{border-bottom:1px solid var(--grid); cursor:pointer;}
table.proj-table tbody tr.proj-row:hover{background:var(--page);}
table.proj-table td{padding:11px 10px; vertical-align:middle;}
table.proj-table tbody tr.proj-row:focus-visible{outline:2px solid var(--accent); outline-offset:-2px;}
.cell-project .kunde{font-weight:var(--fw-semibold); color:var(--text-primary);}
.cell-project .projname{color:var(--text-secondary); font-size:12.3px;}
.cell-project .projnr{color:var(--text-muted); font-size:11px; font-variant-numeric:tabular-nums;}
.row-badges{display:flex; flex-wrap:wrap; gap:4px; margin-top:4px;}
.row-chevron{color:var(--text-muted); text-align:right; transition:transform .12s;}
table.proj-table tbody tr.proj-row:hover .row-chevron{transform:translateX(3px); color:var(--accent);}
tr.proj-row.is-done{opacity:.62;}
.overdue-text{color:var(--status-critical-text); font-weight:var(--fw-semibold);}

/* ByD-Status-Gruppen als eigene Card: je Gruppe ein <tbody>, links eine Leiste in der Gruppenfarbe (--sec) */
/* #24: eine linke Kante im Statusrahmen. Kopf, Kundengruppe, Zeile und Spaltenkopf lesen --sec-einzug. */
table.proj-table.byd-sections{border-collapse:separate; border-spacing:0; --sec-einzug:var(--sp-lg);}
table.proj-table.byd-sections > thead th:first-child, tbody.byd-section > tr > td:first-child{padding-left:var(--sec-einzug);}
tbody.byd-section{--sec:var(--baseline);}
tbody.byd-section > tr > td{background:var(--page); border-top:1px solid var(--grid);}
tbody.byd-section > tr > td:first-child{box-shadow:inset 4px 0 0 var(--sec);}
tbody.byd-section > tr:first-child > td{border-top:1px solid color-mix(in srgb, var(--sec) 30%, var(--grid));}
tbody.byd-section > tr:first-child > td:first-child{border-top-left-radius:10px;}
tbody.byd-section > tr:first-child > td:last-child{border-top-right-radius:10px;}
tbody.byd-section > tr:last-child > td{border-bottom:1px solid var(--grid);}
tbody.byd-section > tr:last-child > td:first-child{border-bottom-left-radius:10px;}
tbody.byd-section > tr:last-child > td:last-child{border-bottom-right-radius:10px;}
tbody.byd-section > tr > td:last-child{border-right:1px solid var(--grid);}
tbody.byd-section > tr.proj-row{border-bottom:none;}
tbody.byd-section > tr.proj-row:hover > td, tbody.byd-section > tr.group-head:hover > td{background:var(--surface-1);}
tbody.byd-gap td{height:12px; padding:0; border:none;}
tr.byd-section-head{cursor:pointer;}
tr.byd-section-head td{padding:14px 12px 12px var(--sec-einzug); font-size:1.05rem; font-weight:var(--fw-bold); color:var(--text-primary);}
tbody.byd-section > tr.byd-section-head > td{background:color-mix(in srgb, var(--sec) 9%, var(--page));}
tbody.byd-section > tr.byd-section-head:hover > td{background:color-mix(in srgb, var(--sec) 15%, var(--page));}
tr.byd-section-head:focus-visible{outline:2px solid var(--accent); outline-offset:-2px;}
.byd-section-bar{display:flex; align-items:center;}
.byd-section-dot{display:inline-block; width:8px; height:8px; border-radius:50%; background:var(--sec); margin-right:8px; vertical-align:1px;}
.byd-section-count{margin-left:6px; font-size:.75rem; font-weight:var(--fw-semibold); color:var(--text-primary); background:color-mix(in srgb, var(--sec) 18%, var(--grid)); padding:1px 7px; border-radius:10px; font-variant-numeric:tabular-nums;}
.byd-section-chevron{margin-left:auto; width:20px; text-align:center; font-size:16px; line-height:1; color:var(--text-muted); transition:transform var(--dauer-kurz) var(--ease-out);}
tr.byd-section-head.open .byd-section-chevron{transform:rotate(90deg);}

/* Kundengruppe (nur Kunden mit mehr als einem sichtbaren Projekt) */
tr.group-head{cursor:pointer;}
tr.group-head:focus-visible{outline:2px solid var(--accent); outline-offset:-2px;}
tr.group-head .group-titel{display:flex; align-items:center; gap:8px; min-width:0;}
tr.group-head .chevron{display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; border-radius:50%; background:var(--accent-fill); color:var(--on-accent); font-size:13px; font-weight:var(--fw-bold); transition:transform var(--dauer-kurz) var(--ease-out); flex:0 0 auto;}
tr.group-head.open .chevron{transform:rotate(90deg);}
tr.group-head .kunde{font-weight:var(--fw-semibold); color:var(--text-primary); min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
tr.group-head .group-badge{font-size:11px; color:var(--accent); font-weight:var(--fw-semibold); white-space:nowrap; flex:0 0 auto;}
tr.proj-row.subrow td.cell-project{padding-left:calc(var(--sec-einzug) + var(--sp-lg));}
.risk-dot{width:9px; height:9px; border-radius:50%; display:inline-block; flex:0 0 auto;}
.risk-dot.good{background:var(--status-good);}
.risk-dot.warning{background:var(--status-warning);}
.risk-dot.critical{background:var(--status-critical);}
@media (prefers-reduced-motion: reduce){ .byd-section-chevron, tr.group-head .chevron, .row-chevron{transition:none;} }

/* Risiko, Pflege; Risiko, QS, Rolle und Marker der Zeile sind Bausteine (.ctl-status, ADR-006) */
.status-good{color:var(--success-text);}
.status-warning{color:var(--status-warning-text);}
.pflege-hint{margin-top:5px; font-size:11px; color:var(--text-muted); border:1px dashed var(--border); border-radius:5px; padding:1px 6px; display:inline-block; white-space:nowrap; cursor:default;}
.typ-tags{display:flex; flex-wrap:wrap; gap:4px; margin-top:4px;}
.typ-tag{font-size:11px; line-height:1.4; padding:0 6px; border-radius:8px; border:1px solid var(--grid); color:var(--text-muted); background:var(--page);}
.typ-tag.on{border-color:var(--accent); color:var(--text-primary);}
.team-avatars{display:flex; align-items:center; gap:3px;}
.mini-avatar{width:22px; aspect-ratio:1; border-radius:50%; background:var(--accent-soft-bg); color:var(--accent-soft-text); font-size:11px; font-weight:var(--fw-bold); display:flex; align-items:center; justify-content:center; border:1px solid var(--border); flex:0 0 auto;}
.mini-avatar.is-pl{background:var(--accent-fill); color:var(--on-accent); border-color:var(--accent-fill);}
/* Größe 24 px (Offene Punkte, #249); Kontakt grau, niemand gestrichelt mit „?“ (bausteine.js avatarHtml) */
.mini-avatar.is-gross{width:24px;}
.mini-avatar.is-kontakt{background:var(--page); color:var(--text-muted);}
.mini-avatar.is-niemand{background:none; border-style:dashed; border-color:var(--baseline); color:var(--text-muted);}
.mini-avatar-more{background:var(--baseline); color:var(--text-secondary); font-weight:var(--fw-semibold);}

/* Marker „In Bearbeitung“ (Zeile, Detailkopf) und Board */
.row-quicklinks{display:flex; gap:5px; flex-wrap:wrap;}
.board-list{display:flex; flex-direction:column; gap:8px;}
.board-item{display:flex; align-items:center; gap:10px; padding:6px 4px; border-radius:var(--radius-sm); cursor:pointer;}
.board-item:hover{background:var(--grid);}
.board-item:focus-visible{outline:2px solid var(--accent); outline-offset:-2px;}
.board-item-info .kunde{font-weight:var(--fw-semibold); font-size:12.8px;}
.board-item-info .projname{font-size:11.5px; color:var(--text-muted);}

/* Performance */
#perfKwSelect{font-size:12.5px; padding:5px 8px; border-radius:var(--radius-sm); border:1px solid var(--border); background:var(--page); color:var(--text-primary);}
table.perf-table td{font-variant-numeric:tabular-nums;}
table.perf-table tr.perf-sum td{font-weight:var(--fw-semibold); border-top:2px solid var(--border);}
.dev-ok{color:var(--success-text);}
.dev-warn{color:var(--status-serious); font-weight:var(--fw-semibold);}

/* ---------- Projektdetail ---------- */
/* Kopf nach dem Konzept der Marke: Aussage (Projekt) SemiBold, darunter der Bezug (Kunde) Light in derselben Größe; das Markup führt den Kunden, order stellt ihn unter den Titel */
.detail-header{margin:0 0 20px; display:flex; flex-direction:column;}
.detail-header h1{order:1; font-size:23px; margin:0; font-weight:var(--fw-semibold); line-height:1.25; overflow-wrap:anywhere;}
.detail-header .detail-kunde{order:2; font-size:23px; line-height:1.25; font-weight:var(--fw-light); color:var(--text-primary); margin:0 0 8px; overflow-wrap:anywhere;}
.detail-header > :not(h1):not(.detail-kunde){order:3;}
.detail-meta{font-size:12.5px; color:var(--text-secondary); font-variant-numeric:tabular-nums; margin-bottom:12px;}
.detail-badges{display:flex; align-items:center; gap:10px; flex-wrap:wrap;}
/* #178: Risiko-Chip (Form: .ctl-status), Grund und Hinweis im Tooltip; der Tooltip bricht um und bleibt am Telefon im Bild */
.risiko-tip[data-tooltip]:focus-visible::after, .risiko-tip[data-tooltip]:hover::after{top:130%; bottom:auto; white-space:normal; width:max-content; max-width:min(280px, 80vw); font-weight:var(--fw-regular);}
@media (max-width: 600px){
  .detail-header{margin-bottom:14px;}
  .detail-header h1{font-size:20px;}
  .detail-header .detail-kunde{font-size:20px; margin-bottom:4px;}
  .detail-meta{font-size:11.5px; margin-bottom:8px;}
  .detail-badges{gap:6px 8px;}
}
.type-chip{font-size:11px; color:var(--text-secondary); background:var(--page); border:1px solid var(--border); padding:2px 9px; border-radius:999px; display:inline-block; white-space:nowrap;}
.editable-field input[type="date"]{font:inherit; font-family:var(--font-text); color:inherit; background:var(--page); border:1px solid var(--border); border-radius:var(--radius-sm); padding:4px 8px; cursor:pointer;}
.editable-field input[type="date"]:hover:not(:disabled){border-color:var(--accent);}
.editable-field input:disabled{cursor:default; opacity:.75;}
.editable-hint{font-size:11px; color:var(--accent-soft-text); background:var(--accent-soft-bg); padding:1px 6px; border-radius:4px; margin-left:8px; vertical-align:middle;}
/* Tabs des Details (Übersicht, Projektplan, LDconnect Diamant) wie .detail-tabs im Ist */
/* #180: eine Zeile; passt sie nicht, scrollt sie quer, und die Fade-Kante (.quer-rand) zeigt, dass mehr kommt */
.detail-tabs{display:flex; gap:4px; margin:0 0 20px; border-bottom:1px solid var(--border); flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none;}
.detail-tabs::-webkit-scrollbar{display:none;}
.detail-tab{
  background:none; border:none; padding:10px 4px; margin-right:22px; font:inherit; font-size:13.5px; font-weight:var(--fw-semibold);
  color:var(--text-secondary); cursor:pointer; border-bottom:2px solid transparent; display:flex; align-items:center; gap:7px;
  flex:0 0 auto; white-space:nowrap;
}
@media (max-width: 600px){ .detail-tab{margin-right:14px;} }
.detail-tab:hover:not(.active){color:var(--text-primary);}
.detail-tab.active{color:var(--accent); border-bottom-color:var(--accent);}
.detail-tab:focus-visible{outline:2px solid var(--accent); outline-offset:-2px;}
.detail-tab .tab-count{
  font-size:11px; font-variant-numeric:tabular-nums; color:var(--text-muted); background:var(--page);
  border-radius:999px; padding:1px 7px;
}
.detail-tab.active .tab-count{color:var(--accent-soft-text); background:var(--accent-soft-bg);}
.detail-tab .tab-count.is-critical{color:var(--status-critical-text); background:var(--status-critical-bg);}
.detail-grid3{display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin-bottom:20px;}
@media (max-width:560px){ .detail-grid3{grid-template-columns:1fr;} }
/* #249 Tab Offene Punkte als Baum (Marco): je Zeile Griff | Pfeil | Haken | Titel mit Meta-Zeile | rechts „＋ Task“,
   Termin, Kürzel. Einzug je Ebene: --op-tiefe mal dem Token --einzug-ebene (basis.css). Aufgeklapptes, die Rückfrage
   zum Abschließen und das Anlegen-Panel stehen darunter ab der Spalte des Titels. Außerhalb des Filters abgeblendet,
   nicht versteckt. Zuklappen und Tastatur-Verschieben ohne Bewegung; beim Ziehen folgt nur die Linie dem Zeiger. */
.op-panel .panel-head{flex-wrap:wrap; gap:var(--sp-sm);}
.op-kopfzahl{font-size:var(--fs-sm); color:var(--text-muted);}
.op-zahl{font-variant-numeric:tabular-nums;}
.op-leiste, .op-gruppe{display:flex; flex-wrap:wrap; align-items:center; gap:var(--sp-xs);}
.op-leiste{gap:var(--sp-md); margin-left:auto;}
.op-neu-auf{width:100%; justify-content:flex-start; border-style:dashed; color:var(--text-muted); margin-bottom:var(--sp-sm);}
.op-neu-panel{grid-column:4 / -1; display:grid; gap:var(--sp-sm); margin:var(--sp-sm) 0; padding:var(--sp-sm); border:1px solid var(--accent);
  border-radius:var(--radius-sm); background:var(--page);}
.op-neu-panel > .ctl-feld{width:100%;}
.op-hilfe{margin:0 0 var(--sp-sm);}
.op-liste{list-style:none; margin:0; padding:0; font-size:var(--fs-sm); color:var(--text-primary);}
.op-baum{position:relative;}
.op-zeile{display:grid; grid-template-columns:auto auto auto minmax(0,1fr) auto; column-gap:var(--sp-xs); align-items:start;
  padding:var(--sp-sm) 0; padding-left:calc(var(--op-tiefe, 0) * var(--einzug-ebene)); border-bottom:1px solid var(--border);}
.op-zeile:last-child{border-bottom:0;}
.op-zeile.is-gedimmt, .is-gezogen{opacity:.45;}
.op-griff, .op-klapp, .op-check{box-sizing:border-box; display:inline-flex; align-items:center; justify-content:center; width:20px; height:20px;
  margin:0; padding:0; border:0; background:none; color:var(--text-muted); font:inherit;}
button.op-griff{cursor:grab; touch-action:none;}
button.op-klapp{cursor:pointer;}
.op-klapp[aria-expanded="false"] .zeichen{transform:rotate(-90deg);}
.op-check{border:1px solid var(--baseline); border-radius:50%; color:transparent;}
button.op-check{cursor:pointer;}
.op-check.is-erledigt{background:var(--status-ok); border-color:var(--status-ok); color:var(--on-status);}
.op-check.is-gesperrt{border-style:dashed; cursor:default;}
button.op-griff:focus-visible, button.op-klapp:focus-visible, button.op-check:focus-visible, .op-titel:focus-visible{outline:2px solid var(--accent); outline-offset:2px;}
@media (hover: hover) and (pointer: fine){
  button.op-griff:hover, button.op-klapp:hover{color:var(--text-primary);}
  button.op-check:not(.is-erledigt):hover{border-color:var(--status-ok); color:var(--status-ok);}
  button.op-titel:hover{color:var(--accent);}
}
.op-inhalt{min-width:0;}
.op-titel{display:block; width:100%; text-align:left; margin:0; padding:0; border:0; background:none; font:inherit; font-weight:var(--fw-semibold);
  color:inherit; cursor:pointer; overflow-wrap:anywhere;}
.op-zeile.is-epic > .op-inhalt > .op-titel{font-size:var(--fs-md); font-weight:var(--fw-bold);}
.op-zeile.is-sub > .op-inhalt > .op-titel{font-weight:var(--fw-regular);}
.op-fortschritt{max-width:240px; height:3px; margin-top:var(--sp-2xs); border-radius:var(--radius-pill); background:var(--border); overflow:hidden;}
.op-fortschritt > span{display:block; height:100%; background:var(--status-ok);}
.op-rechts{display:flex; align-items:center; gap:var(--sp-xs);}
/* „＋ Task“ nur mit Maus beim Darüberfahren oder mit Fokus in der Zeile; per Touch über „Einordnen unter“ im Anlegen-Panel */
.op-plus{display:none;}
@media (hover: hover) and (pointer: fine){
  .op-plus{display:inline-flex; opacity:0;}
  .op-zeile:hover > .op-rechts > .op-plus, .op-zeile:focus-within > .op-rechts > .op-plus{opacity:1;}
}
@media (max-width: 640px){ .op-rechts > .termin, .op-rechts > .op-plus{display:none;} }
.op-bezuege{display:flex; flex-wrap:wrap; gap:var(--sp-xs); margin-top:var(--sp-2xs);}
/* lange Bezug-Titel brechen in der Karte um, statt die Seite zu verbreitern (Review 1, Mangel 1) */
.op-bezuege > .ctl, .op-details [data-op-bezug-weg]{max-width:100%; height:auto; min-height:var(--ctl-h); padding-block:var(--sp-2xs); white-space:normal; overflow-wrap:anywhere; text-align:left; line-height:1.3;}
.op-details, .op-dialog{grid-column:4 / -1; display:grid; gap:var(--sp-sm); margin-top:var(--sp-sm); padding:var(--sp-sm); border-radius:var(--radius-sm); background:var(--page);}
.op-dialog{display:flex; flex-wrap:wrap; align-items:center; border:1px solid var(--accent);}
.op-dialog .ctl-feld{flex:1 1 240px;}
.op-warnung{flex-basis:100%; margin:0; font-size:var(--fs-sm); color:var(--status-warning-text);}
.op-meta{display:flex; flex-wrap:wrap; align-items:center; gap:var(--sp-xs);}
.op-meta .ctl-select{flex:1 1 180px;}
.op-beschreibung{margin:0; white-space:pre-wrap; color:var(--text-secondary);}
.op-leise{font-size:var(--fs-xs); color:var(--text-muted);}
.op-notiz{border-left:2px solid var(--status-ok); padding-left:var(--sp-xs); margin-top:var(--sp-3xs);}
.op-zeile.is-erledigt > .op-inhalt > .op-titel{color:var(--text-muted); text-decoration:line-through; cursor:default;}
.op-abschnitt{margin:var(--sp-lg) 0 var(--sp-xs); font-size:var(--fs-sm); color:var(--text-secondary);}
.op-kw > summary{cursor:pointer; font-size:var(--fs-sm); color:var(--text-muted); padding:var(--sp-2xs) 0;}
/* Linie beim Ziehen: steht in der Lücke, eingerückt auf die gewählte Ebene; der Text sagt, wohin der Punkt kommt */
.op-linie{position:absolute; top:0; right:0; height:2px; background:var(--accent); pointer-events:none; z-index:2;}
.op-linie::after{content:attr(data-text); position:absolute; left:0; top:var(--sp-2xs); padding:0 var(--sp-2xs); border-radius:var(--radius-sm);
  font-size:var(--fs-xs); white-space:nowrap; color:var(--accent-soft-text); background:var(--accent-soft-bg);}
.op-linie.is-falsch{background:var(--status-critical);}
.op-linie.is-falsch::after{color:var(--status-critical-text); background:var(--status-critical-bg);}
/* Dialog „In Projektplan übernehmen“ in der gemeinsamen Hülle .modal-card (ansichten/dialog.js) */
.op-plan-felder{display:grid; gap:var(--sp-md); margin-bottom:var(--sp-lg);}
.op-plan-felder label{display:grid; gap:var(--sp-2xs); font-size:var(--fs-xs); color:var(--text-muted);}
.op-plan-felder .ctl-feld, .op-plan-felder .ctl-select{width:100%;}
/* #249 Graph (ansichten/graph.js mit Präfix op) und Zeitleiste: Plan-Aufgaben gestrichelt, erledigte gedämpft, überfällige
   mit kritischem Rand, Konflikte kritisch. Die Zeitleiste scrollt nur in ihrem Rahmen quer. */
.op-graphwrap{overflow:hidden;}
.op-graphwrap svg, .op-zeit{display:block; font-family:var(--font-text);}
.op-graph text, .op-zeit text{font-family:inherit;}
.op-band{pointer-events:none; font-size:var(--fs-sm); font-weight:var(--fw-semibold); fill:var(--series-1); filter:url(#op-band-grund);}
.op-band-grund{flood-color:var(--surface-1);}
.op-node rect{fill:var(--surface-1); stroke:var(--grid); stroke-width:1.5;}
.op-node[data-op-knoten]{cursor:pointer;}
.op-node .t1{font-size:var(--fs-sm); font-weight:var(--fw-semibold); fill:var(--text-primary);}
.op-node .t2, .op-plan-marke{font-size:var(--fs-xs); fill:var(--text-muted);}
.op-plan-marke{font-weight:var(--fw-semibold); fill:var(--accent);}
.op-node.plan rect{fill:var(--page); stroke:var(--accent); stroke-dasharray:5 3;}
.op-node.erledigt rect{fill:var(--page);}
.op-node.erledigt .t1{fill:var(--text-muted); font-weight:var(--fw-regular);}
.op-node.ueber rect{stroke:var(--status-critical); stroke-width:2.5;}
.op-node.ueber .t2{fill:var(--status-critical-text);}
.op-node.weg rect{fill:var(--status-critical-bg); stroke:var(--status-critical); stroke-dasharray:2 3;}
.op-node.is-gedimmt, .op-z.is-gedimmt{opacity:.35;}
.op-node:focus{outline:none;}
.op-node:focus-visible rect{stroke:var(--text-primary); stroke-width:3;}
@media (hover: hover) and (pointer: fine){ .op-node[data-op-knoten]:hover rect{stroke:var(--text-primary); stroke-width:2.5;} }
.op-edge{fill:none; stroke:var(--edge); stroke-width:1.5; stroke-linejoin:round;}
.op-edge.warn{stroke:var(--edge-warn); stroke-width:2.5;}
.op-zeitwrap{overflow-x:auto; max-width:100%;}
.op-raster{stroke:var(--grid); stroke-width:1;}
.op-kw{font-size:var(--fs-xs); fill:var(--text-muted);}
.op-planband{fill:var(--accent-soft-bg); opacity:.6;}
.op-heute{stroke:var(--accent); stroke-width:2; stroke-dasharray:5 3;}
.op-pfeil{fill:none; stroke:var(--edge); stroke-width:1.5;}
.op-pfeil.warn{stroke:var(--edge-warn); stroke-width:2;}
.op-pfeilspitze{fill:var(--edge);}
.op-pfeilspitze.warn{fill:var(--edge-warn);}
.op-z[data-op-knoten]{cursor:pointer;}
.op-z-titel{font-size:var(--fs-sm); fill:var(--text-primary);}
.op-z.plan .op-z-titel{fill:var(--accent); font-style:italic;}
.op-marker{fill:var(--series-1); stroke:var(--surface-1); stroke-width:2;}
.op-z.plan .op-marker{fill:var(--surface-1); stroke:var(--accent); stroke-width:2.5;}
.op-z.ueber .op-marker{fill:var(--status-critical-bg); stroke:var(--status-critical); stroke-width:3;}
.op-konflikt{font-size:var(--fs-xs); font-weight:var(--fw-semibold); fill:var(--status-critical-text); paint-order:stroke; stroke:var(--surface-1); stroke-width:4;}
.op-z:focus{outline:none;}
.op-z:focus-visible .op-z-titel{text-decoration:underline;}
/* Übersicht (#120): vier Kacheln in einer Reihe, darunter zweispaltig; Budget zuletzt mit Pfeil. Wie im PCT; die
   Selektoren mit .kpi4-rahmen schlagen finanz.css, das nach dieser Datei lädt. */
@container (min-width:900px){.kpi4-rahmen .detail-grid3.kpi4{grid-template-columns:repeat(4,minmax(0,1fr))}}
@container (max-width:519px){.kpi4-rahmen .detail-grid3.kpi4{grid-template-columns:minmax(0,1fr)}}
.detail-two{display:grid; grid-template-columns:1.4fr 1fr; gap:16px; align-items:start;}
.detail-two > *{min-width:0;}
@media (max-width:900px){.detail-two{grid-template-columns:1fr}}
/* Steht die Kachelreihe vierspaltig, nimmt Team genau die Breite der vierten Kachel „Nächste Schritte“: gleiche Spuren
   und gleicher Abstand wie .kpi4. */
[data-detail="uebersicht"]{container-type:inline-size;}
@container (min-width:900px){
  .detail-two{grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px;}
  .detail-two > :first-child{grid-column:span 3;}
}
#budgetPanel{scroll-margin-top:16px;}
#budgetPanel:focus{outline:none;}
#budgetPanel > summary{cursor:pointer; list-style:none;}
#budgetPanel > summary::-webkit-details-marker{display:none;}
#budgetPanel > summary h3::before{content:'▸'; display:inline-block; width:1em; color:var(--text-muted); transition:transform .15s ease-out;}
#budgetPanel[open] > summary h3::before{transform:rotate(90deg);}
#budgetPanel:not([open]) > summary{padding-bottom:16px;}
#budgetPanel > summary:focus-visible{outline:2px solid var(--accent); outline-offset:-2px;}
@media (prefers-reduced-motion: reduce){#budgetPanel > summary h3::before{transition:none;}}
/* Kachel Restbudget: geplante Stunden aus der Wochenplanung (#124) */
.plan-sub{display:flex; justify-content:space-between; gap:8px;}
.plan-sub strong{color:var(--text-primary); font-weight:var(--fw-semibold); font-variant-numeric:tabular-nums;}
.plan-warn{color:var(--status-warning-text);}
/* Team-Panel: Wochenplanung je Person (#125) */
.plan-fuss{margin-top:12px;}
.team-list{display:flex; flex-direction:column; gap:10px;}
.team-person{display:flex; align-items:center; gap:10px;}
.team-person .name{font-size:13px; font-weight:var(--fw-semibold);}
.team-person .name.team-leer{color:var(--text-muted); font-weight:var(--fw-regular);}
.team-person .role{font-size:11.5px; color:var(--text-muted);}
.team-person .util{margin-left:auto; font-size:12px; color:var(--text-secondary); font-variant-numeric:tabular-nums;}
.zuordnung{margin-bottom:10px;}
.zuordnung-label{font-size:11.5px; color:var(--text-muted); margin:8px 0 4px;}

/* ---------- Durchführung ---------- */
.task-status-btn{font-size:11px; border:1px solid var(--border); border-radius:999px; padding:2px 9px; background:var(--page); white-space:nowrap;}
.task-status-btn.is-static{cursor:default;}
.task-status-btn.offen{color:var(--text-secondary);}
.task-status-btn.in-arbeit{color:var(--status-warning-text); border-color:var(--status-warning); background:color-mix(in srgb, var(--status-warning) 14%, var(--page));}
.task-status-btn.erledigt{color:var(--success-text); border-color:var(--status-good); background:color-mix(in srgb, var(--status-good) 12%, var(--page));}
.task-meta{font-size:11px; color:var(--text-muted); white-space:nowrap;}

/* Read-Only Intern (body.ro): Marker sind weg, Wertefelder gesperrt (disabled im HTML) */
body.ro [data-active-id], body.ro #detailActiveToggleBtn, body.ro #assignToggleBtn{display:none !important;}

/* ---------- Dialog „Neues Projekt anlegen“ (Ist: Modal P10) ---------- */
.modal-overlay{position:fixed; inset:0; background:rgba(0,0,0,.45); display:none; align-items:center; justify-content:center; padding:24px; z-index:60; overflow-y:auto;}
.modal-overlay.open{display:flex;}
.modal-card{background:var(--surface-1); border-radius:var(--radius-lg); box-shadow:var(--shadow); padding:26px 28px; max-width:620px; width:100%; max-height:92vh; overflow-y:auto; color:var(--text-primary);}
.modal-card h3{margin:0 0 4px;}
.modal-card .modal-sub{font-size:12.5px; color:var(--text-muted); margin:0 0 18px;}
.modal-grid{display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:16px;}
.modal-grid > div{min-width:0;}
.modal-grid .full{grid-column:1 / -1;}
.modal-grid label{display:block; font-size:11.5px; color:var(--text-muted); margin-bottom:4px;}
.modal-grid input, .modal-grid select, .modal-grid textarea{width:100%; box-sizing:border-box; font:inherit; padding:8px 10px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--page); color:var(--text-primary);}
.modal-grid input[type=number]{font-variant-numeric:tabular-nums; text-align:right;}
.modal-actions{display:flex; gap:10px; justify-content:flex-end;}
.modal-actions button:focus-visible, .modal-grid .chip-toggle:focus-visible{outline:2px solid var(--accent); outline-offset:2px;}
.modal-actions button:active{transform:scale(.97);}
@media (max-width: 600px){
  .modal-overlay{padding:12px;}
  .modal-card{padding:20px 16px;}
  .modal-grid{grid-template-columns:1fr;}
}

/* ---------- Liste unter 600 px: Karten ohne Tabellenkopf (Ist: @media 600px) ----------
   Zeile 1: Projekt und Risiko, Zeile 2: Kontingent und nächster Schritt; Team und Direktzugriff stehen im Detail. */
@media (max-width: 600px){
  table.proj-table.byd-sections, table.proj-table.byd-sections > tbody{display:block;}
  table.proj-table.byd-sections > thead{display:none;}
  tbody.byd-section{border:1px solid var(--grid); border-radius:10px; overflow:hidden;}
  tbody.byd-gap tr, tbody.byd-gap td{display:block; height:8px;}
  tr.byd-section-head{display:block;}
  tr.byd-section-head > td{display:block; padding:10px 12px 10px var(--sec-einzug);}
  tbody.byd-section > tr.proj-row, tbody.byd-section > tr.group-head{
    display:grid; grid-template-columns:minmax(0,1fr) auto; column-gap:8px;
    border-top:1px solid var(--grid); background:var(--page); box-shadow:inset 4px 0 0 var(--sec);
  }
  tbody.byd-section > tr.proj-row.subrow{background:color-mix(in srgb, var(--surface-1) 55%, var(--page));}
  tbody.byd-section > tr.group-head{background:color-mix(in srgb, var(--grid) 35%, var(--page));}
  tbody.byd-section > tr.proj-row > td, tbody.byd-section > tr.group-head > td{
    display:block; border:none !important; border-radius:0 !important; box-shadow:none !important; background:transparent !important; min-width:0;
  }
  tbody.byd-section > tr > td:nth-child(1){grid-column:1; grid-row:1; padding:9px 4px 2px var(--sec-einzug);}
  tbody.byd-section > tr > td:nth-child(2){grid-column:2; grid-row:1; padding:9px 10px 2px 0; text-align:right;}
  tbody.byd-section > tr > td:nth-child(3){grid-column:1; grid-row:2; padding:2px 4px 9px var(--sec-einzug);}
  tbody.byd-section > tr > td:nth-child(5){grid-column:2; grid-row:2; padding:2px 10px 9px 0; text-align:right; white-space:nowrap; font-size:12px; font-variant-numeric:tabular-nums;}
  tbody.byd-section > tr.proj-row > td:nth-child(4), tbody.byd-section > tr.proj-row > td:nth-child(n+6),
  tbody.byd-section > tr.group-head > td:nth-child(4), tbody.byd-section > tr.group-head > td:nth-child(n+6){display:none;}
  tbody.byd-section > tr.proj-row.subrow > td:nth-child(1), tbody.byd-section > tr.proj-row.subrow > td:nth-child(3){padding-left:calc(var(--sec-einzug) + var(--sp-lg));}
  tbody.byd-section .cell-project .projname{hyphens:auto; overflow-wrap:break-word;}
  tbody.byd-section .cell-project .typ-tags, tbody.byd-section .cell-project .projnr{display:none;}
  /* Chips (QS, Rolle, In Bearbeitung) und Pflegelücken stehen im Detail; hier nur die zwei Lesezeilen */
  tbody.byd-section > tr.proj-row .cell-project > div:last-child:not(.projname):not(.kunde), tbody.byd-section .pflege-hint{display:none;}
}
