:root {
  --bg: #f4f6fb;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --ink: #132035;
  --muted: #5f6f87;
  --line: rgba(19, 32, 53, 0.12);
  --brand: #2d5bff;
  --brand-deep: #1f43be;
  --accent: #0ba57d;
  --soft-shadow: 0 10px 28px rgba(30, 44, 73, 0.1);
  --radius-xl: 18px;
  --radius-lg: 14px;
}

html {
  font-size: 16px;
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(45, 91, 255, 0.14), transparent 38%),
    radial-gradient(circle at bottom right, rgba(11, 165, 125, 0.12), transparent 42%),
    var(--bg);
  font-family: "Manrope", sans-serif;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a {
  color: var(--brand-deep);
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.52rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
}

.brand-logo-img {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-wordmark {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.nav-user-pill {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 70%, transparent);
  color: var(--muted);
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-link {
  color: var(--ink);
  font-weight: 600;
}

.compact-nav-link {
  display: inline-flex;
  align-items: center;
  font-size: 0.98rem;
  padding: 0.34rem 0.5rem !important;
  border-radius: 10px;
}

.nav-quick-add-btn {
  white-space: nowrap;
}

.nav-action-chip {
  min-height: 2.32rem;
  padding: 0.44rem 0.95rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
}

.nav-auth-actions .btn.nav-action-chip {
  padding: 0.44rem 0.95rem;
}

.nav-signout-btn {
  min-width: 6.2rem;
}

.compact-nav-link:hover,
.compact-nav-link:focus {
  background: color-mix(in srgb, var(--brand) 12%, transparent);
}

.nav-dropdown .dropdown-menu {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  box-shadow: var(--soft-shadow);
}

.nav-dropdown .dropdown-item {
  font-size: 0.9rem;
  color: var(--ink);
}

.nav-dropdown .dropdown-item:hover,
.nav-dropdown .dropdown-item:focus {
  background: color-mix(in srgb, var(--brand) 14%, transparent);
}

.nav-link:hover,
.footer-link:hover,
a:hover {
  color: var(--brand);
}

.btn {
  border-radius: 999px;
  font-weight: 600;
  padding: 0.48rem 0.9rem;
  font-size: 0.9rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, #2c7d63 100%);
  border-color: transparent;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--brand) 30%, transparent);
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, var(--brand-deep) 0%, var(--brand) 100%);
}

.btn-outline-dark,
.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-danger {
  border-width: 1px;
}

.form-control,
.form-select {
  border-radius: 11px;
  border-color: var(--line);
  padding: 0.5rem 0.72rem;
  font-size: 0.92rem;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface-strong) 94%, transparent);
}

.form-check-input {
  width: 0.95rem;
  height: 0.95rem;
  margin-top: 0.2rem;
  border-color: var(--line);
}

.form-label {
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus,
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus {
  box-shadow: 0 0 0 0.18rem color-mix(in srgb, var(--brand) 35%, transparent);
  border-color: color-mix(in srgb, var(--brand) 55%, transparent);
}

.card,
.alert,
.empty-state,
.hero-card,
.summary-card,
.account-card {
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--soft-shadow);
  border: 1px solid var(--line);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent);
}

.site-main-container {
  padding-top: 1.35rem;
}

.hero-section {
  padding-top: 2rem;
}

.hero-title {
  font-size: clamp(2.15rem, 5.6vw, 3.65rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
}

.hero-copy {
  max-width: 44rem;
  font-size: 0.98rem;
  color: var(--muted);
}

.hero-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.stat-panel {
  padding: 0.9rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-strong) 85%, transparent);
  border: 1px solid var(--line);
}

.stat-value,
.metric-value,
.summary-value {
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.stat-label,
.summary-label,
.feature-row p,
.page-header p,
.text-muted {
  color: var(--muted) !important;
}

.auth-shell {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 13rem);
}

.auth-card {
  width: min(100%, 30rem);
}

.page-header {
  padding-top: 0.55rem;
}

.currency-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-strong) 90%, transparent);
  box-shadow: var(--soft-shadow);
}

.currency-switcher .form-label {
  margin-bottom: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12rem;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.currency-switcher .form-select {
  min-width: 6.4rem;
  width: auto;
  font-weight: 700;
}

.progress-rail {
  height: 14px;
  background: rgba(24, 35, 28, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, #e39c63 100%);
}

.onboarding-card {
  background: linear-gradient(160deg, color-mix(in srgb, var(--surface-strong) 93%, #d8f5eb 7%), var(--surface));
}

.onboarding-checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.onboarding-checklist li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-weight: 600;
}

.onboarding-checklist li i {
  color: color-mix(in srgb, var(--muted) 70%, transparent);
}

.onboarding-checklist li.is-done {
  color: var(--ink);
}

.onboarding-checklist li.is-done i {
  color: var(--accent);
}

.color-chip {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  margin-right: 0.5rem;
  vertical-align: middle;
  border: 1px solid rgba(24, 35, 28, 0.08);
}

.site-footer {
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
}

.table {
  --bs-table-bg: transparent;
}

.table > :not(caption) > * > * {
  padding: 0.72rem 0.85rem;
  color: var(--ink);
}

.chart-wrap {
  position: relative;
  width: 100%;
}

.chart-wrap-trend {
  height: 320px;
}

.chart-wrap-category {
  height: 320px;
}

@media (max-width: 1199.98px) {
  .site-header .navbar {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
  }

  #mainNav {
    margin-top: 0.55rem;
    padding-top: 0.55rem;
    border-top: 1px solid var(--line);
  }

  .site-header .navbar-nav {
    gap: 0.2rem;
  }

  .nav-auth-actions {
    width: 100%;
    align-items: stretch;
  }

  .nav-auth-actions .btn,
  .nav-auth-actions form,
  .nav-auth-actions a {
    width: 100%;
  }

  .nav-auth-actions form .btn {
    width: 100%;
  }

  .nav-user-pill {
    max-width: none;
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 991.98px) {
  .hero-stat-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: clamp(1.95rem, 10.5vw, 3rem);
  }

  .site-main-container {
    padding-top: 1rem;
  }
}

@media (max-width: 767.98px) {
  .brand-logo-img {
    width: 1.85rem;
    height: 1.85rem;
  }

  .brand-wordmark {
    font-size: 1rem;
  }

  .hero-section {
    padding-top: 2rem;
  }

  .auth-shell {
    min-height: auto;
    padding-top: 2rem;
  }

  .chart-wrap-trend,
  .chart-wrap-category {
    height: 260px;
  }

  .site-main-container {
    padding-top: 0.85rem;
  }

  .page-header {
    padding-top: 0.7rem;
    margin-bottom: 0.9rem !important;
  }

  .currency-switcher {
    width: 100%;
    justify-content: space-between;
  }

  .table > :not(caption) > * > * {
    padding: 0.62rem 0.58rem;
    font-size: 0.88rem;
  }
}