/* AV-Board — Stile des Moduls js/arbeitsplan.js (Reiter Arbeitsplan, Werkzeug-Check, Selbstkosten).
   Alle Regeln hängen unter .ap-reiter; Farben und Radien kommen aus den Tokens in style.css
   (hell/dunkel über html.dark bzw. [data-theme="dark"]). */

.ap-reiter { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ap-reiter .mitte { text-align: center; }
.ap-reiter td.mitte { font-variant-numeric: tabular-nums; }

/* Leerer Zustand: eine Karte, ein Knopf. */
.ap-karte {
    padding: 26px 20px; text-align: center;
    border: 1px dashed var(--border); border-radius: var(--radius); background: var(--bg);
}
.ap-karte-titel { font-family: var(--font-display); font-weight: 600; font-size: .98rem; }
.ap-karte p { margin: 6px auto 14px; font-size: .82rem; color: var(--text-muted); max-width: 52ch; line-height: 1.5; }

/* Kopfzeile Arbeitsplan: Merkmale als Chips in drei Gruppen. */
.ap-kopfzeile {
    display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center;
    padding: 8px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
}
.ap-gruppe { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.ap-gruppe-label {
    font-family: var(--font-display); font-weight: 600; font-size: .68rem;
    text-transform: uppercase; letter-spacing: .04em; color: var(--primary); margin-right: 3px;
}
.ap-reiter .chip { font-size: .72rem; padding: 1px 8px; }

/* Hinweiszeile (Drift, Katalog-Lücke, Kalkulations-Vorbehalte) — Orange nur hier. */
.ap-hinweis {
    padding: 7px 12px; border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0;
    background: var(--accent-soft); font-size: .8rem; line-height: 1.5; color: var(--text-muted);
}
.ap-hinweis-label { font-weight: 600; color: var(--accent-dark); margin-right: 6px; }
.ap-hinweis ul { margin: 4px 0 0; padding-left: 18px; }
.ap-hinweis li { margin: 2px 0; }

/* Tabellen: schlicht, ruhig, zentrierte Zahlenspalten. */
/* Verdichtet (FB-016 · FB-018, 08.09.2026): Der Browser verteilte die Breite
   gleichmäßig — auf 3812 px stand zwischen Phase und Kostenstelle ein Meter
   Leerraum, während „Arbeitsgang" umbrach. Kein `table-layout: fixed` hier:
   Die Klasse tragen Tabellen mit fünf bis acht Spalten, feste Breiten träfen
   die eine oder die andere. Stattdessen schrumpfen die Zahlen- und
   Aktionsspalten auf ihren Inhalt (`width: 1%` bei auto-layout), und was
   übrig bleibt, geht an den Text. */
.ap-tabelle { width: 100%; font-size: .78rem; }
.ap-tabelle th.mitte, .ap-tabelle td.mitte,
.ap-tabelle th.tat, .ap-tabelle td.tat,
.ap-tabelle td.ap-nowrap { width: 1%; white-space: nowrap; }
.ap-tabelle th { white-space: nowrap; }
.ap-tabelle th .badge { text-transform: none; letter-spacing: 0; }
.ap-tabelle td.ap-nowrap { white-space: nowrap; }
.ap-tabelle td { vertical-align: middle; font-size: .78rem; padding-top: 5px;
    padding-bottom: 5px; overflow-wrap: anywhere; }
.ap-tabelle .ap-gang { min-width: 0; width: auto; }
.ap-tabelle .ap-gang .chip, .ap-tabelle .ap-gang .badge { margin-left: 6px; vertical-align: 1px; }
.ap-tabelle tr.uebernommen td { background: rgba(22,163,74,.05); }
.ap-tabelle tr.gestrichen td { opacity: .55; }
.ap-tabelle tr.gestrichen .ap-gang { text-decoration: line-through; }
.ap-tabelle tr.ohne-werkzeug td { background: var(--st-crit-soft); }
.ap-tabelle tr.ap-ohne-zeit td { background: var(--st-work-soft); }
.ap-tabelle td.stark { font-weight: 700; color: var(--text); }
.ap-tabelle tr.summe td { border-top: 2px solid var(--border); }
.ap-staffeln { font-size: .86rem; }
.ap-staffeln td { padding: 7px 10px; }
.ap-staffeln td.stark { font-size: .92rem; }

/* Aktionen je Planzeile: Pfeile, ersetzen, entscheiden. */
.ap-aktionen { display: inline-flex; align-items: center; gap: 3px; }
.ap-knopf {
    height: 24px; min-width: 24px; padding: 0 6px; border-radius: var(--radius-sm); cursor: pointer;
    border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
    font-family: var(--font-body); font-size: .72rem; line-height: 1; transition: all var(--motion);
}
.ap-knopf.text { padding: 0 8px; font-weight: 600; }
.ap-knopf:hover:not(:disabled) { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); }
/* Wie in der Werteprüfung: Farbe dauerhaft, Füllung beim Zeigen (AL 27.08.2026). */
.ap-knopf.ja   { color: var(--st-done); border-color: color-mix(in srgb, var(--st-done) 40%, var(--border)); }
.ap-knopf.nein { color: var(--st-crit); border-color: color-mix(in srgb, var(--st-crit) 40%, var(--border)); }
.ap-knopf.ja:hover:not(:disabled), .ap-knopf.ja:focus-visible:not(:disabled) {
    background: var(--st-done); border-color: var(--st-done); color: #fff; }
.ap-knopf.nein:hover:not(:disabled), .ap-knopf.nein:focus-visible:not(:disabled) {
    background: var(--st-crit); border-color: var(--st-crit); color: #fff; }
.ap-knopf:disabled { opacity: .35; cursor: not-allowed; }
.ap-wahl {
    max-width: 260px; font-family: var(--font-body); font-size: .78rem; padding: 3px 6px;
    border: 1px solid var(--primary); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text);
}
.ap-leiste { display: flex; gap: 8px; align-items: center; }
.ap-reiter .btn.klein { padding: 4px 11px; font-size: .74rem; }

/* Listen: Entfallen, Lücken, alte Preise. */
.ap-liste { margin: 0; padding-left: 18px; font-size: .8rem; color: var(--text-muted); line-height: 1.5; }
.ap-liste li { margin: 3px 0; }
.ap-liste li.subtil { color: var(--text-subtle); }
.ap-liste .mono { font-size: .76rem; margin-right: 4px; }
.ap-li-titel { color: var(--text); font-weight: 600; margin-right: 6px; }
.ap-liste-titel {
    font-family: var(--font-display); font-weight: 600; font-size: .7rem;
    text-transform: uppercase; letter-spacing: .04em; color: var(--text-subtle); margin-bottom: -6px;
}
.ap-reiter .mehr > summary { font-size: .78rem; }
.ap-reiter .mehr .tabelle-rahmen { margin-top: 8px; }
.ap-reiter .mehr p { max-width: 72ch; }

/* Werkzeuge: Bezeichnung mit Typ-Chip. */
.ap-wz-liste { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.ap-wz { white-space: nowrap; font-size: .8rem; }
.ap-wz .chip { margin-left: 4px; }

/* Stand-Zeile: Text links, Knopf rechts. */
.ap-stand {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding-top: 9px; border-top: 1px solid var(--border);
    font-size: .76rem; color: var(--text-subtle);
}
.ap-stand > span { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ap-stand .btn { margin-left: auto; }
.ap-kosten > .ap-stand { border-top: 0; border-bottom: 1px solid var(--border); padding: 0 0 9px; }

@media (max-width: 1180px) {
    .ap-kopfzeile { gap: 6px 12px; }
    .ap-tabelle td { font-size: .78rem; padding: 4px 6px; }
    .ap-tabelle .ap-gang { min-width: 160px; }
    .ap-wahl { max-width: 200px; }
}

/* Lieferzeit in der Stückliste: Belegjahre in einer eigenen, nicht umbrechenden
   Zeile — sonst wird aus „6 Tage (Belege 2021–2023)“ eine vierzeilige Zelle.
   Seit AP-6 steht „durchschnittlich“ darüber: klein genug, dass die Tage die
   Zelle behalten, deutlich genug, dass niemand die Zahl für eine Zusage hält. */
.lieferzeit .klein,
.lieferzeit .winzig { display: block; white-space: nowrap; }
.lieferzeit .winzig.subtil { margin-bottom: -2px; letter-spacing: .01em; }
/* Kompakte Fassung (v0.9.1, AP-8): „ø 6 T" in einer Zeile, Belege im Tooltip. */
.lieferzeit.kompakt { white-space: nowrap; cursor: help; }
.lieferzeit.kompakt .ø { color: var(--text-subtle); font-weight: 600; }

/* ── Eignung des Werkzeugs bestätigen (F-4) ──────────────────────────────── */
/* Die Chips fransten über die Zeile, sobald BMM sechs Werkzeuge lieferte —
   jetzt bricht die Liste sauber um und der Knopf steht darunter, nicht daneben. */
.ap-eignung { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.ap-werkzeug tr.eignung-zeile td { background: var(--surface-alt, rgba(0,128,201,.05)); }
.ap-werkzeug .ap-wz-liste { max-width: 46ch; }

/* Kundenwissen aus der Erhebung, am Arbeitsplan zum Dagegenhalten (F-9). */
.ap-kundenwissen .ap-li-titel { display: block; }
.ap-kundenwissen li { margin-bottom: 10px; }

/* ── Verschnitt-Schalter in den Selbstkosten (v0.9.1, AP-7/V-8) ──────────── */
/* Er gilt für die ganze Kalkulation; ohne Verschnitt ist sie ein Vergleichswert,
   keine Angebotsgrundlage — deshalb steht das Badge daneben. */
.kalk-verschnitt {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin: 8px 0 4px; font-size: .82rem;
}
.kalk-verschnitt .schalter { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.kalk-verschnitt input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; }

/* ── Werkzeug einer Nachbarvariante (AL 27.08.2026) ──────────────────────── */
/* Ein Hinweis, keine Freigabe: gelb wie ein Vorbehalt, nicht grün wie ein Fund. */
.ap-verwandte {
    margin-top: 8px; padding: 8px 10px; border-radius: 8px;
    background: rgba(245, 182, 66, .10); border-left: 3px solid var(--st-work);
}
.ap-verwandt-titel { font-weight: 600; font-size: .8rem; margin-bottom: 5px; }
.ap-verwandt-block { margin-bottom: 8px; }
.ap-verwandt-zeile { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
.ap-verwandt-praez { padding-left: 2px; }
.ap-wz.link { color: var(--primary-dark); text-decoration: none; border-bottom: 1px dotted currentColor; }
.ap-wz.link:hover { border-bottom-style: solid; }
.ap-verwandte.bestaetigt { background: rgba(34,197,94,.08); border-left-color: var(--st-done);
                           display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Werkzeugliste kompakt (FB-6): zwei Einträge sichtbar, der Rest auf Klick. */
.ap-wz-liste { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.ap-wz-mehr { display: inline; }
.ap-wz-mehr > summary {
    display: inline; cursor: pointer; font-size: .74rem; color: var(--primary);
    list-style: none;
}
.ap-wz-mehr > summary::-webkit-details-marker { display: none; }
.ap-wz-mehr[open] > summary { color: var(--text-muted); }
