/*
    fluktuation.css - Styles fuer die Fluktuation-Simulation
    (werkzeuge/fluktuation-simulation.htm).

    Baut auf legal.css + article.css auf (Segoe-UI-Stack, Akzent
    #3498db, Karten auf #ecf0f1); enthaelt nur die Zusuetze fuer das
    interaktive Tool (Presets, Formularfelder, Team-Tabelle,
    Ergebnis-Karten, Chart-Box).

    ASCII-Kommentare wie article.css, Umlaute transliteriert.
*/

/* ------------------------------------------------------------------
   Buttons (Presets, Zeile hinzufuegen, Berechnen)
   ------------------------------------------------------------------ */
.fl-btn {
    font: inherit;
    font-size: 0.95rem;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
}

.fl-btn-primary {
    background: #3498db;
    color: #fff;
    border: 1px solid #2980b9;
}

.fl-btn-primary:hover {
    background: #2980b9;
}

.fl-btn-ghost {
    background: #fff;
    color: #2c3e50;
    border: 1px solid #bdc3c7;
}

.fl-btn-ghost:hover {
    border-color: #3498db;
    color: #3498db;
}

.fl-presets {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 20px 0 6px 0;
}

/* ------------------------------------------------------------------
   Hinweiszeilen (klein, grau)
   ------------------------------------------------------------------ */
.fl-hint {
    font-size: 0.88rem;
    color: #7f8c8d;
    margin-bottom: 12px;
}

/* ------------------------------------------------------------------
   Projektdaten: 4 Felder nebeneinander (breitenadaptiv)
   ------------------------------------------------------------------ */
.fl-project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin: 10px 0 6px 0;
}

.fl-field label {
    display: block;
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 4px;
}

.fl-field input,
.fl-team input,
.fl-team select {
    font: inherit;
    font-size: 0.95rem;
    width: 100%;
    padding: 7px 9px;
    border: 1px solid #bdc3c7;
    border-radius: 6px;
    background: #fff;
    color: #333;
}

.fl-field input:focus,
.fl-team input:focus,
.fl-team select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.15);
}

/* ------------------------------------------------------------------
   Team-Tabelle (editierbar; auf schmalen Screens horizontal scrollbar)
   ------------------------------------------------------------------ */
.fl-table-scroll {
    overflow-x: auto;
    margin: 6px 0 14px 0;
}

.fl-team {
    width: 100%;
    border-collapse: collapse;
}

.fl-team th {
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    text-align: left;
    background: #f8f9fa;
    padding: 8px;
    border-bottom: 2px solid #e3e7ea;
    white-space: nowrap;
}

.fl-team td {
    padding: 6px;
    border-bottom: 1px solid #eef1f3;
    vertical-align: middle;
}

/* Zahlenspalten etwas schmaler halten */
.fl-col-num {
    width: 96px;
    min-width: 80px;
}

.fl-col-action {
    width: 36px;
    text-align: center;
}

.fl-remove-row {
    background: none;
    border: none;
    color: #bdc3c7;
    font-size: 1.2rem;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
}

.fl-remove-row:hover {
    color: #c0392b;
}

/* ------------------------------------------------------------------
   Fehlerliste (Validierung, wie Berechnen()-MsgBoxen des Originals)
   ------------------------------------------------------------------ */
.fl-errors {
    display: none;   /* wird von fluktuation.js bei Fehlern eingeblendet */
    list-style: disc;
    background: #fdedec;
    border: 1px solid #f5b7b1;
    border-left: 4px solid #c0392b;
    border-radius: 0 8px 8px 0;
    color: #922b21;
    padding: 12px 18px 12px 34px;
    margin: 18px 0;
}

.fl-errors li {
    margin-bottom: 4px;
}

/* ------------------------------------------------------------------
   Ergebnis-Karten (Projekt!B10/B11/B12)
   ------------------------------------------------------------------ */
.fl-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin: 10px 0;
}

.fl-result {
    background: #f8f9fa;
    border: 1px solid #e3e7ea;
    border-radius: 8px;
    padding: 14px 16px;
}

.fl-result-label {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.4;
    margin-bottom: 6px;
}

.fl-result-value {
    font-size: 1.6rem;
    font-weight: 600;
    color: #2c3e50;
}

/* Verzoegerung einfaerben: > 0 kritisch (rot), < 0 Reserve (gruen) */
.fl-result-value.fl-vz-pos {
    color: #c0392b;
}

.fl-result-value.fl-vz-neg {
    color: #27ae60;
}

/* ------------------------------------------------------------------
   Chart (Chart.js, responsive; Hoehe ueber Container)
   ------------------------------------------------------------------ */
.fl-chart-box {
    position: relative;
    height: 340px;
    margin: 8px 0;
}

/* ------------------------------------------------------------------
   Fussnote (GPL-/Quellenhinweis)
   ------------------------------------------------------------------ */
.fl-footnote {
    font-size: 0.88rem;
    color: #7f8c8d;
    margin-top: 28px;
    padding-top: 14px;
    border-top: 1px solid #eef1f3;
}

/* ------------------------------------------------------------------
   Screenreader-Text (Tabellenkopf der Aktionspalte)
   ------------------------------------------------------------------ */
.fl-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ------------------------------------------------------------------
   Kleine Screens (wie article.css: Knob, 479px)
   ------------------------------------------------------------------ */
@media (max-width: 479px) {
    .fl-chart-box {
        height: 240px;
    }

    .fl-result-value {
        font-size: 1.35rem;
    }
}
