/* OSP-Server-Monitor · css/ansichten/projekte.css — Projekte: Apps, Zeit, Offene Punkte (v1.0.0 Stufe B, AP-09).
   Gebaut für den neuen Rahmen (html[data-rahmen="neu"], dunkel fest). Höhe nach Rahmen 2.6: die Ansichten füllen den Inhalt unter der
   Reiterleiste, gescrollt wird nur im Tabellenrumpf, in der Kartenfläche und im Seitenpanel; Schrift nie unter 12 px. */

/* ── Höhe: 100dvh − Kopf 44 − (Polster 16 + Reiterleiste 35) = 95 px; in niedrigen Fenstern (Dichtemodus) Polster 8 → 91 px ── */
html[data-rahmen="neu"] {
  --mp-ok: #4ade80; --mp-warn: #fbbf24; --mp-crit: #f87171; --mp-na: #a9b7cc;
  --mp-abzug: 95px; --mp-chart: 200px;
}
@media (max-height: 560px) { html[data-rahmen="neu"] { --mp-abzug: 91px; --mp-chart: 140px; } }
@media (max-height: 460px) { html[data-rahmen="neu"] { --mp-chart: 112px; } }

.mp { box-sizing: border-box; height: calc(100dvh - var(--mp-abzug)); min-height: 120px; display: flex; flex-direction: column; gap: 8px; }
.mp .sr, .mp-detail .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mp-host { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
.mp-host > .ot { flex: 1 1 0; height: auto; min-height: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.mp-host > .loading { margin: auto; }
.mp-apps .ot-zeile, .mp-offen .ot-zeile { cursor: pointer; }

/* ── Zeilen: in niedrigen Fenstern 2,4 statt 2,5 Schrifthöhen (33,6 px, genau zwei Textzeilen), damit bei 150 % acht Zeilen passen ── */
@media (max-height: 560px) { .mp-host > .ot:not([data-dichte="komfortabel"]) { --ot-zf: 2.4; } }

/* ── Werkzeugleiste: eigene Bedienelemente neben den Knöpfen des Bausteins ──
   Die Suche beginnt schmal (Umbruch entscheidet die Ausgangsbreite, nicht die kleinste), damit die Leiste ab 880 px in einer Zeile bleibt. */
.mp-host .ot-suche { flex: 0 1 9em; }
.mp-werkzeug { display: inline-flex; align-items: center; gap: 6px; }
.mp-werkzeug .info { color: var(--ot-link); }
.mp-umschalter { display: inline-flex; }
.mp-umschalter > button { border-radius: 0; margin-left: -1px; }
.mp-umschalter > button:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.mp-umschalter > button:last-child { border-radius: 0 8px 8px 0; }
.mp-sel { display: block; flex: 0 0 auto; }
.mp-sel .ot-feld { width: auto; min-width: 7em; padding-right: 1.4em; }
.mp-tabtitel { flex: 0 0 auto; padding: 0 .5em 0 .25em; font-weight: 600; white-space: nowrap; color: var(--ot-text); }

/* ── Sortierpfeil des Bausteins: 14 px × 0,85 = 11,9 px liegt knapp unter der Mindestschrift ── */
.mp-host .ot-pfeil { font-size: 12px; }

/* ── Farbe und Link in den Zellen (der Baustein zeichnet nur Text) ── */
.mp-ok { color: var(--mp-ok); }
.mp-warn { color: var(--mp-warn); }
.mp-crit { color: var(--mp-crit); }
.mp-na { color: var(--mp-na); }
.mp-punkt::before { content: "● "; font-size: .85em; }
.mp-na.mp-punkt::before { content: "○ "; }
.ot-z .mp-ok, .ot-z .mp-warn, .ot-z .mp-crit { font-weight: 600; }
.mp-auf { color: var(--mp-ok); }
.mp-ab { color: var(--mp-crit); }
a.mp-name { color: var(--ot-link, var(--blue-2)); font-weight: 600; text-decoration: none; }
a.mp-name:hover, a.mp-sys:hover { text-decoration: underline; }
a.mp-sys { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; color: var(--ot-link, var(--blue-2)); text-decoration: none; }
a.mp-sys svg { width: 12px; height: 12px; }
.mp-farbe { display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 2px; vertical-align: -1px; }
.ot-z .mp-spark, .mp-spark { font-family: var(--mono); letter-spacing: -.5px; }

/* ── Karten ── */
.mp-kbar { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.mp-ksuche { flex: 0 1 18em; min-width: 8em; }
.mp-ksuche input { width: 100%; height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--panel); color: var(--text); font: inherit; font-size: 13px; }
.mp-kzahl { margin-left: auto; color: var(--text-2); font-size: 12px; white-space: nowrap; }
.mp-knopf { min-height: 28px; padding: 0 12px; font: inherit; font-size: 13px; color: var(--text); background: var(--panel); border: 1px solid var(--border-2); cursor: pointer; }
.mp-knopf[aria-pressed="true"] { background: #0070B0; border-color: #0070B0; color: #fff; }
.mp-knopf:not([aria-pressed="true"]):hover { background: var(--panel-2); }
.mp-host > .mp-karten { flex: 1 1 0; min-height: 0; overflow: auto; scrollbar-gutter: stable; display: grid; gap: 10px; align-content: start; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); padding: 2px 2px 8px; }
.mp-karte { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: linear-gradient(180deg, var(--panel), var(--panel-2)); border: 1px solid var(--border); border-radius: var(--radius); }
.mp-karte:hover { border-color: var(--border-2); }
.mp-karte__kopf { display: flex; align-items: center; gap: 9px; min-width: 0; }
.mp-karte__kopf .pcard__img, .mp-karte__kopf .pcard__ic { flex: none; border-radius: 7px; }
.mp-karte__name { display: flex; align-items: center; min-height: 24px; flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-karte__name::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }        /* ganze Karte klickbar */
.mp-karte__name:focus-visible { outline: none; }
.mp-karte:focus-within { outline: 2px solid var(--blue-2); outline-offset: 2px; }
.mp-karte__zweck { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 3 * 1.45em; max-width: 75ch; }
.mp-karte__zahlen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.mp-zahl { display: inline-flex; align-items: baseline; gap: 5px; font-size: 12px; }
.mp-zahl .l { color: var(--text-3); }
.mp-zahl b { font-size: 16px; font-variant-numeric: tabular-nums; }
.mp-zahl small { font-size: 12px; }
.mp-karte__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.mp-karte__fuss { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.mp-karte__git { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-karte .mp-sys { position: relative; z-index: 1; flex: none; min-height: 24px; }

/* ── Detailseite einer App (AP-14b, B-03) ──
   Kopf, Kennzahlen und Reiter stehen fest; nur die Fläche unter den Reitern scrollt in sich (Rahmen 2.6: kein Seitenscroll).
   Höhe wie die Listen: 100dvh − Abzug (Kopf 44, Polster, Reiterleiste der Projekte). */
.mp-detail { box-sizing: border-box; height: calc(100dvh - var(--mp-abzug)); min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.mp-detail > * { flex: none; }
.mp-dkopf { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 0; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.mp-dkopf img, .mp-dkopf .pcard__ic { border-radius: 7px; }
.mp-dkopf__zweck { flex: 1 1 320px; min-width: 0; max-width: 75ch; font-size: 13px; line-height: 1.4; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mp-dkopf__links { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.mp-dkopf .btn { text-decoration: none; }
.mp-dstats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; margin: 0; }
.mp-dstats .dstat { padding: 6px 10px; gap: 1px; }
.mp-dstats .dstat .l, .mp-dstats .dstat .s { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-dstats .dstat .v { font-size: 16px; white-space: nowrap; }
@media (max-width: 1100px) { .mp-dstats .dstat .s { display: none; } }
@media (max-height: 560px) { .mp-dstats .dstat .s { display: none; } .mp-dstats .dstat { padding: 3px 10px; } .mp-dstats .dstat .v { font-size: 15px; } }

.mp-d-reiter { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); }
.mp-d-tab { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 12px; border: 0; border-radius: 8px 8px 0 0; background: transparent; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.mp-d-tab:hover { background: var(--panel); color: var(--text); }
.mp-d-tab[aria-selected="true"] { background: var(--panel-2); color: var(--text); box-shadow: inset 0 -2px 0 var(--blue-2); }
.mp-d-n { font: 600 12px var(--mono); color: var(--text-2); }
.mp-d-flaeche { flex: 1 1 0; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; padding: 10px 14px; background: linear-gradient(180deg, var(--panel), var(--panel-2)); border: 1px solid var(--border); border-radius: var(--radius); }
.mp-d-pane { outline: none; }
.mp-d-pane:focus-visible { outline: 2px solid var(--blue-2); outline-offset: 4px; }
.mp-d-abschnitt + .mp-d-abschnitt { margin-top: 14px; }
.mp-d-h { margin: 0 0 6px; font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text); }
.mp-clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.mp-detail .sesrow .sub, .mp-detail .cellsub, .mp-detail .tbar__v, .mp-detail .muted, .mp-detail .clfoot, .mp-detail .cld, .mp-detail .clt, .mp-detail .cll, .mp-detail .gwarn, .mp-detail .gfile, .mp-detail .mrow, .mp-detail .badge, .mp-detail .tag, .mp-detail .empty { font-size: 12px; }
.mp-kzreihe { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 8px; }
.mp-kz { display: flex; flex-direction: column; gap: 1px; }
.mp-kz .l { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.mp-kz b { font-size: 22px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.mp-kz small { font-size: 12px; color: var(--text-2); }
.mp-verlauf { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 10px; margin-bottom: 4px; }
.mp-verlauf .l { font-size: 12px; color: var(--text-3); }
.mp-befunde { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mp-befunde li { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; line-height: 1.45; }
.mp-befunde li.empty { padding: 4px 0; }
.mp-bkz { flex: none; color: var(--text-3); font-size: 12px; }
.mp-btitel { min-width: 0; color: var(--text-2); }
.mp-datei { margin-top: 12px; font-size: 12px; color: var(--text-3); }
.mp-datei code { padding: 1px 6px; border-radius: 5px; background: var(--panel-2); color: var(--text-2); }
.mp-detail .btn.danger { background: linear-gradient(145deg, #c93c35, #a8261f); }        /* Weiß darauf ≥ 4,5 : 1 */
.mp-detail .tbl-mini th, .mp-detail .tbl-mini td { font-size: 12px; }
.mp-detail .dstat .v.mp-ok { color: var(--mp-ok); }
.mp-detail .dstat .v.mp-warn { color: var(--mp-warn); }
.mp-detail .dstat .v.mp-crit { color: var(--mp-crit); }

/* ── Zeit ──
   Zwei Tabellen nebeneinander haben je weniger als 700 px: Dichte, Export, Zähler, Zurücksetzen und der Filter-Schalter entfallen dort unter
   1800 px Fensterbreite, damit die Leiste einzeilig bleibt (Überschrift, Suche und Spalten bleiben; die Filterzeile steht in hohen Fenstern offen). */
.mp-zeit__chart { position: relative; flex: 0 0 var(--mp-chart); height: var(--mp-chart); padding: 6px 10px 2px; background: linear-gradient(180deg, var(--panel), var(--panel-2)); border: 1px solid var(--border); border-radius: var(--radius); }
.mp-zeit__chart canvas { position: absolute; inset: 6px 10px 2px; }
.mp-zeit__tabellen { flex: 1 1 0; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mp-zeit__tabellen > .mp-host { min-width: 0; }
.mp-zeit .ot-leiste { flex-wrap: wrap; }

@media (max-width: 1799px) {
  .mp-zeit .ot-leiste [data-akt="dichte"], .mp-zeit .ot-leiste [data-akt="export"], .mp-zeit .ot-leiste [data-akt="reset"],
  .mp-zeit .ot-leiste [data-akt="filter"], .mp-zeit .ot-zaehler { display: none; }
  .mp-zeit .ot-suche { flex-basis: 6em; }
}
/* Statusauswahl der Offenen Punkte erst, wo die Leiste breit genug ist; sonst gilt die Filterzeile (Spalte Status). */
@media (max-width: 1249px) { .mp-sel--status { display: none; } }

/* ── Seitenpanel (Offene Punkte) ── */
.mp-panel { width: min(460px, 100vw); display: flex; flex-direction: column; overflow: hidden; outline: none; }
.mp-panel .drawer__hd { flex: none; }
.mp-panel .drawer__hd h3 { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.mp-panel__bd { flex: 1; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; }
.mp-panel__bd .dexplain { max-width: 75ch; overflow-wrap: anywhere; }
.mp-panel__bd .gfiles { display: flex; flex-direction: column; gap: 4px; }
.mp-panel__bd .gfile { display: flex; gap: 8px; align-items: baseline; font-size: 12px; overflow-wrap: anywhere; }
.mp-panel__bd .drow .v { overflow-wrap: anywhere; }
.mp-panel__ft { flex: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--bg-2); }
.mp-panel__ft .btn { min-height: 28px; }

/* ── Schmale und niedrige Fenster ── */
@media (max-width: 1000px) {
  .mp-zeit__tabellen { grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .mp-dkopf__links { margin-left: 0; }
}
