:root {
  --primary:     #1a1a2e;
  --accent:      #4f46e5;
  --bg:          #f8fafc;
  --card:        #ffffff;
  --text:        #1a1a2e;
  --text-muted:  #6b7280;
  --green:       #22c55e;
  --red:         #ef4444;
  --border:      #e5e7eb;
  --budget-ok:   #dcfce7;
  --budget-warn: #fef9c3;
  --budget-over: #fee2e2;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--primary); color: #fff;
  padding: .8rem 1rem; display: flex; flex-direction: column; gap: .15rem;
}
.brand { display: flex; align-items: center; gap: .6rem; font-size: 1.15rem; }
.logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; background: var(--accent); color: #fff;
  border-radius: 6px; font-weight: 700; font-size: .85rem; letter-spacing: -.5px;
}
.motto { color: #cbd5e1; font-size: .82rem; }

nav.tabs {
  display: flex; gap: .25rem; padding: .4rem .5rem;
  background: var(--primary);
  overflow-x: auto; scrollbar-width: thin;
  position: sticky; top: 64px; z-index: 9;
}
nav.tabs a {
  flex: 0 0 auto;
  color: #cbd5e1; text-decoration: none;
  padding: .45rem .75rem; border-radius: 6px;
  font-size: .92rem; white-space: nowrap;
}
nav.tabs a.active, nav.tabs a:hover { background: rgba(255,255,255,.12); color: #fff; }

main { max-width: 960px; margin: 0 auto; padding: 1rem; }
section[data-tab] { padding-bottom: 3rem; }

h2 { margin: 1rem 0 .8rem; font-size: 1.45rem; }
h3 { margin: 1.5rem 0 .6rem; font-size: 1.05rem; color: var(--text-muted); font-weight: 600; }

.row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.muted { color: var(--text-muted); font-size: .9rem; }

/* Buttons */
button { cursor: pointer; font: inherit; }
.btn-primary, .btn-secondary, .btn-danger {
  border: 0; border-radius: 6px; padding: .55rem 1rem; font-weight: 600;
}
.btn-primary  { background: var(--accent); color: #fff; }
.btn-secondary{ background: var(--card); color: var(--text); border: 1px solid var(--border); }
.btn-danger   { background: var(--red); color: #fff; }
button[disabled] { opacity: .4; cursor: not-allowed; }

/* Status / Banner */
.status { margin: .4rem 0; font-size: .92rem; }
.status[data-kind="ok"]    { color: var(--green); }
.status[data-kind="warn"]  { color: #b45309; }

.budget { padding: .8rem 1rem; border-radius: 8px; margin: .6rem 0 1rem; font-weight: 500; }
.budget.ok    { background: var(--budget-ok); color: #166534; }
.budget.warn  { background: var(--budget-warn); color: #854d0e; }
.budget.over  { background: var(--budget-over); color: #991b1b; }

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border); border-radius: 10px;
  padding: 2rem 1rem; text-align: center; background: var(--card);
}
.dropzone.hover { border-color: var(--accent); background: #eef2ff; }
.dropzone input[type=file] { display: block; margin: .8rem auto 0; }

/* Tables */
table.tx { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 8px; overflow: hidden; }
table.tx.wide { box-shadow: 0 1px 3px rgba(0,0,0,.06); }
table.tx th, table.tx td { padding: .55rem .7rem; border-bottom: 1px solid var(--border); text-align: left; font-size: .92rem; }
table.tx th { background: #f1f5f9; font-weight: 600; color: var(--text-muted); }
table.tx td.pos, table.tx tr td.pos { color: var(--green); font-weight: 600; }
table.tx td.neg, table.tx tr td.neg { color: var(--red);   font-weight: 600; }

.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .8rem; }
.filters select, .filters input { padding: .45rem .6rem; border: 1px solid var(--border); border-radius: 6px; background: var(--card); }
.month-select { padding: .4rem .6rem; border: 1px solid var(--border); border-radius: 6px; background: var(--card); }

.pager { display: flex; align-items: center; justify-content: center; gap: .8rem; margin-top: .8rem; }
.manual-mark { color: var(--accent); font-size: .8rem; margin-left: .3rem; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .6rem; margin: .6rem 0 1rem; }
.kpi { background: var(--card); padding: .9rem 1rem; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.kpi-label { color: var(--text-muted); font-size: .85rem; }
.kpi-value { font-size: 1.4rem; font-weight: 700; margin-top: .25rem; }
.kpi-value.pos { color: var(--green); }
.kpi-value.neg { color: var(--red); }

/* Top-Kategorien */
.top-cats { display: flex; flex-direction: column; gap: .35rem; }
.cat-row { display: grid; grid-template-columns: 32px 1fr 100px 90px; align-items: center; gap: .6rem; }
@media (max-width: 600px) { .cat-row { grid-template-columns: 28px 1fr 70px 80px; } }
.cat-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; color: #fff; font-size: 1rem; }
.cat-bar  { background: var(--border); height: 8px; border-radius: 4px; overflow: hidden; }
.cat-bar > span { display: block; height: 100%; }
.cat-amount { text-align: right; font-weight: 600; font-size: .92rem; }
.cat-label { font-size: .92rem; }

/* Charts */
.chart-wrap { background: var(--card); border-radius: 10px; padding: .8rem; box-shadow: 0 1px 3px rgba(0,0,0,.06); height: 280px; }
.chart-wrap.tall { height: 360px; }

/* Categories */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: .8rem; }
.cat-card { background: var(--card); padding: .8rem; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.cat-head { display: flex; align-items: center; gap: .55rem; margin-bottom: .55rem; }
.kw-list { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.kw-tag { background: #f1f5f9; padding: .15rem .45rem; border-radius: 4px; font-size: .8rem; }
.kw-tag button { border: 0; background: transparent; color: var(--red); font-weight: 700; cursor: pointer; padding: 0 .15rem; }
.kw-add input { padding: .25rem .45rem; border: 1px solid var(--border); border-radius: 4px; font-size: .8rem; width: 130px; }
.kw-add button { margin-left: .25rem; background: var(--accent); color: #fff; border: 0; border-radius: 4px; padding: .25rem .5rem; }

/* Settings */
.form-row { display: flex; align-items: center; gap: .8rem; margin: .6rem 0; }
.form-row input { padding: .45rem .6rem; border: 1px solid var(--border); border-radius: 6px; }
.settings-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin: .8rem 0; }
.confirm-box { background: var(--budget-over); padding: .9rem; border-radius: 8px; margin: .8rem 0; }
.confirm-box button { margin-right: .5rem; }

.history { padding-left: 1.2rem; }
.history li { font-size: .9rem; margin-bottom: .2rem; }

/* ===== V2: Period-Selektor (Analyse) ===== */
.period-bar { display: flex; gap: .35rem; margin: .5rem 0 .8rem; }
.period-btn {
  background: var(--card); color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 6px;
  padding: .35rem .7rem; font-size: .85rem; font-weight: 600;
}
.period-btn.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.period-btn:hover:not(.active) { background: #eef2ff; color: var(--accent); }

/* ===== V2: Normalisiert-Tab ===== */
.norm-summary {
  margin-top: 1rem; padding: 1rem;
  background: var(--card); border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.norm-total {
  font-size: 1.1rem; margin-bottom: .4rem;
}
.norm-total strong { color: var(--text); }
.norm-compare {
  font-size: .92rem; color: var(--text-muted);
}
.norm-compare .pos { color: var(--green); font-weight: 700; }
.norm-compare .neg { color: var(--red);   font-weight: 700; }

/* ===== V2: Liquiditäts-Tab ===== */
.liq-kpis {
  display: grid; gap: .6rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin: .6rem 0 1rem;
}
.liq-seven {
  list-style: none; padding: 0; margin: 0;
  background: var(--card); border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06); overflow: hidden;
}
.liq-seven li {
  padding: .55rem .8rem;
  border-bottom: 1px solid var(--border);
  font-size: .92rem;
}
.liq-seven li:last-child { border-bottom: 0; }
.liq-seven li.muted { color: var(--text-muted); font-style: italic; }

/* ===== V3: Accordion (Hilfe) ===== */
.accordion {
  background: var(--card); border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06); overflow: hidden;
  margin-top: .8rem;
}
.accordion-item { border-bottom: 1px solid var(--border); }
.accordion-item:last-child { border-bottom: 0; }
.accordion-header {
  width: 100%; background: none; border: 0;
  padding: .9rem 1rem; text-align: left;
  font-size: 1rem; font-weight: 600; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--text);
}
.accordion-header:hover  { background: var(--bg); }
.accordion-header.open   { background: #eef2ff; color: var(--accent); }
.accordion-header .chevron { transition: transform .2s; color: var(--text-muted); font-size: .9rem; }
.accordion-header.open .chevron { transform: rotate(180deg); color: var(--accent); }
.accordion-body {
  display: none; padding: 0 1rem 1rem;
  line-height: 1.7; color: var(--text); font-size: .95rem;
}
.accordion-body.open { display: block; }
.accordion-body ul, .accordion-body ol { padding-left: 1.4rem; }
.accordion-body li { margin: .25rem 0; }
.accordion-body p  { margin: .5rem 0; }
.accordion-body blockquote {
  border-left: 3px solid var(--accent);
  padding: .35rem .8rem; margin: .6rem 0;
  background: var(--bg); color: var(--text);
  font-style: italic;
}
.accordion-body code {
  background: var(--bg); padding: .1rem .35rem;
  border-radius: 4px; font-size: .88em;
}

/* ===== V3: Handbuch ===== */
.handbuch {
  max-width: 760px; margin: 0 auto; padding: 2rem 1.5rem 4rem;
  line-height: 1.7; color: var(--text);
}
.handbuch header { margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 2px solid var(--primary); }
.handbuch h1 { font-size: 2rem; margin: 0 0 .3rem; color: var(--primary); }
.handbuch .subtitle { color: var(--text-muted); font-size: 1.05rem; }
.handbuch .toc {
  background: var(--card); border-radius: 10px;
  padding: 1.2rem 1.5rem; margin: 1.5rem 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.handbuch .toc h2 { margin: 0 0 .8rem; font-size: 1.15rem; }
.handbuch .toc ol { margin: 0; padding-left: 1.4rem; }
.handbuch .toc li { margin: .3rem 0; }
.handbuch .toc a { color: var(--accent); text-decoration: none; }
.handbuch .toc a:hover { text-decoration: underline; }

.handbuch-section {
  margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border);
}
.handbuch-section h2 {
  font-size: 1.5rem; margin: 0 0 1rem; color: var(--primary);
}
.handbuch-section h3 {
  font-size: 1.1rem; margin: 1.2rem 0 .5rem; color: var(--text);
}
.handbuch-section ul, .handbuch-section ol { padding-left: 1.5rem; }
.handbuch-section li { margin: .25rem 0; }
.handbuch-section blockquote {
  border-left: 3px solid var(--accent);
  padding: .5rem 1rem; margin: 1rem 0;
  background: var(--bg); font-style: italic;
}
.handbuch-section code {
  background: var(--bg); padding: .1rem .4rem;
  border-radius: 4px; font-size: .88em;
}
.handbuch-section table {
  width: 100%; border-collapse: collapse; margin: .8rem 0;
  background: var(--card); border-radius: 8px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.handbuch-section th, .handbuch-section td {
  padding: .6rem .8rem; border-bottom: 1px solid var(--border);
  text-align: left; font-size: .92rem;
}
.handbuch-section th { background: #f1f5f9; font-weight: 600; }
.handbuch-footer {
  margin-top: 4rem; padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center; color: var(--text-muted); font-size: .9rem;
}

@media print {
  nav.tabs, .topbar, header.topbar { display: none !important; }
  body { background: #fff !important; }
  .handbuch { max-width: none; padding: 0; }
  .handbuch-section { page-break-before: always; }
  .handbuch header { page-break-after: avoid; }
  .handbuch .toc   { page-break-after: always; }
  .handbuch a { color: inherit; text-decoration: none; }
}

/* ===== V4: Modul-Liste (Einstellungen) ===== */
.module-list { list-style: none; padding: 0; margin: .5rem 0 1.2rem; background: var(--card); border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.module-list li {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .9rem; border-bottom: 1px solid var(--border);
  font-size: .95rem;
}
.module-list li:last-child { border-bottom: 0; }
.module-list input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); cursor: pointer; }
.module-list label { cursor: pointer; flex: 1; }
.module-list .muted-tag { font-size: .78rem; color: var(--text-muted); font-style: italic; }

/* ===== V4: Liquidität Mode-Switcher ===== */
.liq-mode {
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  margin: .6rem 0 1rem;
  padding: .6rem .8rem; background: var(--card); border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.liq-mode label { display: flex; align-items: center; gap: .35rem; cursor: pointer; font-size: .92rem; }
.liq-mode input[type="radio"] { accent-color: var(--accent); cursor: pointer; }
.liq-date-picker { padding: .35rem .55rem; border: 1px solid var(--border); border-radius: 6px; }
.liq-date-picker:disabled { opacity: .4; cursor: not-allowed; }

/* ===== V4: Liquidität Events-Section ===== */
.liq-events-section { margin-top: 1.5rem; }
.liq-events-section h4 { font-size: 1.05rem; margin: 0 0 .5rem; color: var(--text-muted); font-weight: 600; }
.liq-events-total { margin-top: .6rem; padding: .7rem 1rem; background: #f1f5f9; border-radius: 6px; font-size: .95rem; }

/* ===== V4: Event-Formular ===== */
.event-form {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 1rem; margin: 1rem 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  display: none;
}
.event-form.open { display: block; }
.event-form .form-row { display: flex; gap: .8rem; flex-wrap: wrap; margin-bottom: .7rem; }
.event-form .form-row > div { flex: 1; min-width: 140px; }
.event-form label { font-size: .82rem; color: var(--text-muted); display: block; margin-bottom: .2rem; }
.event-form input, .event-form select, .event-form textarea {
  width: 100%; padding: .45rem .6rem;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: .95rem; background: var(--bg); font-family: inherit;
  box-sizing: border-box;
}
.event-form input:focus, .event-form select:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.event-form .form-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }

/* ===== V4: Reminder-Banner (Dashboard) ===== */
.dash-reminders { display: flex; flex-direction: column; gap: .5rem; margin: .6rem 0; }
.reminder-banner {
  background: #eff6ff; border: 1px solid #93c5fd; border-radius: 10px;
  padding: .8rem 1rem;
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap;
}
.reminder-banner .reminder-text { line-height: 1.5; flex: 1; min-width: 220px; }
.reminder-banner .reminder-title { font-weight: 600; color: var(--text); }
.reminder-banner .reminder-quote { font-style: italic; color: #1e40af; }
.reminder-banner .reminder-sub { font-size: .88rem; color: var(--text-muted); margin-top: .15rem; }
.reminder-banner .reminder-dismiss {
  background: #fff; border: 1px solid #93c5fd; border-radius: 6px;
  padding: .35rem .8rem; font-size: .85rem; cursor: pointer;
  color: #1d4ed8; white-space: nowrap;
}
.reminder-banner .reminder-dismiss:hover { background: #dbeafe; }

/* ===== V4: Event-Liste Aktions-Buttons ===== */
#ev-list .btn-row { display: flex; gap: .35rem; flex-wrap: nowrap; }
#ev-list .btn-mini {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 4px; padding: .2rem .5rem; font-size: .82rem; cursor: pointer;
  color: var(--text); white-space: nowrap;
}
#ev-list .btn-mini:hover { background: var(--bg); border-color: var(--accent); color: var(--accent); }
#ev-list .btn-mini.danger { color: var(--red); }
#ev-list .btn-mini.danger:hover { background: #fef2f2; border-color: var(--red); }
.reminder-pill {
  display: inline-block; padding: .1rem .45rem; font-size: .78rem;
  border-radius: 4px; background: #f1f5f9; color: var(--text-muted);
}
.reminder-pill.active { background: #dbeafe; color: #1d4ed8; }
.reminder-pill.dismissed { background: #f3f4f6; color: var(--text-muted); text-decoration: line-through; }

/* ===== V5: Goals ===== */
.goals-summary {
  display: flex; gap: 1.5rem; flex-wrap: wrap;
  background: var(--card); border-radius: 10px;
  padding: .9rem 1.2rem; margin: .6rem 0 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  font-size: .92rem;
}
.goals-summary span strong { color: var(--text); }
.goals-summary .pos { color: var(--green); }
.goals-summary .accent { color: var(--accent); }

.goal-card {
  background: var(--card); border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  padding: 1rem 1.2rem; margin-bottom: .8rem;
  position: relative;
}
.goal-card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: .8rem;
}
.goal-card-title { font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: .4rem; }
.goal-card-menu { position: relative; }
.goal-card-menu-btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: .25rem .55rem; font-size: .85rem; cursor: pointer; color: var(--text-muted);
}
.goal-card-menu-btn:hover { background: var(--bg); color: var(--accent); }
.goal-card-menu-list {
  position: absolute; right: 0; top: 100%; margin-top: .25rem;
  background: var(--card); border: 1px solid var(--border); border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  min-width: 140px; z-index: 5;
  display: none;
}
.goal-card-menu-list.open { display: block; }
.goal-card-menu-list button {
  display: block; width: 100%; text-align: left; padding: .5rem .8rem;
  border: 0; background: none; cursor: pointer; font-size: .9rem; color: var(--text);
}
.goal-card-menu-list button:hover { background: var(--bg); }
.goal-card-menu-list button.danger { color: var(--red); }
.goal-card-menu-list button.danger:hover { background: #fef2f2; }

.goal-progress-wrap {
  background: var(--border); border-radius: 99px;
  height: 10px; overflow: hidden; margin-bottom: .5rem;
}
.goal-progress-bar { height: 100%; border-radius: 99px; transition: width .6s ease; }

.goal-amount { font-size: .92rem; color: var(--text-muted); margin-bottom: .4rem; }
.goal-amount strong { color: var(--text); }

.goal-meta {
  display: flex; gap: 1.5rem; flex-wrap: wrap;
  font-size: .88rem; color: var(--text-muted);
  margin-top: .5rem;
}
.goal-meta .on-track  { color: var(--green); font-weight: 600; }
.goal-meta .off-track { color: var(--red);   font-weight: 600; }

.goal-actions { display: flex; gap: .4rem; margin-top: .8rem; flex-wrap: wrap; }
.goal-actions button { font-size: .85rem; padding: .3rem .7rem; }

.goal-add-form {
  display: none; gap: .5rem; align-items: center;
  margin-top: .6rem; padding: .55rem .7rem;
  background: var(--bg); border-radius: 6px;
}
.goal-add-form.open { display: flex; }
.goal-add-input {
  width: 110px; padding: .35rem .5rem;
  border: 1px solid var(--border); border-radius: 6px; font-size: .9rem;
  background: var(--card);
}

/* Dashboard Sparziel-Widget */
.dash-goals {
  background: var(--card); border-radius: 10px;
  padding: .8rem 1.1rem; margin: 1rem 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.dash-goals h3 { font-size: .95rem; color: var(--text-muted); margin: 0 0 .6rem; font-weight: 600; }
.dash-goal-row {
  display: flex; align-items: center; gap: .8rem;
  margin-bottom: .4rem; font-size: .9rem;
}
.dash-goal-label { min-width: 140px; max-width: 200px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-goal-bar-wrap { flex: 1; background: var(--border); border-radius: 99px; height: 7px; overflow: hidden; min-width: 80px; }
.dash-goal-bar { height: 100%; border-radius: 99px; transition: width .6s ease; }
.dash-goal-pct { min-width: 40px; text-align: right; font-size: .82rem; color: var(--text-muted); }
.dash-goal-need { min-width: 110px; font-size: .82rem; color: var(--text-muted); white-space: nowrap; }
.dash-goals-link {
  display: inline-block; margin-top: .4rem;
  font-size: .85rem; color: var(--accent); text-decoration: none;
}
.dash-goals-link:hover { text-decoration: underline; }

/* Sparziel-Reminder-Banner (lila) */
.reminder-banner.goal { background: #f5f3ff; border-color: #c4b5fd; }
.reminder-banner.goal .reminder-quote { color: #6d28d9; }
.reminder-banner.goal .reminder-dismiss { color: #6d28d9; border-color: #c4b5fd; }
.reminder-banner.goal .reminder-dismiss:hover { background: #ede9fe; }

/* ===== V6: Einkommensart-Selector ===== */
.income-type-wrap { margin-bottom: 1rem; }
.income-type-wrap select {
  width: 100%; padding: .5rem .7rem;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: .95rem; background: var(--card);
}
.income-type-note {
  font-size: .85rem; color: var(--green);
  margin-top: .4rem; display: flex;
  align-items: center; gap: .4rem;
}
.income-type-note::before { content: "✓"; }
.income-type-wrap .form-row { margin: .5rem 0 0; }

/* Liquidität Ladezustand */
.liq-loading {
  color: var(--text-muted); font-style: italic;
  font-size: .9rem; padding: .5rem 0;
}

/* V6.1: AMS-Auszahlungsart Radios */
.ams-payout-wrap {
  margin-top: .8rem; padding: .6rem .8rem;
  background: var(--bg); border-radius: 8px;
}
.ams-payout-radio {
  display: inline-flex; align-items: center; gap: .35rem;
  margin-right: 1rem; cursor: pointer; font-size: .92rem;
}
.ams-payout-radio input[type="radio"] {
  accent-color: var(--accent); cursor: pointer;
}
.ams-payout-radio .muted { color: var(--text-muted); font-size: .85rem; }

/* V6.1: Liquidität Info-Text unter KPI */
.liq-next-info {
  font-size: .8rem; color: var(--text-muted);
  margin-top: .3rem; font-style: italic;
}

/* ====================== V7: Bank-Schnellzugriff + Feiertage ====================== */

/* Import-Tab Bank-Step */
.import-bank-step {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: .9rem 1rem;
  margin-bottom: 1.2rem;
}
.import-bank-step h4 {
  font-size: .85rem; color: var(--text-muted);
  margin: 0 0 .6rem; text-transform: uppercase;
  letter-spacing: .04em;
}

/* Bank-Button (Anker oder Button) */
.btn-bank {
  background: var(--accent, #4f46e5); color: #fff;
  border: none; border-radius: 8px;
  padding: .55rem 1.1rem; font-size: .95rem;
  cursor: pointer; display: inline-flex;
  align-items: center; gap: .5rem;
  text-decoration: none;
}
.btn-bank:hover { opacity: .88; }
.btn-bank:disabled,
.btn-bank.disabled {
  background: var(--border); color: var(--text-muted);
  cursor: not-allowed; pointer-events: none;
}
.import-bank-hint {
  font-size: .82rem; color: var(--text-muted);
  margin-top: .5rem;
}

/* Feiertags-Badge im Dashboard */
.holiday-badge {
  font-size: .82rem; color: #92400e;
  background: #fef3c7; border: 1px solid #fcd34d;
  border-radius: 6px; padding: .25rem .6rem;
  margin-top: .4rem; display: inline-block;
}

/* ====================== V8: Multi-Bank-Parser ====================== */

/* Bank-Erkennungs-Badge im Import-Tab */
.bank-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .35rem .7rem; border-radius: 999px;
  font-size: .85rem; font-weight: 500;
  margin: .5rem 0 .8rem;
}
.bank-badge.detected {
  background: #dcfce7; color: #166534; border: 1px solid #86efac;
}
.bank-badge.unknown {
  background: #fef3c7; color: #92400e; border: 1px solid #fcd34d;
}
.bank-badge.profile {
  background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd;
}

/* Field-Mapper-UI */
.mapper {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 1rem 1.2rem;
  margin: 1rem 0;
}
.mapper h4 { margin: 0 0 .4rem; font-size: 1rem; }
.mapper .muted { font-size: .88rem; margin: 0 0 .8rem; }
.mapper-meta {
  display: flex; gap: 1.2rem; font-size: .85rem;
  color: var(--text-muted); margin-bottom: .8rem;
}
.mapper-meta code {
  background: var(--border); padding: .1rem .35rem;
  border-radius: 3px; font-size: .9em;
}
.mapper-table {
  width: 100%; border-collapse: collapse;
  font-size: .9rem;
}
.mapper-table th, .mapper-table td {
  padding: .45rem .5rem; text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.mapper-table th {
  background: var(--bg-elev, var(--bg));
  font-weight: 600; color: var(--text-muted);
  font-size: .82rem; text-transform: uppercase;
  letter-spacing: .03em;
}
.mapper-table td.col-idx {
  width: 36px; color: var(--text-muted); font-variant-numeric: tabular-nums;
}
.mapper-table td.col-sample {
  max-width: 240px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-family: monospace; font-size: .85em;
  color: var(--text-muted);
}
.mapper-table select {
  padding: .3rem .5rem; font-size: .88rem;
  border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface, #fff);
}
.mapper-actions {
  display: flex; gap: .8rem; align-items: flex-end;
  margin-top: 1rem; flex-wrap: wrap;
}
.mapper-actions .form-row {
  flex-direction: column; align-items: stretch;
  margin: 0; min-width: 220px;
}
.mapper-actions .form-row input {
  margin-top: .3rem;
}

/* ====================== V9: Recurring + Sonstige + currentBalance ====================== */

/* Sonstige-Badge in der Transaktionen-Tabelle */
.badge-uncategorized {
  display: inline-flex; align-items: center; gap: .3rem;
  background: #fef3c7; color: #92400e;
  border: 1px solid #fcd34d; border-radius: 4px;
  font-size: .75rem; padding: .15rem .4rem;
  cursor: pointer; margin-left: .4rem;
}
.badge-uncategorized:hover { filter: brightness(.95); }

/* Sonstige-Banner im Dashboard */
.uncategorized-banner {
  background: #fffbeb; border: 1px solid #fcd34d;
  border-radius: 10px; padding: .8rem 1rem;
  margin-bottom: .8rem; display: flex;
  justify-content: space-between; align-items: flex-start;
  gap: 1rem;
}
.uncategorized-banner .banner-text { flex: 1; }
.uncategorized-banner strong { display: block; margin-bottom: .2rem; }
.uncategorized-banner .banner-actions { display: flex; gap: .5rem; flex-shrink: 0; }
.uncategorized-banner .btn-mini {
  background: #f59e0b; color: #fff; border: none;
  border-radius: 6px; padding: .35rem .7rem; font-size: .85rem;
  cursor: pointer; white-space: nowrap;
}
.uncategorized-banner .btn-mini.dismiss {
  background: transparent; color: #92400e; border: 1px solid #fcd34d;
}

/* Abbuchungen-Tab: Liste */
.recurring-actions {
  display: flex; gap: .6rem; flex-wrap: wrap;
  margin-bottom: .4rem;
}
.recurring-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.recurring-item {
  display: flex; align-items: center; gap: .8rem;
  padding: .7rem 1rem; border-bottom: 1px solid var(--border);
  background: var(--card, var(--surface, #fff));
}
.recurring-item.inactive { opacity: .5; }
.recurring-item .rec-toggle { cursor: pointer; }
.recurring-item .rec-icon { font-size: 1.1rem; }
.recurring-item .rec-name { flex: 1; font-weight: 500; }
.recurring-item .rec-name .rec-auto-badge {
  font-size: .7rem; margin-left: .4rem;
  background: var(--border); color: var(--text-muted);
  padding: .1rem .35rem; border-radius: 3px;
}
.recurring-item .rec-amount {
  color: var(--red, #dc2626); font-weight: 600;
  min-width: 90px; text-align: right;
  font-variant-numeric: tabular-nums;
}
.recurring-item .rec-day {
  color: var(--text-muted); font-size: .85rem;
  min-width: 90px;
}
.recurring-item .rec-actions { display: flex; gap: .3rem; }
.recurring-item .btn-mini {
  background: transparent; border: 1px solid var(--border);
  border-radius: 5px; padding: .2rem .5rem; font-size: .85rem;
  cursor: pointer; color: var(--text);
}
.recurring-item .btn-mini.danger { color: var(--red, #dc2626); }
.recurring-item .btn-mini:hover { background: var(--bg); }

/* Bearbeiten-Form (klappt auf) */
.recurring-edit-form {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: .9rem 1rem; margin: .4rem 0;
  display: none;
}
.recurring-edit-form.open { display: block; }

/* ====================== V9.2: Import-Register + Vorschau-Aufschlüsselung ====================== */

.import-register {
  list-style: none; padding: 0; margin: .6rem 0 0;
  border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden;
}
.import-register li {
  display: flex; align-items: center; gap: .8rem;
  padding: .8rem 1rem; border-bottom: 1px solid var(--border);
  background: var(--card, var(--surface, #fff));
}
.import-register li:last-child { border-bottom: none; }
.import-register .reg-icon { font-size: 1.2rem; flex-shrink: 0; }
.import-register .reg-info { flex: 1; min-width: 0; }
.import-register .reg-name {
  font-weight: 500; word-break: break-all;
}
.import-register .reg-meta {
  font-size: .82rem; color: var(--text-muted); margin-top: .15rem;
}
.import-register .reg-legacy {
  font-size: .78rem; color: var(--text-muted);
  font-style: italic; margin-top: .15rem;
}
.import-register .btn-mini.danger {
  background: transparent; color: var(--red, #dc2626);
  border: 1px solid #fcd34d; border-radius: 6px;
  padding: .35rem .7rem; font-size: .85rem; cursor: pointer;
  white-space: nowrap;
}
.import-register .btn-mini.danger:hover { background: #fef3c7; }

/* Vorschau-Aufschlüsselung */
.import-summary {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: .7rem 1rem; margin: .6rem 0;
  font-size: .9rem;
}
.import-summary .sum-row {
  display: flex; justify-content: space-between;
  padding: .2rem 0; font-variant-numeric: tabular-nums;
}
.import-summary .sum-row strong { font-weight: 600; }
.import-summary .sum-row.dup { color: #92400e; }
.import-summary .sum-row.err { color: var(--red, #dc2626); }
.import-summary .dup-list {
  margin-top: .4rem; padding-top: .4rem;
  border-top: 1px dashed var(--border);
}
.import-summary .dup-list-title {
  font-size: .8rem; color: var(--text-muted);
  margin-bottom: .25rem;
}
.import-summary .dup-list ul {
  list-style: none; padding: 0; margin: 0;
  font-size: .82rem; font-family: monospace;
}
.import-summary .dup-list li { padding: .1rem 0; color: var(--text-muted); }

/* ====================== V9.4: Erfolgs-Banner + Daten-verwalten ====================== */

/* Import-Erfolgs-Banner */
.import-success-banner {
  background: #f0fdf4; border: 1px solid #86efac;
  border-radius: 10px; padding: 1rem 1.2rem;
  margin-top: 1rem;
}
.import-success-banner h4 {
  color: #166534; font-size: 1rem;
  margin: 0 0 .5rem;
}
.import-success-banner p {
  margin: 0 0 .4rem; font-size: .9rem; color: #166534;
}
.import-success-banner .banner-actions {
  display: flex; gap: .8rem; flex-wrap: wrap;
  margin-top: .8rem; align-items: center;
}
.import-success-banner .banner-actions .btn-primary {
  background: #16a34a;
}
.import-success-banner .banner-actions .btn-primary:hover {
  background: #15803d;
}
.import-undo-btn {
  background: none; border: 1px solid #86efac;
  border-radius: 6px; padding: .35rem .8rem;
  font-size: .88rem; cursor: pointer; color: #166534;
}
.import-undo-btn:hover { background: #dcfce7; }
.import-undo-btn:disabled {
  opacity: .4; cursor: not-allowed;
}
.import-success-banner .undo-hint {
  font-size: .82rem; color: #166534; opacity: .8;
}

/* Daten verwalten Abschnitt */
.data-manage-section {
  border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
  margin-top: .5rem;
}
.data-manage-item {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
  background: var(--card, var(--surface, #fff));
}
.data-manage-item:last-child { border-bottom: 0; }
.data-manage-item h4 {
  font-size: .95rem; margin: 0 0 .3rem;
}
.data-manage-item p {
  font-size: .85rem; color: var(--text-muted);
  margin: 0 0 .7rem;
}
.data-manage-item.danger { background: #fef2f2; }
.data-manage-item.danger h4 { color: var(--red, #dc2626); }
.data-manage-item.danger p  { color: #b91c1c; }
.data-manage-item .confirm-box {
  margin-top: .7rem;
}

/* Reset-Bestätigung */
.reset-confirm-input {
  width: 100%; max-width: 320px;
  padding: .45rem .6rem;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: .95rem; margin: .5rem 0;
  font-family: monospace;
  letter-spacing: .05em;
}
.reset-confirm-input.valid {
  border-color: var(--red, #dc2626); background: #fff1f1;
}

/* ====================== V9.5: Onboarding + Available-KPI + Reconcile + Import-Reminder ====================== */

/* Onboarding-Karte im Import-Tab */
.onboarding-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.4rem 1.6rem;
  margin-bottom: 1.4rem;
}
.onboarding-card h3 { margin: 0 0 .3rem; font-size: 1.2rem; }
.onboarding-card h4 {
  margin: 1.1rem 0 .35rem; font-size: .92rem;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .04em;
}
.onboarding-card input[type="number"],
.onboarding-card input[type="text"],
.onboarding-card select {
  width: 100%; max-width: 320px;
  padding: .5rem .7rem; font-size: 1rem;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface, #fff);
}
.onboarding-card .small { font-size: .8rem; margin: .25rem 0 0; }
.onboarding-card #onb-day-wrap { margin-top: .5rem; }
.onboarding-card #onb-ams-wrap { margin-top: .5rem; }
.onboarding-card #onb-ams-wrap label {
  margin-right: 1rem; font-size: .92rem; cursor: pointer;
}
.onboarding-card .form-actions { margin-top: 1.4rem; }

/* "Noch verfügbar"-KPI im Liquiditäts-Tab */
.available-kpi {
  border-radius: 12px; padding: 1.2rem 1.4rem;
  margin-bottom: 1.2rem; border: 2px solid;
}
.available-kpi.positive { background: #dcfce7; border-color: #86efac; }
.available-kpi.warning  { background: #fef3c7; border-color: #fcd34d; }
.available-kpi.negative { background: #fee2e2; border-color: #fca5a5; }
.available-kpi.unset    { background: #f3f4f6; border-color: #d1d5db; }
.available-kpi .available-label {
  font-size: .88rem; color: var(--text-muted); margin-bottom: .3rem;
}
.available-kpi .available-amount {
  font-size: 2rem; font-weight: 700; margin: .2rem 0 .6rem;
  font-variant-numeric: tabular-nums;
}
.available-kpi .available-warning {
  color: #b91c1c; font-weight: 600; margin-top: .3rem;
}
.available-kpi .available-breakdown {
  font-size: .85rem; border-top: 1px solid rgba(0,0,0,.08);
  padding-top: .6rem; margin-top: .4rem;
}
.available-kpi .available-breakdown div {
  display: flex; justify-content: space-between; padding: .12rem 0;
  color: var(--text-muted);
}
.available-kpi .available-breakdown .avail-total {
  font-weight: 700; color: var(--text);
  border-top: 1px solid rgba(0,0,0,.1);
  margin-top: .3rem; padding-top: .3rem;
}
.available-kpi .btn-mini {
  background: var(--accent, #4f46e5); color: #fff;
  border: none; border-radius: 6px;
  padding: .3rem .7rem; font-size: .85rem; cursor: pointer;
  margin-top: .5rem;
}

/* Kontostand-Subtext im Liquidität-KPI */
.kpi .kpi-subtext {
  font-size: .75rem; color: var(--text-muted);
  margin-top: .2rem;
}

/* Reconcile-Box nach Import */
.reconcile-box {
  background: #eff6ff; border: 1px solid #93c5fd;
  border-radius: 10px; padding: 1rem 1.2rem;
  margin-top: 1rem;
}
.reconcile-box h4 {
  margin: 0 0 .5rem; color: #1e40af; font-size: 1rem;
}
.reconcile-box .recon-row {
  display: flex; justify-content: space-between;
  padding: .15rem 0; font-variant-numeric: tabular-nums;
  font-size: .9rem;
}
.reconcile-box .recon-row.deviation {
  font-weight: 600; padding-top: .4rem;
  border-top: 1px solid rgba(0,0,0,.1); margin-top: .3rem;
}
.reconcile-box .recon-row.deviation.warning { color: #b91c1c; }
.reconcile-box .recon-actions {
  display: flex; gap: .6rem; margin-top: .8rem; flex-wrap: wrap;
}

/* Import-Erinnerung am 15. */
.import-reminder-banner {
  background: #eff6ff; border: 1px solid #93c5fd;
  border-radius: 10px; padding: .8rem 1rem;
  margin-bottom: .8rem;
  display: flex; flex-direction: column; gap: .4rem;
}
.import-reminder-banner h4 {
  margin: 0; color: #1e40af; font-size: .95rem;
}
.import-reminder-banner p {
  margin: 0; font-size: .85rem; color: #1e3a8a;
}
.import-reminder-banner .reminder-actions {
  display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .3rem;
}
.import-reminder-banner .btn-mini {
  background: #3b82f6; color: #fff; border: none;
  border-radius: 6px; padding: .3rem .7rem; font-size: .82rem;
  cursor: pointer;
}
.import-reminder-banner .btn-mini.secondary {
  background: transparent; color: #1e40af; border: 1px solid #93c5fd;
}

/* ====================== V9.6: Fix/Variabel-Badges + Liquiditätshinweis ====================== */

.rec-fix-badge {
  display: inline-block; font-size: .7rem;
  padding: .12rem .4rem; border-radius: 4px;
  margin-left: .5rem; font-weight: 600;
  letter-spacing: .03em;
  vertical-align: middle;
}
.rec-fix-badge.fix {
  background: #dcfce7; color: #166534;
  border: 1px solid #86efac;
}
.rec-fix-badge.variabel {
  background: #f3f4f6; color: #6b7280;
  border: 1px solid #d1d5db;
}

.liq-fix-hint {
  font-size: .82rem; color: var(--text-muted);
  margin: .6rem 0 1.2rem;
  padding: .5rem .8rem;
  background: #f8fafc; border-left: 3px solid #cbd5e1;
  border-radius: 4px;
}
.liq-fix-hint a {
  color: var(--accent, #4f46e5); text-decoration: none;
  margin-left: .5rem;
}
.liq-fix-hint a:hover { text-decoration: underline; }

/* ====================== V9.7: 7-Tage Card-Liste + Inline-Aktionen ====================== */

.liq-item-list {
  list-style: none; padding: 0; margin: 0;
  border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
}
.liq-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--card, var(--surface, #fff));
}
.liq-item:last-child { border-bottom: 0; }
.liq-item-date {
  font-size: .85rem; color: var(--text-muted);
  min-width: 90px; font-variant-numeric: tabular-nums;
}
.liq-item-icon { font-size: 1.1rem; }
.liq-item-name { flex: 1; font-weight: 500; }
.liq-item-amount {
  color: var(--red, #dc2626); font-weight: 600;
  min-width: 80px; text-align: right;
  font-variant-numeric: tabular-nums;
}
.liq-item-actions { display: flex; gap: .3rem; flex-shrink: 0; }
.liq-item-btn {
  background: none; border: 1px solid var(--border);
  border-radius: 5px; padding: .2rem .55rem;
  font-size: .78rem; cursor: pointer; color: var(--text-muted);
  white-space: nowrap;
}
.liq-item-btn:hover { background: var(--bg); color: var(--text); }
.liq-item-btn.danger:hover { border-color: var(--red, #dc2626); color: var(--red, #dc2626); }

/* Inline-Aktion-Buttons in Tabelle (Kommende Abbuchungen) */
#liq-upcoming-rows .liq-item-btn { padding: .15rem .45rem; font-size: .85rem; }

/* Undo-Toast nach Inline-Disable */
.liq-undo-toast {
  font-size: .85rem; color: var(--text-muted);
  padding: .45rem .8rem; background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px;
  margin: .5rem 0 1rem; display: inline-flex;
  align-items: center; gap: .6rem;
}
.liq-undo-toast button {
  background: none; border: none;
  color: var(--accent, #4f46e5);
  cursor: pointer; font-size: .85rem;
  padding: 0; font-weight: 600;
}
.liq-undo-toast button:hover { text-decoration: underline; }

/* V9.9: Verbleibende-Tage Farbcodierung */
.days-today    { color: var(--red, #dc2626); font-weight: 600; }
.days-tomorrow { color: #ea580c; font-weight: 500; }
.days-far      { color: var(--text-muted); }
