:root {
  color-scheme: light;
  /* Clean-Apple-Palette mit asioso-Grün als einzigem Akzent. Status-Töne
     (grün/gelb/rot) sind bewusst ruhiger/entsättigt, damit sie neben dem
     grünen Akzent nicht mit ihm konkurrieren. --accent = interaktiv/Marke,
     --green = positives Status-Signal (bewusst etwas heller/kühler als der
     Akzent, damit "Button" und "gut" unterscheidbar bleiben). */
  --bg: #f5f5f7; --panel: #ffffff; --border: #e6e6ea; --text: #1d1d1f; --text-muted: #86868b;
  /* Blaue Akzent-Variante (Apple-clean). --accent = Füllfarbe (Buttons,
     aktive Zustände), --accent-text = Akzent als Text/Icon auf Weiß (Links,
     Badges), --accent-ink = Text AUF der Akzentfläche (Blau ist dunkel genug
     für Weiß), --accent-bg = heller Tint für Hover/Badges. Zum Umfärben genügt
     das Ändern dieser vier Werte. */
  --accent: #0071e3; --accent-text: #0a63c0; --accent-ink: #ffffff; --accent-bg: #e8f0fe;
  --green: #2f9e57; --green-bg: #eaf7ef; --yellow: #c17d1a; --yellow-bg: #fbf2e2;
  --red: #c7362f; --red-bg: #fdecea; --gray-bg: #f0f0f2;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 13px; }
/* Dezentes Firmen-Signet als Hintergrund auf allen Screens: unten rechts,
   überläuft bewusst den Rand (teils abgeschnitten), sehr transparent, nicht
   klickbar. Liegt hinter den Inhalten (Karten/Panels überdecken es lokal). */
body::before {
  content: "";
  position: fixed;
  right: -90px;
  bottom: -90px;
  width: min(52vw, 640px);
  height: min(52vw, 640px);
  background: url('signet_pos.png') no-repeat right bottom;
  background-size: contain;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}
/* Auch auf dem Login-Screen sichtbar (dessen Overlay hat einen deckenden BG). */
.login-overlay::after {
  content: "";
  position: fixed;
  right: -90px;
  bottom: -90px;
  width: min(60vw, 560px);
  height: min(60vw, 560px);
  background: url('signet_pos.png') no-repeat right bottom;
  background-size: contain;
  opacity: 0.06;
  pointer-events: none;
}
#app { padding: 16px 20px 40px; max-width: 1500px; margin: 0 auto; position: relative; }
.lang-switch { position: absolute; top: 16px; right: 20px; display: flex; gap: 2px; background: var(--gray-bg); border-radius: 8px; padding: 3px; z-index: 5; }
/* Hilfe-Icon: schwebend unten links, groß und gut sichtbar. */
.help-btn { position: fixed; bottom: 22px; left: 22px; z-index: 50; width: 52px; height: 52px; border-radius: 50%; border: none; background: var(--accent); color: var(--accent-ink); font-size: 26px; font-weight: 800; line-height: 1; cursor: pointer; box-shadow: 0 4px 14px rgba(0,113,227,.36); transition: transform .12s, box-shadow .12s; }
.help-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,113,227,.44); }
/* Hilfe-Dialog. */
.help-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.help-tab { border: 1px solid var(--border); background: var(--panel); border-radius: 999px; padding: 5px 14px; font-size: 12.5px; font-weight: 700; cursor: pointer; color: var(--text-muted); }
.help-tab.active { border-color: var(--accent); background: var(--accent-bg); color: var(--accent-text); }
.help-intro { font-size: 13px; line-height: 1.5; color: var(--text); margin: 0 0 12px; }
.help-faqs { display: flex; flex-direction: column; gap: 6px; }
.help-faq { border: 1px solid var(--border); border-radius: 8px; background: var(--panel); }
.help-faq summary { cursor: pointer; padding: 9px 12px; font-size: 13px; font-weight: 700; color: var(--text); list-style: none; }
.help-faq summary::-webkit-details-marker { display: none; }
.help-faq summary::before { content: '▸ '; color: var(--text-muted); }
.help-faq[open] summary::before { content: '▾ '; }
.help-faq-a { padding: 0 12px 11px 22px; font-size: 12.5px; line-height: 1.5; color: var(--text-muted); }
/* Hilfe-Chat. */
.help-chat { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.help-chat-head { font-size: 12.5px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.help-chat-log { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.help-chat-empty { padding: 8px 2px; }
.help-msg { max-width: 85%; padding: 8px 12px; border-radius: 12px; font-size: 12.5px; line-height: 1.45; white-space: pre-wrap; }
.help-msg.user { align-self: flex-end; background: var(--accent-bg); color: var(--text); border-bottom-right-radius: 4px; }
.help-msg.assistant { align-self: flex-start; background: var(--gray-bg); color: var(--text); border-bottom-left-radius: 4px; }
.help-msg.help-typing { color: var(--text-muted); }
.help-chat-row { display: flex; gap: 8px; }
.help-chat-row input { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.help-chat-note { margin-top: 6px; font-size: 11px; }
/* Nutzerleiste (E-Mail · Rolle · Abmelden) oben rechts, unter dem Sprachschalter. */
/* Nutzerleiste als auffälliger Chip (Panel + Rand + Schatten), gestapelt
   unter dem Sprachschalter. */
.user-bar { position: absolute; top: 52px; right: 20px; z-index: 5; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-muted); background: var(--panel); border: 0.5px solid var(--border); border-radius: 22px; padding: 5px 6px 5px 13px; box-shadow: 0 2px 8px rgba(20,22,26,.08); }
.user-bar-email { color: var(--text); font-weight: 500; }
.user-bar-role { background: var(--accent); color: var(--accent-ink); border-radius: 20px; padding: 3px 10px; font-size: 11px; font-weight: 700; }

/* Login-Overlay */
.login-overlay { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-overlay.hidden { display: none; }
.login-box { background: var(--panel); border: 0.5px solid var(--border); border-radius: 16px; box-shadow: 0 8px 30px rgba(20,22,26,.12); padding: 32px 30px; width: 100%; max-width: 380px; text-align: center; }
.login-penguin { height: 84px; width: auto; margin: 0 auto 8px; display: block; }
.login-cup { height: 300px; width: auto; margin: 0 auto 12px; display: block; }
.login-box { position: relative; }
.login-lang { position: absolute; top: 12px; right: 12px; display: flex; gap: 4px; }
.login-lang .lang-btn { font-size: 11px; padding: 3px 8px; }
.login-title { font-size: 22px; font-weight: 700; margin: 0 0 6px; letter-spacing: -0.01em; }
.login-sub { font-size: 13px; color: var(--text-muted); margin: 0 0 20px; line-height: 1.5; }
.login-input { width: 100%; box-sizing: border-box; padding: 11px 13px; border: 1px solid var(--border); border-radius: 9px; font-size: 14px; margin-bottom: 10px; }
.login-input:focus { outline: none; border-color: var(--accent); }
.login-btn { width: 100%; padding: 11px; font-size: 14px; border-radius: 9px; }
#loginResendBtn { width: 100%; margin-top: 8px; border: none; background: none; color: var(--accent-text); }
.login-msg { font-size: 12.5px; color: var(--text-muted); margin-top: 14px; min-height: 18px; line-height: 1.4; }
.login-msg-error { color: var(--red); font-weight: 500; }
.login-input-error { border-color: var(--red) !important; }
.login-input-error:focus { border-color: var(--red) !important; }
.lang-btn { border: none; background: none; padding: 4px 10px; border-radius: 6px; font-size: 11.5px; font-weight: 700; color: var(--text-muted); cursor: pointer; }
.lang-btn:hover { color: var(--text); }
.lang-btn.active { background: var(--panel); color: var(--accent-text); box-shadow: 0 1px 3px rgba(20,22,26,.1); }
/* Header: großer Wortmarke-Name "PCA" mit einem Cartoon-Pinguin, der dezent
   dahinter hervorlugt und die Ansicht etwas auflockert. Der Pinguin ist rein
   dekorativ (position:absolute, hinter dem Text) und liegt bewusst leicht
   hinter dem großen Namen. */
.app-header { position: relative; margin-bottom: 8px; padding-top: 4px; min-height: 96px; }
.app-header-text { position: relative; z-index: 1; min-width: 0; }
.app-header-text h1 { margin: 0; display: block; line-height: 0.92; }
.brand-name { font-size: 80px; font-weight: 900; line-height: 0.9; letter-spacing: -0.03em; color: var(--text); }
.brand-desc { display: block; font-size: 17px; font-weight: 500; color: var(--text-muted); margin-top: 6px; }
/* Pinguin lugt hinter dem rechten Rand des großen "PCA" hervor (Text liegt per
   z-index davor, daher "hinter dem Namen"). */
.header-agent {
  position: absolute; top: -8px; left: 188px; height: 104px; width: auto; z-index: 0;
  pointer-events: none;
}
/* Raccoon im PIA-Header etwas kleiner. */
#initView .header-agent { height: 90px; }
/* PM-Tipp (einblendbar) rechts oben unter den Sprachschalter, größer (16px)
   und rechtsbündig. Absolut positioniert, damit er nicht mehr unter dem
   Wortmarke-Block in der Flussbreite liegt. */
/* Spruch/Zitat als Sprechblase, die der Pinguin "sagt": ein Zipfel oben zeigt
   nach oben zum Pinguin. Im normalen Fluss (überlappt nichts), akzent-getönt,
   größere, mittelfette Schrift. */
.subtitle {
  position: relative;
  display: flex; align-items: flex-start; gap: 10px;
  margin: 16px 0 18px; padding: 13px 18px;
  background: var(--panel); border: 0.5px solid var(--border);
  border-radius: 14px; color: var(--text-muted);
  font-size: 16.5px; font-weight: 300; line-height: 1.45;
  box-shadow: 0 3px 12px rgba(20,22,26,.10);
}
/* Sprechblasen-Zipfel nach oben, ungefähr unter dem Pinguin (links). Etwas
   größer und mit weichem Schatten (drop-shadow folgt der Dreiecksform), damit
   er sich wie die Blase abhebt. */
.subtitle::after {
  content: ""; position: absolute; top: -13px; left: 208px;
  width: 0; height: 0;
  border-left: 13px solid transparent; border-right: 13px solid transparent;
  border-bottom: 13px solid var(--panel);
  filter: drop-shadow(0 -2px 2px rgba(20,22,26,.10));
}
.subtitle::before { content: "💡 "; }
.config-warning { background: var(--yellow-bg); border: 1px solid var(--yellow); color: #7a3b00; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: 12.5px; }
.config-warning code { background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 4px; }

/* Übersichtsbereich (Kennzahlen-Karten, Chart, kritische Projekte) ist
   einklappbar, damit man direkt zu den Board-Kacheln springen kann, ohne
   Informationen zu verlieren — im eingeklappten Zustand bleibt die kompakte
   Zusammenfassungszeile stehen. */
.overview-toggle-row { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.overview-toggle {
  border: none; background: none; padding: 4px 0; font-size: 13px; font-weight: 700; color: var(--text);
  cursor: pointer; display: flex; align-items: center; gap: 6px;
}
.overview-toggle:hover { color: var(--accent-text); }
.overview-chevron { font-size: 11px; color: var(--text-muted); transition: transform .15s; }
.overview-summary { font-size: 12.5px; color: var(--text-muted); align-items: center; gap: 4px; }
.overview-summary b { color: var(--text); font-weight: 700; }
.overview-panel.collapsed { display: none; }

.cards { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.card { background: var(--panel); border: 0.5px solid var(--border); border-radius: 14px; padding: 18px 20px; min-width: 170px; flex: 1; box-shadow: 0 2px 6px rgba(20,22,26,.045); }
.card .val { font-size: 30px; font-weight: 600; line-height: 1.1; letter-spacing: -0.01em; }
/* Die ersten 4 Kennzahl-Karten (aktive Boards, Ø Score, Eskalation, non-billable)
   mit großer, fetter Zahl. Die 5. Karte ("letzte Aktualisierung") bleibt klein,
   da dort ein Datum/Uhrzeit steht. */
#cardActive, #cardAvg, #cardEsc, #cardNonBillable { font-size: 60px; font-weight: 900; }
.card .lbl { color: var(--text-muted); font-size: 13px; margin-top: 6px; }
/* Der Zeitstempel bei "letzte Aktualisierung" ist Text, keine kompakte Zahl —
   bei voller 40px-Größe würde er die Karte sprengen, deshalb hier moderater. */
#cardLastRefresh { font-size: 16px; white-space: nowrap; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.toolbar input[type=text] { padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; width: 220px; }
.sort-control { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.sort-control select { padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; color: var(--text); background: var(--panel); }
/* Nur eine Sache gegenüber dem Original: das lange Owner-/PM-Feld wird gedeckelt
   und lang bei Bedarf mit "…" abgeschnitten — sonst bläht es sich auf und reißt
   die Lücke bzw. drängt "Sortieren" in die zweite Zeile. Label bleibt vorne. */
.toolbar .sort-control select { max-width: 190px; text-overflow: ellipsis; }
/* Buttons bewusst mit fetterer Schrift + etwas größeren Icons/Emojis, damit
   die primären Aktionen (Aktualisieren, Analysieren, PM kontaktieren, …) im
   Blick schneller auffallen statt im übrigen Text unterzugehen. */
.btn { border: 1px solid var(--border); background: var(--panel); border-radius: 7px; padding: 7px 14px; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--text); }
.btn:hover { background: #f2f3f5; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { opacity: .9; }
.btn:disabled { opacity: .5; cursor: default; }
.attention-icon { display: inline-block; margin-left: 6px; color: var(--red); font-weight: 700; cursor: help; }
.mini-btn { border: 1px solid var(--border); background: var(--panel); border-radius: 6px; padding: 4px 10px; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--accent-text); }
.mini-btn:hover { background: var(--accent-bg); }
.mini-btn:disabled { opacity: .5; cursor: default; }

.progress-wrap { flex: 1; min-width: 180px; }
.progress-bar-bg { background: var(--gray-bg); border-radius: 6px; height: 7px; overflow: hidden; }
.progress-bar-fill { background: var(--accent); height: 100%; transition: width .3s; }
.progress-text { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Generische Tabellen-Basis wird nur noch vom "PF-Daten pflegen"-Modal
   gebraucht (das Haupt-Dashboard ist jetzt ein Kachel-Grid, siehe unten). */
table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
thead th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }

.board-name { font-weight: 700; font-size: 13.5px; }
.board-name a { color: inherit; text-decoration: none; }
.board-name a:hover { text-decoration: underline; color: var(--accent-text); }
.board-key { color: var(--text-muted); font-size: 11px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge.internal { background: var(--gray-bg); color: var(--text-muted); }
.badge.billable { background: var(--green-bg); color: var(--green); }
.badge.service { background: var(--accent-bg); color: var(--accent-text); }
.badge.gray { background: var(--gray-bg); color: var(--text-muted); }
.reason-list { list-style: none; margin: 4px 0 0; padding: 0; font-size: 11px; color: var(--text-muted); line-height: 1.5; }
.reason-list li::before { content: "• "; }
.pill { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; padding: 2px 6px; border-radius: 6px; font-weight: 700; font-size: 12px; }
.pill.g { background: var(--green-bg); color: var(--green); }
.pill.y { background: var(--yellow-bg); color: var(--yellow); }
.pill.r { background: var(--red-bg); color: var(--red); }
.pill.n { background: var(--gray-bg); color: var(--text-muted); }
.status-txt { color: var(--text-muted); font-size: 11.5px; }

/* ---- Kachel-Grid (Board-Dashboard) ---- */
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; align-items: start; }
.board-tile {
  position: relative;
  background: var(--panel); border: 0.5px solid var(--border); border-radius: 14px; padding: 14px 16px;
  cursor: pointer; transition: box-shadow .15s, border-color .15s; grid-column: span 1;
  box-shadow: 0 2px 8px rgba(20,22,26,.05);
}
.board-tile:hover { border-color: #d8d8dd; box-shadow: 0 4px 14px rgba(20,22,26,.08); }
.board-tile.expanded { grid-column: 1 / -1 !important; cursor: default; box-shadow: 0 6px 20px rgba(20,22,26,.10); }
.board-tile.tile-placeholder { cursor: default; }
/* Inaktive Boards (0 Tickets im 90-Tage-Fenster) bleiben sichtbar, sollen
   aber auf den ersten Blick als "schläft" erkennbar sein — dezent ausgegraut,
   beim Hovern/Aufklappen wieder normal lesbar. */
.board-tile.tile-inactive { opacity: .55; filter: grayscale(.65); }
.board-tile.tile-inactive:hover, .board-tile.tile-inactive.expanded { opacity: .85; filter: grayscale(.25); }

/* Experimentelle Ansicht "Kachelgröße nach Eskalation" (umschaltbar über
   #tileLayoutSelect, Standard bleibt einheitlich): Hoch = größte Kachel,
   absteigend über Mittel/Niedrig bis Inaktiv = kleinste. Breite über
   grid-column-Span, dazu leicht skalierte Schrift/Innenabstand für den
   optischen Größeneindruck. */
.board-tile.tile-size-xl { grid-column: span 3; padding: 20px 22px; }
.board-tile.tile-size-xl .board-name { font-size: 17px; }
.board-tile.tile-size-xl .bt-score .pill { font-size: 19px; min-width: 42px; padding: 4px 10px; }
.board-tile.tile-size-xl .grade-badge { font-size: 44px; min-width: 54px; }
.board-tile.tile-size-xl .bt-value { font-size: 14.5px; }

.board-tile.tile-size-lg { grid-column: span 2; padding: 16px 18px; }
.board-tile.tile-size-lg .board-name { font-size: 15px; }
.board-tile.tile-size-lg .bt-score .pill { font-size: 16px; }
.board-tile.tile-size-lg .grade-badge { font-size: 38px; }

.board-tile.tile-size-md { grid-column: span 1; }

.board-tile.tile-size-xs { grid-column: span 1; padding: 9px 11px; }
.board-tile.tile-size-xs .board-name { font-size: 12px; }
.board-tile.tile-size-xs .bt-score .pill { font-size: 13px; min-width: 28px; }
.board-tile.tile-size-xs .grade-badge { font-size: 26px; min-width: 34px; }
.bt-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.bt-title { min-width: 0; }
.bt-title .board-name { overflow-wrap: break-word; }
.bt-score { text-align: center; flex-shrink: 0; }
.bt-score-lbl { font-size: 9.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); margin-bottom: 2px; }
.bt-score .pill { font-size: 15px; min-width: 34px; padding: 3px 8px; }
.bt-score-row { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.grade-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; padding: 2px 8px; border-radius: 9px; font-weight: 700; font-size: 35px; line-height: 1; cursor: help; box-shadow: 0 2px 6px rgba(20,22,26,.12); }
.grade-A { background: var(--green-bg); color: var(--green); }
.grade-B { background: var(--accent-bg); color: var(--accent-text); }
.grade-C { background: var(--yellow-bg); color: var(--yellow); }
.grade-D { background: var(--red-bg); color: var(--red); }
.bt-sparkline { display: block; margin: 4px 0 0 auto; }
.bt-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 10px; margin-top: 10px; }
.bt-field { min-width: 0; }
.bt-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); cursor: help; }
.bt-value { font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-pf { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 12.5px; cursor: help; }
.bt-pf-label { color: var(--text-muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; display: block; margin-bottom: 2px; }
.bt-pf-value { font-weight: 600; }
.bt-expand-toggle { margin-top: 10px; font-size: 11.5px; font-weight: 700; color: var(--accent-text); text-align: center; }
.bt-status { margin-top: 8px; }
.bt-actions { margin-top: 8px; }

.bt-detail { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); }
.bt-detail-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.bt-detail-actions .status-txt { font-size: 11px; }
/* Kunden-Statusreport-Button: rechtsbündig und auffällig (Akzent-Blau). */
.bt-detail-actions .report-btn {
  margin-left: auto; border: none; background: var(--accent); color: var(--accent-ink);
  padding: 11px 22px; border-radius: 10px; font-size: 14.5px; font-weight: 800;
  letter-spacing: .2px; box-shadow: 0 2px 8px rgba(0,113,227,.28);
}
.bt-detail-actions .report-btn:hover { background: var(--accent-text); box-shadow: 0 3px 12px rgba(0,113,227,.36); }
@media (max-width: 620px) { .bt-detail-actions .report-btn { margin-left: 0; } }

/* Kennzahlenleiste in der Detailansicht: alles, was nicht schon auf der
   Kachel-Vorderseite steht, als Reihe kleiner Kärtchen (Label oben, Wert
   darunter) statt als Fließtext oder reine Pill-Reihe — schneller erfassbar. */
.detail-quickstats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.qs-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  font-size: 12.5px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 12px; min-width: 92px;
}
.qs-label { color: var(--text-muted); font-size: 10px; text-transform: uppercase; letter-spacing: .03em; cursor: help; }

.detail-callout { border-radius: 10px; padding: 11px 15px; margin-bottom: 14px; font-size: 12.5px; line-height: 1.5; }
.detail-callout.warn { background: var(--red-bg); color: #7a1f1f; }
.detail-callout.todo { background: var(--yellow-bg); color: #7a3b00; }
.detail-callout.ok { background: var(--green-bg); color: #1e5e2b; }
.detail-callout strong { display: block; margin-bottom: 3px; }
.detail-callout .reason-list { color: inherit; }
.detail-callout a { color: inherit; font-weight: 700; text-decoration: underline; }

/* Detailinhalte in klar abgegrenzte Karten statt einer dichten Textwand —
   macht das Aufklappen leichter scannbar. Leichter Schatten + Hover passend
   zum übrigen Kachel-Design, dezente farbige Icon-Kapsel vor dem Titel für
   schnellere visuelle Orientierung zwischen den Karten. */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.detail-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(20,22,26,.05); transition: box-shadow .15s;
}
.detail-card:hover { box-shadow: 0 4px 14px rgba(20,22,26,.08); }
.detail-card h4 {
  margin: 0 0 10px; font-size: 11.5px; text-transform: uppercase; color: var(--text-muted);
  letter-spacing: .03em; display: flex; align-items: center; gap: 8px; padding-bottom: 9px;
  border-bottom: 1px solid var(--border);
}
.detail-card h4 .card-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border-radius: 10px; background: #ececee; color: #3a3a3c; flex-shrink: 0;
}
.detail-card h4 .card-icon svg { width: 21px; height: 21px; display: block; }
.detail-callout { overflow-wrap: anywhere; word-break: break-word; }
.doc-kickoff { margin-top: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.doc-kickoff .kickoff-btn { background: var(--accent-bg); border-color: var(--accent); color: var(--accent-text); font-weight: 700; }
.doc-kickoff .kickoff-status { font-size: 11.5px; }
.doc-kickoff-example { margin-top: 6px; font-size: 12px; }
.doc-kickoff-example a { color: var(--accent-text); text-decoration: none; }
.doc-kickoff-example a:hover { text-decoration: underline; }
.suggestion { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; margin-bottom: 7px; font-size: 12.5px; line-height: 1.5; }
.suggestion:last-child { margin-bottom: 0; }
.suggestion a { color: var(--accent-text); font-weight: 600; text-decoration: none; }
.suggestion .thema { font-weight: 600; margin: 2px 0 3px; }
/* Board Qualität Control */
.qc-fazit { font-size: 12.5px; line-height: 1.6; margin-bottom: 10px; padding: 9px 11px; border-radius: 8px; background: var(--accent-bg, #eef4ff); border: 1px solid var(--border); }
.qc-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 2px; }
.qc-badge { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; border-radius: 6px; padding: 1px 7px; }
.qc-badge.qc-cat { color: #3a3a3c; background: #ececee; border: 1px solid #dcdce0; }
.qc-badge.qc-sev.sev-high { color: #fff; background: #d64545; border: 1px solid #c23a3a; }
.qc-badge.qc-sev.sev-mid { color: #7a3b00; background: #ffe4bf; border: 1px solid #f0c890; }
.qc-badge.qc-sev.sev-low { color: #4a4a4d; background: #eef0f2; border: 1px solid #dcdce0; }
.qc-befund { margin: 1px 0 4px; }
.qc-vorschlag { color: var(--text); }
.qc-vorschlag-lbl { font-weight: 700; }
.narrative { font-size: 12.5px; line-height: 1.6; }
.doc-checklist { list-style: none; margin: 8px 0 0; padding: 0; font-size: 12px; display: grid; gap: 3px; }
.doc-checklist li { padding: 2px 0; }
.doc-checklist .ok { color: var(--green); font-weight: 700; }
.doc-checklist .missing { color: var(--red); font-weight: 700; }

/* Key-Value-Zeilen mit Fortschrittsbalken — v.a. für die PF-Kennzahlen-Karte,
   damit Soll/Ist (Budget, Kapazität) auf einen Blick statt aus Fließtext
   erfassbar ist. */
.kv-grid { display: flex; flex-direction: column; gap: 10px; }
.kv-row { display: flex; flex-direction: column; gap: 4px; }
.kv-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .02em; }
.kv-value { display: flex; flex-direction: column; gap: 4px; }
.progress-track { height: 7px; border-radius: 4px; background: var(--gray-bg); overflow: hidden; display: flex; }
.progress-fill { height: 100%; border-radius: 4px; background: var(--accent); transition: width .3s; }
.progress-fill.over { background: var(--red); }
.progress-seg { height: 100%; }
.progress-seg.ok { background: var(--green); }
.progress-seg.warn { background: var(--yellow); }
.kv-value .progress-text { font-size: 12.5px; color: var(--text); margin-top: 0; }
.progress-warn { color: var(--red); font-weight: 700; }
/* Sichtbar abgesetzte Box je Abschnitt (Budget / 6-Monats-Kapazität /
   Lifetime-Referenz) in der PF-Kachel — bewusst ein eigener Kasten mit
   Hintergrund statt nur einer dünnen Trennlinie, damit auf den ersten Blick
   klar ist, welche Kennzahlen zusammengehören, auch bei viel Information auf
   engem Raum. */
.kv-section { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.kv-section + .kv-section { margin-top: 8px; }
.kv-section-title { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 700; margin-bottom: 8px; }

/* Kompaktes Kennzahlen-Grid, z.B. für Ticket-Kennzahlen in der Detailansicht —
   gleiche Optik wie die Stat-Kärtchen im oberen Bereich der App. */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 420px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-box { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 6px; text-align: center; }
.stat-box.stat-warn { background: var(--yellow-bg); border-color: transparent; }
.stat-box.stat-warn .stat-num { color: var(--yellow); }
.stat-num { font-size: 18px; font-weight: 700; }
.stat-lbl { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .02em; margin-top: 2px; }
/* Anklickbare Kennzahl-Box (öffnet passenden Jira-Filter). */
.stat-box.stat-link { display: block; text-decoration: none; color: inherit; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.stat-box.stat-link:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(20,22,26,.10); }
.stat-box.stat-link.stat-warn:hover { border-color: var(--yellow); }
.stat-ext { color: var(--accent-text); font-weight: 700; }
.stat-box.stat-warn .stat-ext { color: var(--yellow); }

.chart-row { display: flex; gap: 16px; margin-bottom: 16px; align-items: stretch; }
.chart-row .chart-wrap { margin-bottom: 0; flex: 2; min-width: 0; }
.chart-row .attention-wrap { flex: 1; min-width: 260px; overflow-y: auto; height: 258px; }
.chart-row .pm-chart-wrap { flex: 1; min-width: 210px; height: 258px; display: flex; flex-direction: column; }
.pm-chart-wrap h4 { margin: 0; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); cursor: help; }
.pm-chart-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.pm-chart-header .mini-btn { flex-shrink: 0; }
.chart-wrap { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; height: 230px; }
.chart-wrap-main { display: flex; flex-direction: column; height: 258px; }
.chart-toolbar { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.chart-toolbar .sort-control select { padding: 3px 6px; font-size: 12px; }
.chart-canvas-wrap { position: relative; flex: 1; min-height: 0; }
.attention-wrap h4 { margin: 0 0 8px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); }
.attn-item { border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; margin-bottom: 6px; font-size: 12px; cursor: pointer; transition: border-color .12s, background .12s, box-shadow .12s; }
.attn-item:hover { border-color: var(--accent); background: var(--accent-bg); box-shadow: 0 2px 8px rgba(20,22,26,.08); }
.attn-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.attn-item a { color: inherit; font-weight: 600; text-decoration: none; }
.attn-item a:hover { text-decoration: underline; color: var(--accent-text); }
.attn-tags { margin-top: 3px; display: flex; gap: 4px; flex-wrap: wrap; }
.attn-tag { display: inline-block; padding: 1px 6px; border-radius: 10px; font-size: 10.5px; font-weight: 600; }
.attn-tag.esc { background: var(--red-bg); color: var(--red); }
.attn-tag.budget { background: var(--yellow-bg); color: var(--yellow); }
.attn-tag.noboard { background: var(--gray-bg); color: var(--accent-text); }
.attn-tag.flow { background: var(--red-bg); color: var(--red); }
.attn-empty { color: var(--text-muted); font-size: 12px; padding: 8px 0; }

.critical-section { margin-bottom: 18px; }
.critical-section h3 { margin: 0 0 10px; }
/* Standard (keine kritischen Projekte): neutrale, dezente Leiste — fällt
   nicht unter dem Chart-Row weg, ist aber nicht alarmierend, wenn es
   gerade nichts zu tun gibt. */
.critical-toggle {
  cursor: pointer; user-select: none; display: flex; align-items: center; gap: 8px;
  background: var(--gray-bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 16px; font-size: 14.5px; font-weight: 600; color: var(--text);
  box-shadow: 0 2px 6px rgba(20,22,26,.08);
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.critical-toggle:hover { box-shadow: 0 3px 10px rgba(20,22,26,.12); }
.critical-toggle:hover { border-color: var(--accent-text); }
/* Sobald es echte Handlungsempfehlungen gibt: kräftige rote Warnleiste,
   damit der Abschnitt zwischen Charts oben und Board-Toolbar unten nicht
   mehr untergeht (ursprüngliches Problem: reiner Fließtext ohne jeden
   visuellen Ankerpunkt). */
.critical-section.has-items .critical-toggle {
  background: var(--red-bg); border-color: var(--red); color: #7a1f1f;
  box-shadow: 0 2px 8px rgba(224,49,49,.18);
}
.critical-section.has-items .critical-toggle:hover { background: #ffe3e3; }
.critical-chevron { display: inline-block; font-size: 11px; color: inherit; opacity: .7; transition: transform .15s; }
.critical-section.expanded .critical-chevron { transform: rotate(90deg); }
.critical-count {
  color: var(--text-muted); font-size: 11.5px; font-weight: 700;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 1px 8px;
}
.critical-section.has-items .critical-count { background: var(--red); border-color: var(--red); color: #fff; }
.critical-section:not(.expanded) .critical-grid { display: none; }
.critical-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.critical-card { background: var(--panel); border: 1px solid var(--border); border-left: 4px solid var(--red); border-radius: 10px; padding: 12px 14px; }
.critical-card .cc-title { font-weight: 700; font-size: 13.5px; }
.critical-card .cc-title a { color: inherit; text-decoration: none; }
.critical-card .cc-key { color: var(--text-muted); font-size: 11px; margin-bottom: 6px; }
.critical-card .cc-tags { margin: 2px 0 8px; display: flex; gap: 4px; flex-wrap: wrap; }
.critical-card ul.cc-recs { margin: 0 0 10px; padding-left: 18px; font-size: 12.5px; line-height: 1.5; }
.cc-mail-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: var(--accent-ink); border: none; border-radius: 7px; padding: 7px 14px; font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer; }
.cc-mail-btn:hover { opacity: .88; }
.cc-mail-note { font-size: 10.5px; color: var(--text-muted); margin-top: 5px; line-height: 1.4; }
.critical-empty { color: var(--text-muted); font-size: 12.5px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; grid-column: 1 / -1; }

footer { margin-top: 22px; color: var(--text-muted); font-size: 11px; line-height: 1.6; border-top: 1px solid var(--border); padding-top: 10px; }
.spin { display: inline-block; width: 11px; height: 11px; border: 2px solid var(--border); border-top-color: var(--accent-text); border-radius: 50%; animation: spin 0.8s linear infinite; margin-right: 5px; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }
.doc-yes { color: var(--green); }
.doc-no { color: var(--text-muted); }
.empty-hint { padding: 30px; text-align: center; color: var(--text-muted); }

.modal-overlay { position: fixed; inset: 0; background: rgba(20,22,26,.45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-overlay.hidden { display: none; }
.modal { background: var(--panel); border-radius: 12px; width: 640px; max-width: 92vw; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { margin: 0; font-size: 14.5px; }
.modal-body { padding: 12px 18px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.modal-close { border: none; background: none; font-size: 18px; cursor: pointer; color: var(--text-muted); }
.proj-pick-row { display: flex; align-items: center; gap: 8px; padding: 5px 2px; border-bottom: 1px solid #f0f1f3; font-size: 12.5px; }
.proj-pick-row .name { flex: 1; }
.proj-pick-row .key { color: var(--text-muted); font-size: 11px; }
.proj-pick-toolbar { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; align-items: center; }
.proj-pick-tabs { display: flex; gap: 4px; margin-bottom: 10px; border-bottom: 1px solid var(--border); }
.proj-tab { background: none; border: none; border-bottom: 2px solid transparent; padding: 7px 12px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); cursor: pointer; }
.proj-tab:hover { color: var(--text); }
.proj-tab.active { color: var(--accent-text); border-bottom-color: var(--accent-text); }

/* ---- Chat-Icon auf der Kachel + projektbezogenes Chatfenster ---- */
/* Kleine Zwischenüberschrift innerhalb einer Detail-Karte (z.B. "Warum diese
   Note?" jetzt in der Kennzahlen-Karte). */
.kv-subhead { margin: 14px 0 8px; padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 700; }

/* Direkt eingebetteter Projekt-Chat: Karte über zwei Grid-Spalten, damit der
   Chat genug Breite hat (nutzt den Platz der früheren "Warum diese Note?"-Karte). */
/* Karte streckt sich auf die Höhe der (höheren) Nachbarkarte in derselben
   Grid-Zeile (Standard-Grid-Verhalten align-items: stretch). Der Chat füllt
   diese Höhe: Nachrichtenbereich wächst, Eingabefeld sitzt unten. */
/* Der Chat richtet seine Höhe komplett nach den Nachbarkarten (Grid-Stretch):
   KEIN eigener max-height-Deckel, sonst bliebe er bei sehr hohen Nachbarn zu
   kurz. Der Nachrichtenbereich (flex:1 1 0 + overflow) füllt exakt den Rest
   und scrollt bei viel Text intern — dadurch wächst die Kachel beim Chatten
   NICHT und Schnellfragen + Eingabefeld sitzen immer ganz unten. */
.detail-card-chat { grid-column: span 2; display: flex; flex-direction: column; }
@media (max-width: 720px) { .detail-card-chat { grid-column: span 1; } }
.chat-embed { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
/* flex:1 1 0 + min-height:0 => füllt den verfügbaren Platz und scrollt bei
   viel Text intern, statt das Eingabefeld nach oben zu drücken. */
.chat-embed-msgs {
  flex: 1 1 0; min-height: 140px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px; padding: 4px 2px;
}
.chat-embed .chat-quick { padding: 0; }
.chat-embed .chat-input-row { border-top: none; padding: 6px 0 0; }
.chat-embed .chat-input-row textarea { min-height: 38px; max-height: 80px; }

.chat-panel {
  position: fixed; bottom: 20px; right: 20px; width: 400px; max-width: calc(100vw - 40px);
  height: 560px; max-height: calc(100vh - 40px); background: var(--panel);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 12px 40px rgba(20,22,26,.28);
  display: flex; flex-direction: column; z-index: 50; overflow: hidden;
}
.chat-panel.hidden { display: none; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--bg); }
.chat-head-title { min-width: 0; }
.chat-head-name { display: block; font-weight: 700; font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head-sub { display: block; font-size: 10.5px; color: var(--text-muted); }
.chat-head-actions { display: flex; gap: 4px; flex-shrink: 0; }
.chat-icon-btn { border: none; background: none; font-size: 15px; cursor: pointer; color: var(--text-muted); padding: 4px; border-radius: 6px; }
.chat-icon-btn:hover { background: #e8eaee; color: var(--text); }

.chat-messages { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-empty { color: var(--text-muted); font-size: 12.5px; line-height: 1.5; text-align: center; margin: auto 0; padding: 0 10px; }
.chat-msg { display: flex; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.assistant { justify-content: flex-start; }
.chat-bubble { max-width: 85%; padding: 8px 11px; border-radius: 12px; font-size: 12.5px; line-height: 1.5; overflow-wrap: break-word; }
.chat-msg.user .chat-bubble { background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.chat-msg.assistant .chat-bubble { background: var(--gray-bg); color: var(--text); border-bottom-left-radius: 4px; }
.chat-typing { color: var(--text-muted); font-style: italic; }

.chat-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px 0; }
.chat-quick-btn { border: 1px solid var(--border); background: var(--panel); border-radius: 14px; padding: 4px 10px; font-size: 11px; font-weight: 600; color: var(--accent-text); cursor: pointer; }
.chat-quick-btn:hover { background: var(--accent-bg); }

.chat-input-row { display: flex; gap: 8px; padding: 10px 14px 12px; border-top: 1px solid var(--border); align-items: flex-end; }
.chat-input-row textarea { flex: 1; resize: none; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 12.5px; max-height: 120px; }
.chat-input-row .btn { flex-shrink: 0; }

/* ---- Kunden-Statusreport-Modal ---- */
.report-modal { max-width: 620px; }
.report-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--text); background: var(--bg); border: 0.5px solid var(--border); border-radius: 10px; padding: 10px 14px; margin: 4px 0 14px; }
.report-meta span b { color: var(--text); font-weight: 600; }
.report-meta .rm-label { color: var(--text-muted); margin-right: 4px; }
.report-period { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; }
.report-period label { font-size: 12px; color: var(--text-muted); display: flex; flex-direction: column; gap: 4px; }
.report-period input { padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 13px; color: var(--text); }
.report-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); margin: 12px 0 5px; }
.report-modal textarea { width: 100%; box-sizing: border-box; resize: vertical; border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px; font: inherit; font-size: 13px; line-height: 1.45; color: var(--text); }
.report-modal textarea:focus, .report-period input:focus { outline: none; border-color: var(--accent); }
.report-check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text); margin-top: 14px; }
.report-check input { width: 15px; height: 15px; accent-color: var(--accent); }
/* 6-Monats-Spalten im PF-Modal standardmäßig ausgeblendet (Toggle-Button). */
#pfTable.pf-6m-hidden .col6m { display: none; }
/* API-gepflegte Felder (Angebot/Verbraucht/billable/non-billable, Lebenszeit):
   read-only, grau hinterlegt — kommen automatisch aus der Projectfacts-API. */
.pf-api-field { background: #f0f0f2; color: #6a6a6e; cursor: not-allowed; border-color: #e2e2e6; }
/* PF-Kachel: Tabs pro PF-Projekt (Gesamt + einzelne) */
/* Überlappende "Ordner"-Tabs: folgende Tabs schieben sich per negativem
   Rand teils hinter den vorherigen, der aktive Tab liegt (z-index) vorne,
   hebt sich weiß ab und verschmilzt mit dem Inhalt darunter. */
.pf-tabbar { display: flex; align-items: flex-end; padding-left: 2px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
/* z-index kommt inline über --z (früherer Tab = höher), damit frühere Tabs
   VOR späteren liegen. Der aktive Tab überschreibt das per Klassen-Spezifität. */
.pf-tab { position: relative; border: 1px solid var(--border); border-bottom: none; background: var(--gray-bg); color: var(--text-muted); border-radius: 9px 9px 0 0; padding: 5px 16px 7px; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; margin-left: -10px; z-index: var(--z, 1); box-shadow: 0 -1px 2px rgba(0,0,0,.05); }
.pf-tab:first-child { margin-left: 0; }
.pf-tab.active { background: var(--panel); color: var(--accent-text); z-index: 100; margin-bottom: -1px; padding-bottom: 8px; box-shadow: 0 -2px 5px rgba(0,0,0,.08); }
.pf-tab:not(.active):hover { background: #f7f7f8; color: var(--text); }
/* Sofort-Tooltip beim Überfahren (voller PF-Projektname) */
.pf-tab[data-tip]:hover::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); background: var(--text); color: #fff; padding: 5px 9px; border-radius: 6px; font-size: 11px; font-weight: 600; white-space: nowrap; z-index: 60; box-shadow: 0 3px 10px rgba(0,0,0,.22); pointer-events: none; }
.pf-tab[data-tip]:hover::before { content: ''; position: absolute; left: 50%; bottom: calc(100% + 1px); transform: translateX(-50%); border: 5px solid transparent; border-top-color: var(--text); z-index: 60; pointer-events: none; }
.pf-tab-panel { display: none; }
.pf-tab-panel.active { display: block; }
.pf-tab-name { font-size: 12px; font-weight: 700; color: var(--text); margin: 0 0 6px; padding-bottom: 4px; border-bottom: 1px dashed var(--border); white-space: normal; }
/* PM-Auswertung */
#pmReportBody { overflow-x: auto; }
.pmreport-table { width: 100%; font-size: 12.5px; border-collapse: collapse; }
.pmreport-table th, .pmreport-table td { padding: 6px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.pmreport-table th { text-align: center; font-weight: 700; color: var(--text); background: var(--bg); position: sticky; top: 0; }
.pmreport-table td.c { text-align: center; }
.pmreport-table tr:last-child td { border-bottom: none; }
.pmreport-bad { color: #fff; background: #d64545; font-weight: 800; border-radius: 6px; }
.pmreport-warn { color: #7a3b00; background: #ffe4bf; font-weight: 700; border-radius: 6px; }
.pmreport-ok { color: #1e5e2b; background: var(--green-bg, #e6f4ea); font-weight: 700; border-radius: 6px; }
/* Badge auf der Kachel, wenn ein PM PF-Daten geändert hat (Admin-Sicht).
   Auffällig: kräftiges Orange, weiße Schrift, dezenter Puls. */
.pm-edit-badge { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .2px; color: #fff; background: #f57c00; border: 1px solid #e06f00; border-radius: 10px; padding: 2px 9px; vertical-align: middle; white-space: nowrap; box-shadow: 0 1px 3px rgba(245,124,0,.4); animation: pmEditPulse 1.8s ease-in-out infinite; }
@keyframes pmEditPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(245,124,0,.45); } 50% { box-shadow: 0 0 0 5px rgba(245,124,0,0); } }
@media (prefers-reduced-motion: reduce) { .pm-edit-badge { animation: none; } }
/* Kleinere Variante als Zeilen-Marker im PF-Modal. */
.pm-edit-badge.sm { font-size: 10px; padding: 1px 7px; animation: none; box-shadow: none; }
/* PM-Notiz-Badge: Admin hat eine Änderung abgelehnt + kommentiert (blau). */
.pm-note-badge { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .2px; color: #fff; background: var(--accent, #0071e3); border: 1px solid var(--accent, #0071e3); border-radius: 10px; padding: 2px 9px; vertical-align: middle; white-space: nowrap; box-shadow: 0 1px 3px rgba(0,113,227,.35); }
/* Konkrete "alt → neu"-Liste im Admin-Prüfhinweis. */
.pf-diff { margin-top: 8px; }
.pf-diff-head { font-weight: 700; margin-bottom: 3px; }
.pf-diff-list { margin: 0; padding-left: 16px; }
.pf-diff-list li { margin: 1px 0; }
.pf-diff-label { color: inherit; }
.pf-diff-val { font-weight: 800; }
.pf-review-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pf-reject-btn { color: var(--red, #d64545); border-color: #e6b3b3; }
.pf-reject-btn:hover { background: var(--red-bg, #fdecec); }
/* Zeile im PF-Modal hervorheben, wenn ein PM sie geändert hat. */
#pfTable tr.pf-row-edited td { background: #fff6ec; }
/* Glocken-Icon oben rechts mit Zähler offener PM-Änderungen. */
.pf-notif-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid var(--border); background: var(--panel); border-radius: 10px; cursor: pointer; color: #3a3a3c; }
.pf-notif-btn:hover { background: var(--accent-bg); }
.pf-notif-btn.active { border-color: #f57c00; background: #fff3e0; }
.pf-notif-btn svg { width: 20px; height: 20px; }
.pf-notif-count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #f57c00; color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
/* PM-Variante (Ablehnungs-Kommentare) in Akzent-Blau statt Orange. */
.pf-notif-btn.pm .pf-notif-count { background: var(--accent, #0071e3); }
.pf-notif-btn.pm.active { border-color: var(--accent, #0071e3); background: var(--accent-bg, #e8f2fe); }
.report-required::after { content: ' *'; color: var(--red, #d64545); font-weight: 700; }
.report-sched-opts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.report-sched-opt { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 14px; font-size: 13px; color: var(--text); cursor: pointer; user-select: none; }
.report-sched-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.report-sched-opt::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--border); flex-shrink: 0; }
.report-sched-opt.sched-on::before { background: #8AB833; }
.report-sched-opt.sched-risk::before { background: #e89822; }
.report-sched-opt.sched-overshoot::before { background: #d64545; }
.report-sched-opt:hover { border-color: var(--text-muted); }
.report-sched-opts:has(input:checked) .report-sched-opt { opacity: .55; }
.report-sched-opt:has(input:checked) { opacity: 1 !important; border-color: var(--text); background: var(--bg); font-weight: 600; box-shadow: 0 0 0 1px var(--text) inset; }
.report-sched-opts.needs-choice .report-sched-opt { border-color: var(--red, #d64545); box-shadow: 0 0 0 1px var(--red, #d64545) inset; }
#reportModalStatus.error { color: var(--red, #d64545); font-weight: 600; }

/* ===== Projektablauf-Analyse (superadmin) ===== */
.modal.modal-wide { width: 900px; }
.rolechip { display:inline-block; background:#111; color:#fff; font-size:10px; font-weight:700; border-radius:6px; padding:2px 7px; vertical-align:middle; margin-left:6px; letter-spacing:.3px; }
/* Kompakte, gut sichtbare Ablauf-Warnung in der Kachel (hugt den Inhalt,
   wird NICHT über die ganze Breite gestreckt). */
.flow-alert { display:inline-flex; align-items:center; gap:7px; margin:10px 0 2px; padding:6px 11px; border-radius:8px; font-size:12.5px; font-weight:700; cursor:pointer; border:1px solid transparent; transition:filter .12s; }
.flow-alert .flow-alert-ic { font-size:15px; line-height:1; }
.flow-alert .flow-alert-txt b { font-weight:800; }
.flow-alert .flow-alert-cta { font-size:11px; font-weight:700; opacity:.75; white-space:nowrap; }
.flow-alert.red { background:var(--red-bg); color:#8a201b; border-color:#eabbb6; }
.flow-alert.yellow { background:var(--yellow-bg); color:#8a5a12; border-color:#e7d09a; }
.flow-alert.red .flow-alert-ic { color:var(--red); }
.flow-alert.yellow .flow-alert-ic { color:var(--yellow); }
.flow-alert:hover { filter:brightness(.97); }
#flowBody .card, #flowBody .flow-ai { background:var(--panel); border:1px solid var(--border); border-radius:12px; padding:14px 16px; margin-bottom:14px; }
#flowBody .card h3 { margin:0 0 10px; font-size:14px; }
.flow-cmp { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin:2px 0 14px; }
.flow-cmp-box { border:1px solid var(--border); border-radius:10px; padding:8px 12px; font-size:12.5px; }
.flow-cmp-box.flow-r { border-color:#e7b4b0; background:var(--red-bg); }
.flow-cmp-box.flow-y { border-color:#e6d19a; background:var(--yellow-bg); }
.flow-cmp-arrow { color:var(--text-muted); font-size:18px; }
#flowBody .flow-ai { background:linear-gradient(180deg,#fbfdff,#f4f9ff); border-color:#d6e6fb; }
.flow-ai-head { display:flex; align-items:center; gap:8px; font-weight:800; font-size:14px; margin-bottom:8px; }
.flow-flag { display:flex; gap:8px; align-items:flex-start; padding:9px 12px; border-radius:10px; margin-bottom:7px; font-size:13px; }
.flow-flag.r { background:var(--red-bg); } .flow-flag.y { background:var(--yellow-bg); }
.flow-table { width:100%; border-collapse:collapse; font-size:13px; }
.flow-table th,.flow-table td { text-align:left; padding:8px 10px; border-bottom:1px solid var(--border); }
.flow-table th { font-size:11px; text-transform:uppercase; letter-spacing:.4px; color:var(--text-muted); }
.flow-table td.num,.flow-table th.num { text-align:right; font-variant-numeric:tabular-nums; }
.flow-bar { position:relative; height:9px; width:150px; border-radius:5px; background:var(--gray-bg); }
.flow-bar>span { position:absolute; left:0; top:0; bottom:0; border-radius:5px; }
.flow-ref { position:absolute; top:-2px; bottom:-2px; width:2px; background:var(--red); opacity:.55; }

/* Link von "Warum diese Note?" zur Projektablauf-Detailansicht */
.flow-open-link { color:var(--accent-text); font-weight:700; font-size:12px; text-decoration:none; }
.flow-open-link:hover { text-decoration:underline; }

/* "Ansicht als" (Impersonation) */
.impersonate-select { padding: 4px 8px; border: 1px solid var(--border); border-radius: 7px; font-size: 12px; background: var(--panel); color: var(--text); max-width: 200px; }
.impersonate-banner { display: flex; align-items: center; justify-content: center; gap: 12px; background: #2a2a2e; color: #fff; font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 10px; margin: 6px 0 14px; }
.impersonate-banner .mini-btn { background: #fff; color: #1d1d1f; border: none; }
.impersonate-banner .mini-btn:hover { background: #eaeaea; }

/* Linker Icon-Rail (Seiten-Umschalter) */
body { padding-left: 68px; }
.side-rail { position: fixed; top: 0; left: 0; bottom: 0; width: 68px; background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 0; z-index: 40; }
.rail-btn { width: 56px; border: none; background: transparent; border-radius: 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0; color: var(--text-muted); font-size: 9.5px; font-weight: 700; }
.rail-btn svg { width: 22px; height: 22px; }
.rail-btn:hover { background: var(--gray-bg); color: var(--text); }
.rail-btn.active { background: var(--accent-bg); color: var(--accent-text); }

/* Mitarbeiteranalyse: Unternehmens-Übersicht, Umschalter, Visual-Balken */
.ma-overview { display: flex; align-items: center; gap: 20px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 14px 18px; margin-bottom: 14px; }
.ma-ov-title { font-size: 14px; font-weight: 800; margin-bottom: 6px; }
.ma-ov-legend { font-size: 13px; line-height: 1.7; }
.ma-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; border: 1px solid var(--border); }
.ma-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; margin-bottom: 10px; flex-wrap: wrap; }
.ma-year-card { margin-bottom: 4px; }
/* Jahresansicht (breiter) + Abrechnungslücke (schmäler), gleiche Höhe */
.ma-charts-row { display: grid; grid-template-columns: 1.7fr 1fr; gap: 12px; align-items: stretch; }
.ma-charts-row > .card { margin: 0; display: flex; flex-direction: column; }
@media (max-width: 900px) { .ma-charts-row { grid-template-columns: 1fr; } }
.ma-switch { display: inline-flex; background: var(--gray-bg); border-radius: 9px; padding: 3px; gap: 2px; }
.ma-switch-btn { border: none; background: transparent; padding: 5px 14px; border-radius: 7px; font-size: 12.5px; font-weight: 700; color: var(--text-muted); cursor: pointer; }
.ma-switch-btn.active { background: var(--panel); color: var(--accent-text); box-shadow: 0 1px 3px rgba(20,22,26,.12); }
.ma-table th { user-select: none; }
.ma-visual { display: flex; flex-direction: column; gap: 7px; }
.ma-legend { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.ma-bar-row { display: flex; align-items: center; gap: 10px; }
.ma-bar-name { width: 160px; flex: none; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ma-bar-track { flex: 1; background: transparent; }
.ma-bar { display: flex; height: 16px; border-radius: 5px; overflow: hidden; min-width: 2px; }
.ma-bar-fill.bill { background: var(--green); }
.ma-bar-fill.non { background: var(--gray-bg); }
.ma-bar-meta { width: 120px; flex: none; text-align: right; font-size: 11.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* MA: Veraltet-Warnung (Cache älter als 7 Tage) */
.ma-stale { background: var(--yellow-bg); color: #8a5a12; border: 1px solid #e7d09a; border-radius: 9px; padding: 8px 12px; font-size: 12.5px; font-weight: 600; margin-bottom: 10px; }

/* Feature: Projekt initialisieren (Wizard) */
/* Stepper: gleichmäßig verteilte Kreise mit Verbindungslinie dahinter. */
.init-steps { display: flex; align-items: flex-start; margin: 8px 0 20px; padding: 0; }
.init-step { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 0 4px; border: none; background: none; font-size: 12.5px; cursor: pointer; color: var(--text-muted); }
/* Verbindungslinie: läuft von der Mitte dieses Kreises nach rechts zum nächsten. */
.init-step::before { content: ""; position: absolute; top: 15px; left: 50%; width: 100%; height: 2px; background: var(--border); z-index: 0; }
.init-step:last-child::before { display: none; }
.init-step.done::before { background: var(--green); }
.init-step-circle { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--panel); border: 2px solid var(--border); font-size: 13px; font-weight: 800; color: var(--text-muted); transition: all .15s; }
.init-step-label { text-align: center; line-height: 1.2; max-width: 130px; }
.init-step.active .init-step-circle { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 4px var(--accent-bg); }
.init-step.active .init-step-label { color: var(--text); font-weight: 700; }
.init-step.done .init-step-circle { background: var(--green); border-color: var(--green); color: #fff; }
.init-step.done .init-step-label { color: var(--text); }
.init-step:hover .init-step-circle { border-color: var(--accent); }
/* Navigation: Ghost-Zurück · Schrittzähler · Primär-Weiter. */
.init-nav { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.btn.ghost { background: none; border-color: transparent; color: var(--text-muted); }
.btn.ghost:hover { background: var(--gray-bg); color: var(--text); }
.init-nav-counter { flex: 1; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.init-nav .btn.primary { min-width: 130px; padding: 9px 20px; font-size: 14px; }
.init-offers { display: flex; flex-direction: column; gap: 6px; max-height: 460px; overflow: auto; }
.init-offer { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.init-offer:hover { background: var(--gray-bg); }
.init-offer.sel { border-color: var(--accent, #2f6fed); background: var(--blue-bg, #eef4ff); }
.init-offer input { grid-row: 1 / span 2; }
.init-offer-main { font-weight: 600; font-size: 13.5px; }
.init-offer-meta { grid-column: 2; font-size: 12px; color: var(--text-muted); }
.init-badge { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; vertical-align: middle; }
.init-badge.ok { background: var(--green-bg); color: var(--green); }
.init-badge.no { background: var(--gray-bg); color: var(--text-muted); }
.init-offer-link { grid-column: 3; grid-row: 1 / span 2; font-size: 12px; white-space: nowrap; text-decoration: none; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; }
.init-offer-link:hover { background: var(--card-bg, #fff); }
.init-notfound { margin-top: 12px; font-size: 13px; }
.init-notfound summary { cursor: pointer; color: var(--accent, #2f6fed); }
.init-s2-sec { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-top: 12px; }
.init-s2-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.init-s2-head code { background: var(--gray-bg); padding: 3px 7px; border-radius: 6px; font-size: 12.5px; }
.init-sec-icon { font-size: 15px; }
.init-ok { color: var(--green); font-weight: 700; font-size: 12.5px; }
/* Erkannter Name (Space/Board) als eigene Zeile unter dem Kopf. */
.init-detected { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--text); }
/* Aktionsreihe: Buttons klar abgesetzt mit Abstand nach oben. */
.init-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.init-actions .btn { text-decoration: none; }
/* Manuelle Verknüpfung als abgesetzter Fallback-Block. */
.init-manual { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }
.init-manual-label { display: block; font-size: 11.5px; color: var(--text-muted); margin-bottom: 5px; }
.init-manual-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.init-input { flex: 1; min-width: 240px; padding: 7px 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
/* Unter-Abschnitt (Seiten anlegen) innerhalb der Space-Sektion. */
.init-sub { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.init-sub-title { font-size: 12.5px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
/* Seiten-Statusliste (existiert vs. wird angelegt). */
.init-pages-status { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.init-page-status { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; }
.init-page-status.exists { background: var(--green-bg); border-color: #a6d8b0; }
.init-page-status .init-ps-ico { font-weight: 800; }
.init-page-status.exists .init-ps-ico { color: var(--green); }
.init-page-status.new .init-ps-ico { color: var(--text-muted); }
.init-ps-title { flex: 1; color: var(--text); font-weight: 600; }
.init-ps-tag { font-size: 11px; color: var(--text-muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; background: var(--panel); }
.init-ps-tag.new { color: var(--accent-text); border-color: var(--accent-bg); }
/* Gefundene bestehende Seiten (Kunde als Seite unter Sammel-Space). */
.init-matches { margin-top: 10px; }
.init-matches-h { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.init-matches .init-page-link { margin-bottom: 6px; }
/* Anker-Auswahl (Kleinkunde: welche Kundenseite ist Elternseite). */
.init-anchor-pick { margin-top: 10px; }
.init-anchor-opt { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; cursor: pointer; font-size: 12.5px; }
.init-anchor-opt.sel { border-color: var(--accent); background: var(--accent-bg); }
.init-anchor-opt input { margin: 0; }
.init-anchor-opt .init-page-title { flex: 1; font-weight: 600; }
/* Manuelle URL-Verknüpfung inline neben dem Button. */
.init-manual-inline { display: inline-flex; align-items: center; gap: 8px; flex: 1; min-width: 260px; }
.init-manual-inline .init-manual-label { flex: 0 0 auto; white-space: nowrap; margin: 0; }
.init-manual-inline .init-input { min-width: 160px; }
/* Kurztext + Beispielseiten-Links unter der Seitenliste. */
.init-examples-note { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin: 0 0 8px; }
.init-examples-note a { font-weight: 700; color: var(--accent-text); text-decoration: none; white-space: nowrap; }
.init-examples-note a:hover { text-decoration: underline; }
/* Mitlaufende Qualitätsbewertung — dauerhaft oben sichtbar (sticky), farblich hinterlegt. */
.init-quality { position: sticky; top: 8px; z-index: 5; border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 16px; margin: 4px 0 14px; background: var(--panel); box-shadow: 0 3px 12px rgba(20,22,26,.10); }
.init-quality.ok { border-color: #7cc292; background: var(--green-bg); }
.init-quality.warn { border-color: var(--yellow); background: var(--yellow-bg); }
.init-quality.bad { border-color: #d98b8b; background: #fdecea; }
.init-quality-top { display: flex; align-items: baseline; justify-content: space-between; }
.init-quality-title { font-size: 12.5px; font-weight: 800; color: var(--text); }
.init-quality-pct { font-size: 18px; font-weight: 800; }
.init-quality.ok .init-quality-pct { color: var(--green); }
.init-quality.warn .init-quality-pct { color: var(--yellow); }
.init-quality.bad .init-quality-pct { color: #c0392b; }
.init-quality-bar { height: 7px; border-radius: 999px; background: var(--gray-bg); overflow: hidden; margin: 7px 0 9px; }
.init-quality-bar > span { display: block; height: 100%; border-radius: 999px; transition: width .3s; }
.init-quality.ok .init-quality-bar > span { background: var(--green); }
.init-quality.warn .init-quality-bar > span { background: var(--yellow); }
.init-quality.bad .init-quality-bar > span { background: #c0392b; }
.init-quality-items { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.init-q-item { font-size: 12px; font-weight: 600; }
.init-q-item.ok { color: var(--green); }
.init-q-item.warn { color: var(--yellow); }
.init-q-item.missing { color: var(--text-muted); }
.init-q-item.na { color: var(--text-muted); opacity: .6; }
/* Namensprüfung (Nomenklatur-Warnungen). */
.init-nomen { margin: 12px 0 4px; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--panel); }
.init-nomen.ok { border-color: #a6d8b0; background: var(--green-bg); }
.init-nomen.warn { border-color: var(--yellow); background: var(--yellow-bg); }
.init-nomen-h { font-size: 12.5px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.init-nomen-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; padding: 3px 0; }
.init-nomen-label { flex: 0 0 130px; color: var(--text-muted); }
.init-nomen-val { flex: 1; color: var(--text); word-break: break-word; }
.init-nomen-bad { color: #9a5b00; font-weight: 700; font-size: 12px; }
.init-nomen-hint { margin-top: 8px; font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }
/* Kapazitäts-Namen (empfohlen vs. aktuell). */
.init-cap-names { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.init-cap-name { font-size: 12.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.init-cap-lbl { color: var(--text-muted); min-width: 130px; }
.init-cap-name code { background: var(--gray-bg); padding: 3px 7px; border-radius: 6px; font-size: 12px; }
.init-cap-statuswarn { margin-top: 8px; padding: 8px 12px 8px 10px; border: 1px solid var(--yellow); background: var(--yellow-bg); border-radius: 8px; font-size: 12px; color: #7a4e00; line-height: 1.4; }
.init-cap-statuswarn ul { margin: 0; padding-left: 18px; }
.init-cap-statuswarn li { margin: 2px 0; }
.init-pages { margin: 4px 0 0; padding-left: 20px; font-size: 12.5px; color: var(--text); }
.init-pages li { margin: 2px 0; }
.init-pages-result { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.init-page-link { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); color: var(--text); transition: background .12s, border-color .12s; }
.init-page-link:hover { background: var(--accent-bg); border-color: var(--accent-text); }
.init-page-ico { color: #1a7f37; font-weight: 800; }
.init-page-title { font-weight: 700; font-size: 13px; flex: 1; }
.init-page-tag { font-size: 11px; color: var(--text-muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
.init-page-tag.ok { color: #1a7f37; border-color: #a6d8b0; background: #eafaef; }
.init-page-open { font-size: 12px; font-weight: 700; color: var(--accent-text); white-space: nowrap; }
.init-todo { background: var(--gray-bg); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; color: var(--text-muted); }
.init-ov { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 14px; }
.init-ov-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); }
.init-ov-dot { width: 20px; height: 20px; flex: 0 0 20px; display: flex; align-items: center; justify-content: center; border-radius: 999px; font-size: 12px; font-weight: 800; }
.init-ov-dot.ok { color: #1a7f37; background: #eafaef; border: 1px solid #a6d8b0; }
.init-ov-dot.off { color: var(--text-muted); background: var(--gray-bg); border: 1px solid var(--border); }
.init-ov-ico { flex: 0 0 auto; font-size: 15px; line-height: 1; }
.init-ov-main { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.init-ov-jump { flex: 0 0 auto; border: 1px solid var(--yellow); background: var(--yellow-bg); color: #7a4e00; border-radius: 999px; padding: 2px 10px; font-size: 11px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.init-ov-jump:hover { background: #f7ead0; }
/* Superadmin: Initialisierung zurücknehmen. */
.init-undo { border-color: #e0a3a3; background: #fdf6f6; }
/* Lucide-Icons als Ersatz der Emoji-Systemsymbole. Erben Farbe/Größe vom Text. */
.ic { width: 1.05em; height: 1.05em; display: inline-block; vertical-align: -0.16em; flex-shrink: 0; }
.ic-ok { color: var(--green); }
.ic-bad { color: #c0392b; }
.ic-warn { color: var(--yellow); }
.ic-muted { color: var(--text-muted); }
.ic-accent { color: var(--accent-text); }
/* Etwas Abstand, wenn ein Icon direkt vor Text/Button-Label steht. */
.btn .ic, .mini-btn .ic, .init-s2-head .ic, .ma-drill-h .ic, .init-nomen-h .ic { margin-right: 5px; }
/* ETA-Drill-down (Auslastung je Projekt). */
/* Mitarbeiter-Link: Textfarbe (nicht blau), aber unterstrichen. */
.ma-drill { color: var(--text); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.ma-drill:hover { color: var(--text); text-decoration: underline; }
.ma-drill-sum { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 14px; }
.ma-drill-h { font-size: 12.5px; font-weight: 800; margin-bottom: 8px; }
.ma-drill-h.ok { color: var(--green); }
.ma-drill-h.no { color: var(--text-muted); }
.ma-drill-tag { font-size: 10.5px; color: var(--text-muted); border: 1px solid var(--border); border-radius: 999px; padding: 0 6px; margin-left: 4px; }
.ma-drill-note { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
/* Monats-Strip: Auslastung je Monat, klickbar zum Umschalten im Popup. */
.ma-drill-monthswrap { margin-bottom: 16px; }
.ma-drill-months-h { font-size: 12.5px; font-weight: 800; margin-bottom: 8px; color: var(--text); }
.ma-drill-months { display: flex; align-items: flex-end; gap: 8px; overflow-x: auto; padding: 4px 2px 2px; }
.ma-drill-mbar { display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer; flex: 0 0 auto; min-width: 40px; padding: 4px; border-radius: 8px; transition: background .12s; }
.ma-drill-mbar:hover { background: var(--gray-bg); }
.ma-drill-mbar.active { background: var(--accent-bg); outline: 1.5px solid var(--accent); }
.ma-drill-mbar .mb-pct { font-size: 11px; font-weight: 700; color: var(--text); }
.ma-drill-mbar .mb-track { width: 24px; height: 72px; display: flex; align-items: flex-end; background: var(--gray-bg); border-radius: 5px; overflow: hidden; }
.ma-drill-mbar.active .mb-track { background: #fff; }
.ma-drill-mbar .mb-fill { width: 100%; border-radius: 5px 5px 0 0; min-height: 3px; }
.ma-drill-mbar .mb-fill.g { background: var(--green); }
.ma-drill-mbar .mb-fill.y { background: var(--yellow); }
.ma-drill-mbar .mb-fill.r { background: var(--red); }
.ma-drill-mbar .mb-lbl { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.ma-drill-mbar.active .mb-lbl { color: var(--text); font-weight: 700; }
.ma-drill-monthlabel { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.ma-year-note { font-size: 12px; font-weight: 500; color: var(--text-muted); }
/* Zwei Torten nebeneinander. */
.ma-drill-pies { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 680px) { .ma-drill-pies { grid-template-columns: 1fr; } }
.ma-drill-piecol { border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.ma-drill-pieblock { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.ma-drill-svg { flex: 0 0 auto; }
.ma-drill-legend { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 5px; }
.ma-drill-leg { display: flex; align-items: baseline; gap: 7px; font-size: 12px; }
.ma-drill-leg .ma-dot { flex: 0 0 auto; align-self: center; }
.ma-drill-leg-name { flex: 1; color: var(--text); word-break: break-word; }
.ma-drill-leg-name a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.ma-drill-leg-val { flex: 0 0 auto; color: var(--text-muted); font-weight: 700; white-space: nowrap; }
.ma-drill-empty { padding: 8px 0; }
/* Hervorgehobene Kennzahlen unter den Torten. */
.ma-drill-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
@media (max-width: 680px) { .ma-drill-kpis { grid-template-columns: 1fr; } }
.ma-drill-kpi { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; text-align: center; background: var(--panel); }
.ma-drill-kpi .k-val { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1.05; }
.ma-drill-kpi .k-unit { font-size: 15px; font-weight: 800; }
.ma-drill-kpi .k-sub { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-top: 2px; }
.ma-drill-kpi .k-lbl { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; font-weight: 600; }
.ma-drill-kpi.ok { border-color: #a6d8b0; background: var(--green-bg); }
.ma-drill-kpi.ok .k-val { color: var(--green); }
.ma-drill-kpi.no { border-color: var(--border); background: var(--gray-bg); }
.btn.init-danger { border-color: #d98b8b; color: #b23b3b; }
.btn.init-danger:hover { background: #fdecea; }
.init-ov-label { font-size: 13px; font-weight: 600; color: var(--text); }
.init-ov-detail { font-size: 11.5px; color: var(--text-muted); }
.init-ov-dim { color: var(--text-muted); }
.init-ov-link { font-size: 12px; font-weight: 700; color: var(--accent-text); text-decoration: none; white-space: nowrap; }
.init-ov-link:hover { text-decoration: underline; }
.init-ov-missing { font-size: 11px; color: var(--text-muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
/* Empfehlungen (Schritt 4) */
.init-rec { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
@media (max-width: 720px) { .init-rec { grid-template-columns: 1fr; } }
.init-rec-block { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--panel); }
.init-rec-h { font-size: 12.5px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.init-rec-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.init-rec-list li { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--text); line-height: 1.35; }
.init-rec-ico { color: var(--accent-text); font-weight: 800; flex: 0 0 auto; }
.init-rec-ico.tip { color: #c88a00; }
.init-rec-jump { margin-left: auto; flex: 0 0 auto; border: 1px solid var(--border); background: var(--panel); border-radius: 6px; padding: 1px 8px; font-size: 11px; font-weight: 700; cursor: pointer; color: var(--accent-text); white-space: nowrap; }
.init-rec-jump:hover { background: var(--accent-bg); }

/* MA: Abrechnungslücke je Projekt */
.ma-gap-card { margin-top: 12px; }
.ma-gap-total { font-size: 13px; font-weight: 700; color: var(--text); background: var(--gray-bg); border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; text-align: center; }
.ma-gap-legend { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.ma-gap-row { display: grid; grid-template-columns: 220px 1fr auto; gap: 10px; align-items: center; margin-bottom: 6px; }
.ma-gap-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ma-gap-bar { height: 14px; background: #e0a53c; border-radius: 4px; overflow: hidden; min-width: 4px; }
.ma-gap-inv { display: block; height: 100%; background: var(--green); }
.ma-gap-meta { font-size: 12px; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .ma-gap-row { grid-template-columns: 1fr auto; } .ma-gap-bar { grid-column: 1 / -1; } }

/* MA: Projekt-Klassifizierung — aktive Einstufung hervorheben */
.ma-proj-set { padding: 2px 9px; font-size: 12px; opacity: .6; }
.ma-proj-set.active { opacity: 1; background: var(--accent, #2f6fed); color: #fff; border-color: transparent; font-weight: 700; }

/* MA: Fortschrittsbalken für laufende Berechnungen (Monat/Jahr) */
.ma-prog { display: inline-flex; align-items: center; width: 160px; height: 8px; background: var(--gray-bg); border-radius: 6px; overflow: hidden; vertical-align: middle; }
.ma-prog-fill { height: 100%; width: 0; background: var(--green); border-radius: 6px; transition: width .3s ease; }

/* MA: Summe/Soll-Zelle — Summe farbig (grün ≥ Soll, rot < Soll) */
.ma-sum { display: inline-block; padding: 1px 7px; border-radius: 6px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ma-sum.ok { background: var(--green-bg); color: var(--green); }
.ma-sum.bad { background: var(--red-bg); color: var(--red); }

/* MA: zwei Überblick-Torten nebeneinander */
.ma-overviews { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.ma-overviews .ma-overview { flex: 1; min-width: 300px; margin-bottom: 0; }

/* MA: klickbare/hoverbare Torten-Segmente + Klassen-Filter */
.ma-pie-seg { cursor: pointer; transition: stroke-width .12s ease; }
.ma-pie-seg:hover { stroke-width: 25; }
.ma-util-leg { cursor: pointer; border-radius: 6px; padding: 1px 4px; margin: 0 -4px; }
.ma-util-leg:hover { background: var(--gray-bg); }
.ma-util-leg.active { background: var(--accent-bg); font-weight: 700; }
.ma-filter-chip { display: inline-block; background: var(--accent-bg); color: var(--accent-text); border-radius: 8px; padding: 5px 11px; font-size: 12.5px; margin-bottom: 10px; }
.ma-filter-chip a { color: var(--accent-text); font-weight: 700; }

/* MA-Tabelle: Zebra-Zeilen (abwechselnd weiß / hellgrau) */
.ma-table tbody tr:nth-child(even) { background: var(--gray-bg); }

/* MA-Tabelle: Mitarbeiternamen fett */
.ma-table tbody td:first-child { font-weight: 700; }

/* Rail: Header-Bilder statt Icons */
.rail-btn .rail-img { width: 30px; height: 30px; object-fit: contain; display: block; }

/* =========================================================================
   PCA UI-Feinschliff — NUR die Filterleiste als Karte, gebunden an
   #boardView.ui-clean. Alles andere ist auf das Originaldesign zurückgesetzt.
   ZURÜCKROLLEN: Klasse "ui-clean" von #boardView entfernen (public/index.html)
   ODER diesen Block löschen. Kein Einfluss auf Logik, Markup oder Diagramme.
   ========================================================================= */
/* Such-/Sortier- und Filterzeile als Karten hinterlegen (NICHT die Action-Buttons).
   Der Rest ist bewusst NICHT umgestylt (Originaldesign). */
#boardView.ui-clean .toolbar:not(.toolbar-actions) { gap: 8px; margin: 6px 0 10px; padding: 12px 14px; background: var(--panel); border: 0.5px solid var(--border); border-radius: 14px; }
#boardView.ui-clean .toolbar:not(.toolbar-actions) input[type=text] { border-radius: 8px; border-color: var(--border); }
#boardView.ui-clean .toolbar.toolbar-actions { margin-top: 4px; }
