/* =====================================================================
   jbvan.eu — Stylesheet
   Konzept: "Open Road" — helles, schlichtes, raffiniertes Design
   - Warme Off-White Basis mit subtiler Tiefe
   - Sanfte Sage/Tealgrün Akzente (Camper-Welt, Natur)
   - Warme Coral/Apricot Akzente (Sonnenuntergang)
   - Editorial Typografie: Fraunces (Display) + Geist (UI)
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700;9..144,900&family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

:root {
  /* Farbpalette */
  --bg:            #FAF8F4;     /* warmer Off-White */
  --bg-elev:       #FFFFFF;
  --surface:       #F4F0E8;     /* Sand */
  --ink:           #1A1F1C;     /* Tiefes Dunkelgrün/Schwarz */
  --ink-soft:      #4A524C;
  --ink-muted:     #7A8378;

  --line:          #E5E0D5;
  --line-strong:   #C9C2B2;

  --sage:          #4A7C6F;     /* Hauptakzent */
  --sage-deep:     #2D5247;
  --sage-soft:     #D4E2DB;
  --sage-tint:     #EAF1ED;

  --coral:         #D97757;     /* Sekundär */
  --coral-soft:    #F4D5C5;
  --coral-tint:    #FBEBE2;

  --amber:         #D4A24C;
  --amber-soft:    #F2E2BE;

  --danger:        #B5443A;
  --success:       #4A7C6F;

  /* Schatten */
  --shadow-sm:  0 1px 2px rgba(26,31,28,.04), 0 1px 3px rgba(26,31,28,.06);
  --shadow-md:  0 4px 12px rgba(26,31,28,.06), 0 2px 4px rgba(26,31,28,.04);
  --shadow-lg:  0 12px 32px rgba(26,31,28,.08), 0 4px 12px rgba(26,31,28,.05);
  --shadow-xl:  0 24px 64px rgba(26,31,28,.12), 0 8px 24px rgba(26,31,28,.06);

  /* Radien */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  /* Typografie */
  --font-display: 'Fraunces', 'Times New Roman', serif;
  --font-body:    'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'Geist Mono', ui-monospace, monospace;
}

/* ---------------------------------------------------------------------
   Reset & Basis
   --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(74,124,111,.10), transparent 60%),
    radial-gradient(700px 400px at 105% 8%, rgba(217,119,87,.08), transparent 55%),
    radial-gradient(600px 400px at 50% 110%, rgba(212,162,76,.06), transparent 60%);
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2.2rem, 4.5vw, 3.6rem); font-weight: 500; }
h2 { font-size: clamp(1.6rem, 2.8vw, 2.2rem); }
h3 { font-size: 1.25rem; font-weight: 600; }
p  { margin: 0 0 1rem; color: var(--ink-soft); }

a { color: var(--sage-deep); text-decoration: none; transition: color .2s; }
a:hover { color: var(--coral); }

::selection { background: var(--sage-soft); color: var(--ink); }

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .75rem 1.4rem;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: .92rem; font-weight: 500;
  cursor: pointer;
  transition: all .2s cubic-bezier(.2,.8,.2,1);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { background: var(--sage-deep); transform: translateY(-1px); box-shadow: var(--shadow-lg); color: var(--bg); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-elev);
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-secondary:hover { border-color: var(--ink); color: var(--ink); }

.btn-accent { background: var(--coral); color: white; }
.btn-accent:hover { background: #C4684A; color: white; transform: translateY(-1px); }

.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--surface); color: var(--ink); }

.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: white; }

.btn-sm { padding: .5rem 1rem; font-size: .85rem; }
.btn-lg { padding: 1rem 1.8rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */
.form-group { margin-bottom: 1.1rem; }
.form-row { display: grid; gap: 1rem; }
@media (min-width: 640px) {
  .form-row.cols-2 { grid-template-columns: 1fr 1fr; }
  .form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
  .form-row.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
}

.label {
  display: block;
  font-size: .8rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: .35rem;
  letter-spacing: .01em;
}
.input, .select, .textarea {
  width: 100%;
  padding: .7rem .9rem;
  font: inherit;
  font-size: .95rem;
  color: var(--ink);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color .15s, box-shadow .15s, background .15s;
  font-variant-numeric: tabular-nums;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 4px rgba(74,124,111,.12);
  background: var(--bg-elev);
}
.input-suffix {
  position: relative;
}
.input-suffix .input { padding-right: 3rem; }
.input-suffix .suffix {
  position: absolute; right: .9rem; top: 50%; transform: translateY(-50%);
  color: var(--ink-muted); font-size: .85rem; pointer-events: none;
}

.checkbox {
  display: flex; align-items: flex-start; gap: .6rem; cursor: pointer;
  font-size: .9rem; color: var(--ink-soft);
}
.checkbox input[type="checkbox"] {
  appearance: none;
  width: 18px; height: 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: 5px;
  background: var(--bg-elev);
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all .15s;
  position: relative;
}
.checkbox input[type="checkbox"]:checked {
  background: var(--ink);
  border-color: var(--ink);
}
.checkbox input[type="checkbox"]:checked::after {
  content: ''; position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: solid var(--bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---------------------------------------------------------------------
   Cards
   --------------------------------------------------------------------- */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.card-elevated { box-shadow: var(--shadow-md); }
.card-magic {
  background: linear-gradient(135deg, var(--bg-elev) 0%, var(--sage-tint) 100%);
  border: 1px solid var(--sage-soft);
  position: relative;
  overflow: hidden;
}
.card-magic::after {
  content: '';
  position: absolute; top: -50%; right: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.5), transparent 50%);
  pointer-events: none;
}

/* ---------------------------------------------------------------------
   Auth-Layout (Login/Register)
   --------------------------------------------------------------------- */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 980px) {
  .auth-shell { grid-template-columns: 1.1fr 1fr; }
}
.auth-hero {
  position: relative;
  background:
    linear-gradient(180deg, rgba(26,31,28,.55) 0%, rgba(26,31,28,.85) 100%),
    radial-gradient(800px 500px at 80% 20%, rgba(217,119,87,.5), transparent 60%),
    linear-gradient(135deg, #2D5247 0%, #1A1F1C 100%);
  color: var(--bg);
  padding: 3rem;
  display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden;
}
.auth-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(180deg, transparent, transparent 28px, rgba(255,255,255,.03) 28px, rgba(255,255,255,.03) 29px);
  pointer-events: none;
}
.auth-hero::after {
  content: '';
  position: absolute;
  bottom: -120px; left: -100px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(212,162,76,.25), transparent 70%);
  pointer-events: none;
  border-radius: 50%;
}

.auth-hero-content {
  position: relative; z-index: 2;
  max-width: 520px;
}
.brand-mark {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 600; letter-spacing: -.01em;
  color: var(--bg);
}
.brand-mark .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(217,119,87,.3);
}
.auth-hero h1 {
  color: var(--bg);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 400;
  margin: 2rem 0 1rem;
  line-height: 1.05;
}
.auth-hero h1 em {
  font-style: italic;
  font-weight: 500;
  color: var(--coral-soft);
}
.auth-hero .lead {
  font-size: 1.05rem;
  color: rgba(250,248,244,.85);
  max-width: 460px;
  margin-bottom: 2rem;
}

.feature-pills { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2rem; position: relative; z-index: 2; }
.pill {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .4rem .85rem;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 100px;
  font-size: .82rem;
  color: rgba(250,248,244,.9);
  backdrop-filter: blur(6px);
}

.auth-hero-footer {
  position: relative; z-index: 2;
  font-size: .8rem;
  color: rgba(250,248,244,.5);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.auth-form-wrap {
  display: flex; align-items: center; justify-content: center;
  padding: 2.5rem 1.5rem;
}
.auth-card {
  width: 100%;
  max-width: 420px;
}
.auth-card h2 {
  font-size: 2rem;
  font-weight: 500;
  margin-bottom: .25rem;
}
.auth-card .subtitle {
  color: var(--ink-muted);
  font-size: .95rem;
  margin-bottom: 2rem;
}

.alert {
  padding: .85rem 1rem;
  border-radius: var(--r-md);
  font-size: .88rem;
  margin-bottom: 1.2rem;
  border: 1px solid;
}
.alert-error   { background: var(--coral-tint); border-color: var(--coral-soft); color: #8B3D2A; }
.alert-success { background: var(--sage-tint);  border-color: var(--sage-soft);  color: var(--sage-deep); }
.alert-info    { background: var(--amber-soft); border-color: #E6CD8E; color: #856427; }

.tab-switch {
  display: flex; gap: .25rem;
  background: var(--surface);
  padding: .25rem;
  border-radius: var(--r-md);
  margin-bottom: 1.5rem;
}
.tab-switch a {
  flex: 1;
  text-align: center;
  padding: .55rem 1rem;
  border-radius: 10px;
  font-size: .88rem; font-weight: 500;
  color: var(--ink-muted);
  transition: all .2s;
}
.tab-switch a.active {
  background: var(--bg-elev);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.divider {
  text-align: center;
  color: var(--ink-muted);
  font-size: .78rem;
  margin: 1.5rem 0;
  position: relative;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.divider::before, .divider::after {
  content: '';
  position: absolute; top: 50%;
  width: calc(50% - 30px); height: 1px;
  background: var(--line);
}
.divider::before { left: 0; }
.divider::after  { right: 0; }

/* ---------------------------------------------------------------------
   App-Layout (nach Login)
   --------------------------------------------------------------------- */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }
}

.sidebar {
  background: var(--bg-elev);
  border-right: 1px solid var(--line);
  padding: 1.5rem 1rem;
  position: sticky; top: 0;
  height: 100vh;
  display: flex; flex-direction: column;
  gap: 1rem;
}
@media (max-width: 880px) {
  .sidebar {
    position: static; height: auto;
    border-right: none; border-bottom: 1px solid var(--line);
    flex-direction: row; align-items: center;
    overflow-x: auto;
  }
}

.sidebar-brand {
  display: flex; align-items: center; gap: .55rem;
  font-family: var(--font-display);
  font-size: 1.2rem; font-weight: 600; letter-spacing: -.01em;
  color: var(--ink);
  padding: 0 .5rem;
}
.sidebar-brand .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 3px rgba(217,119,87,.18);
}

.nav { display: flex; flex-direction: column; gap: .15rem; }
@media (max-width: 880px) { .nav { flex-direction: row; gap: .15rem; } }

.nav a {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem .8rem;
  border-radius: var(--r-sm);
  font-size: .9rem; font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: all .15s;
}
.nav a:hover { background: var(--surface); color: var(--ink); }
.nav a.active {
  background: var(--ink);
  color: var(--bg);
}
.nav a .icon { width: 16px; height: 16px; flex-shrink: 0; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: .8rem;
  color: var(--ink-muted);
}
@media (max-width: 880px) {
  .sidebar-footer { display: none; }
}

.main { padding: 2rem 2rem 4rem; max-width: 1400px; }
@media (max-width: 640px) { .main { padding: 1.5rem 1rem 3rem; } }

.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}
.page-header h2 { margin: 0; }
.page-header .lead { color: var(--ink-muted); margin: .35rem 0 0; font-size: .95rem; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------------------------------------------------------------------
   KPI / Stat-Tiles
   --------------------------------------------------------------------- */
.stat-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 2rem;
}
.stat {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.4rem;
  position: relative;
  overflow: hidden;
}
.stat-label {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-muted);
  margin-bottom: .35rem;
  font-weight: 500;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 500;
  letter-spacing: -.02em;
  color: var(--ink);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-unit { font-size: 1rem; color: var(--ink-muted); margin-left: .15rem; font-family: var(--font-body); font-weight: 400; }
.stat-sub { font-size: .82rem; color: var(--ink-muted); margin-top: .5rem; }
.stat-accent { background: linear-gradient(135deg, var(--ink) 0%, var(--sage-deep) 100%); color: var(--bg); border-color: transparent; }
.stat-accent .stat-label, .stat-accent .stat-sub { color: rgba(250,248,244,.7); }
.stat-accent .stat-value, .stat-accent .stat-unit { color: var(--bg); }
.stat-accent::after {
  content: '';
  position: absolute; right: -40px; top: -40px;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217,119,87,.4), transparent 70%);
}

.delta-up   { color: var(--danger); }
.delta-down { color: var(--success); }

/* ---------------------------------------------------------------------
   Tabellen
   --------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg-elev); }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: .85rem 1rem; text-align: left; border-bottom: 1px solid var(--line); }
.table th {
  font-weight: 500; font-size: .78rem;
  color: var(--ink-muted);
  text-transform: uppercase; letter-spacing: .06em;
  background: var(--surface);
}
.table tbody tr:hover { background: var(--sage-tint); }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
.table td.num { font-size: .85rem; }

/* ---------------------------------------------------------------------
   Vehicle Cards (Übersicht)
   --------------------------------------------------------------------- */
.vehicle-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.vehicle-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  display: flex; flex-direction: column;
  gap: 1rem;
  transition: all .25s;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}
.vehicle-card:hover {
  transform: translateY(-3px);
  border-color: var(--ink);
  box-shadow: var(--shadow-lg);
}
.vehicle-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--sage), var(--coral));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s ease;
}
.vehicle-card:hover::before { transform: scaleX(1); }

.vehicle-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.vehicle-card h3 { margin: 0 0 .2rem; }
.vehicle-card .meta { font-size: .85rem; color: var(--ink-muted); }
.vehicle-badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .25rem .65rem;
  background: var(--sage-tint);
  color: var(--sage-deep);
  border-radius: 100px;
  font-size: .72rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .05em;
}
.vehicle-badge.campervan { background: var(--coral-tint); color: #8B3D2A; }

.vehicle-card .price-line {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.vehicle-card .price-sub { color: var(--ink-muted); font-size: .82rem; margin-top: -.4rem; }
.vehicle-card .breakdown {
  display: grid; grid-template-columns: 1fr 1fr; gap: .5rem;
  padding-top: 1rem; border-top: 1px dashed var(--line);
  font-size: .82rem;
}
.vehicle-card .breakdown div { display: flex; justify-content: space-between; }
.vehicle-card .breakdown span { color: var(--ink-muted); }
.vehicle-card .breakdown b { font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------------
   Calculator-Layout (Detailseite)
   --------------------------------------------------------------------- */
.calc-layout { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 1100px) {
  .calc-layout { grid-template-columns: 1fr 380px; align-items: start; }
  .calc-summary { position: sticky; top: 1.5rem; }
}

.section {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.section h3 {
  margin: 0 0 .25rem;
  display: flex; align-items: center; gap: .55rem;
}
.section h3::before {
  content: '';
  display: inline-block;
  width: 6px; height: 22px;
  background: var(--coral);
  border-radius: 2px;
}
.section .section-sub {
  color: var(--ink-muted);
  font-size: .85rem;
  margin: 0 0 1.25rem;
}

.summary-card {
  background: linear-gradient(160deg, var(--ink) 0%, var(--sage-deep) 100%);
  color: var(--bg);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.summary-card::after {
  content: '';
  position: absolute; bottom: -80px; right: -80px;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217,119,87,.35), transparent 70%);
  pointer-events: none;
}
.summary-card h3 { color: var(--bg); margin-bottom: 1.25rem; }
.summary-card h3::before { background: var(--coral); }
.summary-row { display: flex; justify-content: space-between; padding: .65rem 0; border-bottom: 1px solid rgba(250,248,244,.12); font-size: .9rem; position: relative; z-index: 1; }
.summary-row:last-of-type { border-bottom: none; }
.summary-row span { color: rgba(250,248,244,.75); }
.summary-row b { font-variant-numeric: tabular-nums; font-weight: 500; }
.summary-total {
  padding: 1rem 0 .25rem;
  margin-top: .5rem;
  border-top: 1px solid rgba(250,248,244,.25);
  display: flex; justify-content: space-between; align-items: baseline;
  position: relative; z-index: 1;
}
.summary-total span { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(250,248,244,.7); }
.summary-total b {
  font-family: var(--font-display);
  font-size: 1.85rem; font-weight: 500;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------------
   Charts
   --------------------------------------------------------------------- */
.chart-wrap { position: relative; width: 100%; height: 320px; }
.chart-wrap.tall { height: 400px; }
.legend { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; margin-top: 1rem; font-size: .85rem; }
.legend .item { display: inline-flex; align-items: center; gap: .5rem; color: var(--ink-soft); }
.legend .swatch { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }

/* ---------------------------------------------------------------------
   Modal
   --------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(26,31,28,.5);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center; justify-content: center;
  padding: 1.5rem;
  animation: fade .2s;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--bg-elev);
  border-radius: var(--r-xl);
  width: 100%; max-width: 760px;
  max-height: 92vh;
  overflow: auto;
  box-shadow: var(--shadow-xl);
  animation: pop .25s cubic-bezier(.2,.9,.3,1.2);
}
.modal-head { padding: 1.5rem 1.75rem 1rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 1.4rem; }
.modal-close {
  background: var(--surface); border: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--ink-soft);
  transition: all .15s;
}
.modal-close:hover { background: var(--coral-tint); color: var(--coral); transform: rotate(90deg); }
.modal-body { padding: 1.5rem 1.75rem; }
.modal-foot { padding: 1rem 1.75rem 1.5rem; display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop  { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------------
   Vergleichsansicht
   --------------------------------------------------------------------- */
.compare-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 220px repeat(auto-fit, minmax(180px, 1fr));
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.compare-row {
  display: contents;
}
.compare-row > div {
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--line);
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
}
.compare-row > div:first-child {
  background: var(--surface);
  font-weight: 500;
  color: var(--ink-soft);
  border-right: 1px solid var(--line);
}
.compare-row.head > div {
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1rem;
  border-bottom: none;
}
.compare-row.total > div {
  background: var(--sage-tint);
  font-weight: 600;
  color: var(--sage-deep);
  border-bottom: none;
}

/* ---------------------------------------------------------------------
   Cookie-Banner & DSGVO
   --------------------------------------------------------------------- */
.cookie-banner {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 950;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  padding: 1.25rem 1.5rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem;
  max-width: 760px;
  margin: 0 auto;
  font-size: .9rem;
}
.cookie-banner.hidden { display: none; }
.cookie-banner p { margin: 0; flex: 1 1 280px; color: var(--ink-soft); }
.cookie-banner .actions { display: flex; gap: .5rem; }

/* ---------------------------------------------------------------------
   Utility
   --------------------------------------------------------------------- */
.muted   { color: var(--ink-muted); }
.mono    { font-family: var(--font-mono); }
.center  { text-align: center; }
.flex    { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.gap-1   { gap: .5rem; }
.gap-2   { gap: 1rem; }
.mt-1    { margin-top: .5rem; }
.mt-2    { margin-top: 1rem; }
.mt-3    { margin-top: 1.5rem; }
.mt-4    { margin-top: 2rem; }
.mb-2    { margin-bottom: 1rem; }
.hidden  { display: none !important; }

/* Toast */
.toast-stack {
  position: fixed; right: 1rem; top: 1rem; z-index: 999;
  display: flex; flex-direction: column; gap: .5rem;
}
.toast {
  background: var(--ink);
  color: var(--bg);
  padding: .8rem 1.1rem;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  font-size: .88rem;
  max-width: 360px;
  animation: slideIn .25s, fadeOut .3s 3.5s forwards;
}
.toast.error   { background: var(--danger); }
.toast.success { background: var(--sage-deep); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-8px); } }

/* Animation: Page-Enter */
.fade-up { animation: fadeUp .55s cubic-bezier(.2,.8,.2,1) backwards; }
.fade-up.d2 { animation-delay: .08s; }
.fade-up.d3 { animation-delay: .16s; }
.fade-up.d4 { animation-delay: .24s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Spezielle Footer-Texte */
.legal-footer {
  text-align: center;
  padding: 2rem 1rem 1rem;
  font-size: .8rem;
  color: var(--ink-muted);
}
.legal-footer a { color: var(--ink-soft); margin: 0 .5rem; }
.legal-footer a:hover { color: var(--ink); }

/* Empty-State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  border: 2px dashed var(--line-strong);
  border-radius: var(--r-lg);
  color: var(--ink-muted);
}
.empty-state .icon-circle {
  width: 72px; height: 72px;
  margin: 0 auto 1rem;
  background: var(--sage-tint);
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 1.8rem;
}
.empty-state h3 { color: var(--ink); margin-bottom: .5rem; }

/* Tabs in App */
.app-tabs {
  display: flex; gap: .25rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.app-tabs button {
  background: transparent; border: none;
  padding: .8rem 1.1rem;
  font: inherit; font-weight: 500; font-size: .9rem;
  color: var(--ink-muted);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}
.app-tabs button.active { color: var(--ink); }
.app-tabs button.active::after {
  content: '';
  position: absolute; bottom: -1px; left: .5rem; right: .5rem;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp .25s; }

/* Plan/Ist-Indikator */
.indicator {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .85rem;
  padding: .2rem .55rem;
  border-radius: 100px;
  font-weight: 500;
}
.indicator.over  { background: var(--coral-tint);  color: #8B3D2A; }
.indicator.under { background: var(--sage-tint);   color: var(--sage-deep); }
.indicator.even  { background: var(--surface);     color: var(--ink-soft); }

/* Sehen-Lassen */
input[type=number] { -moz-appearance: textfield; }
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------------------------------------------------------------------
   Charts-Grid für Compare-Page
   --------------------------------------------------------------------- */
.charts-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
  margin-top: 1.5rem;
}
@media (min-width: 1100px) {
  .charts-grid.cols-2 { grid-template-columns: 1fr 1fr; }
}
.chart-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.5rem;
}
.chart-card h3 {
  margin: 0 0 .15rem;
  font-size: 1.15rem;
  display: flex; align-items: center; gap: .55rem;
}
.chart-card h3::before {
  content: '';
  display: inline-block;
  width: 5px; height: 18px;
  background: var(--sage);
  border-radius: 2px;
}
.chart-card .hint {
  color: var(--ink-muted);
  font-size: .85rem;
  margin: 0 0 1.1rem;
}
.chart-card .chart-wrap { height: 280px; }
.chart-card .chart-wrap.tall { height: 340px; }

/* ---------------------------------------------------------------------
   Finanzierungs-Schalter (Was-wäre-wenn)
   --------------------------------------------------------------------- */
.fin-compare {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 880px) {
  .fin-compare { grid-template-columns: repeat(3, 1fr); }
}
.fin-option {
  background: var(--bg-elev);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  position: relative;
  transition: all .2s;
}
.fin-option.recommended {
  border-color: var(--sage);
  background: linear-gradient(180deg, var(--sage-tint) 0%, var(--bg-elev) 60%);
}
.fin-option.recommended::after {
  content: 'GÜNSTIGSTE';
  position: absolute;
  top: -10px; right: 14px;
  background: var(--sage-deep);
  color: var(--bg);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  padding: .25rem .6rem;
  border-radius: 100px;
}
.fin-option .fin-label {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-muted);
  font-weight: 500;
  margin-bottom: .35rem;
}
.fin-option h4 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 500;
  margin: 0 0 .85rem;
}
.fin-option .big {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 500;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.fin-option .small { font-size: .84rem; color: var(--ink-muted); margin-top: .25rem; }
.fin-option .row {
  display: flex; justify-content: space-between;
  padding: .35rem 0;
  font-size: .85rem;
  border-top: 1px dashed var(--line);
  margin-top: .25rem;
}
.fin-option .row:first-of-type { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .65rem; }
.fin-option .row span { color: var(--ink-muted); }
.fin-option .row b { font-variant-numeric: tabular-nums; font-weight: 500; }

/* Inline-Editor für Finanzierungs-Parameter */
.fin-inputs {
  display: grid;
  gap: .5rem;
  grid-template-columns: 1fr 1fr;
  margin-top: .8rem;
  padding-top: .8rem;
  border-top: 1px dashed var(--line);
}
.fin-inputs .mini-label {
  font-size: .72rem;
  color: var(--ink-muted);
  margin-bottom: .15rem;
  display: block;
}
.fin-inputs input {
  width: 100%;
  padding: .4rem .55rem;
  font: inherit;
  font-size: .85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-elev);
  font-variant-numeric: tabular-nums;
}
.fin-inputs input:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 3px rgba(74,124,111,.12); }
