:root {
  --color-bg: #eef1f6;
  --color-surface: #ffffff;
  --color-border: #e5e9f0;
  --color-text: #1f2937;
  --color-text-muted: #6b7280;
  --color-primary: #0d6efd;
  --color-primary-dark: #0b5ed7;
  --color-success: #16a34a;
  --color-success-bg: #e9f9ee;
  --color-warning: #f59e0b;
  --color-warning-bg: #fff4e0;
  --color-danger: #dc2626;
  --color-income: #22c55e;
  --color-outflows: #f59e0b;
  --color-debts: #7c3aed;
  --color-inflows: #0ea5e9;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --sidebar-width: 240px;
  --bottom-nav-height: 64px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar (desktop) ---------- */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  padding: 0 4px;
}
.sidebar-logo img { height: 32px; }

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}
.sidebar-nav li { margin-bottom: 2px; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--color-text-muted);
  font-size: 0.92rem;
  font-weight: 500;
}
.sidebar-nav a:hover { background: var(--color-bg); }
.sidebar-nav a.active {
  background: #e8f1ff;
  color: var(--color-primary);
}
.sidebar-nav .icon { width: 18px; text-align: center; }

.upgrade-banner {
  background: linear-gradient(135deg, #fff7e6, #ffedc7);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.upgrade-banner-text { display: flex; align-items: center; gap: 12px; }
.upgrade-banner-text .crown { font-size: 1.6rem; }
.upgrade-banner-text strong { font-size: 0.95rem; }
.upgrade-banner-text p { margin: 2px 0 0; font-size: 0.8rem; color: var(--color-text-muted); }
.upgrade-banner-btn {
  background: #1f2937;
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 12px;
  color: var(--color-danger);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 8px;
}
.sidebar-logout:hover { background: #fdeeee; }

/* ---------- Main content ---------- */
.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 20px 28px 40px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.topbar h1 { font-size: 1.3rem; margin: 0; }
.topbar-search {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 8px 14px;
  color: var(--color-text-muted);
  gap: 8px;
}
.topbar-search input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 0.9rem;
}
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-bell { position: relative; font-size: 1.2rem; }
.topbar-bell .badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--color-danger);
  color: #fff;
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 999px;
}
.topbar-profile { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; position: relative; cursor: pointer; }
.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #dbeafe;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.topbar-profile-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--color-surface);
  border-radius: 10px;
  box-shadow: var(--shadow);
  min-width: 160px;
  padding: 6px;
  z-index: 60;
}
.topbar-profile-menu.open { display: block; }
.topbar-profile-menu a {
  display: block;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
}
.topbar-profile-menu a:hover { background: var(--color-bg); }
.topbar-profile-menu a#topbar-logout-btn { color: var(--color-danger); }

.banner {
  background: var(--color-success-bg);
  color: var(--color-success);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.banner a { font-weight: 600; text-decoration: underline; }

.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.grid-row {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
}
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.badge-pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.stat-card { display: flex; flex-direction: column; gap: 10px; }
.stat-card-head { display: flex; align-items: center; justify-content: space-between; }
.stat-card-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.92rem; }
.stat-card .stat-label { font-size: 0.78rem; color: var(--color-text-muted); }
.stat-card .stat-value { font-size: 1.1rem; font-weight: 700; }
.stat-card .stat-amount { font-size: 1.3rem; font-weight: 700; }
.stat-card button {
  border: none;
  border-radius: 8px;
  padding: 9px 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}
.stat-card.goals .stat-card-title { color: var(--color-primary); }
.stat-card.goals button { background: var(--color-primary); }
.stat-card.inflows .stat-card-title { color: var(--color-inflows); }
.stat-card.inflows button { background: #d7f0fd; color: var(--color-inflows); }
.stat-card.outflows .stat-card-title { color: var(--color-outflows); }
.stat-card.outflows button { background: #fdecd2; color: var(--color-outflows); }
.stat-card.debts .stat-card-title { color: var(--color-debts); }
.stat-card.debts button { background: #ece2fc; color: var(--color-debts); }

.wallet-tracker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}
.month-nav { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.month-nav button {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: 50%;
  width: 30px;
  height: 30px;
}
.view-report-btn {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
}
.view-report-btn:disabled { color: var(--color-success); border-color: var(--color-success); opacity: 0.7; cursor: default; }

.close-month-form-container { max-height: 50vh; overflow-y: auto; }
.close-month-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.close-month-item label { flex: 1 1 200px; font-size: 0.85rem; }
.close-month-item select {
  flex: 1 1 170px;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 0.82rem;
}

.wallet-summary { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 16px; }
.wallet-summary-item { font-size: 0.85rem; color: var(--color-text-muted); }
.wallet-summary-item strong { display: block; font-size: 1rem; color: var(--color-text); margin-top: 2px; }
.wallet-net-balance { margin-top: 14px; }
.wallet-net-balance .label { font-size: 0.85rem; color: var(--color-text-muted); }
.wallet-net-balance .value { font-size: 1.6rem; font-weight: 700; }

.chart-legend { display: flex; gap: 18px; margin-top: 10px; font-size: 0.8rem; }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.income { background: var(--color-income); }
.dot.outflows { background: var(--color-outflows); }
.dot.debts { background: var(--color-debts); }

.transactions-list { list-style: none; margin: 12px 0 0; padding: 0; }
.transactions-list li {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.88rem;
}
.transactions-list li:last-child { border-bottom: none; }
.transactions-list .txn-meta { color: var(--color-text-muted); font-size: 0.78rem; }
.empty-state { text-align: center; padding: 30px 10px; color: var(--color-text-muted); }
.empty-state .icon { font-size: 1.6rem; margin-bottom: 8px; }

.quick-actions-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px;
  border-radius: var(--radius);
  background: var(--color-bg);
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
}
.quick-action .qa-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.qa-income .qa-icon { background: #dcfce7; color: var(--color-income); }
.qa-expense .qa-icon { background: #fef3c7; color: var(--color-outflows); }
.qa-debt .qa-icon { background: #ede9fe; color: var(--color-debts); }
.qa-goal .qa-icon { background: #dbeafe; color: var(--color-primary); }

.features-strip {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  text-align: center;
}
.features-strip .feature h4 { margin: 8px 0 4px; font-size: 0.85rem; }
.features-strip .feature p { margin: 0; font-size: 0.75rem; color: var(--color-text-muted); }
.features-strip .feature-icon { font-size: 1.4rem; }

/* ---------- Bottom nav (mobile) ---------- */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  z-index: 50;
  align-items: center;
  justify-content: space-around;
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--color-text-muted);
  font-weight: 600;
}
.bottom-nav a.active { color: var(--color-primary); }
.bottom-nav .bn-icon { font-size: 1.35rem; line-height: 1; }
.bottom-nav .bn-label { font-size: 0.65rem; }
.bottom-nav .fab {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-top: -18px;
}

/* ---------- Resource management pages (Goals/Inflows/Outflows/Debts) ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 14px;
}
.back-link:hover { color: var(--color-primary); }

/* ---------- Upgrade / plans ---------- */
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.plan-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 20px;
  position: relative;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.plan-card.recommended { border-color: var(--color-primary); }
.plan-card.current { border-color: var(--color-success); }
.plan-ribbon {
  position: absolute;
  top: -12px;
  left: 20px;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}
.plan-name { font-size: 1.1rem; font-weight: 700; }
.plan-price { font-size: 1.8rem; font-weight: 700; }
.plan-price span { font-size: 0.9rem; font-weight: 500; color: var(--color-text-muted); }
.plan-discount { color: var(--color-success); font-size: 0.82rem; font-weight: 600; }
.plan-card button {
  margin-top: auto;
  padding: 10px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  background: var(--color-primary);
  color: #fff;
}
.plan-card button:disabled { background: var(--color-bg); color: var(--color-text-muted); cursor: default; }
.upgrade-error { background: #fdeeee; color: var(--color-danger); border-radius: 8px; padding: 12px 14px; font-size: 0.85rem; margin-bottom: 16px; display: none; }
.resource-summary {
  display: flex;
  gap: 32px;
  margin-bottom: 20px;
}
.resource-summary-item { font-size: 0.85rem; color: var(--color-text-muted); }
.resource-summary-item strong { display: block; font-size: 1.4rem; color: var(--color-text); margin-top: 2px; }
.resource-form-card { margin-bottom: 20px; }
.resource-form-actions { display: flex; gap: 10px; margin-top: 4px; }
.resource-form-actions button[type="submit"] {
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
}
.resource-form-actions .btn-cancel {
  background: var(--color-bg);
  color: var(--color-text);
  border: none;
  padding: 10px 22px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  display: none;
}
.entry-edit, .entry-delete, .entry-extra {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  padding: 2px 4px;
}
.entry-edit:hover { color: var(--color-primary); }
.entry-delete:hover { color: var(--color-danger); }
.entry-extra:hover { color: var(--color-success); }

.placeholder-page {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 60px 20px;
  text-align: center;
  color: var(--color-text-muted);
}

/* ---------- Login page ---------- */
html.login-page, body.login-page {
  height: 100%;
  overflow: hidden;
  margin: 0;
}
.login-wrap {
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  overflow: hidden;
}
.login-split {
  display: flex;
  width: 100%;
  height: 100%;
  max-width: 1080px;
  background: var(--color-surface);
  overflow: hidden;
}
@media (min-width: 860px) {
  .login-split {
    height: calc(100vh - 80px);
    height: calc(100dvh - 80px);
    max-height: 640px;
    margin: 40px auto;
    border-radius: 20px;
    box-shadow: 0 24px 70px rgba(7,59,76,0.22);
  }
}
.login-form-panel {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px 28px;
  overflow-y: auto;
}
.login-form-inner { width: 100%; max-width: 360px; }
.login-logo { height: 38px; display: block; margin: 0 0 30px; }
.login-form-inner h2 { margin: 0 0 4px; font-size: 1.55rem; }
.login-form-inner p.subtitle { color: var(--color-text-muted); font-size: 0.92rem; margin: 0 0 26px; }

.login-brand-panel {
  position: relative;
  overflow: hidden;
  flex: 1 1 50%;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 48px 44px;
  color: #fff;
  background:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,0.14) 0, transparent 40%),
    radial-gradient(circle at 85% 12%, rgba(34,197,94,0.30) 0, transparent 45%),
    radial-gradient(circle at 80% 88%, rgba(13,110,253,0.35) 0, transparent 50%),
    radial-gradient(circle at 8% 88%, rgba(245,158,11,0.22) 0, transparent 45%),
    linear-gradient(135deg, #073b4c 0%, #0a4d68 40%, #0d6efd 75%, #06a77d 100%);
}
@media (min-width: 860px) {
  .login-brand-panel { display: flex; }
}
.login-brand-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cpath d='M0 110 L22 85 L44 95 L66 55 L88 65 L110 25 L140 38' stroke='white' stroke-width='2' fill='none' opacity='0.55'/%3E%3Ccircle cx='22' cy='85' r='2.5' fill='white'/%3E%3Ccircle cx='66' cy='55' r='2.5' fill='white'/%3E%3Ccircle cx='110' cy='25' r='2.5' fill='white'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 140px 140px;
  opacity: 0.10;
  pointer-events: none;
}
#login-bg-chart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.55;
  pointer-events: none;
}
.login-brand-content { position: relative; z-index: 1; max-width: 360px; }
.login-brand-badge {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 22px;
}
.login-brand-content h1 { font-size: 2.1rem; margin: 0 0 6px; font-weight: 700; }
.login-brand-tagline { font-size: 1rem; opacity: 0.92; margin: 0 0 30px; }
.login-feature-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 15px; }
.login-feature-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 0.92rem; line-height: 1.4; }
.login-feature-icon {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(34,197,94,0.35);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 1px;
}
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 6px; }
.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 0.92rem;
}
.form-group select { width: 100%; padding: 10px 12px; border: 1px solid var(--color-border); border-radius: 8px; font-size: 0.92rem; }
.form-group.checkbox { display: flex; align-items: center; gap: 8px; }
.form-group.checkbox label { margin: 0; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.signup-link { text-align: center; font-size: 0.85rem; color: var(--color-text-muted); margin-top: 16px; }
.login-app-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: #1f2937;
  color: #fff;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(31,41,55,0.25);
}
.login-app-badge:hover { background: #111827; }
.login-app-badge svg { width: 16px; height: 16px; flex: none; }

/* ---------- Onboarding wizard ---------- */
.onboarding-wrap {
  min-height: 100vh;
  background: var(--color-bg);
  padding: 30px 20px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.onboarding-logo { height: 34px; margin-bottom: 22px; }
.onboarding-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 32px;
  width: 100%;
  max-width: 560px;
}

.onboarding-stepper {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  max-width: 560px;
  margin-bottom: 24px;
}
.onboarding-step { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; position: relative; }
.onboarding-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 14px;
  left: 55%;
  width: 90%;
  height: 2px;
  background: var(--color-border);
  z-index: 0;
}
.onboarding-step.done:not(:last-child)::after { background: var(--color-success); }
.onboarding-step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text-muted);
  z-index: 1;
}
.onboarding-step.done .onboarding-step-circle { background: var(--color-success); border-color: var(--color-success); color: #fff; }
.onboarding-step.current .onboarding-step-circle { border-color: var(--color-primary); color: var(--color-primary); }
.onboarding-step-label { font-size: 0.72rem; color: var(--color-text-muted); text-align: center; }
.onboarding-step.current .onboarding-step-label { color: var(--color-primary); font-weight: 600; }
.onboarding-step.done .onboarding-step-label { color: var(--color-success); }

/* Quiz */
.quiz-progress-bar { background: var(--color-bg); height: 8px; border-radius: 4px; overflow: hidden; margin-bottom: 8px; }
.quiz-progress-fill { background: var(--color-primary); height: 100%; transition: width 0.3s ease; }
.quiz-progress-text { font-size: 0.78rem; color: var(--color-text-muted); margin-bottom: 20px; }
.quiz-question { font-size: 1.15rem; font-weight: 700; margin-bottom: 18px; }
.quiz-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border: 2px solid var(--color-border);
  border-radius: 14px;
  margin-bottom: 12px;
  cursor: pointer;
  font-size: 0.98rem;
  line-height: 1.4;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.quiz-option:hover { border-color: var(--color-primary); box-shadow: 0 2px 10px rgba(13,110,253,0.08); }
.quiz-option:active { transform: scale(0.99); }
.quiz-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.quiz-option-radio {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  position: relative;
  transition: border-color 0.15s;
}
.quiz-option-radio::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--color-primary);
  transform: scale(0);
  transition: transform 0.15s;
}
.quiz-option-text { flex: 1; }
.quiz-option.selected {
  background: #e8f1ff;
  border-color: var(--color-primary);
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(13,110,253,0.12);
}
.quiz-option.selected .quiz-option-radio { border-color: var(--color-primary); }
.quiz-option.selected .quiz-option-radio::after { transform: scale(1); }
.quiz-nav { display: flex; justify-content: space-between; margin-top: 22px; }
.quiz-nav button {
  padding: 10px 22px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 0.9rem;
}
.quiz-nav .btn-secondary { background: var(--color-bg); color: var(--color-text); }
.quiz-nav .btn-primary { background: var(--color-primary); color: #fff; }
.quiz-nav button:disabled { opacity: 0.5; cursor: not-allowed; }

.zone-result { text-align: center; }
.zone-badge {
  display: inline-block;
  color: #fff;
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 700;
  margin-bottom: 14px;
}
.zone-description { color: var(--color-text-muted); font-size: 0.9rem; white-space: pre-line; margin-bottom: 22px; text-align: left; }
.zone-result .btn-primary { background: var(--color-primary); color: #fff; }

/* Onboarding entry forms */
.onboarding-entries { list-style: none; margin: 16px 0 0; padding: 0; }
.onboarding-entries li {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--color-bg);
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 0.85rem;
}
.onboarding-entries .entry-meta { color: var(--color-text-muted); font-size: 0.75rem; }
.onboarding-entries .entry-paid { color: var(--color-success); font-size: 0.75rem; font-weight: 600; }
.onboarding-empty { color: var(--color-text-muted); font-size: 0.82rem; text-align: center; padding: 10px 0; }
.onboarding-actions { display: flex; justify-content: space-between; margin-top: 22px; }
.onboarding-actions button {
  padding: 10px 22px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 0.9rem;
  background: var(--color-primary);
  color: #fff;
}
.onboarding-actions .btn-add { background: #1f2937; }
.btn-add { background: #1f2937; }

/* Welcome tooltip modal */
.welcome-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.welcome-modal {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 28px 26px;
  max-width: 380px;
  text-align: center;
}
.welcome-modal .emoji { font-size: 2.2rem; margin-bottom: 10px; }
.welcome-modal h3 { margin: 0 0 8px; }
.welcome-modal p { color: var(--color-text-muted); font-size: 0.88rem; margin: 0 0 20px; }
.welcome-modal button {
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
}

@media (max-width: 600px) {
  .onboarding-card { padding: 22px 18px; }
  .onboarding-step-label { display: none; }
  .form-row { flex-direction: column; gap: 0; }
}
.login-btn {
  width: 100%;
  padding: 11px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 6px;
}
.login-error {
  background: #fdeeee;
  color: var(--color-danger);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.85rem;
  margin-bottom: 14px;
  display: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 16px 16px calc(var(--bottom-nav-height) + 24px); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .quick-actions-grid { grid-template-columns: repeat(4, 1fr); }
  .features-strip { grid-template-columns: repeat(2, 1fr); }
  .bottom-nav { display: flex; }
  .topbar-search { display: none; }
  .topbar-profile-name { display: none; }
}
