/* ===========================================================================
   AV-Board — PPS · leiste.css
   Hinweis-Leiste (Plan Editorial 0.30, B-9 / W-5): eine Zeile, Punkt links,
   Kurztext, Zähler, Aktion rechts; Details aufklappbar. Nur Tokens.
   Varianten: .leiste--offen (warn) · .leiste--info · .leiste--rot · .leiste--ok
   =========================================================================== */

.leiste {
    --leiste-farbe: var(--warn);
    margin: var(--sp-2) 0;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-left: 3px solid var(--leiste-farbe);
    border-radius: var(--radius-s);
    font-size: var(--fs-2);
    color: var(--ink);
}
.leiste--offen { --leiste-farbe: var(--warn); }
.leiste--info  { --leiste-farbe: var(--primary); }
.leiste--ok    { --leiste-farbe: var(--ok); }
.leiste--rot   { --leiste-farbe: var(--err); background: var(--err-soft); border-color: var(--err); }

.leiste-zeile {
    display: flex; align-items: center; gap: var(--sp-2);
    min-height: 34px; padding: var(--sp-1) var(--sp-2) var(--sp-1) var(--sp-3);
}
.leiste-punkt {
    flex: none; width: 8px; height: 8px; border-radius: 50%;
    background: var(--leiste-farbe);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--leiste-farbe) 22%, transparent);
}
.leiste-text { flex: 1 1 auto; min-width: 0; line-height: 1.35; }
.leiste-text .leiste-kurz { font-weight: 600; }
.leiste-text .leiste-rest { color: var(--muted); margin-left: .4em; }
.leiste-zahl {
    flex: none; font-family: var(--font-mono); font-size: var(--fs-1); font-weight: 600;
    min-width: 1.6em; padding: 1px var(--sp-2); text-align: center;
    border-radius: var(--radius-pill); color: var(--ink);
    background: color-mix(in srgb, var(--leiste-farbe) 18%, var(--surface));
}
.leiste--rot .leiste-zahl { background: var(--err); color: var(--surface); }
.leiste-aktion {
    flex: none; background: none; border: 0; padding: var(--sp-1) var(--sp-1); cursor: pointer;
    font: 600 var(--fs-2) var(--font-body); color: var(--primary-strong); white-space: nowrap;
    border-radius: var(--radius-s);
}
.leiste-aktion:hover { text-decoration: underline; }
.leiste-aktion:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.leiste-aktion:disabled { color: var(--muted); cursor: not-allowed; text-decoration: none; }
/* Hinweis schließen (AP-9): ein ×, 24 px Zielfläche (WCAG 2.5.8), steht am rechten Rand der Zeile. */
.leiste-zu {
    flex: none; display: inline-flex; align-items: center; justify-content: center;
    min-width: 24px; min-height: 24px; margin-left: auto; padding: 0;
    background: none; border: 0; border-radius: var(--radius-s); cursor: pointer;
    font: 400 var(--fs-4)/1 var(--font-body); color: var(--muted);
}
.leiste-text + .leiste-zu, .leiste-zahl + .leiste-zu, .leiste-aktion + .leiste-zu { margin-left: var(--sp-1); }
.leiste-zu:hover { color: var(--ink); background: color-mix(in srgb, var(--leiste-farbe) 14%, transparent); }
/* Nach dem Schließen springt der Fokus in den Behälter — ohne Rahmen um den ganzen Bereich. */
.fokus-still:focus { outline: none; }
.leiste-zu:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

/* aufklappbar: <details class="leiste"><summary class="leiste-zeile">…</summary><div class="leiste-detail"> */
details.leiste > summary { list-style: none; cursor: pointer; }
details.leiste > summary::-webkit-details-marker { display: none; }
details.leiste > summary .leiste-pfeil {
    flex: none; color: var(--muted); font-size: var(--fs-1); transition: transform .12s;
}
details.leiste[open] > summary .leiste-pfeil { transform: rotate(90deg); }
.leiste-detail {
    padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-6); border-top: 1px solid var(--line);
    display: flex; flex-direction: column; gap: var(--sp-1); font-size: var(--fs-2);
}
.leiste-detail .leiste-eintrag { display: flex; gap: var(--sp-2); align-items: baseline; }
.leiste-detail .leiste-eintrag.entfaellt { color: var(--muted); }
.leiste-detail .eyebrow { flex: none; }
.leiste-verborgen { display: none; }
.leiste-detail input, .leiste-detail select { max-width: 100%; }

/* Leiste als Zeichen bzw. Chip (AL 10.11.2026, tabelle.js leisteHtml ``data-knapp``): kein Kasten, keine Breite —
   info nur ⓘ, offen/ok als Chip mit Kurztext und Zahl, rot als rotes Zeichen mit Zahl. Der Text steht im Tooltip. */
.leiste[data-knapp] {
    width: fit-content; max-width: 100%; margin: var(--sp-1) 0;
    background: none; border: 0; border-radius: var(--radius-pill);
}
.leiste[data-knapp] > .leiste-zeile { min-height: 26px; padding: 0; gap: var(--sp-1); }
.leiste--offen[data-knapp] > .leiste-zeile, .leiste--ok[data-knapp] > .leiste-zeile {
    padding: 1px var(--sp-2) 1px var(--sp-1); border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--leiste-farbe) 10%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--leiste-farbe) 45%, var(--surface));
}
.leiste[data-knapp] .leiste-text { flex: 0 1 auto; }
.leiste-zeichen {
    flex: none; display: inline-flex; align-items: center; justify-content: center;
    min-width: 24px; min-height: 24px; border-radius: var(--radius-pill); color: var(--leiste-farbe); cursor: help;
}
.leiste-zeichen:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.leiste--info[data-knapp] .leiste-zeichen { color: var(--primary-strong); }
.leiste--rot[data-knapp] .leiste-zeichen { color: var(--on-fill); background: var(--err); min-width: 26px; min-height: 26px; }
.leiste--rot[data-knapp] .leiste-zahl { background: var(--err); color: var(--on-fill); }
details.leiste[data-knapp] > summary { width: fit-content; }
details.leiste[data-knapp][open] { width: auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s); }
details.leiste[data-knapp] > summary .leiste-pfeil { display: inline-flex; }
.leiste-satz { margin: 0 0 var(--sp-1); color: var(--muted); }
.leiste--rot .leiste-satz { color: var(--err); font-weight: 600; }
.leiste-zeichen, .leiste-zeichen * { text-decoration: none !important; }
.leiste-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 640px) {
    .leiste-zeile { flex-wrap: wrap; }
    .leiste-text { flex-basis: 100%; order: 2; }
}

/* Maßmodell-Zeile (FB-041): drei Begriffe mit ⓘ, Wert dahinter */
.mm-zeile-text { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-5); align-items: baseline; }
.mm-begriff { display: inline-flex; align-items: baseline; gap: var(--sp-1); }
.mm-begriff .mm-wert { font-size: var(--fs-2); }
.mm-begriff .mm-wert.offen { color: var(--muted); }
.mm-detail { padding-left: var(--sp-3); }

/* Ähnliche Artikelanlagen (FB-044): eine Zeile je Treffer, Details aufklappbar */
.bp-liste { margin: var(--sp-3) 0 var(--sp-1); border-top: 1px solid var(--line); }
.bp-liste > .eyebrow { padding: var(--sp-1) 0 2px; }
.bp-zeile { border-bottom: 1px solid var(--line); }
.bp-zeile > summary {
    display: flex; align-items: center; gap: var(--sp-2); min-height: var(--ctl-h); padding: var(--sp-1) var(--sp-1);
    cursor: pointer; list-style: none; font-size: var(--fs-2);
}
.bp-zeile > summary::-webkit-details-marker { display: none; }
.bp-zeile > summary:hover { background: var(--primary-soft); }
.bp-punkt { flex: none; width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--muted); }
.bp-punkt.gruen { background: var(--ok); border-color: var(--ok); }
.bp-punkt.blau { background: var(--primary); border-color: var(--primary); }
.bp-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-zeile .bp-inhalt { padding: var(--sp-1) var(--sp-1) var(--sp-2) var(--sp-4); }

/* Kundenseite: Vorgangsliste links, Planner-Kacheln rechts (FB-035, B-17) */
.kunde-spalten { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
.kunde-spalten.mit-planner { grid-template-columns: minmax(0, 1fr) minmax(260px, 320px); }
/* AP-UX: Unter 1500 px Fensterbreite rückt der Planner unter die Vorgänge — daneben blieben der
   Vorgangstabelle bei 1366 px nur ≈ 700 px, und „verifiziert“/„Stand“ fielen rechts weg. */
@media (max-width: 1499px) { .kunde-spalten.mit-planner { grid-template-columns: minmax(0, 1fr); } }
.planner-spalte { min-width: 0; }
.planner-spalte:empty { display: none; }
.pk-liste { display: flex; flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-1); }
.pk-kachel {
    display: flex; flex-direction: column; gap: var(--sp-1); padding: var(--sp-2) var(--sp-3);
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s);
    color: var(--ink); text-decoration: none;
}
a.pk-kachel:hover { border-color: var(--primary); box-shadow: var(--shadow-s); }
.pk-titel {
    font-size: var(--fs-2); line-height: 1.35; font-weight: 600;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pk-fuss { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); font-size: var(--fs-1); color: var(--muted); }
.pk-faellig.ueberfaellig { color: var(--err); font-weight: 600; }
.pk-wer { margin-left: auto; }

/* Kennzahlen (Selbstkosten-Staffel, FB-047): Editorial-Zahlen statt Tabelle */
.kz-reihe { display: flex; flex-wrap: wrap; gap: 0; margin: var(--sp-2) 0 var(--sp-1); border-top: 1px solid var(--ink); }
.kz { flex: 1 1 180px; padding: var(--sp-2) var(--sp-4) var(--sp-2) 0; margin-right: var(--sp-4); border-bottom: 1px solid var(--line); }
.kz-gross { font-family: var(--font-display); font-size: var(--fs-6); font-weight: 700; line-height: 1.15; font-variant-numeric: proportional-nums; }
.kz-klein { font-size: var(--fs-1); color: var(--muted); margin-top: 2px; }
.kalk-rechenweg { margin-top: var(--sp-2); }
