@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ══════════════════════════════════════════════════════════════════
   FINANZBUCH SHELL — Cockpit über Steuerbuch, Budgetbuch, Vertragsbuch
   --------------------------------------------------------------------
   Optik-Standard (Header/Sidebar/User-Chip/Tenant-Switcher) kommt aus
   _shell/buch-header.css + _shell/buch-sidebar.css. Hier nur Layout-
   Spezifika, Buch-eigene Tokens, Komponenten (KPI-Cards, Insights,
   Cashflow-Bars, Sync-Health).
   ══════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Marcher Lab. CD-Tokens (Navy + Gold) */
  --fb-navy:         #1E2A4A;
  --fb-navy-dark:    #162039;
  --fb-navy-light:   #2D3F6B;
  --fb-gold:         #F5C518;
  --fb-gold-dark:    #D4A017;
  --fb-gold-light:   #FEF3C7;

  --fb-bg:           #F4F6F9;
  --fb-bg-2:         #EEF1F5;
  --fb-surface:      #FFFFFF;
  --fb-text:         #1A1A2E;
  --fb-text-muted:   #6B7280;
  --fb-border:       #E5E7EB;

  /* Status-Farben (für KPIs und Insights) */
  --fb-success:      #10B981;
  --fb-warn:         #F59E0B;
  --fb-danger:       #EF4444;
  --fb-info:         #3B82F6;

  /* Quellen-Farben (Sub-Brands) */
  --fb-src-sb:       #3B82F6;  /* Steuerbuch */
  --fb-src-bb:       #10B981;  /* Budgetbuch */
  --fb-src-vb:       #8B5CF6;  /* Vertragsbuch */

  --fb-shadow-sm: 0 1px 3px rgba(30,42,74,0.08);
  --fb-shadow-md: 0 4px 12px rgba(30,42,74,0.10);
  --fb-shadow-lg: 0 8px 24px rgba(30,42,74,0.15);

  --fb-sidebar-width: 240px;
  --fb-header-h: calc(64px + env(safe-area-inset-top, 0px));
}

html, body {
  height: 100%;
  height: 100dvh;
  overflow-x: clip;
}
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--fb-text);
  background: var(--fb-bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  touch-action: pan-y;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ══════════════════════════════════════════════════════════════════
   HEADER — nur Layout (Optik kommt aus buch-header.css)
   ══════════════════════════════════════════════════════════════════ */
.fb-header {
  height: var(--fb-header-h);
  padding-top: env(safe-area-inset-top, 0px);
  display: flex;
  align-items: center;
  flex-shrink: 0;
  position: relative;
  z-index: 50;
}
.fb-header-left,
.fb-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.fb-header-left { flex: 1; min-width: 0; }

.fb-menu-toggle {
  display: none;
  background: transparent;
  border: 0;
  color: #fff;
  padding: 4px;
  margin-right: 4px;
  border-radius: 6px;
}
.fb-menu-toggle:hover { background: rgba(255,255,255,0.08); }

.fb-tenant-switcher-wrap { position: relative; }

/* ══════════════════════════════════════════════════════════════════
   DROPDOWN-MENUS (Header-Tenant + User)
   ══════════════════════════════════════════════════════════════════ */
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--fb-border);
  border-radius: 8px;
  box-shadow: var(--fb-shadow-lg);
  padding: 6px;
  z-index: 200;
  max-height: 70vh;
  overflow-y: auto;
}
.dropdown-menu.anchor-left  { left: 0; }
.dropdown-menu.anchor-right { right: 0; }
.dropdown-menu.is-open { display: block; }

.dropdown-head {
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--fb-border);
  margin-bottom: 6px;
}
.dropdown-head-name { font-size: 14px; font-weight: 700; color: var(--fb-text); }
.dropdown-head-sub  { font-size: 12px; color: var(--fb-text-muted); margin-top: 2px; word-break: break-all; }

.dropdown-section { padding: 4px 0; }
.dropdown-section + .dropdown-section { border-top: 1px solid var(--fb-border); padding-top: 8px; margin-top: 4px; }

.dropdown-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fb-text-muted);
  padding: 4px 12px 6px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  text-align: left;
  font-size: 14px;
  color: var(--fb-text);
  cursor: pointer;
  font-family: inherit;
}
.dropdown-item:hover { background: var(--fb-bg-2); }
.dropdown-item.is-active { background: var(--fb-bg-2); font-weight: 600; }
.dropdown-item-icon { display: inline-flex; width: 18px; height: 18px; flex-shrink: 0; }
.dropdown-item-icon svg { width: 18px; height: 18px; }
.dropdown-item-col { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dropdown-item-col > span:first-child { font-weight: 600; }
.dropdown-item-meta { font-size: 12px; color: var(--fb-text-muted); }

/* ══════════════════════════════════════════════════════════════════
   BODY LAYOUT
   ══════════════════════════════════════════════════════════════════ */
.fb-body {
  flex: 1;
  display: flex;
  min-height: 0;
  position: relative;
}

/* ══════════════════════════════════════════════════════════════════
   SIDEBAR — nur Layout (Optik kommt aus buch-sidebar.css)
   ══════════════════════════════════════════════════════════════════ */
.fb-sidebar {
  width: var(--fb-sidebar-width);
  flex-shrink: 0;
}

.fb-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(22,32,57,0.55);
  z-index: 39;
}
.fb-sidebar-backdrop.is-open { display: block; }

/* ══════════════════════════════════════════════════════════════════
   MAIN
   ══════════════════════════════════════════════════════════════════ */
.fb-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  overflow-x: clip;
  padding: 2rem 2rem 4rem 2rem;
}
.fb-content { width: 100%; }
.fb-loading {
  padding: 4rem;
  text-align: center;
  color: var(--fb-text-muted);
}

/* Page-Head (für Subseiten) */
.fb-page-head { margin-bottom: 2rem; }
.fb-page-breadcrumb {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fb-gold-dark);
  margin-bottom: 0.4rem;
}
.fb-page-title {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--fb-navy);
  letter-spacing: -0.01em;
  margin-bottom: 0.4rem;
}
.fb-page-subtitle {
  font-size: 0.95rem;
  color: var(--fb-text-muted);
  max-width: 720px;
}

/* ══════════════════════════════════════════════════════════════════
   SHARED COMPONENTS
   ══════════════════════════════════════════════════════════════════ */

/* Buttons */
.fb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.6rem 1.1rem;
  border-radius: 6px;
  border: 1px solid var(--fb-border);
  background: #fff;
  color: var(--fb-text);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.fb-btn:hover { background: var(--fb-bg-2); border-color: #D1D5DB; }
.fb-btn.is-primary {
  background: var(--fb-navy-dark);
  color: #fff;
  border-color: var(--fb-navy-dark);
}
.fb-btn.is-primary:hover { background: #0F1626; border-color: #0F1626; }
.fb-btn.is-gold {
  background: var(--fb-gold);
  color: var(--fb-navy-dark);
  border-color: var(--fb-gold);
}
.fb-btn.is-gold:hover { background: var(--fb-gold-dark); border-color: var(--fb-gold-dark); }
.fb-btn svg { width: 16px; height: 16px; }

/* Section-Card (für Dashboard-Sections) */
.fb-section-card {
  background: var(--fb-surface);
  border: 1px solid var(--fb-border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}
.fb-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.fb-section-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--fb-navy);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.fb-section-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  background: var(--fb-gold);
  border-radius: 2px;
}
.fb-section-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fb-text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.fb-section-link:hover { color: var(--fb-navy); }

/* KPI-Grid */
.fb-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.fb-kpi-card {
  background: var(--fb-surface);
  border: 1px solid var(--fb-border);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  position: relative;
}
.fb-kpi-card[data-source="bb"] { border-top: 3px solid var(--fb-src-bb); }
.fb-kpi-card[data-source="sb"] { border-top: 3px solid var(--fb-src-sb); }
.fb-kpi-card[data-source="vb"] { border-top: 3px solid var(--fb-src-vb); }
.fb-kpi-card[data-source="mix"]{ border-top: 3px solid var(--fb-gold); }

.fb-kpi-source-tag {
  position: absolute;
  top: 0.55rem;
  right: 0.7rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fb-text-muted);
  background: var(--fb-bg-2);
  padding: 2px 6px;
  border-radius: 999px;
}
.fb-kpi-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fb-text-muted);
  margin-bottom: 0.35rem;
}
.fb-kpi-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--fb-navy);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.fb-kpi-sub {
  font-size: 0.72rem;
  color: var(--fb-text-muted);
  margin-top: 0.3rem;
}
.fb-kpi-sub.pos { color: var(--fb-success); }
.fb-kpi-sub.neg { color: var(--fb-danger); }
.fb-kpi-sub.warn { color: var(--fb-warn); }

/* Cashflow Chart (SVG) */
.fb-cashflow-chart {
  position: relative;
  height: 220px;
  width: 100%;
}
.fb-cashflow-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.fb-cashflow-bar { transition: opacity 0.15s; cursor: pointer; }
.fb-cashflow-bar:hover { opacity: 0.78; }
.fb-cashflow-month-labels {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  margin-top: 0.4rem;
}
.fb-cashflow-month-label {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--fb-text-muted);
  text-align: center;
  letter-spacing: 0.03em;
}
.fb-cashflow-month-label.is-current {
  color: var(--fb-navy);
  font-weight: 800;
}

.fb-legend {
  display: flex;
  gap: 1.25rem;
  font-size: 0.75rem;
  color: var(--fb-text-muted);
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.fb-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.fb-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

/* Insight-Card */
.fb-insight-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.fb-insight-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid;
  background: #fff;
}
.fb-insight-card.severity-info  { border-color: #BFDBFE; background: #EFF6FF; }
.fb-insight-card.severity-warn  { border-color: #FDE68A; background: #FFFBEB; }
.fb-insight-card.severity-alert { border-color: #FECACA; background: #FEF2F2; }

.fb-insight-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.fb-insight-card.severity-info  .fb-insight-icon { background: var(--fb-info); }
.fb-insight-card.severity-warn  .fb-insight-icon { background: var(--fb-warn); }
.fb-insight-card.severity-alert .fb-insight-icon { background: var(--fb-danger); }
.fb-insight-icon svg { width: 16px; height: 16px; stroke-width: 2.2; }

.fb-insight-body { flex: 1; min-width: 0; }
.fb-insight-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--fb-text);
  margin-bottom: 0.25rem;
}
.fb-insight-text {
  font-size: 0.83rem;
  color: var(--fb-text-muted);
  line-height: 1.45;
}
.fb-insight-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}
.fb-insight-action {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid currentColor;
  color: var(--fb-text-muted);
  cursor: pointer;
}
.fb-insight-action.is-primary {
  background: var(--fb-navy-dark);
  color: #fff;
  border-color: var(--fb-navy-dark);
}
.fb-insight-action.is-primary:hover { background: #0F1626; }
.fb-insight-action:hover { color: var(--fb-text); }

.fb-insight-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--fb-text-muted);
  font-size: 0.9rem;
}
.fb-insight-empty-icon {
  font-size: 1.5rem;
  margin-bottom: 0.4rem;
  color: var(--fb-success);
}

/* Sync-Health */
.fb-sync-list { display: flex; flex-direction: column; gap: 0.5rem; }
.fb-sync-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--fb-border);
  border-radius: 8px;
  background: #fff;
  font-size: 0.85rem;
}
.fb-sync-row-label { font-weight: 600; color: var(--fb-text); }
.fb-sync-row-meta { color: var(--fb-text-muted); font-size: 0.78rem; }
.fb-sync-row-status {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.fb-sync-row-status.is-ok    { background: #D1FAE5; color: #065F46; }
.fb-sync-row-status.is-warn  { background: #FEF3C7; color: #92400E; }
.fb-sync-row-status.is-alert { background: #FEE2E2; color: #991B1B; }

/* Quick-Actions (Dashboard) */
.fb-qa-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.fb-qa-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-start;
  padding: 1rem 1.1rem;
  border: 1px solid var(--fb-border);
  border-radius: 8px;
  background: #fff;
  text-decoration: none;
  color: var(--fb-text);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.fb-qa-card:hover {
  border-color: var(--fb-gold);
  box-shadow: var(--fb-shadow-sm);
  transform: translateY(-1px);
}
.fb-qa-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--fb-bg-2);
  border-radius: 6px;
  color: var(--fb-navy);
}
.fb-qa-icon svg { width: 16px; height: 16px; stroke-width: 2; }
.fb-qa-title { font-size: 0.88rem; font-weight: 700; }
.fb-qa-sub   { font-size: 0.75rem; color: var(--fb-text-muted); }

/* Tabs */
.fb-tabs {
  display: inline-flex;
  background: var(--fb-bg-2);
  border-radius: 8px;
  padding: 4px;
  gap: 2px;
  margin-bottom: 1rem;
}
.fb-tab {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  background: transparent;
  border: 0;
  color: var(--fb-text-muted);
  cursor: pointer;
  font-family: inherit;
}
.fb-tab.is-active {
  background: #fff;
  color: var(--fb-navy);
  box-shadow: var(--fb-shadow-sm);
}

/* Toast */
.fb-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--fb-navy);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  box-shadow: var(--fb-shadow-lg);
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  z-index: 9999;
}
.fb-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Wrong-Tenant / Error */
.fb-shell-error {
  max-width: 560px;
  margin: 4rem auto;
  padding: 2rem;
  background: #fff;
  border: 1px solid var(--fb-border);
  border-radius: 10px;
  text-align: center;
}
.fb-shell-error-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--fb-navy);
  margin-bottom: 0.6rem;
}
.fb-shell-error-sub {
  font-size: 0.92rem;
  color: var(--fb-text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

/* Mobile */
@media (max-width: 960px) {
  .fb-menu-toggle { display: inline-flex; }
  .fb-sidebar {
    position: fixed;
    top: var(--fb-header-h);
    bottom: 0;
    left: 0;
    z-index: 90;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .fb-sidebar.is-open { transform: translateX(0); }
  .fb-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .fb-main { padding: 1.25rem 1rem 3rem; }
  .fb-section-card { padding: 1rem; }
  .fb-qa-grid { grid-template-columns: 1fr; }
  /* Source-Tags auf Mobile verstecken — der farbige Top-Border zeigt die Quelle */
  .fb-kpi-source-tag { display: none; }
  /* KPI-Card kompakter */
  .fb-kpi-card { padding: 0.85rem 0.9rem; }
  .fb-kpi-label { font-size: 0.62rem; margin-bottom: 0.25rem; }
  .fb-kpi-sub { font-size: 0.68rem; line-height: 1.35; margin-top: 0.25rem; }
}

@media (max-width: 480px) {
  .fb-kpi-grid { grid-template-columns: 1fr 1fr; gap: 0.55rem; }
  .fb-kpi-card { padding: 0.75rem 0.8rem; }
  .fb-kpi-value { font-size: 1.15rem; }
  .fb-page-title { font-size: 1.4rem; }
}

/* Body-Layout: alle Cockpit-Pages haben header → body[flex:row{sidebar,main}] */
body { display: flex; flex-direction: column; }
.fb-body { flex: 1; display: flex; min-height: 0; }

/* ═══════════════════════════════════════════════════════════════
   Dashboard-Maximierung (Mai 2026): Bücher-Jump, Wealth-Section,
   Vertragslast-Mini, Sync-Summary, Reality-Hint
   ═══════════════════════════════════════════════════════════════ */

/* ── Bücher-Jump (3-Karten-Reihe, prominent oben) ─────────────── */
.fb-buecher-jump {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.fb-buecher-jump-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: var(--fb-surface);
  border: 1px solid var(--fb-border);
  border-radius: 10px;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.fb-buecher-jump-card:hover {
  border-color: var(--fb-gold);
  box-shadow: var(--fb-shadow-md);
  transform: translateY(-1px);
}
.fb-buecher-jump-icon {
  width: 36px; height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--fb-bg-2);
  border-radius: 8px;
  color: var(--fb-navy);
}
.fb-buecher-jump-icon svg { width: 18px; height: 18px; }
.fb-buecher-jump-card[data-book="sb"] .fb-buecher-jump-icon { background: rgba(59,130,246,0.10); color: var(--fb-src-sb); }
.fb-buecher-jump-card[data-book="bb"] .fb-buecher-jump-icon { background: rgba(16,185,129,0.10); color: var(--fb-src-bb); }
.fb-buecher-jump-card[data-book="vb"] .fb-buecher-jump-icon { background: rgba(139,92,246,0.10); color: var(--fb-src-vb); }
.fb-buecher-jump-meta { flex: 1; min-width: 0; }
.fb-buecher-jump-eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fb-text-muted);
  margin-bottom: 0.1rem;
}
.fb-buecher-jump-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--fb-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fb-buecher-jump-arrow {
  width: 16px; height: 16px;
  color: var(--fb-text-muted);
  flex-shrink: 0;
}
.fb-buecher-jump-card:hover .fb-buecher-jump-arrow { color: var(--fb-gold-dark); }

/* ── Reality-Hint (informativer Banner) ───────────────────────── */
.fb-reality-hint {
  display: flex;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: var(--fb-gold-light);
  border: 1px solid var(--fb-gold);
  border-radius: 10px;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--fb-text);
  line-height: 1.55;
}
.fb-reality-hint-icon {
  flex-shrink: 0;
  width: 22px; height: 22px;
  color: var(--fb-gold-dark);
}
.fb-reality-hint-icon svg { width: 22px; height: 22px; }
.fb-reality-hint-text strong { display: block; margin-bottom: 0.15rem; }
.fb-reality-hint-text a { color: var(--fb-navy); font-weight: 600; text-decoration: underline; }

/* ── Wealth-Section (eigener Block, prominent) ────────────────── */
.fb-wealth-total {
  text-align: center;
  padding: 1rem 0 1.25rem;
  border-bottom: 1px solid var(--fb-border);
  margin-bottom: 1.25rem;
}
.fb-wealth-total-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fb-text-muted);
  margin-bottom: 0.4rem;
}
.fb-wealth-total-value {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--fb-navy);
  letter-spacing: -0.02em;
}
.fb-wealth-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.fb-wealth-component {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.85rem 0.5rem;
  background: var(--fb-bg-2);
  border-radius: 8px;
}
.fb-wealth-component.is-empty { opacity: 0.55; }
.fb-wealth-component-icon {
  width: 28px; height: 28px;
  color: var(--fb-text-muted);
  margin-bottom: 0.4rem;
}
.fb-wealth-component-icon svg { width: 22px; height: 22px; }
.fb-wealth-component-label {
  font-size: 0.72rem;
  color: var(--fb-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.fb-wealth-component-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--fb-text);
}
.fb-wealth-component-value.fb-muted { color: var(--fb-text-muted); font-weight: 400; }
.fb-wealth-component-year {
  font-size: 0.68rem;
  color: var(--fb-text-muted);
  margin-top: 0.15rem;
}
.fb-wealth-debts-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--fb-border);
  font-size: 0.85rem;
}
.fb-wealth-debts-label { color: var(--fb-text-muted); }
.fb-wealth-debts-value { color: var(--fb-danger); font-weight: 700; }

/* ── Vertragslast-Mini ───────────────────────────────────────── */
.fb-contracts-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.fb-contracts-mini-item {
  padding: 0.75rem 0.5rem;
  background: var(--fb-bg-2);
  border-radius: 8px;
  text-align: center;
}
.fb-contracts-mini-item.is-warn { background: rgba(245,158,11,0.10); border: 1px solid rgba(245,158,11,0.25); }
.fb-contracts-mini-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--fb-text);
  line-height: 1.2;
}
.fb-contracts-mini-item.is-warn .fb-contracts-mini-value { color: var(--fb-warn); }
.fb-contracts-mini-label {
  font-size: 0.7rem;
  color: var(--fb-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.15rem;
}

/* ── Link-Progress (Verträge ↔ Budget verlinkt) ───────────────── */
.fb-link-progress {
  background: var(--fb-bg-2);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
}
.fb-link-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--fb-text);
  margin-bottom: 0.4rem;
}
.fb-link-progress-count { font-weight: 700; color: var(--fb-navy); }
.fb-link-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--fb-border);
  border-radius: 999px;
  overflow: hidden;
}
.fb-link-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--fb-gold) 0%, var(--fb-gold-dark) 100%);
  border-radius: 999px;
  transition: width 0.3s;
}

/* ── Sync-Summary (Verträge ↔ Budget / Steuer) ──────────────── */
.fb-sync-summary {
  background: var(--fb-bg-2);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}
.fb-sync-summary-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.35rem 0;
}
.fb-sync-summary-row + .fb-sync-summary-row { border-top: 1px solid var(--fb-border); }
.fb-sync-summary-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fb-text);
  flex: 1;
  min-width: 0;
}
.fb-sync-summary-label svg { width: 14px; height: 14px; color: var(--fb-text-muted); }
.fb-sync-summary-bar {
  flex: 1;
  height: 6px;
  background: var(--fb-border);
  border-radius: 999px;
  overflow: hidden;
  max-width: 160px;
}
.fb-sync-summary-fill {
  height: 100%;
  background: var(--fb-success);
  border-radius: 999px;
  transition: width 0.3s;
}
.fb-sync-summary-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--fb-navy);
  white-space: nowrap;
}

/* ── Responsive: Stacking auf mobile ──────────────────────────── */
@media (max-width: 720px) {
  .fb-buecher-jump { grid-template-columns: 1fr; gap: 0.5rem; margin-bottom: 1rem; }
  /* Bücher-Jump-Karten kompakter auf Mobile */
  .fb-buecher-jump-card { padding: 0.7rem 0.85rem; gap: 0.65rem; }
  .fb-buecher-jump-icon { width: 32px; height: 32px; }
  .fb-buecher-jump-icon svg { width: 16px; height: 16px; }
  .fb-buecher-jump-eyebrow { font-size: 0.68rem; }
  .fb-buecher-jump-title { font-size: 0.82rem; }
  /* Wealth-Section kompakter */
  .fb-wealth-grid { grid-template-columns: 1fr; gap: 0.5rem; }
  .fb-wealth-total-value { font-size: 1.7rem; }
  .fb-wealth-component { padding: 0.7rem 0.5rem; }
  /* Contracts-Mini 2x2 auf Mobile, kompakter */
  .fb-contracts-mini-grid { grid-template-columns: repeat(2, 1fr); gap: 0.4rem; }
  .fb-contracts-mini-value { font-size: 1rem; }
  .fb-contracts-mini-label { font-size: 0.65rem; }
  /* Sync-Summary stacking */
  .fb-sync-summary-row { flex-wrap: wrap; }
  .fb-sync-summary-bar { max-width: none; flex-basis: 100%; order: 3; }
  /* Reality-Hint kompakter */
  .fb-reality-hint { padding: 0.7rem 0.85rem; font-size: 0.8rem; }
}

/* ── Quell-Bücher-Links in Sidebar (externe Links zu SB/BB/VB) ── */
.nav-item-source {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  font-size: 13.5px;
  font-weight: 500;
  color: #6B7280;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.nav-item-source:hover {
  background: #F3F4F6;
  color: #1A1A2E;
}
.nav-item-source .nav-item-icon {
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  color: inherit;
  flex-shrink: 0;
}
.nav-item-source .nav-item-icon svg { width: 16px; height: 16px; stroke: currentColor; }
.nav-item-source .nav-item-label { flex: 1; }
.nav-item-source-arrow {
  width: 14px; height: 14px;
  opacity: 0.4;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.nav-item-source-arrow svg { width: 12px; height: 12px; }
.nav-item-source:hover .nav-item-source-arrow { opacity: 0.7; }

/* ── YEAR-SWITCHER (Steuerjahr-Wechsel im Hero) ──────────────── */
.fb-page-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.fb-year-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: #F3F4F6;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
}
.fb-year-switch-btn {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0.4rem 0.85rem;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #6B7280;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.fb-year-switch-btn:hover {
  color: #162039;
}
.fb-year-switch-btn.is-active {
  background: #162039;
  color: #F5C518;
  box-shadow: 0 1px 2px rgba(22, 32, 57, 0.15);
}

/* ═══════════════════════════════════════════════════════════════════
   ALL-IN DASHBOARD (Story-Logik: Monat → Vermögen → Verträge → Steuern)
   Stand: 2026-06-13
   ═══════════════════════════════════════════════════════════════════ */

/* Section-Sub (Untertitel unter Section-Titles) */
.fb-section-sub {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--fb-text-muted);
  margin-top: 0.2rem;
  text-transform: none;
  letter-spacing: 0;
}
.fb-section-empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--fb-text-muted);
  font-size: 0.88rem;
  background: var(--fb-bg);
  border-radius: 8px;
}
.fb-section-empty a {
  color: var(--fb-navy);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--fb-gold);
}
.fb-section-empty-sub {
  padding: 0.75rem;
  text-align: center;
  color: var(--fb-text-muted);
  font-size: 0.82rem;
  font-style: italic;
}

/* ── DIESEN MONAT ────────────────────────────────────────────────── */
.fb-month-saldo {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 1.5rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, #162039 0%, #1E2A4A 100%);
  border-radius: 10px;
  margin-bottom: 1.25rem;
  color: #fff;
}
.fb-month-saldo-tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.fb-month-saldo-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fb-gold);
  margin-bottom: 0.5rem;
}
.fb-month-saldo-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.fb-month-saldo-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fb-month-saldo-icon svg { width: 18px; height: 18px; }
.fb-month-saldo-icon.pos { background: rgba(16, 185, 129, 0.25); color: #10B981; }
.fb-month-saldo-icon.neg { background: rgba(239, 68, 68, 0.25);  color: #EF4444; }
.fb-month-saldo-value {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
.fb-month-saldo-value.pos { color: #10B981; }
.fb-month-saldo-value.neg { color: #EF4444; }
.fb-month-saldo-plan {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 0.5rem;
}
.fb-month-flow {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.7rem;
}
.fb-month-flow-row {
  display: grid;
  grid-template-columns: 90px 1fr 120px;
  align-items: center;
  gap: 0.75rem;
}
.fb-month-flow-label {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}
.fb-month-flow-bar {
  position: relative;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}
.fb-month-flow-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.fb-month-flow-bar-fill.is-income { background: #10B981; }
.fb-month-flow-bar-fill.is-expense { background: #EF4444; }
.fb-month-flow-value {
  text-align: right;
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.fb-month-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.fb-month-block {
  display: flex;
  flex-direction: column;
}
.fb-month-block-head {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fb-text-muted);
  margin-bottom: 0.75rem;
}

/* Top-Kategorien-Rows */
.fb-cat-list, .fb-tx-list, .fb-deadline-list, .fb-contract-list, .fb-ded-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.fb-cat-row {
  display: block;
  padding: 0.7rem 0.85rem;
  background: var(--fb-bg);
  border: 1px solid var(--fb-border);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.fb-cat-row:hover {
  background: #fff;
  border-color: var(--fb-gold);
  transform: translateX(2px);
}
.fb-cat-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.fb-cat-row-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fb-text);
}
.fb-cat-row-val {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--fb-navy);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.fb-cat-row-plan {
  color: var(--fb-text-muted);
  font-weight: 400;
}
.fb-cat-row-bar {
  height: 5px;
  background: rgba(30, 42, 74, 0.08);
  border-radius: 3px;
  overflow: hidden;
}
.fb-cat-row-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}
.fb-cat-row-bar-fill.is-ok    { background: #10B981; }
.fb-cat-row-bar-fill.is-warn  { background: #F59E0B; }
.fb-cat-row-bar-fill.is-over  { background: #EF4444; }
.fb-cat-row-noplan {
  font-size: 0.72rem;
  color: var(--fb-text-muted);
  font-style: italic;
}

/* Letzte Transaktionen */
.fb-tx-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: var(--fb-bg);
  border: 1px solid var(--fb-border);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.fb-tx-row:hover {
  background: #fff;
  border-color: var(--fb-gold);
  transform: translateX(2px);
}
.fb-tx-row-main { flex: 1; min-width: 0; }
.fb-tx-row-desc {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fb-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fb-tx-row-meta {
  font-size: 0.72rem;
  color: var(--fb-text-muted);
  margin-top: 0.15rem;
}
.fb-tx-row-amount {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--fb-text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.fb-tx-row-amount.pos { color: #10B981; }

/* ── VERTRÄGE ────────────────────────────────────────────────── */
.fb-contracts-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  padding: 1rem;
  background: var(--fb-bg);
  border-radius: 10px;
  margin-bottom: 1.25rem;
}
.fb-contracts-stat-item { text-align: center; }
.fb-contracts-stat-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--fb-navy);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.fb-contracts-stat-item.is-warn .fb-contracts-stat-value { color: #D4A017; }
.fb-contracts-stat-label {
  font-size: 0.7rem;
  color: var(--fb-text-muted);
  font-weight: 500;
  margin-top: 0.15rem;
}

.fb-contracts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.fb-contracts-block { display: flex; flex-direction: column; }

.fb-deadline-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: var(--fb-bg);
  border: 1px solid var(--fb-border);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.fb-deadline-row:hover {
  background: #fff;
  border-color: var(--fb-gold);
  transform: translateX(2px);
}
.fb-deadline-row.is-warn {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.04);
}
.fb-deadline-row.is-urgent {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.05);
}
.fb-deadline-row-days {
  flex-shrink: 0;
  width: 44px;
  text-align: center;
  padding: 0.35rem 0;
  background: #fff;
  border-radius: 6px;
  border: 1px solid var(--fb-border);
}
.fb-deadline-row.is-warn .fb-deadline-row-days { border-color: #F59E0B; color: #D4A017; }
.fb-deadline-row.is-urgent .fb-deadline-row-days { border-color: #EF4444; color: #EF4444; }
.fb-deadline-row-days-num {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.fb-deadline-row-days-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fb-text-muted);
  margin-top: 0.1rem;
}
.fb-deadline-row-main { flex: 1; min-width: 0; }
.fb-deadline-row-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fb-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fb-deadline-row-meta {
  font-size: 0.72rem;
  color: var(--fb-text-muted);
  margin-top: 0.15rem;
}
.fb-deadline-row-arrow {
  width: 16px;
  height: 16px;
  color: var(--fb-text-muted);
  flex-shrink: 0;
}

.fb-contract-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: var(--fb-bg);
  border: 1px solid var(--fb-border);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.fb-contract-row:hover {
  background: #fff;
  border-color: var(--fb-gold);
  transform: translateX(2px);
}
.fb-contract-row-main { flex: 1; min-width: 0; }
.fb-contract-row-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fb-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fb-contract-row-meta {
  font-size: 0.72rem;
  color: var(--fb-text-muted);
  margin-top: 0.15rem;
}
.fb-contract-row-cost { text-align: right; }
.fb-contract-row-cost-value {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--fb-navy);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1;
}
.fb-contract-row-cost-label {
  font-size: 0.65rem;
  color: var(--fb-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.15rem;
}

/* ── VERMÖGEN (Klickbare Komponenten) ────────────────────────── */
/* Bestehendes .fb-wealth-component muss klickbar werden, da jetzt <a> statt <div> */
a.fb-wealth-component {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
a.fb-wealth-component:hover {
  border-color: var(--fb-gold);
  transform: translateY(-2px);
}
a.fb-wealth-debts-row {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
a.fb-wealth-debts-row:hover { color: var(--fb-navy); }

/* ── STEUERN ─────────────────────────────────────────────────── */
/* Vorschau-Kachel "Geschätzte Steuerlast" (TaxEstimator, kompakt) */
.fb-tax-estimate {
  background: linear-gradient(135deg, #162039 0%, #1F2C4D 100%);
  color: #fff;
  padding: 1rem 1.15rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.fb-tax-estimate-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fb-gold);
  font-weight: 700;
  margin-bottom: 0.3rem;
}
.fb-tax-estimate-amount {
  font-size: 1.65rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.fb-tax-estimate-sub {
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.72);
}
.fb-tax-estimate-loading {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.6);
}
.fb-tax-estimate-delta {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.fb-tax-estimate-delta.up   { background: #FEE2E2; color: #991B1B; }
.fb-tax-estimate-delta.down { background: #D1FAE5; color: #065F46; }
.fb-tax-estimate-delta.same { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.8); }

.fb-tax-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.fb-tax-summary-tile {
  display: block;
  padding: 1rem 1.1rem;
  background: var(--fb-bg);
  border: 1px solid var(--fb-border);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.fb-tax-summary-tile:hover {
  background: #fff;
  border-color: var(--fb-gold);
  transform: translateY(-2px);
}
.fb-tax-summary-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fb-text-muted);
  margin-bottom: 0.45rem;
}
.fb-tax-summary-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--fb-navy);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.35rem;
}
.fb-delta-pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}
.fb-delta-pill.pos { background: rgba(16, 185, 129, 0.12); color: #047857; }
.fb-delta-pill.neg { background: rgba(239, 68, 68, 0.12);  color: #B91C1C; }

/* Säule 3a */
.fb-saule3a {
  padding: 1.1rem 1.2rem;
  background: var(--fb-bg);
  border: 1px solid var(--fb-border);
  border-radius: 10px;
  margin-bottom: 1.25rem;
}
.fb-saule3a-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}
.fb-saule3a-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--fb-navy);
}
.fb-saule3a-meta {
  font-size: 0.75rem;
  color: var(--fb-text-muted);
  margin-top: 0.15rem;
}
.fb-saule3a-pct {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--fb-navy);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.fb-saule3a-bar {
  height: 10px;
  background: rgba(30, 42, 74, 0.08);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 0.6rem;
}
.fb-saule3a-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--fb-gold) 0%, var(--fb-gold-dark) 100%);
  border-radius: 5px;
  transition: width 0.4s ease;
}
.fb-saule3a-hint {
  font-size: 0.78rem;
}
.fb-saule3a-hint a {
  color: var(--fb-navy);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--fb-gold);
}
.fb-saule3a-hint a:hover { color: var(--fb-gold-dark); }
.fb-saule3a-hint-done {
  color: #047857;
  font-weight: 600;
}

.fb-tax-deductions { margin-top: 0.25rem; }
.fb-ded-row {
  display: block;
  padding: 0.65rem 0.85rem;
  background: var(--fb-bg);
  border: 1px solid var(--fb-border);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.fb-ded-row:hover {
  background: #fff;
  border-color: var(--fb-gold);
  transform: translateX(2px);
}
.fb-ded-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.fb-ded-row-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fb-text);
}
.fb-ded-row-value {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--fb-navy);
  font-variant-numeric: tabular-nums;
}
.fb-ded-row-bar {
  height: 5px;
  background: rgba(30, 42, 74, 0.08);
  border-radius: 3px;
  overflow: hidden;
}
.fb-ded-row-bar-fill {
  height: 100%;
  background: var(--fb-navy);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* ── UPSELL-CARD ─────────────────────────────────────────────── */
.fb-upsell-card {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  background: linear-gradient(135deg, #fff 0%, #FEF9E7 100%);
  border: 1px solid var(--fb-gold);
  padding: 1.5rem;
}
.fb-upsell-icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  background: rgba(245, 197, 24, 0.15);
  border: 1px solid var(--fb-gold);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fb-navy);
}
.fb-upsell-icon svg { width: 26px; height: 26px; }
.fb-upsell-body { flex: 1; min-width: 0; }
.fb-upsell-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fb-gold-dark);
  margin-bottom: 0.4rem;
}
.fb-upsell-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--fb-navy);
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
}
.fb-upsell-text {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--fb-text);
  margin: 0 0 1rem;
}
.fb-upsell-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.fb-upsell-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--fb-gold);
  color: var(--fb-navy);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.65rem 1.25rem;
  border-radius: 5px;
  text-decoration: none;
  transition: background 0.15s;
}
.fb-upsell-btn-primary:hover { background: var(--fb-gold-dark); }
.fb-upsell-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--fb-navy);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.65rem 1rem;
  border-radius: 5px;
  text-decoration: none;
  border: 1px solid var(--fb-navy);
  transition: background 0.15s, color 0.15s;
}
.fb-upsell-btn-ghost:hover {
  background: var(--fb-navy);
  color: #fff;
}

/* ── SYNC-COLLAPSED (default zugeklappt am Page-Ende) ──────── */
.fb-sync-toggle {
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.fb-sync-toggle .fb-section-head--inline { margin-bottom: 0; }
.fb-sync-toggle-chevron {
  width: 18px;
  height: 18px;
  color: var(--fb-text-muted);
  transition: transform 0.2s;
}
.fb-sync-collapsed .fb-sync-body { display: none; }
.fb-sync-collapsed.is-open .fb-sync-body {
  display: block;
  margin-top: 1.25rem;
}
.fb-sync-collapsed.is-open .fb-sync-toggle-chevron { transform: rotate(180deg); }

/* ── RESPONSIVE (Desktop primär, aber Mobile darf nicht brechen) ── */
@media (max-width: 880px) {
  .fb-month-saldo {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .fb-month-grid,
  .fb-contracts-grid,
  .fb-tax-summary {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .fb-contracts-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .fb-month-flow-row {
    grid-template-columns: 80px 1fr 100px;
    gap: 0.5rem;
  }
  .fb-upsell-card {
    flex-direction: column;
    gap: 0.75rem;
  }
}
