/* ============================================================
   Wealth.Dule — LIGHT theme
   clean + bright + colourful (no flat slabs)
   ============================================================ */

:root {
  --wd-bg:        #f8fafc;
  --wd-bg-2:      #ffffff;
  --wd-bg-3:      #f1f5f9;
  --wd-navy:      #0f172a;
  --wd-navy-2:    #1e293b;

  --wd-emerald:   #059669;
  --wd-emerald-2: #10b981;
  --wd-gold:      #d97706;
  --wd-gold-2:    #f59e0b;
  --wd-red:       #dc2626;
  --wd-red-2:     #ef4444;
  --wd-blue:      #3b82f6;
  --wd-blue-2:    #2563eb;
  --wd-violet:    #8b5cf6;
  --wd-teal:      #14b8a6;

  --wd-text:      #0f172a;
  --wd-text-dim:  #475569;
  --wd-text-mute: #64748b;

  --wd-border:    rgba(15, 23, 42, .08);
  --wd-border-2:  rgba(15, 23, 42, .16);

  --grad-emerald: linear-gradient(135deg, #059669 0%, #10b981 100%);
  --grad-rainbow: linear-gradient(90deg, #059669 0%, #3b82f6 50%, #8b5cf6 100%);
  --grad-hero-num: linear-gradient(135deg, #059669 0%, #2563eb 100%);

  --wd-shadow:       0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --wd-shadow-hover: 0 4px 12px rgba(15, 23, 42, .08), 0 2px 4px rgba(15, 23, 42, .05);
  --wd-shadow-lg:    0 10px 25px -5px rgba(15, 23, 42, .10), 0 8px 10px -6px rgba(15, 23, 42, .04);
}

/* ----- base ----- */
html, body { background: var(--wd-bg); color: var(--wd-text); }
body.app-body,
body.auth-body {
  font-family: "Sarabun", -apple-system, BlinkMacSystemFont, "Inter", system-ui, "Segoe UI", Roboto, sans-serif;
  font-size: 14.5px;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(5, 150, 105, .05), transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 0%, rgba(59, 130, 246, .04), transparent 55%),
    radial-gradient(ellipse 60% 50% at 0% 100%, rgba(139, 92, 246, .04), transparent 55%),
    var(--wd-bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { font-variant-numeric: tabular-nums; }
::selection { background: rgba(16, 185, 129, .22); color: var(--wd-navy); }

/* ----- helpers ----- */
.tabular { font-variant-numeric: tabular-nums; }
.text-emerald   { color: var(--wd-emerald) !important; }
.text-emerald-2 { color: var(--wd-emerald-2) !important; }
.text-gold      { color: var(--wd-gold) !important; }
.text-red       { color: var(--wd-red) !important; }
.text-dim       { color: var(--wd-text-dim) !important; }
.text-mute      { color: var(--wd-text-mute) !important; }

/* ----- glass = WHITE CARD (no blur on light theme) ----- */
.glass {
  background: var(--wd-bg-2);
  border: 1px solid var(--wd-border);
  border-radius: 12px;
  box-shadow: var(--wd-shadow);
  position: relative;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .25s ease, border-color .25s ease;
}
.glass.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: var(--wd-shadow-hover);
  border-color: var(--wd-border-2);
}

/* ----- navbar ----- */
.wd-navbar {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--wd-border);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
  padding: .7rem 1rem;
  position: sticky;
  top: 0;
  z-index: 1030;
}
.wd-navbar .navbar-brand,
.wd-navbar .nav-link { color: var(--wd-navy-2); }
.wd-navbar .navbar-brand:hover,
.wd-navbar .nav-link:hover { color: var(--wd-navy); }
.wd-navbar .navbar-toggler { border-color: var(--wd-border-2); }

.wd-brand {
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: .55rem;
  letter-spacing: -.01em;
}
.wd-brand .ti {
  color: var(--wd-emerald);
  font-size: 1.45rem;
  filter: drop-shadow(0 0 8px rgba(5, 150, 105, .35));
}
.wd-brand .brand-dot { color: var(--wd-emerald); }

.wd-navbar .nav-link {
  border-radius: 8px;
  padding: .35rem .75rem !important;
  transition: background .15s ease, color .15s ease;
}
.wd-navbar .nav-link:hover { background: var(--wd-bg-3); }
.wd-navbar .nav-link.active {
  background: rgba(5, 150, 105, .10);
  color: var(--wd-emerald);
}
.wd-navbar .nav-link .ti { font-size: 1.05rem; vertical-align: -2px; margin-right: .3rem; }

.wd-user-toggle .ti-user-circle { font-size: 1.4rem; vertical-align: -3px; }
.wd-navbar .dropdown-menu {
  background: var(--wd-bg-2);
  border: 1px solid var(--wd-border);
  box-shadow: var(--wd-shadow-lg);
}
.wd-navbar .dropdown-item { color: var(--wd-text); }
.wd-navbar .dropdown-item:hover { background: var(--wd-bg-3); color: var(--wd-navy); }
.wd-navbar .dropdown-item.text-danger { color: var(--wd-red) !important; }
.wd-navbar .dropdown-item.text-danger:hover { background: rgba(220, 38, 38, .08); }
.wd-navbar form { margin: 0; }

/* ----- dashboard ----- */
.wd-dashboard { max-width: 1320px; padding-top: 1.5rem; }

.section-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--wd-navy);
  display: flex;
  align-items: center;
  gap: .4rem;
  letter-spacing: -.01em;
}
.section-title .ti { color: var(--wd-emerald); }

/* ----- alerts (override Bootstrap on light bg) ----- */
.alert {
  background: var(--wd-bg-2);
  border: 1px solid var(--wd-border);
  color: var(--wd-text);
}
.alert-success { border-color: rgba(5, 150, 105, .35);  color: var(--wd-emerald); background: rgba(5, 150, 105, .06); }
.alert-warning { border-color: rgba(217, 119, 6, .35);  color: var(--wd-gold);    background: rgba(217, 119, 6, .06); }
.alert-danger  { border-color: rgba(220, 38, 38, .35);  color: var(--wd-red);     background: rgba(220, 38, 38, .06); }
.alert-info    { border-color: rgba(37, 99, 235, .35);  color: var(--wd-blue-2);  background: rgba(37, 99, 235, .06); }

/* ============================================================
   Auth layout (sign-in, PIN)
   ============================================================ */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  box-sizing: border-box;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--wd-bg-2);
  border: 1px solid var(--wd-border);
  border-radius: 18px;
  padding: 40px 32px 32px;
  box-shadow: var(--wd-shadow-lg);
  position: relative;
  overflow: hidden;
}
/* gradient top accent bar */
.auth-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--grad-rainbow);
}

.auth-brand { text-align: center; margin-bottom: 28px; }
.auth-brand .ti {
  font-size: 2.4rem;
  color: var(--wd-emerald);
  background: linear-gradient(135deg, rgba(5, 150, 105, .12), rgba(20, 184, 166, .08));
  width: 68px;
  height: 68px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  border: 1px solid rgba(5, 150, 105, .25);
  box-shadow: 0 4px 12px rgba(5, 150, 105, .15);
}
.auth-brand h1 {
  font-size: 1.65rem;
  font-weight: 700;
  margin: 0;
  color: var(--wd-navy);
  letter-spacing: -.02em;
}
.auth-brand .brand-dot { color: var(--wd-emerald); }
.auth-brand .tagline {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--wd-text-mute);
  letter-spacing: .08em;
  font-style: italic;
  text-transform: uppercase;
}

.auth-form .form-label { color: var(--wd-text-dim); }
.auth-form .input-group-text {
  background: var(--wd-bg-3);
  border-color: var(--wd-border);
  color: var(--wd-text-mute);
}
.auth-form .form-control {
  background: var(--wd-bg-2);
  border-color: var(--wd-border);
  color: var(--wd-text);
  padding: .6rem .8rem;
}
.auth-form .form-control:focus {
  background: var(--wd-bg-2);
  border-color: var(--wd-emerald);
  color: var(--wd-text);
  box-shadow: 0 0 0 .2rem rgba(5, 150, 105, .18);
}
.auth-form .form-control::placeholder { color: var(--wd-text-mute); opacity: .55; }

.auth-submit {
  background: var(--grad-emerald);
  border: 0;
  padding: .7rem;
  font-weight: 600;
  letter-spacing: .03em;
  border-radius: 10px;
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(5, 150, 105, .55);
  transition: transform .12s ease, box-shadow .25s ease;
}
.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -6px rgba(5, 150, 105, .65);
  color: #fff;
}
.auth-submit:active { transform: translateY(0); }

.auth-footer {
  margin-top: 22px;
  color: var(--wd-text-mute);
  font-size: 12px;
  letter-spacing: .04em;
}

a, a:hover { color: var(--wd-emerald); }

/* PIN */
.pin-icon-circle {
  width: 70px; height: 70px;
  background: linear-gradient(135deg, rgba(5, 150, 105, .14), rgba(20, 184, 166, .08));
  color: var(--wd-emerald);
  border: 1px solid rgba(5, 150, 105, .28);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 2.0rem;
  box-shadow: 0 4px 14px rgba(5, 150, 105, .15);
}
.pin-form .pin-input {
  letter-spacing: .85rem;
  font-size: 1.7rem;
  text-align: center;
  font-weight: 600;
  padding: .8rem;
  background: var(--wd-bg-2);
  border-color: var(--wd-border);
  color: var(--wd-navy);
  border-radius: 10px;
}
.pin-form .pin-input:focus {
  background: var(--wd-bg-2);
  border-color: var(--wd-emerald);
  color: var(--wd-navy);
  box-shadow: 0 0 0 .25rem rgba(5, 150, 105, .18);
}
.pin-locked {
  background: rgba(220, 38, 38, .06);
  border: 1px solid rgba(220, 38, 38, .30);
  color: var(--wd-red);
  padding: 16px;
  border-radius: 10px;
  text-align: center;
}
.pin-locked .ti { font-size: 1.5rem; display: block; margin-bottom: 6px; color: var(--wd-red); }

/* ============================================================
   HERO — white card + rainbow top bar
   ============================================================ */
.wd-hero {
  padding: 28px 32px 30px;
  border-radius: 18px;
  position: relative;
  background: var(--wd-bg-2);
  border: 1px solid var(--wd-border);
  box-shadow: var(--wd-shadow);
  overflow: hidden;
}
.wd-hero::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--grad-rainbow);
}
.wd-hero .hero-glow {
  position: absolute;
  inset: -30% -10% auto auto;
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(5, 150, 105, .07) 0%, transparent 65%);
  pointer-events: none;
  max-width: 100%;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--wd-emerald);
  padding: 4px 10px;
  background: rgba(5, 150, 105, .08);
  border: 1px solid rgba(5, 150, 105, .25);
  border-radius: 999px;
}
.hero-eyebrow .ti { font-size: 14px; }
.hero-date { font-size: 12.5px; color: var(--wd-text-mute); }

.hero-amount {
  font-size: 3.6rem;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -.03em;
  margin: 0;
  background: var(--grad-hero-num);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 768px) { .hero-amount { font-size: 2.5rem; } }

.hero-mom {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: 5px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.hero-mom .ti { font-size: 16px; }
.hero-mom.is-up      { background: rgba(5, 150, 105, .10); color: var(--wd-emerald); border: 1px solid rgba(5, 150, 105, .30); }
.hero-mom.is-down    { background: rgba(220, 38, 38, .08); color: var(--wd-red);     border: 1px solid rgba(220, 38, 38, .28); }
.hero-mom.is-neutral { background: var(--wd-bg-3);          color: var(--wd-text-mute); border: 1px solid var(--wd-border); font-size: 12px; }

.hero-spark { position: relative; }
.hero-spark canvas { max-height: 80px; }

/* donut */
.hero-donut-wrap {
  position: relative;
  max-width: 340px;
  margin: 0 auto;
}
.hero-donut-wrap canvas { max-height: 340px; }
.hero-donut-center {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}
.donut-label {
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--wd-text-mute);
  margin: 0 0 2px;
}
.donut-amount {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--wd-navy);
  margin: 0;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   Legacy bucket cards (referenced by some older partials)
   ============================================================ */
.bucket-card-legacy {
  border-left: 3px solid var(--bucket-color, var(--wd-emerald));
}
.bucket-card-legacy .card-body { padding: 1.1rem 1.25rem; }
.bucket-card-legacy .bucket-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.bucket-card-legacy .bucket-name { font-weight: 600; color: var(--wd-navy); }
.bucket-card-legacy .bucket-key {
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: .06em;
  color: var(--wd-text-mute);
}
.bucket-card-legacy .bucket-amount {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 4px 0 12px;
  color: var(--wd-navy);
  letter-spacing: -.02em;
}
.bucket-card-legacy .progress.bucket-bar {
  height: 6px;
  background: var(--wd-bg-3);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}
.bucket-card-legacy .progress-bar { border-radius: 999px; transition: width .4s ease; }
.bucket-card-legacy .bucket-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

/* detail tables — light + high-contrast */
.wd-detail-table {
  --bs-table-color: var(--wd-text);
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--wd-border);
  color: var(--wd-text);
  margin-bottom: 0;
}
.wd-detail-table tbody td {
  padding: .65rem .35rem;
  vertical-align: middle;
  border-color: var(--wd-border);
  background-color: transparent;
}
.wd-detail-table tbody td:first-child { color: var(--wd-text-mute); }
.wd-detail-table tbody td.text-end,
.wd-detail-table tbody td:last-child {
  color: var(--wd-navy);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.wd-detail-table .table-total td {
  border-top: 2px solid var(--wd-emerald);
  padding-top: .9rem;
  color: var(--wd-emerald);
  font-weight: 700;
  background-color: transparent;
}
.wd-detail-table .table-total td.text-end { color: var(--wd-emerald); font-weight: 700; }

.card-body > h3.h6 {
  color: var(--wd-navy);
  font-weight: 600;
  letter-spacing: -.01em;
}

.card { background: transparent; border: 0; }
.card-header { border-color: var(--wd-border); background: var(--wd-bg-2); }

.badge.bg-secondary {
  background: var(--wd-bg-3) !important;
  color: var(--wd-text-mute) !important;
  font-weight: 500;
  border: 1px solid var(--wd-border);
}

/* ============================================================
   QUICK STATS
   ============================================================ */
.qstat {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  min-height: 88px;
}
.qstat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.45rem;
  flex-shrink: 0;
}
.qstat-body { min-width: 0; }
.qstat-label {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--wd-text-mute);
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qstat-value {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
  color: var(--wd-navy);
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.qstat-sub {
  margin: 1px 0 0;
  font-size: 11.5px;
  color: var(--wd-text-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qstat.tone-emerald .qstat-icon { background: rgba(5, 150, 105, .12);   color: var(--wd-emerald); border: 1px solid rgba(5, 150, 105, .25); }
.qstat.tone-gold    .qstat-icon { background: rgba(217, 119, 6, .12);   color: var(--wd-gold);    border: 1px solid rgba(217, 119, 6, .25); }
.qstat.tone-red     .qstat-icon { background: rgba(220, 38, 38, .10);   color: var(--wd-red);     border: 1px solid rgba(220, 38, 38, .25); }
.qstat.tone-blue    .qstat-icon { background: rgba(59, 130, 246, .12);  color: var(--wd-blue-2);  border: 1px solid rgba(59, 130, 246, .25); }
.qstat.tone-violet  .qstat-icon { background: rgba(139, 92, 246, .12);  color: var(--wd-violet);  border: 1px solid rgba(139, 92, 246, .25); }

.qstat.tone-emerald .qstat-value { color: var(--wd-emerald); }
.qstat.tone-red     .qstat-value { color: var(--wd-red); }
.qstat.tone-gold    .qstat-value { color: var(--wd-gold); }
.qstat.tone-blue    .qstat-value { color: var(--wd-blue-2); }

/* ============================================================
   BUCKET CARDS — premium
   ============================================================ */
.bucket-card {
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  border-left: 3px solid var(--bucket-color, var(--wd-emerald));
}
.bucket-card .bucket-glow {
  position: absolute;
  inset: -30% -30% auto auto;
  width: 180px; height: 180px;
  background: radial-gradient(circle, var(--bucket-color, #10b981) 0%, transparent 70%);
  opacity: .06;
  pointer-events: none;
  max-width: 100%;
}
.bucket-card.hover-lift:hover .bucket-glow { opacity: .12; }

.bucket-card-body {
  padding: 1.1rem 1.2rem 1.15rem;
  position: relative;
  z-index: 1;
}
.bucket-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.bucket-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--bucket-color) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--bucket-color) 28%, transparent);
  color: var(--bucket-color);
  font-size: 1.2rem;
}

.bucket-badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.bucket-badge.tone-emerald { background: rgba(5, 150, 105, .10);  color: var(--wd-emerald); border: 1px solid rgba(5, 150, 105, .25); }
.bucket-badge.tone-gold    { background: rgba(217, 119, 6, .10);  color: var(--wd-gold);    border: 1px solid rgba(217, 119, 6, .25); }
.bucket-badge.tone-red     { background: rgba(220, 38, 38, .08);  color: var(--wd-red);     border: 1px solid rgba(220, 38, 38, .25); }
.bucket-badge.tone-mute    { background: var(--wd-bg-3);          color: var(--wd-text-mute); border: 1px solid var(--wd-border); }

.bucket-card .bucket-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--wd-text-dim);
  margin: 0 0 2px;
  letter-spacing: .02em;
}
.bucket-card .bucket-amount {
  font-size: 1.55rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--wd-navy);
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

.bucket-spark {
  height: 32px;
  margin-bottom: 12px;
}
.bucket-spark canvas { max-height: 32px; max-width: 100%; }

.bucket-card .progress.bucket-bar {
  height: 6px;
  background: var(--wd-bg-3);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}
.bucket-card .bucket-bar-fill {
  border-radius: 999px;
  transition: width .4s ease;
  box-shadow: 0 0 8px color-mix(in srgb, var(--bucket-color) 35%, transparent);
}

.bucket-card .bucket-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.bucket-pct {
  font-size: 14px;
  font-weight: 700;
  color: var(--bucket-color);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   SNAPSHOT FORM
   ============================================================ */
.snap-form-wrap { max-width: 980px; }

.snap-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--wd-emerald);
  padding: 4px 10px;
  background: rgba(5, 150, 105, .08);
  border: 1px solid rgba(5, 150, 105, .25);
  border-radius: 999px;
  margin: 0 0 12px;
}
.snap-eyebrow .ti { font-size: 14px; }

.snap-title {
  font-size: 1.85rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--wd-navy);
  letter-spacing: -.02em;
}
.snap-sub { font-size: 13.5px; color: var(--wd-text-mute); }

.snap-card { border-radius: 12px; height: 100%; }
.snap-card .snap-card-body { padding: 1.1rem 1.25rem 1.25rem; position: relative; z-index: 1; }
.snap-card-title {
  font-size: .98rem;
  font-weight: 600;
  color: var(--wd-navy);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: .45rem;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--wd-border);
}
.snap-card-title .ti {
  color: var(--tone, var(--wd-emerald));
  font-size: 1.2rem;
}

.snap-field { margin-bottom: 14px; }
.snap-field:last-child { margin-bottom: 0; }

.snap-label {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: 12.5px;
  color: var(--wd-text-dim);
  margin: 0 0 6px;
  letter-spacing: .02em;
}
.snap-label .ti { font-size: 14px; color: var(--wd-text-mute); }

.snap-input {
  background: var(--wd-bg-2);
  border: 1px solid var(--wd-border);
  color: var(--wd-navy);
  padding: .58rem .8rem;
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.snap-input::placeholder { color: var(--wd-text-mute); opacity: .55; }
.snap-input:focus {
  background: var(--wd-bg-2);
  border-color: var(--wd-emerald);
  color: var(--wd-navy);
  box-shadow: 0 0 0 .2rem rgba(5, 150, 105, .18);
  outline: 0;
}

.snap-amount-input {
  position: relative;
}
.snap-amount-input .thb-prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--wd-text-mute);
  font-weight: 600;
  pointer-events: none;
  z-index: 1;
}
.snap-amount-input .snap-amount {
  padding-left: 28px;
  font-size: 1.05rem;
  font-weight: 600;
}
.snap-amount-input .snap-amount:focus + .thb-prefix,
.snap-amount-input .snap-amount:focus ~ .thb-prefix { color: var(--wd-emerald); }

.snap-actions {
  display: flex;
  gap: .75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.btn-emerald {
  background: var(--grad-emerald);
  border: 0;
  color: #fff;
  font-weight: 600;
  padding: .65rem 1.5rem;
  border-radius: 10px;
  letter-spacing: .02em;
  box-shadow: 0 6px 16px -6px rgba(5, 150, 105, .55);
  transition: transform .12s ease, box-shadow .25s ease;
}
.btn-emerald:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -6px rgba(5, 150, 105, .65);
}
.btn-emerald:active { transform: translateY(0); }

.btn-ghost {
  background: var(--wd-bg-2);
  border: 1px solid var(--wd-border);
  color: var(--wd-text-dim);
  padding: .65rem 1.25rem;
  border-radius: 10px;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn-ghost:hover {
  background: var(--wd-bg-3);
  color: var(--wd-navy);
  border-color: var(--wd-border-2);
}

/* ============================================================
   BANK ACCOUNTS — index + groups
   ============================================================ */
.bank-page { max-width: 1100px; }
.bank-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}
.bank-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--wd-emerald);
  padding: 4px 10px;
  background: rgba(5, 150, 105, .08);
  border: 1px solid rgba(5, 150, 105, .25);
  border-radius: 999px;
  margin: 0 0 12px;
}
.bank-title {
  font-size: 1.85rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--wd-navy);
  letter-spacing: -.02em;
}
.bank-sub { font-size: 13.5px; color: var(--wd-text-mute); }

/* bucket-totals strip */
.bucket-totals {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 900px) { .bucket-totals { grid-template-columns: repeat(2, 1fr); } }
.bt-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
}
.bt-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.bt-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--wd-text-mute); margin: 0; }
.bt-value { font-size: 1.15rem; font-weight: 700; color: var(--wd-navy); margin: 2px 0 0; font-variant-numeric: tabular-nums; }
.bt-card.tone-blue    .bt-icon { background: rgba(59, 130, 246, .12); color: var(--wd-blue-2); border: 1px solid rgba(59, 130, 246, .25); }
.bt-card.tone-emerald .bt-icon { background: rgba(5, 150, 105, .12);  color: var(--wd-emerald); border: 1px solid rgba(5, 150, 105, .25); }
.bt-card.tone-gold    .bt-icon { background: rgba(217, 119, 6, .12);  color: var(--wd-gold);    border: 1px solid rgba(217, 119, 6, .25); }
.bt-card.tone-violet  .bt-icon { background: rgba(139, 92, 246, .12); color: var(--wd-violet);  border: 1px solid rgba(139, 92, 246, .25); }
.bt-card.tone-red     .bt-icon { background: rgba(220, 38, 38, .10);  color: var(--wd-red);     border: 1px solid rgba(220, 38, 38, .25); }
.bt-card.tone-red     .bt-value { color: var(--wd-red); }

/* per-bank group cards */
.bank-group {
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  border-left: 3px solid var(--brand, var(--wd-emerald));
}
.bank-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--wd-border);
  background: var(--wd-bg-3);
}
.bank-group-name {
  display: flex;
  align-items: center;
  gap: .55rem;
}
.bank-group-name h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: var(--wd-navy);
  letter-spacing: -.01em;
}
.bank-chip {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand) 14%, transparent);
  color: var(--brand);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.bank-group-total {
  font-size: 13px;
  color: var(--wd-text-mute);
}
.bank-group-total .amount {
  color: var(--wd-navy);
  font-weight: 700;
  margin-left: 8px;
  font-variant-numeric: tabular-nums;
}

.bank-rows { padding: 4px 0; }
.bank-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  text-decoration: none;
  border-bottom: 1px solid var(--wd-border);
  transition: background .12s ease;
  color: inherit;
}
.bank-row:last-child { border-bottom: 0; }
.bank-row:hover { background: var(--wd-bg-3); color: inherit; }
.row-label { margin: 0; font-weight: 600; color: var(--wd-navy); font-size: 14px; }
.row-meta {
  margin: 4px 0 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--wd-text-mute);
  flex-wrap: wrap;
}
.row-num {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: .03em;
  color: var(--wd-text-dim);
}
.row-type { color: var(--wd-text-mute); }
.row-bucket-badge {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}
.row-bucket-badge.tone-blue    { background: rgba(59, 130, 246, .10); color: var(--wd-blue-2); border: 1px solid rgba(59, 130, 246, .25); }
.row-bucket-badge.tone-emerald { background: rgba(5, 150, 105, .10);  color: var(--wd-emerald); border: 1px solid rgba(5, 150, 105, .25); }
.row-bucket-badge.tone-gold    { background: rgba(217, 119, 6, .10);  color: var(--wd-gold);    border: 1px solid rgba(217, 119, 6, .25); }
.row-bucket-badge.tone-violet  { background: rgba(139, 92, 246, .10); color: var(--wd-violet);  border: 1px solid rgba(139, 92, 246, .25); }
.row-bucket-badge.tone-red     { background: rgba(220, 38, 38, .08);  color: var(--wd-red);     border: 1px solid rgba(220, 38, 38, .25); }
.row-bucket-badge.tone-mute    { background: var(--wd-bg-3);          color: var(--wd-text-mute); border: 1px solid var(--wd-border); }

.bank-row-amount {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bank-row-amount .amount {
  font-weight: 700;
  color: var(--wd-navy);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
}

.grand-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  border-radius: 12px;
  margin-top: 16px;
  border-top: 3px solid var(--wd-emerald);
}
.grand-total .amount {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--wd-emerald);
  font-variant-numeric: tabular-nums;
}

/* update_balances form */
.bank-balances-page { max-width: 980px; }
.bbal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--wd-border);
}
.bbal-row:last-child { border-bottom: 0; }
.bbal-row-meta { min-width: 0; flex: 1; }
.bbal-row-input { flex: 0 0 200px; }
@media (max-width: 600px) {
  .bbal-row { flex-direction: column; align-items: stretch; }
  .bbal-row-input { flex: 1; }
}
.snap-card-title .ms-auto { margin-left: auto; }

.sticky-actions {
  position: sticky;
  bottom: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--wd-border);
  border-radius: 12px;
  z-index: 5;
  box-shadow: var(--wd-shadow);
}

.bank-actions { display: flex; gap: .5rem; }

/* ============================================================
   OD section
   ============================================================ */
.od-section { padding-top: 8px; border-top: 1px dashed var(--wd-border); margin-top: 28px; }

.od-stat {
  padding: 14px 18px;
  border-radius: 12px;
}
.od-stat-label {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--wd-text-mute);
  margin: 0 0 4px;
  display: flex; align-items: center; gap: .35rem;
}
.od-stat-label .ti { font-size: 14px; }
.od-stat-value {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 0;
  font-variant-numeric: tabular-nums;
  color: var(--wd-navy);
  letter-spacing: -.02em;
}
.od-stat.tone-blue    { border-left: 3px solid var(--wd-blue); }
.od-stat.tone-blue    .od-stat-value { color: var(--wd-blue-2); }
.od-stat.tone-red     { border-left: 3px solid var(--wd-red); }
.od-stat.tone-red     .od-stat-value { color: var(--wd-red); }
.od-stat.tone-emerald { border-left: 3px solid var(--wd-emerald); }
.od-stat.tone-emerald .od-stat-value { color: var(--wd-emerald); }

.od-row .row-label { color: var(--wd-navy); }
.od-row .text-red { color: var(--wd-red); }
.od-progress {
  height: 4px;
  background: var(--wd-bg-3);
  border-radius: 999px;
  overflow: hidden;
}
.od-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--wd-red) 0%, #f87171 100%);
  border-radius: 999px;
  transition: width .3s ease;
}

.od-form-card { border-left: 3px solid var(--wd-red); }

/* ============================================================
   WEALTH AGENTS
   ============================================================ */
.agents-page { max-width: 1100px; }

.agent-card {
  border-radius: 12px;
  padding: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-left: 3px solid var(--tone-color, var(--wd-emerald));
}
.agent-card.tone-emerald { --tone-color: var(--wd-emerald); }
.agent-card.tone-gold    { --tone-color: var(--wd-gold); }
.agent-card.tone-violet  { --tone-color: var(--wd-violet); }
.agent-card.tone-blue    { --tone-color: var(--wd-blue-2); }
.agent-card.tone-red     { --tone-color: var(--wd-red); }
.agent-card.tone-mute    { --tone-color: var(--wd-text-mute); }

.agent-card-head {
  display: flex;
  gap: 14px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--wd-border);
}
.agent-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--tone-color) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--tone-color) 28%, transparent);
  color: var(--tone-color);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.45rem;
  flex-shrink: 0;
}
.agent-title-block { min-width: 0; flex: 1; }
.agent-key-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.agent-key {
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 11px;
  letter-spacing: .08em;
  background: var(--wd-bg-3);
  color: var(--wd-text-dim);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--wd-border);
}
.agent-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--wd-navy);
}
.agent-meta {
  margin: 6px 0 0;
  font-size: 11.5px;
  color: var(--wd-text-mute);
  display: flex;
  align-items: center;
  gap: .35rem;
}
.agent-meta .ti { font-size: 13px; }

/* status pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid;
}
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 4px currentColor;
}
.status-pill.status-idle    { color: var(--wd-text-mute);   background: var(--wd-bg-3);          border-color: var(--wd-border); }
.status-pill.status-running { color: var(--wd-gold);        background: rgba(217, 119, 6, .10);  border-color: rgba(217, 119, 6, .30); animation: pulse 1.4s ease-in-out infinite; }
.status-pill.status-success { color: var(--wd-emerald);     background: rgba(5, 150, 105, .10);  border-color: rgba(5, 150, 105, .30); }
.status-pill.status-error   { color: var(--wd-red);         background: rgba(220, 38, 38, .08);  border-color: rgba(220, 38, 38, .28); }

@keyframes pulse { 50% { opacity: .55; } }

.agent-card-body {
  padding: 14px 18px;
  flex: 1;
}
.agent-summary {
  font-size: 14px;
  color: var(--wd-navy);
  margin: 0 0 8px;
  font-weight: 500;
}
.agent-alerts {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--wd-text-dim);
}
.agent-alerts li { margin-bottom: 4px; }
.agent-detail {
  margin-top: 8px;
}
.agent-detail summary {
  cursor: pointer;
  font-size: 12.5px;
  color: var(--wd-emerald);
  list-style: none;
}
.agent-detail summary::-webkit-details-marker { display: none; }
.agent-detail summary .ti { transition: transform .2s ease; }
.agent-detail[open] summary .ti { transform: rotate(90deg); }
.agent-detail-body {
  margin: 8px 0 0;
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--wd-text);
  background: var(--wd-bg-3);
  border: 1px solid var(--wd-border);
  border-radius: 8px;
  white-space: pre-wrap;
  font-family: "Sarabun", -apple-system, system-ui, sans-serif;
  max-height: 260px;
  overflow-y: auto;
}

.agent-card-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--wd-border);
  display: flex;
  justify-content: flex-end;
  background: var(--wd-bg-3);
}
.agent-card-foot .btn { margin: 0; }
.btn-sm { padding: .4rem 1rem; font-size: 13px; border-radius: 8px; }
.agent-card-foot form { margin: 0; }

/* ============================================================
   HORIZONTAL-SCROLL GUARDS
   ============================================================ */
html, body { overflow-x: hidden; max-width: 100%; }
body.app-body main { overflow-x: hidden; }

.wd-dashboard,
.wd-dashboard .container-fluid,
.wd-dashboard > .row { max-width: 100%; }

.wd-hero { max-width: 100%; overflow: hidden; }
.wd-hero .hero-glow { max-width: 100%; }

.wd-dashboard canvas,
.wd-dashboard img,
.wd-dashboard svg { max-width: 100%; height: auto; }

.bucket-card canvas { max-width: 100%; }

.wd-detail-table { table-layout: fixed; width: 100%; }
.wd-detail-table td { word-break: break-word; }

/* ============================================================
   Hero — additional bits (Step 1)
   ============================================================ */
.wd-hero { position: relative; }
.wd-hero .hero-cta {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: .5rem 1rem;
  border-radius: 10px;
  font-size: 13px;
  text-decoration: none;
  z-index: 3;
}
@media (max-width: 640px) {
  .wd-hero .hero-cta {
    position: static;
    margin: 0 0 14px;
    width: 100%;
    text-align: center;
    justify-content: center;
    display: inline-flex;
  }
}
.hero-stale-pill {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--wd-gold);
  background: rgba(217, 119, 6, .10);
  border: 1px solid rgba(217, 119, 6, .30);
  border-radius: 999px;
  padding: 3px 10px;
}
.hero-stale-pill .ti { font-size: 13px; }

.hero-updated {
  font-size: 12.5px;
  color: var(--wd-text-mute);
  margin: 0;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.hero-updated .ti { font-size: 14px; color: var(--wd-emerald); }
.hero-updated strong { color: var(--wd-text-dim); font-weight: 600; }

/* ============================================================
   ALLOCATION PLAN
   ============================================================ */
.alloc-total-pill {
  font-size: 12px;
  font-weight: 600;
  color: var(--wd-emerald);
  background: rgba(5, 150, 105, .08);
  border: 1px solid rgba(5, 150, 105, .25);
  border-radius: 999px;
  padding: 4px 12px;
}

.alloc-head {
  display: grid;
  grid-template-columns: 2.5fr .6fr 1fr 1.3fr 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 18px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--wd-text-mute);
  background: var(--wd-bg-3);
  border-bottom: 1px solid var(--wd-border);
}

.alloc-row {
  display: grid;
  grid-template-columns: 2.5fr .6fr 1fr 1.3fr 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--wd-border);
  transition: background .12s ease;
  --alloc-color: var(--wd-emerald);
}
.alloc-row:hover { background: var(--wd-bg-3); }
.alloc-row:last-child { border-bottom: 0; }

.alloc-row.tone-emerald { --alloc-color: var(--wd-emerald); }
.alloc-row.tone-gold    { --alloc-color: var(--wd-gold); }
.alloc-row.tone-violet  { --alloc-color: var(--wd-violet); }
.alloc-row.tone-blue    { --alloc-color: var(--wd-blue-2); }
.alloc-row.tone-red     { --alloc-color: var(--wd-red); }

.alloc-row-total {
  background: rgba(5, 150, 105, .04);
  font-weight: 700;
}
.alloc-row-total .alloc-label { color: var(--wd-emerald); }
.alloc-row-total .alloc-planned { color: var(--wd-emerald); }

.alloc-name {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.alloc-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--alloc-color) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--alloc-color) 28%, transparent);
  color: var(--alloc-color);
}
.alloc-name-block { min-width: 0; flex: 1; }
.alloc-label {
  margin: 0 0 5px;
  font-weight: 600;
  font-size: 14px;
  color: var(--wd-navy);
}
.alloc-bar {
  height: 4px;
  background: var(--wd-bg-3);
  border-radius: 999px;
  overflow: hidden;
}
.alloc-bar .progress-bar {
  border-radius: 999px;
  transition: width .4s ease;
}

.alloc-pct {
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  color: var(--wd-text-dim);
  font-variant-numeric: tabular-nums;
}
.alloc-planned {
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  color: var(--wd-navy);
  font-variant-numeric: tabular-nums;
}
.alloc-actual {
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  color: var(--wd-navy);
  font-variant-numeric: tabular-nums;
}
.alloc-actual.text-red { color: var(--wd-red); }
.alloc-progress-num {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--wd-text-mute);
}

.alloc-status-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
}
.alloc-status-badge.tone-emerald { background: rgba(5, 150, 105, .10); color: var(--wd-emerald); border: 1px solid rgba(5, 150, 105, .25); }
.alloc-status-badge.tone-gold    { background: rgba(217, 119, 6, .10); color: var(--wd-gold);    border: 1px solid rgba(217, 119, 6, .25); }
.alloc-status-badge.tone-red     { background: rgba(220, 38, 38, .08); color: var(--wd-red);     border: 1px solid rgba(220, 38, 38, .25); }
.alloc-status-badge.tone-mute    { background: var(--wd-bg-3);          color: var(--wd-text-mute); border: 1px solid var(--wd-border); }

@media (max-width: 768px) {
  .alloc-head { display: none !important; }
  .alloc-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 14px 16px;
  }
  .alloc-pct, .alloc-planned, .alloc-actual, .alloc-status { text-align: left; }
  .alloc-pct::before     { content: "% : "; color: var(--wd-text-mute); }
  .alloc-planned::before { content: "เป้า: "; color: var(--wd-text-mute); }
  .alloc-actual::before  { content: "ทำได้: "; color: var(--wd-text-mute); }
}

/* ============================================================
   INCOME BREAKDOWN
   ============================================================ */
.income-card {
  padding: 1.2rem 1.3rem;
  border-radius: 12px;
  border-left: 3px solid var(--tone-color, var(--wd-emerald));
}
.income-card.tone-emerald { --tone-color: var(--wd-emerald); }
.income-card.tone-gold    { --tone-color: var(--wd-gold); }
.income-card.tone-violet  { --tone-color: var(--wd-violet); }
.income-card.tone-blue    { --tone-color: var(--wd-blue-2); }

.income-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.income-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: color-mix(in srgb, var(--tone-color) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--tone-color) 28%, transparent);
  color: var(--tone-color);
  flex-shrink: 0;
}
.income-label {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--wd-navy);
}
.income-stability {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--wd-text-mute);
}
.income-stability strong { color: var(--tone-color); font-weight: 600; }
.income-amount {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--wd-navy);
  margin: 0 0 4px;
  font-variant-numeric: tabular-nums;
}
.income-share { margin: 0; }

/* ============================================================
   SNAPSHOT HISTORY
   ============================================================ */
.hist-page { max-width: 1240px; }

.hero-see-all {
  font-size: 12px;
  font-weight: 600;
  color: var(--wd-emerald);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}
.hero-see-all:hover { color: var(--wd-emerald-2); }

.hist-chart-card { padding: 16px 18px 20px; }
.hist-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.hist-chart-body {
  height: 240px;
  position: relative;
}
.hist-chart-body canvas { max-width: 100%; max-height: 240px; }

.hist-table { color: var(--wd-text); margin-bottom: 0; }
.hist-table thead th {
  background: var(--wd-bg-3);
  color: var(--wd-text-mute);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--wd-border);
  padding: 10px 14px;
}
.hist-table tbody td {
  padding: 11px 14px;
  vertical-align: middle;
  border-color: var(--wd-border);
  background-color: transparent;
  font-variant-numeric: tabular-nums;
}
.hist-synthetic-mark {
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--wd-text-mute);
  background: var(--wd-bg-3);
  padding: 1px 7px;
  border-radius: 4px;
  border: 1px solid var(--wd-border);
}

/* ============================================================
   SETTINGS PAGE
   ============================================================ */
.settings-page { max-width: 880px; }

.settings-derived {
  padding: 16px 20px;
}
.derived-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 640px) { .derived-row { grid-template-columns: 1fr; } }
.derived-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--wd-text-mute);
  margin: 0 0 4px;
}
.derived-value {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0 0 4px;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

.settings-field { margin-bottom: 16px; }
.settings-field:last-child { margin-bottom: 0; }
.settings-field code {
  font-size: 11px;
  color: var(--wd-text-mute);
  background: var(--wd-bg-3);
  padding: 1px 6px;
  border-radius: 4px;
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
