:root {
  color-scheme: light;
  --bg: #f8f9ff;
  --surface: #f8f9ff;
  --surface-soft: #f2f3f9;
  --ink: #191c20;
  --muted: #5f6473;
  --subtle: #737688;
  --line: #dfe2ee;
  --line-strong: #c3c5d9;
  --blue: #003ec7;
  --navy: #17384f;
  --teal: #0f766e;
  --green: #2f8f54;
  --red: #e24a4a;
  --gold: #a87900;
  --yellow: #ffd97d;
  --yellow-soft: #fff9e6;
  --shadow: 0 18px 42px rgba(25, 28, 32, .06);
  --shadow-soft: 0 8px 22px rgba(25, 28, 32, .04);
  --shadow-lift: 0 24px 60px rgba(25, 28, 32, .08);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "tnum";
}

h1,h2,h3,p { margin: 0; }
button,.button,input,select { font: inherit; }
button,.button { cursor: pointer; }

.app-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  width: 100%;
  min-height: 100vh;
  margin: 0;
  min-width: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: var(--bg);
  box-shadow: none;
  transition: grid-template-columns .22s ease;
}
.app-layout.sidebar-collapsed {
  grid-template-columns: 88px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 24px;
  background: var(--surface);
  border-right: 1px solid var(--line-strong);
  backdrop-filter: none;
  min-width: 0;
}

.brand {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 14px;
  padding: 6px 2px 22px;
}
.brand-copy {
  min-width: 0;
  transition: opacity .16s ease, transform .16s ease;
}
.brand-mark {
  width: 40px; height: 40px; border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #7aa2ff 0%, #2f6fed 100%);
  box-shadow: 0 12px 24px rgba(0, 62, 199, .18);
}
.brand-mark::before {
  content: "account_balance";
  font-family: "Material Symbols Outlined";
  color: #fff;
  font-size: 26px;
  line-height: 1;
  font-variation-settings: "FILL" 1, "wght" 500;
}
.sidebar-toggle {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .86);
  color: #334155;
  box-shadow: 0 8px 18px rgba(25, 42, 70, .05);
}
.sidebar-toggle::before {
  content: "‹";
  font-size: 21px;
  font-weight: 800;
  line-height: 1;
}
.sidebar-toggle:hover,
.sidebar-toggle:focus-visible {
  background: #eef5ff;
  border-color: #d8e6fb;
  outline: none;
}
.eyebrow {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
h1 { font-size: 22px; line-height: 1.05; }
h2 { font-size: 40px; line-height: 1.08; letter-spacing: 0; font-weight: 800; }
h3 { font-size: 16px; line-height: 1.25; }

.tabbar {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.tabbar button,
.sidebar-action {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  width: 100%;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #243247;
  font-size: 15px;
  font-weight: 720;
  text-align: left;
  text-decoration: none;
  overflow: hidden;
  white-space: nowrap;
  transition: justify-content .18s ease, padding .18s ease, gap .18s ease, background .16s ease, color .16s ease, box-shadow .16s ease;
}
.tabbar button::before,
.sidebar-action::before {
  display: inline-grid;
  place-items: center;
  width: 24px;
  color: #434656;
  font-family: "Material Symbols Outlined";
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  font-variation-settings: "FILL" 0, "wght" 400;
}
.tabbar button[data-tab="overview"]::before { content: "home"; }
.tabbar button[data-tab="cashflow"]::before { content: "insights"; }
.tabbar button[data-tab="categories"]::before { content: "category"; }
.tabbar button[data-tab="recurring"]::before { content: "subscriptions"; }
.tabbar button[data-tab="forecast"]::before { content: "calendar_month"; }
.tabbar button[data-tab="gastronomy"]::before { content: "restaurant"; }
.tabbar button[data-tab="mobility"]::before { content: "directions_car"; }
.tabbar button[data-tab="saving"]::before { content: "savings"; }
.tabbar button[data-tab="wealth"]::before { content: "account_balance_wallet"; }
.tabbar button[data-tab="bookings"]::before { content: "receipt_long"; }
.sidebar-action::before { content: "backup"; }
.sidebar-action[href]::before { content: "logout"; }
.tabbar button.active {
  color: var(--blue);
  background: #dee2ed;
  border-color: transparent;
  box-shadow: none;
}
.tabbar button:focus-visible,
.sidebar-action:focus-visible,
.sidebar-toggle:focus-visible {
  outline: 2px solid rgba(0, 62, 199, .24);
  outline-offset: 2px;
}
.tabbar button.active:focus-visible {
  outline: none;
}
.tabbar button.active::before {
  color: var(--blue);
  font-variation-settings: "FILL" 1, "wght" 500;
}
.tabbar button:hover,
.sidebar-action:hover { background: var(--surface-soft); }
.sidebar-footer {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.sidebar-action {
  justify-content: flex-start;
  color: #243247;
  background: #fff;
  border-color: var(--line);
  box-shadow: 0 8px 18px rgba(25, 42, 70, .04);
}
.app-layout.sidebar-collapsed .sidebar {
  gap: 22px;
  padding: 30px 16px;
}
.app-layout.sidebar-collapsed .brand {
  grid-template-columns: 40px;
  justify-content: center;
  gap: 0;
  padding-left: 0;
  padding-right: 0;
}
.app-layout.sidebar-collapsed .brand-copy {
  width: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateX(-6px);
}
.app-layout.sidebar-collapsed .sidebar-toggle {
  position: absolute;
  top: 36px;
  right: 10px;
  z-index: 3;
  background: #fff;
}
.app-layout.sidebar-collapsed .sidebar-toggle::before {
  content: "›";
}
.app-layout.sidebar-collapsed .tabbar,
.app-layout.sidebar-collapsed .sidebar-footer {
  justify-items: center;
}
.app-layout.sidebar-collapsed .tabbar button,
.app-layout.sidebar-collapsed .sidebar-action {
  justify-content: center;
  width: 48px;
  padding: 0;
  gap: 0;
  color: transparent;
  font-size: 0;
}
.app-layout.sidebar-collapsed .tabbar button::before,
.app-layout.sidebar-collapsed .sidebar-action::before {
  margin: 0;
  color: #334155;
  font-size: 17px;
}
.app-layout.sidebar-collapsed .tabbar button.active::before {
  color: var(--blue);
}
.app-layout.sidebar-collapsed .sidebar-footer {
  grid-template-columns: 1fr;
}

.shell {
  width: min(100%, 1440px);
  padding: 32px 40px 48px;
  min-width: 0;
}
.command-bar {
  position: relative;
  top: 0;
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(520px, auto);
  gap: 24px;
  align-items: start;
  margin: 0 0 26px;
  padding: 0;
  background: transparent;
  border-bottom: 0;
  backdrop-filter: none;
}
.status-line { margin-top: 8px; color: var(--muted); font-size: 16px; font-weight: 500; }
body.forecast-mode .filters { display: none; }
.filters {
  display: grid;
  grid-template-columns: minmax(180px, .7fr) minmax(180px, .7fr) minmax(210px, .8fr);
  gap: 12px;
}
#searchInput,
#rangePreset { display: none; }
input,select {
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  color: var(--ink);
  padding: 0 18px;
  font-size: 15px;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
}
input:focus,select:focus {
  border-color: #8bb8f8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
  outline: none;
}

.page { display: none; }
.page.active { display: block; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.overview-metrics { grid-template-columns: repeat(5, minmax(140px, 1fr)); }
.overview-metrics:empty { display: none; }
.overview-hero {
  display: block;
  margin-bottom: 18px;
}
.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 16px;
}
.kpi-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 11px;
  min-height: 198px;
  padding: 28px 26px;
  border: 1px solid #e2eaf3;
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 18px 42px rgba(25, 42, 70, .055);
}
.kpi-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 5px;
  border-radius: 50%;
  font-size: 22px;
  font-weight: 850;
}
.kpi-card span {
  position: absolute;
  top: 39px;
  left: 82px;
  right: 18px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 820;
}
.kpi-card strong {
  margin-top: 14px;
  color: var(--ink);
  font-size: 40px;
  line-height: 1;
  letter-spacing: 0;
}
.kpi-card small {
  color: #344054;
  font-size: 15px;
  line-height: 1.35;
}
.kpi-card.income .kpi-icon { color: var(--green); background: #e9f7ee; }
.kpi-card.income strong { color: #1f6f43; }
.kpi-card.outcome .kpi-icon { color: var(--blue); background: #eaf2ff; }
.kpi-card.balance .kpi-icon { color: var(--red); background: #fff0f0; }
.kpi-card.balance.positive .kpi-icon { color: var(--green); background: #e9f7ee; }
.kpi-card.balance.negative strong { color: var(--red); }
.kpi-card.balance.positive strong { color: var(--green); }
.kpi-card.saving .kpi-icon { color: var(--green); background: #e9f7ee; }
.kpi-card.saving strong { color: var(--green); }
.kpi-card .flow-track-wrap {
  margin-top: auto;
}
.classification-strip {
  display: grid;
  grid-template-columns: minmax(220px, .66fr) repeat(3, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid #e2eaf3;
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 18px 42px rgba(25, 42, 70, .052);
}
.classification-strip-head,
.class-pill {
  min-height: 112px;
  padding: 21px 24px;
  border-right: 1px solid #edf2f7;
}
.class-pill:last-child { border-right: 0; }
.classification-strip-head {
  display: grid;
  align-content: center;
  gap: 5px;
  background: linear-gradient(180deg, #fbfdff, #f8fbff);
}
.classification-strip-head strong {
  color: var(--ink);
  font-size: 19px;
  line-height: 1.1;
}
.class-pill {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  gap: 7px 16px;
}
.class-pill::before {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  top: 0;
  height: 4px;
  border-radius: 0 0 999px 999px;
  background: var(--blue);
}
.class-pill span {
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
  text-transform: none;
}
.class-pill strong {
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}
.class-pill small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}
.class-pill em {
  grid-row: 1 / 3;
  align-self: center;
  justify-self: end;
  padding: 4px 9px;
  border-radius: 999px;
  color: #344054;
  background: #f1f5f9;
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}
.class-pill.basis::before { background: linear-gradient(90deg, var(--blue), var(--navy)); }
.class-pill.leisure::before { background: linear-gradient(90deg, #2f7f73, var(--green)); }
.class-pill.saving::before { background: linear-gradient(90deg, #d2b53c, var(--gold)); }
.class-pill.saving strong { color: var(--green); }
.flow-track {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
}
.flow-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}
.flow-track-wrap {
  position: relative;
  display: grid;
  align-content: end;
  min-height: 22px;
}
.flow-track-wrap.has-excess { min-height: 22px; }
.flow-excess {
  position: absolute;
  top: 0;
  bottom: 0;
  display: block;
  border-left: 2px solid rgba(255, 255, 255, .85);
  border-radius: 0 999px 999px 0;
  background-size: 8px 8px;
}
.flow-excess.positive {
  background-color: rgba(47, 143, 84, .34);
  background-image: repeating-linear-gradient(45deg, rgba(47, 143, 84, .5) 0 2px, transparent 2px 6px);
}
.flow-excess.negative {
  background-color: rgba(181, 72, 72, .28);
  background-image: repeating-linear-gradient(45deg, rgba(181, 72, 72, .52) 0 2px, transparent 2px 6px);
}
.review-panel {
  margin-bottom: 0;
}
.review-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 18px;
  padding: 28px;
  min-height: 310px;
}
.review-card h3 {
  margin-bottom: 28px;
  font-size: 19px;
}
.review-card p {
  color: #344054;
  font-size: 16px;
}
.review-card strong {
  display: block;
  margin-top: 14px;
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
}
.review-illustration {
  align-self: start;
  justify-self: end;
  width: 118px;
  height: 118px;
  border-radius: 0;
  object-fit: contain;
  object-position: center;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.review-note {
  grid-column: 1 / -1;
  padding: 16px 18px;
  border-radius: 8px;
  color: #243247;
  background: #eef5ff;
  font-size: 14px;
  line-height: 1.45;
}
.review-note::before {
  content: "i";
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: 10px;
  border: 1px solid var(--blue);
  border-radius: 50%;
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
}
.review-card button {
  grid-column: 1 / -1;
  min-height: 44px;
  border: 1px solid #2b64dd;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(180deg, #3d7bff, #2f6fed);
  box-shadow: 0 12px 24px rgba(47, 111, 237, .2);
  font-weight: 850;
}
.review-card button:hover,
.review-card button:focus-visible {
  background: linear-gradient(180deg, #316ff1, #285fd3);
  outline: none;
}
.metric,
.panel {
  background: rgba(255, 255, 255, .9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}
.metric {
  min-height: 78px;
  padding: 11px 13px;
  transition: transform .16s ease, box-shadow .16s ease;
}
.metric:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.metric span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
}
.metric strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 23px;
  line-height: 1.05;
}
.metric small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}
.metric.positive { border-color: #cfe8d8; }
.metric.positive strong { color: var(--green); }
.metric.negative { border-color: #efc7c7; background: linear-gradient(180deg, #fff, #fffafa); }
.metric.negative strong { color: var(--red); }
.metric.warning { border-color: #efd47a; background: linear-gradient(180deg, #fff, #fffaf0); }
.metric.warning strong { color: var(--gold); }

.grid { display: grid; gap: 12px; margin-bottom: 12px; }
.grid.two { grid-template-columns: minmax(520px, 1.05fr) minmax(420px, .95fr); align-items: start; }
.overview-side { display: grid; gap: 14px; min-width: 0; }
.grid .wide { min-width: 0; }
.overview-trend-panel { grid-column: 1 / -1; }
.panel {
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border-color: #e7eef6;
  background: rgba(255, 255, 255, .96);
}
.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px;
  min-height: 52px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.panel-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  text-align: right;
}
.panel-body { padding: 14px 18px; }
.spend-panel .panel-body {
  max-height: 640px;
  overflow: auto;
}
.chart-body { min-height: 0; padding: 16px 18px 14px; overflow: hidden; }
.chart-body.tall { min-height: 0; }
.chart-body svg { width: 100%; height: 276px; display: block; }
.trend-panel .chart-body { padding: 14px 18px 12px; }
.trend-panel .chart-body svg { height: 430px; }
.overview-trend-panel .chart-body { padding: 22px 26px 18px; }
.chart-body.tall svg { height: 282px; }

.table-wrap { overflow: auto; max-height: calc(100vh - 205px); }
.table-wrap.compact { max-height: 430px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 11px;
  color: var(--muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  text-align: left;
}
td {
  padding: 8px 11px;
  border-bottom: 1px solid #edf1f5;
  color: #2f3742;
  font-size: 12px;
  vertical-align: middle;
}
tbody tr:nth-child(even) td { background: #fbfcfe; }
tbody tr:hover td { background: #f3f8ff; }
tbody tr.changed td { background: #fffaf0; }
.right { text-align: right; font-variant-numeric: tabular-nums; }
td input, td select { min-width: 190px; min-height: 30px; font-size: 12px; }
td .description-input { min-width: 320px; }

.actions { white-space: nowrap; text-align: center; }
.autosave-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.autosave-state svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.autosave-state.pending { color: var(--gold); background: #fffaf0; border-color: #efd47a; }
.autosave-state.saving { color: #0f3f68; background: #eef6ff; border-color: #b9d6fb; }
.autosave-state.saving svg { animation: spin .9s linear infinite; }
.autosave-state.saved { color: var(--green); background: #ecf8f0; border-color: #cfe8d8; }
.autosave-state.error { color: var(--red); }
@keyframes spin { to { transform: rotate(360deg); } }
.amount-positive { color: var(--green); font-weight: 780; }
.amount-negative { color: var(--red); font-weight: 780; }

.rank-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  width: 100%;
  column-gap: 14px;
  row-gap: 5px;
  align-items: center;
  padding: 10px 0 12px;
  border: 0;
  border-bottom: 1px solid #edf1f5;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  text-align: left;
}
.rank-row::before {
  content: "•";
  display: grid;
  place-items: center;
  grid-row: 1 / 3;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: #2f6fed;
  background: linear-gradient(135deg, #eaf2ff, #f6f9fd);
  border: 1px solid #e3ebf5;
  font-size: 18px;
  font-weight: 850;
  line-height: 1;
}
.rank-row[data-overview-category*="Sparen"]::before { content: "◉"; color: var(--green); background: #eaf8ef; border-color: #d5eddc; }
.rank-row[data-overview-category*="Miete"]::before,
.rank-row[data-overview-category*="Lebenshaltung"]::before { content: "⌂"; color: var(--blue); background: #eef5ff; border-color: #dbe8ff; }
.rank-row[data-overview-category*="Mobilität"]::before { content: "↔"; color: #6554d9; background: #f0edff; border-color: #e2dcff; }
.rank-row[data-overview-category*="aufschlüssel"]::before,
.rank-row[data-overview-category*="Prüfen"]::before { content: "?"; color: #475467; background: #f3f6fa; border-color: #e3e9f2; }
.rank-row[data-overview-category*="Hobby"]::before,
.rank-row[data-overview-category*="Kleidung"]::before { content: "□"; color: #e06b3d; background: #fff3ed; border-color: #f8ded0; }
.rank-row[data-overview-category*="Verträge"]::before,
.rank-row[data-overview-category*="Abos"]::before { content: "≡"; color: #d08200; background: #fff7e8; border-color: #f4dfb8; }
.rank-row[data-overview-category*="Camping"]::before,
.rank-row[data-overview-category*="Wandern"]::before { content: "△"; color: #168b8a; background: #eaf8f7; border-color: #d3edec; }
.rank-row[data-overview-category*="Gastronomie"]::before { content: "∪"; color: #d84343; background: #fff0f0; border-color: #f4d4d4; }
.rank-row[data-overview-category*="Gesundheit"]::before,
.rank-row[data-overview-category*="Fitness"]::before { content: "+"; color: var(--green); background: #edf9f0; border-color: #d8efd8; }
.rank-row[data-overview-category*="Entertainment"]::before { content: "▶"; color: #7a5ce1; background: #f1edff; border-color: #e2dcff; }
.rank-row:hover,
.rank-row:focus-visible { background: #f6f9fc; outline: none; }
.rank-row:hover .rank-track i,
.rank-row:focus-visible .rank-track i { filter: saturate(1.18); }
.rank-head { display: flex; justify-content: space-between; gap: 14px; }
.rank-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
}
.rank-row span { color: var(--muted); font-weight: 780; }
.rank-row em {
  justify-self: start;
  padding: 2px 7px;
  border-radius: 999px;
  color: #8a6400;
  background: #fff4c7;
  font-size: 10px;
  font-style: normal;
  font-weight: 820;
}
.rank-track { height: 6px; background: #edf1f5; border-radius: 999px; overflow: hidden; }
.rank-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--teal)); border-radius: inherit; }
.rank-row.needs-review .rank-track i { background: linear-gradient(90deg, #d2a106, var(--gold)); }

.chip-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 8px; padding: 12px; }
.category-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fbfcfe;
  font-size: 12px;
  font-weight: 690;
  line-height: 1.12;
  padding: 7px 10px;
  gap: 8px;
}
.category-chip strong { font-size: 13px; white-space: nowrap; }
.category-chip.active { background: #eaf6fb; border-color: #8cc4d7; box-shadow: inset 3px 0 0 #23779d; }
.tag { display: inline-flex; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; background: #eef2f7; }
.tag.good { color: var(--green); background: #e9f6ee; }
.tag.warn { color: var(--gold); background: #fff4c7; }
.action-list { display: grid; gap: 8px; padding: 12px; }
.action-card { padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe; }
.action-card strong { display: block; margin-bottom: 4px; }
.action-card span { color: var(--muted); font-size: 13px; }
.forecast-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 128px;
  padding: 28px 32px;
  margin-bottom: 20px;
  border-color: var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 2px 6px rgba(25, 28, 32, .02);
}
.forecast-toolbar h3 {
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
}
.forecast-toolbar p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
}
.forecast-date-controls {
  display: grid;
  grid-template-columns: repeat(2, 210px);
  gap: 24px;
  min-width: 444px;
}
.forecast-date-controls label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.forecast-date-controls input {
  min-height: 58px;
  padding: 0 20px;
  border-color: var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(25, 28, 32, .04);
}
.forecast-metrics {
  grid-template-columns: repeat(5, minmax(140px, 1fr));
}
.forecast-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.forecast-callout {
  display: grid;
  gap: 8px;
  min-height: 104px;
  padding: 18px;
  border: 1px solid #efd47a;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #fffaf0);
  box-shadow: var(--shadow-soft);
}
.forecast-callout.muted {
  border-color: #d7e5f6;
  background: linear-gradient(180deg, #fff, #f7fbff);
}
.forecast-callout strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1.05;
}
.forecast-callout span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.forecast-answer {
  display: block;
  margin-bottom: 20px;
}
.forecast-need-card,
.forecast-rule-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(25, 28, 32, .025);
}
.forecast-need-card {
  position: relative;
  display: grid;
  gap: 22px;
  min-height: 220px;
  padding: 42px 46px;
  overflow: hidden;
  border-color: var(--yellow);
  background: #fff;
}
.forecast-need-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0 auto;
  width: 420px;
  height: 190px;
  background: radial-gradient(circle at center, rgba(255, 217, 125, .28), rgba(255, 217, 125, 0) 68%);
  pointer-events: none;
  transform: translate(20%, 28%);
}
.forecast-need-card span {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.25;
}
.forecast-need-card strong {
  position: relative;
  z-index: 1;
  color: var(--ink);
  font-size: 64px;
  font-weight: 800;
  line-height: .98;
  letter-spacing: 0;
}
.forecast-need-card p,
.forecast-rule-card p {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.45;
}
.forecast-rule-card {
  display: none;
  align-content: center;
  gap: 10px;
  padding: 24px;
}
.forecast-rule-card strong {
  color: var(--ink);
  font-size: 17px;
}
.forecast-plain-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(340px, .95fr);
  gap: 20px;
  align-items: start;
}
#forecastTab .forecast-plain-grid > .panel {
  min-height: 500px;
  overflow: hidden;
  border-color: var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(25, 28, 32, .025);
}
#forecastTab .forecast-plain-grid > .panel:nth-child(2) {
  border-color: var(--yellow);
  background: var(--yellow-soft);
}
#forecastTab .forecast-plain-grid > .panel:nth-child(2) .panel-title {
  min-height: 112px;
  background: var(--yellow-soft);
}
#forecastTab .panel-title {
  padding: 24px 28px;
  border-bottom: 1px solid var(--line-strong);
}
#forecastTab .panel-title h3 {
  font-size: 20px;
  font-weight: 700;
}
#forecastTab .panel-title span {
  color: var(--blue);
  font-size: 16px;
  font-weight: 700;
}
#forecastTab .forecast-plain-grid > .panel:nth-child(2) .panel-title h3 {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  color: #7a5600;
  font-size: 22px;
  line-height: 1.1;
}
#forecastTab .forecast-plain-grid > .panel:nth-child(2) .panel-title h3::before {
  content: "info";
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  font-family: "Material Symbols Outlined";
  font-size: 28px;
  color: #a87900;
  font-variation-settings: "FILL" 0, "wght" 400;
}
#forecastTab .forecast-plain-grid > .panel:nth-child(2) .panel-title span {
  color: #a87900;
}
#forecastTab #forecastOpenTable {
  max-height: 426px;
  overflow: auto;
}
#forecastTab table th {
  padding: 18px 28px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--muted);
  background: var(--surface);
  font-size: 14px;
  font-weight: 700;
}
#forecastTab table td {
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
  color: #31343d;
  font-size: 16px;
  font-weight: 500;
  vertical-align: middle;
}
#forecastTab table td:first-child,
#forecastTab table td.right {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  font-weight: 500;
}
#forecastTab table td:nth-child(2) {
  font-weight: 700;
}
#forecastTab table td:nth-child(4) {
  color: var(--muted);
  line-height: 1.35;
}
.forecast-muted-list {
  display: grid;
  gap: 20px;
  max-height: 388px;
  overflow: auto;
  padding: 24px;
}
.forecast-muted-item {
  display: grid;
  gap: 8px;
  min-height: 108px;
  padding: 22px;
  border: 1px solid rgba(255, 217, 125, .9);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(25, 28, 32, .03);
}
.forecast-muted-item strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
}
.forecast-muted-item span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}
.forecast-muted-item::after {
  content: "Prüfen  →";
  justify-self: end;
  color: #a87900;
  font-size: 16px;
  font-weight: 800;
}
.saving-hero {
  margin-bottom: 12px;
}
.saving-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 132px;
  padding: 24px 26px;
  border: 1px solid #d6e7d8;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f6fcf8);
  box-shadow: var(--shadow-soft);
}
.saving-status.pending {
  border-color: #efd47a;
  background: linear-gradient(180deg, #fff, #fffaf0);
}
.saving-status.warning {
  border-color: #efc7c7;
  background: linear-gradient(180deg, #fff, #fffafa);
}
.saving-status h3 {
  margin-top: 4px;
  font-size: 24px;
}
.saving-status p {
  max-width: 820px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.saving-status strong {
  flex: 0 0 auto;
  color: var(--green);
  font-size: 42px;
  line-height: 1;
}
.saving-status.pending strong { color: var(--gold); }
.saving-status.warning strong { color: var(--red); }
.saving-plan-chart {
  display: grid;
  gap: 16px;
  padding: 8px 2px 4px;
}
.saving-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}
.saving-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.saving-chart-legend i {
  width: 18px;
  height: 8px;
  border-radius: 999px;
}
.saving-chart-legend .booked { background: var(--green); }
.saving-chart-legend .forecast { background: repeating-linear-gradient(45deg, rgba(168, 121, 0, .45) 0 3px, rgba(168, 121, 0, .15) 3px 7px); }
.saving-chart-legend .extra { background: var(--blue); }
.saving-month {
  display: grid;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf1f5;
}
.saving-month:last-child { border-bottom: 0; }
.saving-month-head,
.saving-month-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}
.saving-month-head strong {
  color: var(--ink);
  font-size: 14px;
}
.saving-bar {
  position: relative;
  display: flex;
  height: 24px;
  overflow: hidden;
  border-radius: 8px;
  background: #edf2f7;
}
.saving-bar i {
  display: block;
  height: 100%;
}
.saving-bar .booked { background: linear-gradient(90deg, #2f8f54, #58a35b); }
.saving-bar .forecast {
  background-color: rgba(168, 121, 0, .18);
  background-image: repeating-linear-gradient(45deg, rgba(168, 121, 0, .45) 0 3px, transparent 3px 8px);
}
.saving-bar .extra { background: linear-gradient(90deg, #2f6fed, #0f766e); }
.saving-bar b {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #111827;
  opacity: .55;
}
.saving-quality {
  display: grid;
  gap: 0;
  padding: 8px 16px 16px;
}
.saving-quality-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid #edf1f5;
  color: var(--muted);
  font-size: 13px;
}
.saving-quality-row strong {
  color: var(--ink);
  text-align: right;
}
.saving-quality-note {
  margin-top: 14px;
  padding: 14px;
  border-radius: 8px;
  color: #24513b;
  background: #edf9f0;
  font-size: 13px;
  line-height: 1.45;
}
.legend-list { display: grid; gap: 9px; padding: 12px 14px; }
.legend-list div { display: flex; justify-content: space-between; gap: 18px; padding-bottom: 12px; border-bottom: 1px solid #edf1f5; }
.legend-list span { color: var(--muted); }
.empty { padding: 12px; color: var(--muted); }
.analysis-note {
  display: block;
  margin-top: 3px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
}

.gridline { stroke: #dfe5eb; stroke-width: 1; }
.axis,.legend { fill: #475467; font-size: 14px; }
.axis.month { text-anchor: middle; font-size: 13px; }
.axis.month.running { fill: var(--gold); font-weight: 800; }
.axisline { stroke: #dfe5eb; }
.bar-label { text-anchor: middle; fill: var(--gold); font-size: 12px; font-weight: 800; }
.running-band { fill: #fffbeb; stroke: #f0d98e; opacity: .82; }
.running-note { fill: var(--gold); font-size: 12px; font-weight: 800; }
.line-end-label rect {
  fill: rgba(255, 255, 255, .92);
  stroke: #dfe7ef;
  stroke-width: 1;
  filter: drop-shadow(0 5px 10px rgba(15, 23, 42, .08));
}
.line-end-label text {
  fill: #344054;
  font-size: 14px;
  font-weight: 850;
}
.hit-dot { fill: transparent; pointer-events: all; }
.visible-dot {
  pointer-events: all;
  stroke: #fff;
  stroke-width: 3;
  transition: r .14s ease, stroke-width .14s ease, filter .14s ease;
}
.running-dot { stroke: #fff6d6; stroke-width: 5; }
.chart-point { outline: none; }
.chart-point:hover .visible-dot,
.chart-point:focus .visible-dot,
.chart-point.is-active .visible-dot {
  r: 8;
  stroke-width: 4;
  filter: drop-shadow(0 4px 8px rgba(15, 23, 42, .22));
}
.point-tooltip {
  opacity: 0;
  pointer-events: none;
  transform-box: fill-box;
  transition: opacity .12s ease;
}
.chart-point:hover .point-tooltip,
.chart-point:focus .point-tooltip,
.chart-point.is-active .point-tooltip { opacity: 1; }
.point-tooltip rect {
  fill: rgba(16, 24, 40, .94);
  stroke: rgba(255, 255, 255, .18);
  stroke-width: 1;
  filter: drop-shadow(0 10px 18px rgba(15, 23, 42, .2));
}
.tooltip-month {
  fill: #cbd5e1;
  font-size: 12px;
  font-weight: 760;
}
.tooltip-value {
  fill: #fff;
  font-size: 13px;
  font-weight: 850;
}
.running-bar { opacity: .58; stroke: var(--gold); stroke-width: 1; stroke-dasharray: 4 3; }
.dashed-line { stroke-dasharray: 8 7; }

.login-page { display: grid; min-height: 100vh; place-items: center; }
.login-box {
  width: min(420px, calc(100vw - 32px));
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.login-form { display: grid; gap: 14px; margin-top: 22px; }
.login-form label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 760; }
.login-form button {
  min-height: 42px;
  border: 1px solid #bfd8fb;
  border-radius: 8px;
  color: #0f3f68;
  background: #eef6ff;
  font-weight: 800;
}
.error { color: var(--red); font-weight: 760; }

@media (max-width: 1180px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .tabbar { display: flex; gap: 6px; overflow-x: auto; }
  .tabbar button { flex: 0 0 auto; width: auto; }
  .sidebar-footer { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 0; }
  .command-bar { position: relative; grid-template-columns: 1fr; margin-top: 0; }
  .kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .classification-strip { grid-template-columns: 1fr; }
  .classification-strip-head,
  .class-pill { border-right: 0; border-bottom: 1px solid #edf2f7; }
  .class-pill:last-child { border-bottom: 0; }
}

@media (max-width: 900px) {
  .shell { padding: 18px 14px 34px; }
  .command-bar { margin: -18px -14px 24px; padding: 14px; }
  .filters,.metric-grid,.overview-metrics,.grid.two { grid-template-columns: 1fr; }
  .forecast-toolbar,.forecast-summary,.forecast-answer,.forecast-plain-grid { grid-template-columns: 1fr; }
  .forecast-toolbar { align-items: stretch; flex-direction: column; }
  .forecast-date-controls { grid-template-columns: 1fr; min-width: 0; }
  .kpi-row { grid-template-columns: 1fr; }
  .classification-strip { grid-template-columns: 1fr; }
  .review-card { grid-template-columns: 1fr; }
  .review-illustration { display: none; }
  .metric strong { font-size: 26px; }
  .trend-panel .chart-body svg { height: 340px; }
  .panel-title { align-items: flex-start; flex-direction: column; gap: 4px; }
  .panel-title span { text-align: left; }
  td .description-input, td input, td select { min-width: 180px; }
}
