/* Finanzen im Blick – eigene Styles zusätzlich zu Bootstrap 5.3 */
:root {
  --brand: #4453c4; --brand-dark: #3743a3; --brand-soft: #eceefb;
  --page: #f6f6fb; --surface: #ffffff; --line: #e3e4ee; --ink-2: #5b6072; --ink-3: #6f7486;
  --neg: #b3261e; --pos: #13734a; --warn: #8a5300; --warn-bg: #fff4dd;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948; --s-rest: #9a9fae;
  --bar-pos: #1d9a63; --bar-neg: #d6453d;
  --nav-h: 64px;
  --bs-primary: #4453c4; --bs-primary-rgb: 68, 83, 196;
  --bs-link-color: #3743a3; --bs-link-color-rgb: 55, 67, 163; --bs-link-hover-color-rgb: 40, 50, 130;
  --bs-body-bg: var(--page);
}
[data-bs-theme="dark"] {
  --brand: #7482ee; --brand-dark: #8e9af4; --brand-soft: #262a48;
  --page: #14151f; --surface: #1c1d2a; --line: #30323f; --ink-2: #a9adbd; --ink-3: #969bad;
  --neg: #ff8f86; --pos: #5fd39a; --warn: #f0bd5e; --warn-bg: #33290f;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; --s8: #e66767; --s-rest: #7b8092;
  --bar-pos: #2fae76; --bar-neg: #e0645c;
  --bs-primary: #7482ee; --bs-primary-rgb: 116, 130, 238;
  --bs-link-color: #a3adf8; --bs-link-color-rgb: 163, 173, 248; --bs-link-hover-color-rgb: 190, 198, 255;
  --bs-body-bg: var(--page); --bs-tertiary-bg: #232532; --bs-border-color: #363948;
}
body { font-variant-numeric: tabular-nums; -webkit-tap-highlight-color: transparent; }
h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.h5, .h6 { font-weight: 650; }
.btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; --bs-btn-border-radius: .6rem; }
.btn-sm { min-height: 36px; }
.btn-primary { --bs-btn-bg: #4453c4; --bs-btn-border-color: #4453c4; --bs-btn-hover-bg: #3743a3; --bs-btn-hover-border-color: #3743a3; --bs-btn-active-bg: #2f3a90; --bs-btn-active-border-color: #2f3a90; --bs-btn-disabled-bg: #4453c4; --bs-btn-disabled-border-color: #4453c4; }
.btn-outline-primary { --bs-btn-color: var(--bs-link-color); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: #4453c4; --bs-btn-hover-border-color: #4453c4; --bs-btn-active-bg: #4453c4; }
.btn-icon { min-width: 44px; font-size: 1.3rem; color: var(--bs-body-color); }
.form-control, .form-select { min-height: 44px; border-radius: .6rem; }
.form-control-color { width: 4rem; }
.form-check-input { width: 1.25em; height: 1.25em; }
.form-check { padding-left: 1.85em; min-height: 1.9rem; } .form-check .form-check-input { margin-left: -1.85em; }
.form-label { font-size: .85rem; color: var(--ink-2); margin-bottom: .25rem; }
.form-narrow { max-width: 640px; }
a { text-underline-offset: 2px; }
.min-w-0 { min-width: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Beträge */
.amt { white-space: nowrap; } .amt-neg { color: var(--neg); } .amt-pos { color: var(--pos); }
.text-ok { color: var(--pos); } .text-warn { color: var(--warn); } .text-neg { color: var(--neg); }

/* Kopf- und Fußnavigation */
.topbar { position: sticky; top: 0; z-index: 1020; background: color-mix(in srgb, var(--page) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
  padding: calc(.4rem + env(safe-area-inset-top)) env(safe-area-inset-right) .4rem env(safe-area-inset-left); }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--bs-body-color); text-decoration: none; min-width: 0; }
.brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: .6rem; background: #4453c4; color: #fff; flex: none; }
.brand-mark-lg { width: 4rem; height: 4rem; font-size: 2rem; border-radius: 1.1rem; }
.topnav { gap: .1rem; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.topnav a { padding: .5rem .65rem; border-radius: .6rem; color: var(--ink-2); text-decoration: none; font-size: .94rem; white-space: nowrap; }
.topnav a:hover { background: var(--brand-soft); } .topnav a.active { color: var(--bs-link-color); background: var(--brand-soft); font-weight: 600; }
.page-main { padding-top: 1.25rem; padding-bottom: 3rem; }
.bottom-nav { position: fixed; inset: auto 0 0 0; z-index: 1030; display: flex; align-items: stretch; background: var(--surface); border-top: 1px solid var(--line);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .72rem; color: var(--ink-3); text-decoration: none; }
.bottom-nav a .bi { font-size: 1.3rem; line-height: 1; } .bottom-nav a.active { color: var(--bs-link-color); font-weight: 600; }
.bottom-plus { flex: none; width: 58px; height: 58px; margin: -16px 6px 0; border: 4px solid var(--page); border-radius: 50%; background: #4453c4; color: #fff; font-size: 1.6rem; display: flex; align-items: center; justify-content: center; padding: 0; }
.bottom-plus:active { background: #2f3a90; }
@media (max-width: 767.98px) { .page-main { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 2.5rem); } h1 { font-size: 1.35rem; } }

/* Flächen */
.card-soft { background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; padding: 1.1rem; }
.card-list { background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; overflow: hidden; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--ink-2); } .empty > .bi { font-size: 2.4rem; display: block; margin-bottom: .5rem; opacity: .6; }
.sumline { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; padding: 0 .25rem .6rem; font-size: .92rem; color: var(--ink-2); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; } .kv dt { font-weight: 400; color: var(--ink-2); } .kv dd { margin: 0; min-width: 0; }
.big-number { font-size: 2.2rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; } .big-number small { display: block; font-size: .85rem; font-weight: 400; letter-spacing: 0; color: var(--ink-2); margin-top: .25rem; }
.stat { min-width: 0; } .stat-label { font-size: .85rem; color: var(--ink-2); } .stat-value { font-size: 1.35rem; font-weight: 650; }
.stat-sub { font-size: .82rem; color: var(--ink-2); }

/* Buchungszeilen */
.day-head { padding: .45rem 1rem; font-size: .82rem; color: var(--ink-2); background: var(--bs-tertiary-bg); border-top: 1px solid var(--line); } .day-head:first-child { border-top: 0; }
.tx-row { display: flex; align-items: center; gap: .8rem; padding: .65rem 1rem; color: inherit; text-decoration: none; border: 0; border-top: 1px solid var(--line); width: 100%; background: none; text-align: left; }
.tx-row:first-child, .day-head + .tx-row { border-top: 0; } a.tx-row:hover, button.tx-row:hover { background: color-mix(in srgb, var(--brand) 6%, transparent); }
.tx-row.is-planned .tx-main, .tx-row.is-planned .tx-amount { opacity: .8; font-style: italic; }
.tx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; } .tx-title { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-sub { font-size: .84rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-meta { font-size: .76rem; color: var(--ink-3); display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .55rem; } .tx-amount { font-weight: 600; text-align: right; }
.acc-dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--c); display: inline-block; flex: none; margin-right: -.2rem; }
.badge-soft { display: inline-flex; align-items: center; gap: .25rem; } .badge-plan { color: var(--warn); }
.pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; padding: .1rem .55rem; border-radius: 2rem; background: var(--bs-tertiary-bg); color: var(--ink-2); white-space: nowrap; border: 1px solid var(--line); }
.pill-ok { color: var(--pos); } .pill-warn { color: var(--warn); background: var(--warn-bg); } .pill-bad { color: var(--neg); }
.cat-icon { width: 2.3rem; height: 2.3rem; flex: none; border-radius: .7rem; display: inline-flex; align-items: center; justify-content: center; color: color-mix(in srgb, var(--c) 78%, var(--bs-body-color)); background: color-mix(in srgb, var(--c) 16%, var(--surface)); }
.account-card { display: flex; align-items: center; gap: .8rem; padding: .9rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; color: inherit; text-decoration: none; } .account-card:hover { border-color: var(--c); }

/* Formular Buchung */
.seg { display: flex; background: var(--bs-tertiary-bg); border-radius: .8rem; padding: 4px; } .seg-item { flex: 1; text-align: center; padding: .55rem .25rem; border-radius: .6rem; cursor: pointer; color: var(--ink-2); font-weight: 550; }
.btn-check:checked + .seg-item { background: var(--surface); color: var(--bs-body-color); box-shadow: 0 1px 3px rgba(0,0,0,.15); } .btn-check:checked + .seg-expense { color: var(--neg); } .btn-check:checked + .seg-income { color: var(--pos); }
.btn-check:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; } .btn-check:disabled + .seg-item { opacity: .4; cursor: not-allowed; }
.amount-field { display: flex; align-items: center; justify-content: center; gap: .3rem; font-size: 2.2rem; font-weight: 700; } .amount-field .form-control { font-size: inherit; font-weight: inherit; border: 0; border-bottom: 2px solid var(--line); border-radius: 0; background: none; text-align: right; width: 7em; padding: 0 .1em; box-shadow: none; } .amount-field .form-control:focus { border-color: var(--brand); }
.chips { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; margin: 0 -.25rem; padding: .25rem; } .chip { flex: none; display: inline-flex; align-items: center; gap: .35rem; min-height: 40px; padding: 0 .8rem; border-radius: 2rem; border: 1px solid var(--line); background: var(--surface); color: var(--bs-body-color); } .chip .bi { color: color-mix(in srgb, var(--c) 78%, var(--bs-body-color)); } .chip.active { border-color: var(--brand); background: var(--brand-soft); }
.more-fields summary { cursor: pointer; color: var(--bs-link-color); padding: .5rem 0; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 4px; } .icon-grid label { height: 42px; display: flex; align-items: center; justify-content: center; border-radius: .6rem; font-size: 1.15rem; cursor: pointer; } .icon-grid label:hover { background: var(--bs-tertiary-bg); } .icon-grid .btn-check:checked + label { background: #4453c4; color: #fff; }

/* Anmeldung */
.auth-body { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: env(safe-area-inset-top) 1rem env(safe-area-inset-bottom); } .auth-box { width: 100%; max-width: 400px; }

/* Diagramme */
.chart-box { position: relative; height: 340px; } .chart-sm { height: 190px; } @media (max-width: 575.98px) { .chart-box { height: 280px; } .chart-sm { height: 170px; } }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; background: var(--c); margin-right: .5rem; }
.legend { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; font-size: .85rem; color: var(--ink-2); } .legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; vertical-align: middle; margin-right: .4rem; background: var(--c); } .legend i.sq { height: 12px; width: 12px; border-radius: 3px; }
.table-num td, .table-num th { font-size: .9rem; } .table-num .n { text-align: right; white-space: nowrap; }
.table { --bs-table-bg: transparent; }
.meter { height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--mc, var(--brand)) 20%, transparent); overflow: hidden; } .meter > span { display: block; height: 100%; border-radius: 4px; background: var(--mc, var(--brand)); } .meter-warn { --mc: #c98500; } .meter-bad { --mc: var(--bar-neg); }
.notice { display: flex; gap: .8rem; align-items: flex-start; padding: .8rem 1rem; border-top: 1px solid var(--line); } .notice:first-child { border-top: 0; } .notice > .bi { font-size: 1.15rem; margin-top: .1rem; } .notice-warn > .bi { color: var(--warn); } .notice-bad > .bi { color: var(--neg); } .notice-info > .bi { color: var(--bs-link-color); }
.more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; } .more-grid a { display: flex; flex-direction: column; gap: .5rem; padding: 1rem; border-radius: 1rem; background: var(--surface); border: 1px solid var(--line); color: inherit; text-decoration: none; } .more-grid .bi { font-size: 1.4rem; color: var(--bs-link-color); }

/* Import-Vorschau */
.imp-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .2rem .8rem; padding: .75rem 1rem; border-top: 1px solid var(--line); align-items: start; } .imp-row:first-child { border-top: 0; } .imp-row.is-off { opacity: .55; } .imp-row .imp-ctl { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; } .imp-row .form-select { max-width: 260px; }
.drop { border: 2px dashed var(--line); border-radius: 1rem; padding: 1.25rem; } .drop.over { border-color: var(--brand); background: var(--brand-soft); }

/* Admin */
.admin-sidebar { width: 240px; background: var(--surface); } .admin-sidebar .nav-link { color: var(--bs-body-color); border-radius: .6rem; min-height: 44px; } .admin-sidebar .nav-link.active { background: var(--brand-soft); color: var(--bs-link-color); font-weight: 600; } .admin-sidebar .nav-link:hover:not(.active) { background: var(--bs-tertiary-bg); }
@media (min-width: 992px) { .admin-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; flex: 0 0 240px; border-right: 1px solid var(--line); } }
.admin-main { flex: 1; min-width: 0; padding: 1.25rem; padding-bottom: calc(6rem + env(safe-area-inset-bottom)); } .fab { position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); z-index: 1025; width: 58px; height: 58px; border-radius: 50%; border: 0; background: #4453c4; color: #fff; font-size: 1.6rem; }
.lamp { width: .8rem; height: .8rem; border-radius: 50%; display: inline-block; flex: none; } .lamp-ok { background: #1d9a63; } .lamp-warn { background: #e0a100; } .lamp-error { background: #d6453d; } .lamp-info { background: #8a8fa0; }
pre.log { max-height: 340px; overflow: auto; font-size: .78rem; white-space: pre-wrap; word-break: break-word; background: var(--bs-tertiary-bg); border-radius: .6rem; padding: .75rem; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
[hidden] { display: none !important; }
.form-switch { padding-left: 2.9em; } .form-switch .form-check-input { width: 2.2em; margin-left: -2.9em; }
/* KI */
.chat { max-height: 60vh; overflow-y: auto; margin-bottom: .75rem; display: flex; flex-direction: column; } .bubble { max-width: 88%; padding: .6rem .9rem; border-radius: 1rem; margin-bottom: .5rem; overflow-wrap: anywhere; } .bubble.me { align-self: flex-end; background: #4453c4; color: #fff; } .bubble.ai { align-self: flex-start; background: var(--bs-tertiary-bg); } .bubble.err { color: var(--neg); } .bubble > :last-child { margin-bottom: 0; } .ai-text ul, .bubble ul { padding-left: 1.2rem; }
.chat .chip { flex: 0 1 auto; max-width: 100%; text-align: left; padding: .45rem .8rem; white-space: normal; }
