/*
 * AlpacaSpar Design System
 * Token-Layer ueber Bootstrap 5 - vereinheitlicht Farben, Radien, Schatten,
 * Buttons und mobile Patterns. Wird auf jeder Seite NACH Bootstrap geladen.
 */

:root {
    /* Farben */
    --as-cream: rgb(252, 247, 235);
    --as-cream-soft: rgb(255, 249, 240);
    --as-page-bg: #faf8f3;
    --as-surface: #ffffff;
    --as-border: #e9e2d4;
    --as-border-soft: #f0ebe0;
    --as-text: #212529;
    --as-text-muted: #6c757d;
    --as-green: #2e7d46;
    --as-green-dark: #256639;
    --as-green-soft: #edfaf4;
    --as-red: #b02a37;
    --as-red-soft: #fdefe9;
    --as-accent: #5a9dad;

    /* Form - Koppel: sehr runde Ecken, weiche Schatten */
    --as-radius: 1.25rem;
    --as-radius-sm: 0.875rem;
    --as-radius-pill: 999px;
    --as-shadow: 0 1px 2px rgba(33, 37, 41, 0.04), 0 6px 18px rgba(33, 37, 41, 0.06);
    --as-shadow-raised: 0 2px 6px rgba(33, 37, 41, 0.06), 0 12px 32px rgba(33, 37, 41, 0.09);

    /* Typo - Koppel: gerundeter Font-Stack fuer Headings/Kennzahlen */
    --as-font-rounded: ui-rounded, -apple-system, 'SF Pro Rounded', system-ui, sans-serif;

    /* Bottom-Tab-Bar */
    --as-bottom-nav-height: 60px;

    /* Bootstrap-Variablen ueberschreiben */
    --bs-body-bg: var(--as-page-bg);
    --bs-body-color: var(--as-text);
}

body {
    background-color: var(--as-page-bg);
}

/* ---------- Typografie (Koppel: gerundet-freundlich) ---------- */

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.navbar-brand,
.card-title {
    font-family: var(--as-font-rounded);
    font-weight: 700;
}

/* ---------- Karten ---------- */

.card {
    border: 1px solid var(--as-border);
    border-radius: var(--as-radius);
    box-shadow: var(--as-shadow);
    background-color: var(--as-surface);
}

/* Gestrichelte Rahmen (Sparziel-Karten) durch ruhige Flaechen ersetzen */
.card[style*="dashed"],
.card.border-dashed {
    border-style: solid !important;
}

.card .card-body {
    padding: 1rem 1.25rem;
}

/* Investment-Karten: dezenter Akzent statt Vollrahmen */
.card-accent-invest {
    border-left: 4px solid #1d4e77;
}

/* ---------- Buttons ---------- */

/* Koppel: Buttons als freundliche Pillen */
.btn {
    border-radius: var(--as-radius-pill);
    font-weight: 600;
}

/* Primaeraktion (.btn-dark): gefuellt in Gruen statt Schwarz.
   Bootstrap 5.1 kennt keine --bs-btn-*-Variablen, daher klassische Overrides. */
.btn-dark {
    background-color: var(--as-green);
    border-color: var(--as-green);
    color: #ffffff;
}

.btn-dark:hover,
.btn-dark:focus {
    background-color: var(--as-green-dark);
    border-color: var(--as-green-dark);
    color: #ffffff;
}

.btn-dark:active,
.btn-dark.active,
.btn-check:checked + .btn-dark {
    background-color: var(--as-green-dark);
    border-color: var(--as-green-dark);
    color: #ffffff;
}

/* Outline-Buttons: Creme-Hover, Pill erbt vom .btn */
.btn-outline-dark:hover,
.btn-outline-dark:focus,
.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background-color: var(--as-cream);
}

/* Cyan-Outline-Buttons (Quill-Speichern etc.) auf ruhiges Grau-Outline ziehen.
   Bootstrap 5.1 nutzt noch keine --bs-btn-Variablen, daher klassische Overrides. */
.btn-outline-info {
    color: var(--as-text-muted);
    border-color: #ced4da;
    background-color: transparent;
}

.btn-outline-info:hover,
.btn-outline-info:focus {
    color: var(--as-text);
    background-color: var(--as-cream-soft);
    border-color: #adb5bd;
    box-shadow: none;
}

.btn-outline-info:active,
.btn-check:checked + .btn-outline-info,
.btn-outline-info.active {
    color: var(--as-text);
    background-color: var(--as-cream);
    border-color: #adb5bd;
}

/* Submit-Buttons konsistent kapitalisiert */
input[type="submit"].btn,
button[type="submit"].btn {
    text-transform: capitalize;
}

/* ---------- Progress ---------- */

/* Koppel: dicke, komplett gerundete Fortschrittsbalken */
.progress {
    height: 1rem;
    border-radius: var(--as-radius-pill);
    background-color: #ece7db;
    overflow: hidden;
}

.progress-bar {
    background-color: var(--as-green);
    border-radius: var(--as-radius-pill);
    font-weight: 700;
    font-size: 0.7rem;
}

/* Bootstraps .bg-success (!important) auf Markengruen ziehen */
.progress-bar.bg-success {
    background-color: var(--as-green) !important;
}

/* Koppel: solide Balken statt Streifen */
.progress-bar-striped {
    background-image: none;
}

/* ---------- KPI-Tiles (ersetzen stat-figure Blockquotes) ---------- */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

@media (min-width: 576px) {
    .kpi-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}

.kpi-tile {
    min-width: 0;
}

.kpi-value {
    font-family: var(--as-font-rounded);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--as-text);
    /* Beträge stehen im kpi-grid untereinander und müssen an der Ziffer ausgerichtet sein */
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-label {
    font-size: 0.75rem;
    color: var(--as-text-muted);
    line-height: 1.3;
}

.kpi-hint {
    font-size: 0.7rem;
    color: var(--as-text-muted);
    opacity: 0.8;
    line-height: 1.3;
}

/* ---------- Zeitraum-Chips ---------- */

.range-chip {
    border-radius: 999px !important;
    padding-inline: 0.75rem;
    background-color: var(--as-surface);
    border-color: var(--as-border);
    color: var(--as-text-muted);
    font-weight: 600;
}

/* Hover: Gruen-Akzent. Hoehere Spezifitaet (0,3,0) schlaegt den
   .btn-outline-secondary:hover-Override weiter oben in dieser Datei. */
.btn.range-chip:hover,
.btn.range-chip:focus {
    background-color: var(--as-green-soft);
    border-color: var(--as-green);
    color: var(--as-green);
}

/* Aktiv: gefuellter gruener Chip. Spezifitaet 0,3,0 schlaegt Bootstraps
   .btn-outline-secondary.active (0,2,0), design-system.css laedt nach Bootstrap. */
.btn.range-chip.active,
.btn-check:checked + .btn.range-chip {
    background-color: var(--as-green);
    border-color: var(--as-green);
    color: #ffffff;
}

.range-custom-form {
    display: inline-flex;
    align-items: center;
    min-height: 31px;
    padding: 0.15rem 0.2rem 0.15rem 0.65rem;
    border: 1px solid var(--as-border);
    border-radius: var(--as-radius-pill);
    background-color: var(--as-surface);
    color: var(--as-text-muted);
    font-family: var(--as-font-rounded);
    font-size: 0.8rem;
    font-weight: 600;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.range-custom-form:hover,
.range-custom-form:focus-within {
    border-color: var(--as-green);
    background-color: var(--as-green-soft);
    box-shadow: 0 0 0 0.2rem rgba(46, 125, 70, 0.1);
    color: var(--as-green);
}

.range-custom-label {
    margin-right: 0.35rem;
    cursor: text;
    white-space: nowrap;
}

.range-custom-input {
    width: 2.8rem;
    min-width: 0;
    padding: 0.05rem 0.25rem;
    border: 0;
    border-radius: 0.45rem;
    outline: 0;
    background-color: var(--as-page-bg);
    color: var(--as-text);
    font: inherit;
    text-align: center;
    appearance: textfield;
}

.range-custom-input::-webkit-inner-spin-button,
.range-custom-input::-webkit-outer-spin-button {
    margin: 0;
    appearance: none;
}

.range-custom-input::placeholder {
    color: var(--as-text-muted);
    opacity: 0.65;
}

.range-custom-unit {
    margin: 0 0.3rem 0 0.2rem;
}

.range-custom-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 23px;
    height: 23px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background-color: var(--as-green-soft);
    color: var(--as-green);
}

.range-custom-submit:hover,
.range-custom-submit:focus {
    background-color: var(--as-green);
    color: #ffffff;
}

.range-custom-submit .material-icons {
    font-size: 16px;
}

.range-custom-form.active {
    border-color: var(--as-green);
    background-color: var(--as-green);
    color: #ffffff;
}

.range-custom-form.active .range-custom-input {
    background-color: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.range-custom-form.active .range-custom-submit {
    background-color: #ffffff;
    color: var(--as-green);
}

.range-custom-form.active:focus-within {
    background-color: var(--as-green-dark);
}

/* ---------- Sticker-Badge (Koppel) ---------- */
/* Kleine Pille: weisser Grund, Gruen-Border, gruener fetter Text, weicher Schatten.
   Fuer Status-Hinweise wie Monats-Delta auf Karten. */
.sticker {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.15rem 0.55rem;
    border-radius: var(--as-radius-pill);
    background-color: var(--as-surface);
    border: 1px solid var(--as-green);
    color: var(--as-green);
    font-family: var(--as-font-rounded);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(33, 37, 41, 0.08);
}

/* Negativ-Variante fuer ruecklaeufige Werte */
.sticker-down {
    border-color: var(--as-red);
    color: var(--as-red);
}

/* ===== Top-Navbar ===== */
.navbar-top {
    background-color: var(--as-cream);
    border-bottom: 1px solid var(--as-border-soft);
}

.navbar-top .container-fluid,
.navbar-top .navbar-collapse {
    min-width: 0;
}

.navbar-top .navbar-brand,
.navbar-top .navbar-toggler,
.navbar-top .nav-link,
.navbar-top .navbar-account-toggle,
.navbar-top .navbar-user-area .btn,
.navbar-top .account-menu-action {
    min-height: 44px;
}

.navbar-top .navbar-toggler {
    min-width: 44px;
}

.navbar-top .nav-link,
.navbar-top .account-menu-action {
    display: flex;
    align-items: center;
}

.navbar-top .navbar-brand:focus-visible,
.navbar-top .navbar-toggler:focus-visible,
.navbar-top .nav-link:focus-visible,
.navbar-top .navbar-account-toggle:focus-visible,
.navbar-top .navbar-user-area .btn:focus-visible,
.navbar-top .account-menu-action:focus-visible,
.bottom-nav-item:focus-visible {
    outline: 3px solid var(--as-accent);
    outline-offset: 2px;
    box-shadow: none;
}

.navbar-user-name {
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.navbar-account-menu {
    flex: 0 0 auto;
}

.navbar-account-toggle[aria-expanded="true"] {
    color: var(--as-green);
    background-color: var(--as-green-soft);
    border-color: var(--as-green);
}

.navbar-account-menu .dropdown-menu {
    min-width: 15rem;
    max-width: min(20rem, calc(100vw - 2rem));
    border-color: var(--as-border);
    border-radius: var(--as-radius-sm);
    box-shadow: var(--as-shadow-raised);
}

.navbar-account-menu form {
    margin: 0;
}

.account-menu-user {
    display: block;
    overflow: hidden;
    color: var(--as-text);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-menu-action {
    white-space: nowrap;
}

/* Creme-Hover ist auf Creme unsichtbar -> weisser Hover */
.navbar-top .btn-outline-dark:hover, .navbar-top .btn-outline-dark:focus,
.navbar-top .btn-outline-secondary:hover, .navbar-top .btn-outline-secondary:focus {
    background-color: var(--as-surface);
}
/* Desktop: Links als Pills, aktiv = gefuellter gruener Chip (wie Bottom-Nav) */
@media (min-width: 768px) {
    .navbar-top .navbar-collapse {
        gap: 0.75rem;
    }

    .navbar-top .navbar-nav { gap: 0.25rem; }
    .navbar-top .navbar-nav .nav-link {
        padding: 0.3rem 0.85rem;
        border-radius: var(--as-radius-pill);
        font-weight: 600;
    }
    .navbar-top .navbar-nav .nav-link:hover,
    .navbar-top .navbar-nav .nav-link:focus {
        color: var(--as-green);
        background-color: var(--as-green-soft);
    }
    .navbar-top .navbar-nav .nav-link.active {
        background-color: var(--as-green);
        color: #ffffff;
    }
}

/* ---------- Navbar (mobil) ---------- */

@media (max-width: 767.98px) {
    .navbar-collapse .navbar-nav {
        padding-top: 0.5rem;
        border-top: 1px solid var(--as-border);
        margin-top: 0.5rem;
    }

    .navbar-collapse .nav-link {
        padding: 0.625rem 0.5rem;
        border-radius: var(--as-radius-sm);
    }

    .navbar-collapse .nav-link.active {
        background-color: rgba(46, 125, 70, 0.08);
        font-weight: 600;
        color: var(--as-green);
    }

    /* User-Bereich: eigene Zeile, sauber getrennt */
    .navbar-collapse .navbar-user-area {
        border-top: 1px solid var(--as-border);
        margin-top: 0.5rem;
        padding: 0.75rem 0.5rem 0.375rem;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem;
    }

    .navbar-collapse .navbar-account-menu {
        width: 100%;
        border-top: 1px solid var(--as-border);
        margin-top: 0.5rem;
        padding-top: 0.5rem;
    }

    .navbar-collapse .navbar-account-toggle {
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: space-between;
    }

    .navbar-collapse .navbar-account-menu .dropdown-menu {
        position: static !important;
        width: 100%;
        max-width: none;
        margin-top: 0.25rem;
        transform: none !important;
    }
}

/* ---------- Bottom-Tab-Bar (Koppel, nur Mobile) ---------- */
/*
 * Haupt-Navigation auf Mobile: fixierte Leiste am unteren Rand mit 4 Tabs.
 * Auf Desktop (>=768px) komplett ausgeblendet - dort bleibt die Navbar.
 */

.bottom-nav {
    display: none;
}

@media (max-width: 767.98px) {
    .bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1030;
        justify-content: space-around;
        align-items: stretch;
        background-color: rgb(252, 247, 235);
        border-top: 1px solid var(--as-border);
        padding: 0.375rem 0.25rem calc(0.375rem + env(safe-area-inset-bottom));
        box-shadow: 0 -2px 12px rgba(33, 37, 41, 0.05);
    }

    .bottom-nav-item {
        flex: 1 1 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.15rem;
        padding: 0.15rem 0.25rem;
        text-decoration: none;
        color: var(--as-text-muted);
        min-width: 0;
        min-height: 44px;
    }

    .bottom-nav-item .bottom-nav-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 30px;
        border-radius: var(--as-radius-pill);
        transition: background-color 0.15s ease, color 0.15s ease;
    }

    .bottom-nav-item svg {
        width: 20px;
        height: 20px;
    }

    .bottom-nav-label {
        font-size: 0.65rem;
        font-weight: 600;
        font-family: var(--as-font-rounded);
        line-height: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    /* Aktiver Tab: gefuellter runder Chip in Gruen, weisses Icon */
    .bottom-nav-item.active {
        color: var(--as-green);
    }

    .bottom-nav-item.active .bottom-nav-icon {
        background-color: var(--as-green);
        color: #ffffff;
    }

    /* Platz fuer die Bar schaffen, damit nichts verdeckt wird */
    body {
        padding-bottom: calc(var(--as-bottom-nav-height) + env(safe-area-inset-bottom));
    }
}

/* ---------- Globaler Footer: nur auf Desktop ---------- */

@media (max-width: 767.98px) {
    footer .navbar.fixed-bottom {
        display: none;
    }
}

/* ---------- Quill-Editor kompakt ---------- */

.ql-container {
    min-height: 90px;
    border-bottom-left-radius: var(--as-radius-sm);
    border-bottom-right-radius: var(--as-radius-sm);
}

.ql-toolbar {
    border-top-left-radius: var(--as-radius-sm);
    border-top-right-radius: var(--as-radius-sm);
}

/* ---------- Tabellen mobil ---------- */

@media (max-width: 575.98px) {
    .table {
        font-size: 0.875rem;
    }

    .table td,
    .table th {
        padding: 0.375rem 0.375rem;
    }
}

/* ---------- Buchungs-Tabelle (Koppel) ---------- */
/*
 * Ersetzt die alten Vollzeilen-Tints (.table-plus/.table-minus) durch eine
 * ruhige weisse Karte. Die Zeilen bleiben klickbar (Edit-Modal), Farbe steckt
 * nur noch im Betrag und in der Konto-Pille. Passt zu den .card-Regeln oben.
 */

.buchungs-card {
    background-color: var(--as-surface);
    border: 1px solid var(--as-border-soft);
    border-radius: var(--as-radius);
    padding: 1rem 1.25rem;
}

.buchungs-table {
    margin-bottom: 0;
    --bs-table-bg: transparent;
    /* Hover-Tint dezent gruen statt Bootstrap-Grau */
    --bs-table-hover-bg: var(--as-green-soft);
}

/* Bootstraps harte 2px-Linie unter dem thead abschalten */
.buchungs-table > :not(:first-child) {
    border-top: 0;
}

/* Kopfzeile: kleine, ruhige Label-Optik */
.buchungs-table thead th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--as-text-muted);
    font-weight: 600;
    border-top: none;
    border-bottom: 1px solid var(--as-border);
}

/* Datenzellen: luftig, weiche Trennlinien */
.buchungs-table tbody td {
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid var(--as-border-soft);
    vertical-align: middle;
}

/* Letzte Zeile ohne Trennlinie */
.buchungs-table tbody tr:last-child td {
    border-bottom: none;
}

/* Ganze Zeile klickbar (oeffnet das Edit-Modal) */
.buchungs-table tbody tr {
    cursor: pointer;
}

/* Dezente Vorzeichen-Tints auf ganzer Zeile */
.buchungs-table tbody tr.row-plus > td {
    background-color: var(--as-green-soft);
}

.buchungs-table tbody tr.row-minus > td {
    background-color: var(--as-red-soft);
}

/* Hover: etwas tiefere Variante des jeweiligen Tints statt globalem Gruen */
.buchungs-table tbody tr.row-plus {
    --bs-table-hover-bg: #ddf2e7;
}

.buchungs-table tbody tr.row-minus {
    --bs-table-hover-bg: #f9e2d9;
}

/* Betrag: fette Ziffern, tabellarisch ausgerichtet */
.buchung-amount {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.amount-plus {
    color: var(--as-green);
}

.amount-minus {
    color: var(--as-red);
}

.buchung-date {
    color: var(--as-text-muted);
}

/* Konto-Pille: Farbe kommt als --konto-color aus dem Template.
   Fallback-Zeile zuerst fuer Browser ohne color-mix. */
.konto-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    background: #f1f3f5;
    color: #495057;
    border: 1px solid #dee2e6;
    background: color-mix(in srgb, var(--konto-color, #6c757d) 16%, #ffffff);
    color: color-mix(in srgb, var(--konto-color, #6c757d) 55%, #1a1a1a);
    border: 1px solid color-mix(in srgb, var(--konto-color, #6c757d) 35%, #ffffff);
}

/* Aktions-Icons in Verwaltungs-Tabellen: ruhig grau, farbiger Hover */
.buchungs-table .action-icon {
    color: var(--as-text-muted);
    text-decoration: none;
    vertical-align: middle;
}

.buchungs-table .action-icon.action-edit:hover,
.buchungs-table .action-icon.action-edit:focus {
    color: var(--as-green);
}

.buchungs-table .action-icon.action-delete:hover,
.buchungs-table .action-icon.action-delete:focus {
    color: var(--as-red);
}

/* Mobil: Zellen etwas kompakter */
@media (max-width: 576px) {
    .buchungs-table tbody td {
        padding: 0.5rem 0.4rem;
        font-size: 0.8rem;
    }
}

/* Drag & Drop: Karten-Sortierung */
.drag-handle {
    color: var(--as-text-muted);
    opacity: .45;
    cursor: grab;
    z-index: 2;
    padding: .25rem .5rem;
    touch-action: none;
}

.drag-handle:active {
    cursor: grabbing;
}

.sortable-chosen .card {
    box-shadow: var(--as-shadow-raised);
}

.sortable-ghost {
    opacity: .4;
}

.sortable-ghost .card {
    border: 2px dashed var(--as-green);
}

/* Sparrücklage – approved compact design G (#299). Keep shared savings views unchanged. */
.sparruecklage-page .reserve-page {
    width: calc(100% - 56px);
    max-width: 1318px;
    margin: 24px auto 30px;
    font-size: 15px;
}
.sparruecklage-page .reserve-page .card {
    border: 1px solid var(--as-border);
    border-radius: var(--as-radius-sm);
    box-shadow: none;
    min-width: 0;
}
.sparruecklage-page .reserve-page .text-success { color: var(--as-green) !important; }
.sparruecklage-page .reserve-page .text-danger { color: var(--as-red) !important; }
.sparruecklage-page .reserve-overview { padding: 18px 26px 17px; margin-bottom: 20px; }
.sparruecklage-page .reserve-title { font-size: 22px; letter-spacing: -.35px; margin: 0 0 5px; overflow-wrap: anywhere; }
.sparruecklage-page .reserve-overview .kpi-grid { display: flex; flex-wrap: wrap; margin: 0; gap: 18px; }
.sparruecklage-page .reserve-overview .kpi-tile { flex: 1 1 0; min-width: fit-content; max-width: 100%; padding: 0; background: transparent; border: 0; }
.sparruecklage-page .reserve-overview .kpi-value { font-size: 27px; line-height: 1.25; overflow-wrap: anywhere; white-space: normal; overflow: visible; text-overflow: clip; }
.sparruecklage-page .reserve-overview .kpi-tile:last-child .kpi-value { font-size: 22px; }
.sparruecklage-page .reserve-overview .kpi-label { font-size: 13px; }
.sparruecklage-page .reserve-charts { margin-top: 15px; }
.sparruecklage-page .reserve-charts > .mb-4 { margin-bottom: 0 !important; }
.sparruecklage-page .range-form .range-chip { min-height: 32px; padding: 4px 13px; font-size: 13px; }
.sparruecklage-page .range-form .input-group-text { background: var(--as-surface); color: var(--as-text-muted); border-color: var(--as-border); font-size: 13px; }
.sparruecklage-page .range-form .form-select { background-color: var(--as-page-bg); border-color: var(--as-border); min-height: 34px; font-size: 13px; }
.sparruecklage-page .range-form .ms-auto { margin-left: 0 !important; font-size: 13px; }
.sparruecklage-page .savings-chart-panels { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 28px; margin: 5px 0 0; }
.sparruecklage-page .savings-chart-panels > div { width: auto; min-width: 0; padding: 0; }
.sparruecklage-page .reserve-chart-title { font: 600 14px var(--as-font-rounded); margin: 0 0 7px 64px; overflow-wrap: anywhere; }
.sparruecklage-page .chart-container { height: 205px !important; }
.sparruecklage-page .reserve-columns { display: grid; grid-template-columns: minmax(0,2.06fr) minmax(0,1fr); gap: 24px; align-items: start; }
.sparruecklage-page .reserve-left, .sparruecklage-page .reserve-right { display: grid; gap: 16px; min-width: 0; }
.sparruecklage-page .reserve-booking { padding: 17px 20px 18px; }
.sparruecklage-page .reserve-page h2 { font-size: 17px; font-weight: 650; margin: 0; }
.sparruecklage-page .reserve-booking h2 { margin-bottom: 13px; }
.sparruecklage-page .booking-fields { display: grid; grid-template-columns: 124px minmax(0,1fr) 191px 90px; gap: 10px; align-items: end; }
.sparruecklage-page .booking-fields > div { min-width: 0; }
.sparruecklage-page .field-label { display: block; color: var(--as-text-muted); font-size: 12px; font-weight: 500; margin: 0 0 6px 2px; line-height: 1.2; }
.sparruecklage-page .booking-fields .input-group { flex-wrap: nowrap; border: 1px solid var(--as-border); border-radius: 11px; background: var(--as-surface); min-height: 44px; }
.sparruecklage-page .booking-fields .form-control, .sparruecklage-page .booking-fields .form-select { min-width: 0; min-height: 44px; font-size: 14px; border: 1px solid var(--as-border); border-radius: 11px; padding: 10px 12px; background-color: var(--as-surface); }
.sparruecklage-page .booking-fields .input-group .form-control, .sparruecklage-page .booking-fields .input-group .form-select { border: 0; border-radius: 11px; min-height: 44px; background-color: transparent; }
.sparruecklage-page .booking-fields .form-select { padding-right: 30px; }
.sparruecklage-page .booking-fields .input-group-text { border: 0; background: transparent; padding: 6px 9px; color: var(--as-text-muted); }
.sparruecklage-page .booking-fields .currency-unit { padding-right: 13px; }
.sparruecklage-page .booking-fields .konto-badge { font-size: 10px; min-width: 29px; padding: 3px 6px; }
.sparruecklage-page .booking-fields .btn { min-height: 44px; font-size: 14px; }
.sparruecklage-page .booking-fields .input-group:focus-within { border-color: var(--as-green); box-shadow: 0 0 0 3px rgb(46 125 70 / 10%); }
.sparruecklage-page .bookings-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 17px 20px 14px; }
.sparruecklage-page .bookings-head > span { font-size: 12px; color: var(--as-text-muted); }
.sparruecklage-page .reserve-bookings { overflow: hidden; }
.sparruecklage-page .table-scroll { overflow-x: auto; }
.sparruecklage-page .buchungs-card { border: 0; padding: 0; border-radius: 0; max-width: none; }
.sparruecklage-page .buchungs-table { font-size: 15px; min-width: 360px; --bs-table-hover-bg: var(--as-page-bg); }
.sparruecklage-page .buchungs-table thead th { padding: 12px 13px; font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; background: var(--as-page-bg); border-color: var(--as-border); white-space: nowrap; }
.sparruecklage-page .buchungs-table tbody td { height: 44px; padding: 8px 13px; background: var(--as-surface); border-bottom-color: var(--as-border-soft); }
.sparruecklage-page .buchungs-table tbody tr.row-plus > td, .sparruecklage-page .buchungs-table tbody tr.row-minus > td { background: var(--as-surface); }
.sparruecklage-page .buchungs-table tbody tr { --bs-table-hover-bg: var(--as-page-bg); }
.sparruecklage-page .buchungs-table tbody tr:hover td { background: var(--as-page-bg); }
.sparruecklage-page .buchungs-table th:first-child, .sparruecklage-page .buchungs-table td:first-child { width: 75px; padding-left: 24px; }
.sparruecklage-page .buchungs-table th:nth-child(2) { width: 141px; }
.sparruecklage-page .buchungs-table th:nth-child(2), .sparruecklage-page .buchungs-table td:nth-child(2) { text-align: right; padding-right: 18px; white-space: nowrap; }
.sparruecklage-page .buchungs-table td:nth-child(3) { min-width: 80px; overflow-wrap: anywhere; }
.sparruecklage-page .buchungs-table th:last-child, .sparruecklage-page .buchungs-table td:last-child { width: 116px; padding-right: 24px; text-align: right; white-space: nowrap; }
.sparruecklage-page .buchung-amount { display: inline-block; padding: 3px 7px; border-radius: 6px; font-size: 15px; font-weight: 650; white-space: nowrap; }
.sparruecklage-page .amount-plus { background: var(--as-green-soft); }
.sparruecklage-page .amount-minus { background: var(--as-red-soft); }
.sparruecklage-page .buchung-date { font-size: 13px; }
.sparruecklage-page .buchungs-table .konto-badge { min-width: 33px; font-size: 10px; justify-content: center; }
.sparruecklage-page .booking-edit { display: block; width: 100%; border: 0; padding: 0; background: transparent; color: inherit; text-align: left; font: inherit; overflow-wrap: anywhere; }
.sparruecklage-page .section-head { display: flex; align-items: center; gap: 9px; padding: 16px 20px 12px; }
.sparruecklage-page .section-head .material-icons { font-size: 19px; color: var(--as-text-muted); }
.sparruecklage-page .notes-body { padding: 0 20px 18px; }
.sparruecklage-page .notes-body .ql-toolbar.ql-snow { background: var(--as-page-bg); border-color: var(--as-border); border-radius: 11px 11px 0 0; padding: 8px 5px; }
.sparruecklage-page .notes-body .ql-toolbar .ql-formats { margin-right: 5px; }
.sparruecklage-page .notes-body .ql-container.ql-snow { border-color: var(--as-border); border-radius: 0 0 11px 11px; height: auto; font-size: 14px; background: var(--as-surface); }
.sparruecklage-page .notes-body .ql-editor { min-height: 98px; max-height: 300px; overflow-y: auto; }
.sparruecklage-page .note-footer { display: flex; justify-content: flex-end; margin-top: 12px; }
.sparruecklage-page .note-footer .btn { min-height: 33px; font-size: 13px; }
.sparruecklage-page .evaluation-body { padding: 2px 20px 18px; }
.sparruecklage-page .account-card { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,max-content); grid-template-areas: "name balance" ". interest"; gap: 5px 8px; padding: 5px 0 13px; }
.sparruecklage-page .account-card + .account-card { border-top: 1px solid var(--as-border-soft); padding-top: 13px; }
.sparruecklage-page .account-identity { grid-area: name; display: flex; gap: 8px; align-items: center; min-width: 0; }
.sparruecklage-page .account-identity .konto-badge { padding: 4px 7px; font-size: 10px; flex: none; }
.sparruecklage-page .account-name { font-size: 13px; font-weight: 550; overflow-wrap: anywhere; }
.sparruecklage-page .account-kpi { min-width: 0; overflow-wrap: anywhere; grid-area: balance; text-align: right; font-family: var(--as-font-rounded); font-size: 19px; font-weight: 650; letter-spacing: -.3px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.sparruecklage-page .account-interest { grid-area: interest; justify-self: end; font-size: 13px; font-variant-numeric: tabular-nums; }
.sparruecklage-page .evaluation-total { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; align-items: center; padding-top: 10px; border-top: 1px solid var(--as-border-soft); font-size: 13px; color: var(--as-text-muted); }
.sparruecklage-page .evaluation-total strong { font-weight: 650; font-variant-numeric: tabular-nums; }
.sparruecklage-page .evaluation-empty { margin: 0; color: var(--as-text-muted); font-size: 13px; }
.sparruecklage-page .reserve-actions { border: 1px solid var(--as-border); border-radius: var(--as-radius-sm); overflow: hidden; background: var(--as-surface); }
.sparruecklage-page .reserve-actions .accordion-item { border: 0; border-radius: 0; background: transparent; }
.sparruecklage-page .reserve-actions .accordion-item + .accordion-item { border-top: 1px solid var(--as-border-soft); }
.sparruecklage-page .reserve-actions .accordion-button { min-height: 49px; padding: 15px 20px; font-size: 14px; font-weight: 400; background: var(--as-surface); color: var(--as-text); box-shadow: none; }
.sparruecklage-page .reserve-actions .accordion-button svg { color: var(--as-text-muted); flex: none; }
.sparruecklage-page .reserve-actions .bi-trash { color: var(--as-red) !important; }
.sparruecklage-page .reserve-actions .accordion-button::after { height: 13px; width: 13px; background-size: 13px; }
.sparruecklage-page .reserve-actions .accordion-body { padding: 0 20px 18px; }
.sparruecklage-page .reserve-page :is(button, input, select, [tabindex], [contenteditable]):focus-visible { outline: 3px solid var(--as-accent); outline-offset: 3px; }
@media (max-width: 1100px) {
    .sparruecklage-page .reserve-page { width: calc(100% - 40px); }
    .sparruecklage-page .booking-fields { grid-template-columns: 110px minmax(0,1fr) 165px 80px; gap: 8px; }
    .sparruecklage-page .buchungs-table th:first-child, .sparruecklage-page .buchungs-table td:first-child { width: 60px; padding-left: 15px; }
    .sparruecklage-page .buchungs-table th:nth-child(2) { width: 127px; }
    .sparruecklage-page .buchungs-table th:nth-child(2), .sparruecklage-page .buchungs-table td:nth-child(2) { padding-right: 14px; }
    .sparruecklage-page .buchungs-table th:last-child, .sparruecklage-page .buchungs-table td:last-child { width: 107px; padding-right: 15px; }
    .sparruecklage-page .buchungs-table tbody td { padding-left: 8px; padding-right: 8px; }
    .sparruecklage-page .account-card { grid-template-areas: "name name" "balance interest"; gap: 10px 5px; }
    .sparruecklage-page .account-kpi { text-align: left; font-size: 20px; }
    .sparruecklage-page .account-interest { align-self: center; font-size: 12px; }
}
@media (max-width: 950px) {
    .sparruecklage-page .booking-fields { grid-template-columns: 110px minmax(0,1fr); }
    .sparruecklage-page .account-form-field, .sparruecklage-page .booking-fields .btn { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
    .sparruecklage-page .reserve-page { width: calc(100% - 28px); margin-top: 16px; }
    .sparruecklage-page .reserve-overview { padding: 18px 16px 20px; }
    .sparruecklage-page .reserve-overview .kpi-value { font-size: 25px; }
    .sparruecklage-page .reserve-overview .kpi-label { font-size: 12px; }
    .sparruecklage-page .reserve-columns, .sparruecklage-page .savings-chart-panels { grid-template-columns: minmax(0,1fr); gap: 20px; }
    .sparruecklage-page .reserve-chart-title { margin-left: 45px; }
    .sparruecklage-page .chart-container { height: 210px !important; }
    .sparruecklage-page .range-form .range-chip { min-height: 44px; padding: 5px 9px; font-size: 12px; }
    .sparruecklage-page .range-form > .d-flex:last-child { display: grid !important; grid-template-columns: minmax(0,1fr); }
    .sparruecklage-page .range-form .input-group { width: 100% !important; min-width: 0; }
    .sparruecklage-page .range-form .form-select { min-height: 42px; min-width: 0; }
    .sparruecklage-page .reserve-booking { padding: 18px; }
    .sparruecklage-page .booking-fields .form-control, .sparruecklage-page .booking-fields .form-select { font-size: 13px; }
    .sparruecklage-page .bookings-head { padding: 17px 16px 13px; }
    .sparruecklage-page .buchungs-table { font-size: 14px; }
    .sparruecklage-page .buchungs-table thead th { padding: 11px 8px; font-size: 11px; }
    .sparruecklage-page .buchungs-table th:first-child, .sparruecklage-page .buchungs-table td:first-child { width: 51px; padding-left: 12px; }
    .sparruecklage-page .buchungs-table th:nth-child(2) { width: 113px; }
    .sparruecklage-page .buchungs-table td:nth-child(2), .sparruecklage-page .buchungs-table th:nth-child(2) { padding-right: 11px; }
    .sparruecklage-page .buchungs-table th:last-child, .sparruecklage-page .buchungs-table td:last-child { width: 88px; padding-right: 12px; }
    .sparruecklage-page .buchung-amount { font-size: 13px; }
    .sparruecklage-page .buchung-date { font-size: 11px; }
    .sparruecklage-page .account-card { grid-template-areas: "name balance" ". interest"; gap: 7px; }
    .sparruecklage-page .account-kpi { text-align: right; font-size: 20px; }
    .sparruecklage-page .account-name { font-size: 14px; }
    .sparruecklage-page .notes-body .ql-toolbar button, .sparruecklage-page .notes-body .ql-toolbar .ql-picker { min-height: 36px; }
    .sparruecklage-page .note-footer .btn { min-height: 40px; }
}
