/* ═══════════════════════════════════════════════════════════════
   MINIMALIST FINANCE – SALARY PLANNER
   style.css
════════════════════════════════════════════════════════════════ */

/* ── CSS CUSTOM PROPERTIES ── */
:root {
  --bg:           #f8f9fa;
  --card:         #ffffff;
  --text:         #1a1a2e;
  --muted:        #6b7280;
  --border:       #e5e7eb;
  --shadow:       0 2px 16px rgba(0,0,0,0.08);
  --shadow-hover: 0 6px 32px rgba(0,0,0,0.13);
  --hover:        rgba(0,0,0,0.04);

  /* step palette */
  --amber-start:  #f6c344;
  --amber-end:    #f09519;
  --pink-start:   #f472b6;
  --pink-end:     #ec4899;
  --violet-start: #a78bfa;
  --violet-end:   #7c3aed;
  --emerald-start:#34d399;
  --emerald-end:  #059669;
  --blue-start:   #60a5fa;
  --blue-end:     #3b82f6;

  /* category */
  --c-living:     #ec4899;
  --c-savings:    #a78bfa;
  --c-fun:        #f87171;

  --radius-card:  16px;
  --radius-pill:  50px;
  --radius-step:  20px;
  --radius-input: 12px;

  --transition: 0.2s ease;
}

[data-theme="dark"] {
  --bg:    #0f0f1a;
  --card:  #1e1e2e;
  --text:  #e2e8f0;
  --muted: #94a3b8;
  --border:#2d2d3d;
  --shadow:       0 2px 16px rgba(0,0,0,0.4);
  --shadow-hover: 0 6px 32px rgba(0,0,0,0.55);
  --hover:        rgba(255,255,255,0.06);
}

/* ════════════════════════════════════════
   SPLASH SCREEN
════════════════════════════════════════ */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: splashFadeOut 0.5s ease 2.6s both;
}

.splash.hidden {
  display: none;
}

.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.splash-logo {
  animation: splashLogoIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

.splash-logo svg {
  filter: drop-shadow(0 8px 24px rgba(232, 67, 147, 0.4));
}

.splash-title {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  animation: splashTextIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both;
}

.splash-subtitle {
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  animation: splashTextIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.75s both;
}

@keyframes splashLogoIn {
  from { opacity: 0; transform: scale(0.5) translateY(20px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}

@keyframes splashTextIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes splashFadeOut {
  from { opacity: 1; pointer-events: all; }
  to   { opacity: 0; pointer-events: none; }
}

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; touch-action: manipulation; }

html { font-size: 16px; }
button, a, input, select, textarea, label { touch-action: manipulation; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  line-height: 1.5;
}

button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select { font-family: inherit; font-size: 1rem; }
input:focus, select:focus, button:focus-visible {
  outline: 2px solid var(--blue-end);
  outline-offset: 2px;
}

.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════════
   ONBOARDING
════════════════════════════════════════════════════════════════ */

.onboarding-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 40px;
}

.step-container {
  display: none;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  animation: fadeUp 0.35s ease;
}

.step-container.active { display: flex; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes drawArc {
  to { stroke-dashoffset: 0; }
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes spinIcon {
  0%   { transform: rotate(0deg)   scale(1); }
  40%  { transform: rotate(180deg) scale(0.6); }
  100% { transform: rotate(360deg) scale(1); }
}

.icon-btn.spinning {
  animation: spinIcon 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Onboarding topbar ── */
.onboarding-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}

/* Add top padding to onboarding-wrapper so content clears the fixed topbar */
.onboarding-wrapper {
  padding-top: 88px;
}

/* ── Fixed cost edit button ── */
.edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 0.85rem;
  opacity: 0.5;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.edit-btn:hover { opacity: 1; background: var(--hover); }
.item-row.editing { background: var(--hover); border-radius: 10px; padding: 8px; }

/* ── Step gradient card ── */
.step-card {
  border-radius: var(--radius-step);
  padding: 24px;
  color: #fff;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.step-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.08);
  border-radius: inherit;
  pointer-events: none;
}

.step-card--amber  { background: linear-gradient(135deg, var(--amber-start), var(--amber-end)); }
.step-card--pink   { background: linear-gradient(135deg, var(--pink-start),  var(--pink-end)); }
.step-card--violet { background: linear-gradient(135deg, var(--violet-start),var(--violet-end)); }
.step-card--emerald{ background: linear-gradient(135deg, var(--emerald-start),var(--emerald-end)); }
.step-card--blue   { background: linear-gradient(135deg, var(--blue-start),  var(--blue-end)); }

.step-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.step-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: rgba(255,255,255,0.25);
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
}

.step-pct {
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.9;
}

.step-card__body {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.step-icon {
  font-size: 1.8rem;
  background: rgba(255,255,255,0.25);
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.step-subtitle {
  font-size: 0.875rem;
  opacity: 0.85;
  margin-top: 4px;
}

.progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.3);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: rgba(255,255,255,0.9);
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ── Step content area ── */
.step-content {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  transition: background var(--transition), box-shadow var(--transition);
}

.content-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.content-desc {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 24px;
}

/* ── Currency input ── */
.currency-card {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-input);
  padding: 0 20px;
  margin-bottom: 20px;
  transition: border-color var(--transition);
}

.currency-card:focus-within {
  border-color: var(--amber-end);
}

.currency-symbol {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--muted);
  margin-right: 12px;
  user-select: none;
}

.currency-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  padding: 20px 0;
  width: 100%;
}

.currency-input:focus { outline: none; }

.currency-input::placeholder { color: var(--border); }

/* ── Extra income streams ── */
.stream-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
}

.stream-row input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-input);
  padding: 12px 16px;
  background: var(--bg);
  color: var(--text);
  transition: border-color var(--transition);
}

.stream-row input:focus { border-color: var(--amber-end); outline: none; }

.stream-row .stream-amount {
  max-width: 140px;
}

.delete-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fee2e2;
  color: #ef4444;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition);
}

.delete-btn:hover { background: #fecaca; }

[data-theme="dark"] .delete-btn { background: #3f1f1f; color: #f87171; }
[data-theme="dark"] .delete-btn:hover { background: #4f2828; }

.link-btn {
  color: var(--amber-end);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 4px 0;
  background: none;
  border: none;
  cursor: pointer;
  display: inline-block;
  margin-bottom: 16px;
  text-decoration: none;
  transition: opacity var(--transition);
}

.link-btn:hover { opacity: 0.75; }

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: var(--radius-input);
  border: 1.5px solid var(--border);
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 8px;
}

.total-amount {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

/* ── Fixkosten buffer card ── */
.fc-buffer-card {
  padding: 20px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(99,102,241,0.08) 0%, rgba(139,92,246,0.08) 100%);
  border: 1.5px solid rgba(99,102,241,0.2);
  border-radius: var(--radius-card);
  empty-cells: show;
}
.fc-buffer-card:empty { display: none; }

.fc-buffer-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.fc-buffer-icon { font-size: 1.6rem; line-height: 1; flex-shrink: 0; }
.fc-buffer-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.fc-buffer-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}
.fc-buffer-amount {
  font-size: 2rem;
  font-weight: 800;
  color: #6366f1;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}
[data-theme="dark"] .fc-buffer-amount { color: #a5b4fc; }
.fc-buffer-breakdown {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--muted);
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.fc-buffer-note {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 8px;
  padding: 6px 10px;
  background: rgba(245,158,11,0.08);
  border-radius: 8px;
  border-left: 3px solid #f59e0b;
}

/* ── Budget step ── */
.donut-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 24px;
}

.donut-wrapper svg { overflow: visible; }

.donut-wrapper--sm { margin-bottom: 16px; }

.budget-rows { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }

.budget-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: var(--radius-input);
  border: 1.5px solid var(--border);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot--pink   { background: var(--c-living); }
.dot--purple { background: var(--c-savings); }
.dot--red    { background: var(--c-fun); }

.budget-label { flex: 1; font-size: 0.9rem; color: var(--text); font-weight: 500; }

.budget-eur {
  font-size: 0.875rem;
  color: var(--muted);
  min-width: 70px;
  text-align: right;
}

.pct-control {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
}

.pct-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--border);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  flex-shrink: 0;
}

.pct-btn:hover { background: var(--muted); color: #fff; }

.pct-value {
  width: 30px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.warning-box {
  background: #fef3c7;
  border: 1.5px solid #fbbf24;
  border-radius: var(--radius-input);
  padding: 12px 16px;
  font-size: 0.875rem;
  color: #92400e;
  margin-top: 8px;
}

[data-theme="dark"] .warning-box {
  background: #2d2000;
  border-color: #b45309;
  color: #fbbf24;
}

/* ── SETTINGS DROPDOWN ── */
.settings-wrapper { position: relative; }
.settings-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 210px;
  z-index: 300;
  overflow: hidden;
}
.settings-dropdown.hidden { display: none; }
.settings-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  border: none;
  background: none;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition);
}
.settings-item:hover { background: var(--hover); }
.settings-item + .settings-item { border-top: 1px solid var(--border); }
.settings-item--danger { color: #ef4444; }

/* ── RESET MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  padding: 24px;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 28px 24px 20px;
  width: 100%; max-width: 340px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.modal-title { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.modal-body  { font-size: 0.9rem; color: var(--muted); margin-bottom: 24px; line-height: 1.5; }
.modal-actions { display: flex; gap: 10px; }
.modal-btn {
  flex: 1; padding: 12px; border: none; border-radius: var(--radius-input);
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
}
.modal-btn--cancel  { background: var(--border); color: var(--text); }
.modal-btn--confirm { background: #ef4444; color: #fff; }

/* ── SUMMARY MODAL ── */
.summary-modal-box {
  max-width: 420px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.summary-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.summary-modal-title { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.summary-close-btn {
  width: 30px; height: 30px;
  border: none; background: var(--border);
  border-radius: 50%; cursor: pointer;
  font-size: 0.8rem; color: var(--text);
  display: flex; align-items: center; justify-content: center;
}
.summary-content {
  overflow-y: auto;
  padding: 16px 20px;
  flex: 1;
}
.sum-date { font-size: 0.78rem; color: var(--muted); margin-bottom: 16px; }
.sum-section {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.sum-section:last-child { border-bottom: none; margin-bottom: 0; }
.sum-section--highlight {
  background: var(--bg);
  border-radius: var(--radius-input);
  padding: 14px;
  border: 1.5px solid var(--border);
  margin-top: 4px;
}
.sum-section-title { font-size: 0.8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }
.sum-highlight { font-size: 1.5rem; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.sum-sub { font-size: 0.8rem; color: var(--muted); }
.sum-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text);
  padding: 5px 0;
  gap: 8px;
}
.sum-row small { color: var(--muted); }
.sum-row--sub { padding-left: 14px; color: var(--muted); font-size: 0.82rem; }
.sum-row--muted { color: var(--muted); font-size: 0.85rem; }
.summary-actions {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.summary-action-btn {
  flex: 1; padding: 12px; border: none;
  border-radius: var(--radius-input);
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
}
.summary-action-btn--share  { background: var(--c-savings); color: #fff; }
.summary-action-btn--print  { background: var(--border); color: var(--text); }

@media print {
  body > *:not(#summary-modal) { display: none !important; }
  #summary-modal { display: block !important; position: static !important; background: none !important; }
  .summary-modal-box { max-height: none; box-shadow: none; }
  .summary-actions, .summary-close-btn, .summary-modal-header button { display: none !important; }
}

/* ── Add item card (Step 3 & 4) ── */
.add-item-card {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-input);
  padding: 16px;
  margin-bottom: 20px;
}

.item-input {
  flex: 1;
  min-width: 120px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--card);
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color var(--transition);
}

.item-input:focus { border-color: var(--blue-end); outline: none; }

.item-input--amount { max-width: 120px; min-width: 90px; }

.item-select {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 10px;
  background: var(--card);
  color: var(--text);
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color var(--transition);
  flex-shrink: 0;
}

.item-select:focus { border-color: var(--blue-end); outline: none; }

/* ── Item list ── */
.item-list { display: flex; flex-direction: column; gap: 10px; }

.item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-input);
}

.item-row__name {
  flex: 1;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text);
}

.item-row__amount {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.item-row__sub {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.empty-state__icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state p { font-size: 0.9rem; }

/* ── Fixkosten Tab ── */
.tab-subtitle {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 6px 0 24px;
}

/* Impact card */
.fc-impact-card {
  margin-bottom: 28px;
  padding: 20px 22px;
}

.fc-impact-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.fc-impact-icon { font-size: 1.2rem; }

.fc-impact-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.fc-impact-bar-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.fc-impact-total { font-weight: 600; color: var(--text); }

.fc-progress-track {
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 16px;
}

.fc-progress-fill {
  height: 100%;
  background: var(--c-fun);
  border-radius: 99px;
  transition: width 0.5s ease;
}

.fc-stat-row {
  display: flex;
  gap: 12px;
}

.fc-stat-card {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fc-stat-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--blue-start);
  display: inline-block;
  margin-bottom: 2px;
}

.fc-stat-dot--muted { background: var(--muted); }

.fc-stat-label {
  font-size: 0.75rem;
  color: var(--muted);
}

.fc-stat-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--blue-start);
}

/* Section header */
.fc-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.fc-section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.btn--dark {
  background: var(--text);
  color: var(--bg);
  border: none;
}

.btn--dark:hover { opacity: 0.85; }

.btn--pill {
  border-radius: 99px;
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 600;
}

/* Fixed cost item cards */
.fc-card-list { display: flex; flex-direction: column; gap: 2px; }

.fc-item-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--card);
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  transition: box-shadow var(--transition);
}

.fc-item-card:hover {
  box-shadow: var(--shadow);
}

.fc-item-card.editing { background: var(--hover); }

.fc-item-icon {
  font-size: 1.4rem;
  width: 44px; height: 44px;
  background: var(--bg);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.fc-item-info { flex: 1; min-width: 0; }

.fc-item-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.fc-item-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

.fc-item-amount {
  text-align: right;
  min-width: 80px;
}

.fc-item-freq-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-transform: uppercase;
}

.fc-item-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.fc-item-edit-btn,
.fc-item-del-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
  font-size: 0.9rem;
}

.fc-item-card:hover .fc-item-edit-btn,
.fc-item-card:hover .fc-item-del-btn,
.fc-item-card.editing .fc-item-edit-btn,
.fc-item-card.editing .fc-item-del-btn {
  opacity: 1;
}

.fc-item-edit-btn:hover { background: var(--hover); }
.fc-item-del-btn:hover  { background: #fee2e2; color: #dc2626; }

/* ── Budget Modal ── */
.budget-modal-card {
  max-width: 440px;
}

.bm-donut-wrap {
  display: flex;
  justify-content: center;
  margin: 8px 0 20px;
}

.budget-row-info {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

/* ── Summary card (Step 5) ── */
.summary-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.summary-row:last-child { border-bottom: none; }

.summary-label { font-size: 0.9rem; color: var(--muted); }

.summary-value {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

/* ── Step navigation ── */
.step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.step-nav--single { justify-content: center; }

/* ── Buttons ── */
.btn {
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  border: none;
  cursor: pointer;
}

.btn:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }

.btn--full { width: 100%; }

.btn--sm {
  padding: 8px 18px;
  font-size: 0.85rem;
  border-radius: 20px;
}

.btn--amber  { background: linear-gradient(135deg, var(--amber-start), var(--amber-end)); color: #fff; box-shadow: 0 4px 14px rgba(240,149,25,0.35); }
.btn--pink   { background: linear-gradient(135deg, var(--pink-start),  var(--pink-end));  color: #fff; box-shadow: 0 4px 14px rgba(236,72,153,0.35); }
.btn--violet { background: linear-gradient(135deg, var(--violet-start),var(--violet-end));color: #fff; box-shadow: 0 4px 14px rgba(124,58,237,0.35); }
.btn--emerald{ background: linear-gradient(135deg, var(--emerald-start),var(--emerald-end));color:#fff;box-shadow: 0 4px 14px rgba(5,150,105,0.35); }
.btn--blue   { background: linear-gradient(135deg, var(--blue-start),  var(--blue-end));  color: #fff; box-shadow: 0 4px 14px rgba(59,130,246,0.35); }

.btn--ghost {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--muted);
  border-radius: var(--radius-pill);
}

.btn--ghost:hover:not(:disabled) { border-color: var(--muted); color: var(--text); }

.btn--add {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  padding: 0;
  background: linear-gradient(135deg, var(--blue-start), var(--blue-end));
  color: #fff;
  font-size: 1.4rem;
  font-weight: 400;
  box-shadow: 0 2px 10px rgba(59,130,246,0.3);
}

.btn--disabled, .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD
════════════════════════════════════════════════════════════════ */

.dashboard-wrapper { min-height: 100vh; display: flex; flex-direction: column; }

/* ── Top Nav ── */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 64px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
  transition: background var(--transition), border-color var(--transition);
  gap: 16px;
}

.nav-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-svg { flex-shrink: 0; border-radius: 8px; }

.nav-tabs {
  display: flex;
  gap: 6px;
  flex: 1;
  justify-content: center;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 16px;
}

.nav-tabs::-webkit-scrollbar { display: none; }

.nav-tab {
  padding: 10px 24px;
  border-radius: 22px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
  letter-spacing: 0.01em;
}

.nav-tab:hover { background: var(--hover); color: var(--text); }

.nav-tab.active {
  background: var(--text);
  color: var(--card);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--muted);
  transition: background var(--transition), color var(--transition);
}

.icon-btn svg { display: block; }
.icon-btn:hover { background: var(--bg); color: var(--text); }

/* ── Dashboard main ── */
.dashboard-main { flex: 1; padding: 32px 28px 48px; max-width: 1200px; margin: 0 auto; width: 100%; }

.tab-panel { display: none; animation: fadeUp 0.3s ease; }
.tab-panel.active { display: block; }

/* Dashboard stagger entrance — 2 cards only */
#tab-dashboard.active .metrics-grid .metric-card:nth-child(1) { animation: fadeSlideUp 0.38s ease 0.00s both; }
#tab-dashboard.active .metrics-grid .metric-card:nth-child(2) { animation: fadeSlideUp 0.38s ease 0.08s both; }
#tab-dashboard.active .allocation-card                         { animation: fadeSlideUp 0.38s ease 0.16s both; }
#tab-dashboard.active .dash-charts-row .chart-card:nth-child(1){ animation: fadeSlideUp 0.38s ease 0.24s both; }
#tab-dashboard.active .dash-charts-row .chart-card:nth-child(2){ animation: fadeSlideUp 0.38s ease 0.32s both; }

/* Planer stagger — chart is nth-child(1), categories are nth-child(2,3,4) */
#tab-planer.active .planer-chart-card                  { animation: fadeSlideUp 0.38s ease 0.00s both; }
#tab-planer.active .planer-category:nth-child(2)       { animation: fadeSlideUp 0.38s ease 0.09s both; }
#tab-planer.active .planer-category:nth-child(3)       { animation: fadeSlideUp 0.38s ease 0.17s both; }
#tab-planer.active .planer-category:nth-child(4)       { animation: fadeSlideUp 0.38s ease 0.25s both; }

/* ── Dashboard header ── */
.dash-header { margin-bottom: 20px; }

.dash-welcome { font-size: 1.8rem; font-weight: 800; color: var(--text); margin-bottom: 8px; }

.dash-tip {
  font-size: 0.88rem;
  color: #1d4ed8;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-input);
  padding: 12px 16px;
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
}

/* ── Alert ── */
.alert-card {
  border-radius: var(--radius-input);
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.alert-card--red {
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  color: #991b1b;
}

[data-theme="dark"] .alert-card--red {
  background: #2d0a0a;
  border-color: #7f1d1d;
  color: #fca5a5;
}

/* ── Metrics grid ── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.metric-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}

.metric-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }

.card-clickable {
  cursor: pointer;
  position: relative;
}

.card-action-hint {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 10px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.card-clickable:hover .card-action-hint {
  opacity: 1;
  transform: translateY(0);
}

.card-clickable:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.metric-icon {
  font-size: 1.4rem;
  width: 46px; height: 46px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
  background: var(--hover);
}

.metric-icon--green  { background: #d1fae5; }
.metric-icon--orange { background: #ffedd5; }
.metric-icon--blue   { background: #dbeafe; }
.metric-icon--purple { background: #ede9fe; }

.metric-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.metric-value { font-size: 1.6rem; font-weight: 800; color: var(--text); }

/* ── Allocation card ── */
.allocation-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.allocation-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  gap: 12px;
}

.allocation-title { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }

.allocation-subtitle { font-size: 0.85rem; color: var(--muted); }

.allocation-amounts {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.alloc-item { display: flex; align-items: center; gap: 8px; }

.alloc-label { font-size: 0.875rem; color: var(--muted); }

.alloc-value { font-size: 1rem; font-weight: 700; color: var(--text); }

.alloc-value--green { color: var(--emerald-end); }

/* ── Dashboard charts row ── */
.dash-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow);
}

.chart-card__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.chart-card__subtitle {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 18px;
}

/* ── Bar chart ── */
.bar-chart-area { display: flex; flex-direction: column; gap: 12px; }

.bar-row { display: flex; flex-direction: column; gap: 6px; }

.bar-row__label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
}

.bar-track {
  height: 10px;
  background: var(--bg);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.6s ease;
}

/* ── Donut legend ── */
.donut-legend { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.825rem;
  color: var(--muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-row__label { flex: 1; }
.legend-row__value { font-weight: 600; color: var(--text); }

/* ── Fixkosten tab ── */
.tab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.tab-title { font-size: 1.4rem; font-weight: 700; color: var(--text); }

/* ── Planer chart card ── */
.planer-chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.planer-chart-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.planer-chart-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.planer-chart-card__subtitle {
  font-size: 0.78rem;
  color: var(--muted);
}

.planer-chart-body {
  display: flex;
  align-items: center;
  gap: 32px;
}

.planer-chart-wrapper { flex-shrink: 0; }

.planer-chart-legend {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

.donut-segment {
  transition: stroke-dasharray 0.45s ease, transform 0.45s ease;
}

.planer-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.planer-legend-label { color: var(--text); font-weight: 500; }
.planer-legend-pct   { color: var(--muted); font-size: 0.8rem; }
.planer-legend-value { font-weight: 700; color: var(--text); }

/* ── Calculation breakdown ── */
.living-calc {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: var(--radius-input);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 0.875rem;
}

.calc-label { color: var(--muted); }
.calc-value { font-weight: 600; color: var(--text); }
.calc-value--red   { color: var(--c-fun); }
.calc-value--green { color: #059669; }

[data-theme="dark"] .calc-value--green { color: #34d399; }

.calc-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.calc-row--result .calc-label {
  font-weight: 700;
  color: var(--text);
}

.planer-pct-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 4px;
  white-space: nowrap;
}

/* (moved into main responsive block below) */

/* ── Planer tab ── */
.planer-category {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px 24px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.planer-category__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.planer-category__title { font-weight: 700; font-size: 0.95rem; color: var(--text); display: flex; align-items: center; gap: 12px; }

.planer-cat-icon {
  font-size: 1.3rem;
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.planer-cat-desc {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
  margin-top: 2px;
}

.planer-category__amounts { text-align: right; }

.planer-category__budget { font-size: 1.1rem; font-weight: 800; color: var(--text); }

.planer-category__available { font-size: 0.8rem; color: var(--muted); }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════════════ */

/* ── Tablet (≤900px) ── */
@media (max-width: 900px) {
  .dashboard-main { padding: 20px 16px 40px; }
  .dash-charts-row { grid-template-columns: 1fr; }
  .planer-chart-body { gap: 20px; }
}

/* ── Mobile (≤600px) ── */
@media (max-width: 600px) {
  /* Nav */
  .top-nav { padding: 10px 14px; gap: 8px; }
  .nav-tabs { padding: 0 2px; gap: 2px; }
  .nav-tab  { padding: 7px 10px; font-size: 0.72rem; }

  /* Dashboard layout */
  .dashboard-main { padding: 16px 14px 40px; }
  .dash-welcome   { font-size: 1.3rem; }

  /* Cards — reduce padding on small screens */
  .metric-card, .allocation-card, .chart-card, .planer-chart-card, .planer-category { padding: 16px; }

  /* Metrics: 2 cols kept but compact */
  .metrics-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
  .metric-icon  { width: 38px; height: 38px; font-size: 1.1rem; margin-bottom: 8px; }
  .metric-value { font-size: 1.2rem; }

  /* Allocation amounts stack */
  .allocation-amounts { flex-direction: column; gap: 8px; }

  /* Planer chart: stack SVG above legend */
  .planer-chart-body   { flex-direction: column; align-items: center; gap: 16px; }

  /* Planer category header: stack title + amounts */
  .planer-category__header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .planer-category__amounts { text-align: left; }

  /* Budget rows: keep on one line but tighten */
  .budget-row { padding: 10px 12px; gap: 8px; }
  .budget-eur { min-width: 60px; font-size: 0.8rem; }
  .pct-btn    { width: 36px; height: 36px; border-radius: 10px; }
  .pct-value  { width: 28px; font-size: 0.85rem; }
  /* Touch-friendly icon buttons */
  .icon-btn   { width: 40px; height: 40px; }

  /* Fixkosten stats: 2 across */
  .fc-stat-row  { flex-wrap: wrap; }
  .fc-stat-card { min-width: calc(50% - 6px); }
  .fc-section-header { flex-wrap: wrap; gap: 10px; }

  /* Add item form */
  .add-item-card { flex-direction: column; align-items: stretch; gap: 8px; }
  .item-input--amount { max-width: none; }
  .btn--add { width: 100%; border-radius: var(--radius-pill); height: 46px; }

  /* Onboarding */
  .onboarding-topbar { padding: 0 14px; }
  .logo-text, .logo-subtext { display: none; }
  .step-card         { padding: 18px; }
  .step-nav          { gap: 8px; }
  .btn               { padding: 13px 18px; font-size: 0.875rem; }

  /* Tab title */
  .tab-title { font-size: 1.15rem; }
}

/* ── Small mobile (≤380px) ── */
@media (max-width: 380px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .metric-value { font-size: 1.1rem; }
  .nav-tab { padding: 6px 10px; font-size: 0.73rem; }
  .planer-pct-badge { display: none; }
}

/* ── Very small (≤340px): +/- unter den Label-Text ── */
@media (max-width: 340px) {
  .budget-row { flex-wrap: wrap; }
  .budget-row-info { flex: 1 1 100%; }
  .pct-control { width: 100%; justify-content: center; margin-left: 0; }
}

/* ── Budget Edit Panel ── */
.budget-edit-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  animation: fadeSlideUp 0.25s ease;
}

.budget-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.budget-edit-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

/* ── Income Edit Panel ── */
.income-edit-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  animation: fadeSlideUp 0.25s ease;
}

.income-edit-panel h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}

/* ── Scrollbar styling ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
