/* =====================================================
   Segmented Control (Pill-Track + gefuelltes Aktiv-Segment)
   SSoT fuer alle Umschalter: EUR/AOA-Waehrungstoggle,
   Monat/Quartal-Steuer-View-Toggle und kuenftige Switcher.

   Affordanz: eingelassene "Rille" als Track (signalisiert
   Schaltbarkeit) + satte Primary-Pille fuer das aktive
   Segment (signalisiert Auswahl). Token-basiert -> Dark-
   und High-Contrast-Theme greifen automatisch.

   Aktiv-Klasse: .is-active (kanonisch). Legacy-Aliasse
   (.currency-toggle*) erben dieselbe Optik unveraendert.
   ===================================================== */

.lp-segmented,
.currency-toggle {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
    flex-wrap: nowrap;
}

.lp-segmented-btn,
.currency-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-width: 2.75rem;
    border: none;
    background: transparent;
    color: var(--color-muted);
    border-radius: 6px;
    padding: 0.34rem 0.8rem;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.lp-segmented-btn:hover:not(.is-active),
.currency-toggle-btn:hover:not(.is-active) {
    background: var(--color-hover);
    color: var(--color-text);
}

.lp-segmented-btn.is-active,
.currency-toggle-btn.is-active {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 1px 3px rgba(var(--color-primary-rgb, 37, 99, 235), 0.45);
}

.lp-segmented-btn:focus-visible,
.currency-toggle-btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Icons innerhalb eines Segments (z.B. Monat/Quartal) auf
   schmalen Viewports ausblenden -- Label bleibt sichtbar. */
@media (max-width: 600px) {
    .lp-segmented-btn i {
        display: none;
    }

    .lp-segmented-btn {
        padding: 0.3rem 0.55rem;
        font-size: 0.75rem;
    }
}

/* =====================================================
   Currency Toggle — EUR/AOA-Umschalter als Segmented-Control
   Zwei gleichwertige Segmente (€ | Kz); das aktive Segment ist
   satt gefuellt (Primary). Teilt die Optik mit .lp-segmented,
   damit app-weit nur EIN Umschalt-Paradigma existiert (statt
   Slider neben Segmented im selben Dialog). State-Treiber bleibt
   das data-curr-Attribut am Container — rein CSS-gesteuert, kein
   .is-active-Klassen-Juggling im JS noetig.

   Markup unveraendert (Abwaertskompatibilitaet zu 9 Views):
   die __label-Spans werden zu Segmenten, __track/__knob sind
   nicht mehr sichtbar.
   ===================================================== */
.lp-curr-switch {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    user-select: none;
}

/* Legacy-Slider-Innereien — im Segmented-Layout nicht mehr genutzt. */
.lp-curr-switch__track,
.lp-curr-switch__knob {
    display: none;
}

.lp-curr-switch__label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    padding: 0.34rem 0.7rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-muted);
    text-align: center;
    transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.lp-curr-switch__label:hover {
    color: var(--color-text);
}

/* Aktives Segment: gefuellte Primary-Pille (wie .lp-segmented-btn.is-active). */
.lp-curr-switch[data-curr="eur"] .lp-curr-switch__label-eur,
.lp-curr-switch[data-curr="aoa"] .lp-curr-switch__label-aoa {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 1px 3px rgba(var(--color-primary-rgb, 37, 99, 235), 0.45);
}

/* Aktives Segment nicht weiter aufhellen beim Hover. */
.lp-curr-switch[data-curr="eur"] .lp-curr-switch__label-eur:hover,
.lp-curr-switch[data-curr="aoa"] .lp-curr-switch__label-aoa:hover {
    color: #fff;
}

/* =====================================================
   Currency-Affix — €/Kz-Praefix in Betrags-Inputs
   Spiegelt die aktive Waehrung des zugehoerigen
   lp-curr-switch. Verknuepfung: <span class="cur-affix"
   data-currency-affix-for="<hidden-currency-input-id>">.
   Live-Update via initCurrencyAffixes() (app.utils.js),
   das auf das 'change'-Event des Hidden-Inputs hoert (das
   currSwitchSet beim Umschalten feuert). SSoT-Affix fuer
   Gehalt, Ausgaben und Sonderzahlungen.
   ===================================================== */
.cur-affix-field {
    position: relative;
    display: flex;
    align-items: stretch;
}
.cur-affix-field .cur-affix {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-muted);
    background: var(--color-surface-alt);
    border-right: 1px solid var(--color-border);
    border-radius: var(--radius) 0 0 var(--radius);
    pointer-events: none;
    z-index: 1;
}
.cur-affix-field .form-control {
    flex: 1 1 auto;
    min-width: 0;
    padding-left: 3.1rem;
}

