/* ==========================================================================
   Kardo Beta 1.0 (Powered by AQ-INVEST) — Production Mobile-First PWA Styles
   ========================================================================== */

:root {
  --bg-outer: #e9eff6;
  --bg-app: #f7f9fc;
  --bg-surface: #ffffff;
  --bg-surface-soft: #f1f5f9;
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --brand-primary: #0f62fe;
  --brand-primary-dark: #0043ce;
  --brand-primary-soft: #edf4ff;
  --brand-emerald: #059669;
  --brand-emerald-soft: #ecfdf5;

  --status-danger: #dc2626;
  --status-danger-soft: #fef2f2;
  --status-warn: #d97706;
  --status-warn-soft: #fffbeb;
  --status-info: #0284c7;
  --status-info-soft: #f0f9ff;
  --status-good: #059669;
  --status-good-soft: #ecfdf5;

  --series-msi: #0f62fe;
  --series-regular: #10b981;
  --series-revolving: #f59e0b;
  --series-interest: #ef4444;
  --series-fees: #8b5cf6;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --shadow-card: 0 2px 10px rgba(15, 23, 42, 0.05);
  --shadow-shell: 0 20px 60px rgba(15, 23, 42, 0.12);
  --shadow-float: 0 12px 32px rgba(15, 23, 42, 0.16);

  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="dark"] {
  --bg-outer: #050911;
  --bg-app: #0b1120;
  --bg-surface: #11192c;
  --bg-surface-soft: #182238;
  --border-subtle: #1f2d47;
  --border-strong: #2d3f61;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --brand-primary: #3b82f6;
  --brand-primary-dark: #2563eb;
  --brand-primary-soft: rgba(59, 130, 246, 0.15);
  --brand-emerald: #10b981;
  --brand-emerald-soft: rgba(16, 185, 129, 0.14);

  --status-danger: #f87171;
  --status-danger-soft: rgba(239, 68, 68, 0.15);
  --status-warn: #fbbf24;
  --status-warn-soft: rgba(245, 158, 11, 0.15);
  --status-info: #38bdf8;
  --status-info-soft: rgba(56, 189, 248, 0.14);
  --status-good: #34d399;
  --status-good-soft: rgba(16, 185, 129, 0.14);

  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.28);
  --shadow-shell: 0 24px 70px rgba(0, 0, 0, 0.55);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: var(--font-sans);
  background: var(--bg-outer);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

.num {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* ==========================================================================
   App Container (Native fullscreen on mobile, Full Web App on Desktop >= 960px)
   ========================================================================== */
.app-outer {
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.app-shell {
  width: 100%;
  max-width: 480px;
  height: min(880px, calc(100dvh - 32px));
  background: var(--bg-app);
  border-radius: 30px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-shell);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.app-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.app-maincol {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.desktop-sidenav {
  display: none;
}

.desktop-only-btn {
  display: none;
}

@media (max-width: 540px) {
  .app-outer {
    padding: 0;
    background: var(--bg-app);
  }
  .app-shell {
    max-width: 100%;
    height: 100dvh;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
}

/* Desktop Web Version (>= 960px) */
@media (min-width: 960px) {
  .app-outer {
    padding: 20px;
  }
  .app-shell {
    max-width: 1180px;
    height: calc(100dvh - 40px);
    min-height: 640px;
    border-radius: 26px;
  }
  .app-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: 100%;
  }
  .desktop-sidenav {
    display: flex;
    flex-direction: column;
    background: #0b192f;
    color: #f8fafc;
    padding: 22px 16px 18px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    overflow-y: auto;
  }
  .sidenav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 6px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .sidenav-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: #fff;
    line-height: 1.1;
  }
  .sidenav-links {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 16px;
  }
  .sidenav-btn {
    border: none;
    background: transparent;
    color: rgba(248, 250, 252, 0.78);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease, color 0.15s ease;
  }
  .sidenav-btn svg {
    width: 19px;
    height: 19px;
    stroke-width: 2;
    flex-shrink: 0;
  }
  .sidenav-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
  }
  .sidenav-btn.active {
    background: var(--brand-primary);
    color: #fff;
    font-weight: 700;
  }
  .sidenav-footer {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
  .mobile-only-icon {
    display: none !important;
  }
  .desktop-only-btn {
    display: inline-flex;
  }
  .bottom-nav {
    display: none;
  }
  .app-header {
    padding: 18px 26px 14px;
    border-bottom: 1px solid var(--border-subtle);
  }
  .app-header-title {
    font-size: 22px;
  }
  .app-content {
    padding: 20px 26px 32px;
  }
  .demo-ribbon, .install-banner {
    margin: 12px 26px 0;
  }
  .desktop-grid-2 {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 20px;
    align-items: start;
  }
  .cc-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 6px;
  }
  .cc-grid .cc-visual {
    margin-bottom: 0;
  }
  .onboarding-wrap {
    max-width: 520px;
    margin: 0 auto;
    justify-content: center;
  }
  .sheet-backdrop {
    align-items: center;
    justify-content: center;
    padding: 24px;
  }
  .sheet-panel {
    max-width: 520px;
    border-radius: 22px;
    box-shadow: var(--shadow-float);
  }
  .sheet-handle {
    display: none;
  }
}

/* App Top Header */
.app-header {
  padding: max(14px, env(safe-area-inset-top)) 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-app);
  flex-shrink: 0;
  gap: 8px;
}

.app-brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.app-brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex-shrink: 0;
}

.app-header-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.app-header-sub {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 600;
}

.powered-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.powered-tag strong {
  color: var(--brand-primary);
}

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

.plan-pill {
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  letter-spacing: 0.03em;
}

.plan-pill.pro { background: linear-gradient(135deg, #0f62fe, #059669); color: #fff; }
.plan-pill.free { background: var(--bg-surface); border-color: var(--border-strong); color: var(--text-secondary); }

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.icon-btn:hover { border-color: var(--brand-primary); color: var(--brand-primary); }

/* Demo Mode Ribbon */
.demo-ribbon {
  margin: 0 16px 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--status-info-soft);
  border: 1px solid rgba(2, 132, 199, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-primary);
}

/* Install Banner */
.install-banner {
  margin: 0 16px 10px;
  padding: 10px 12px;
  border-radius: 13px;
  background: var(--brand-primary-soft);
  border: 1px solid rgba(15, 98, 254, 0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

/* Main Scrollable Area */
.app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 16px calc(92px + env(safe-area-inset-bottom));
  scroll-behavior: smooth;
}

.app-content::-webkit-scrollbar { width: 4px; }
.app-content::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

/* Bottom Navigation */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(74px + env(safe-area-inset-bottom));
  padding: 0 6px calc(8px + env(safe-area-inset-bottom));
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  z-index: 20;
}

.nav-item {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  padding: 6px 2px;
}

.nav-item svg { width: 21px; height: 21px; stroke-width: 2; }
.nav-item.active { color: var(--brand-primary); }

.nav-fab-wrap { display: flex; justify-content: center; align-items: center; }

.nav-fab {
  width: 50px;
  height: 50px;
  border-radius: 17px;
  border: none;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-emerald));
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(15, 98, 254, 0.34);
  transform: translateY(-9px);
  transition: transform 0.15s ease;
}

.nav-fab:hover { transform: translateY(-11px) scale(1.03); }

/* ==========================================================================
   Onboarding View (Guest-First)
   ========================================================================== */
.onboarding-wrap {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px 22px 24px;
  overflow-y: auto;
}

.onboarding-hero {
  text-align: center;
  margin-top: 8px;
}

.onboarding-logo {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  box-shadow: 0 14px 30px rgba(15, 98, 254, 0.24);
  margin-bottom: 14px;
}

.onboarding-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.onboarding-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 12px auto 18px;
  max-width: 340px;
}

.trust-pill-box {
  background: var(--status-good-soft);
  border: 1px solid rgba(5, 150, 105, 0.25);
  border-radius: 14px;
  padding: 11px 13px;
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.45;
  text-align: left;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.country-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.country-card-btn {
  font-family: inherit;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  border-radius: 13px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.country-card-btn.selected {
  border-color: var(--brand-primary);
  background: var(--brand-primary-soft);
}

/* ==========================================================================
   Safe Card Catalog Picker
   ========================================================================== */
.catalog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
  max-height: 196px;
  overflow-y: auto;
  padding: 2px;
}

.catalog-item {
  font-family: inherit;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-surface-soft);
  color: var(--text-primary);
  border-radius: 12px;
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
}

.catalog-item.selected {
  border-color: var(--brand-primary);
  background: var(--brand-primary-soft);
}

.catalog-swatch {
  width: 24px;
  height: 15px;
  border-radius: 4px;
  margin-bottom: 2px;
}

.swatch-ocean { background: linear-gradient(135deg, #0b3b75, #0f62fe); }
.swatch-emerald { background: linear-gradient(135deg, #065f46, #10b981); }
.swatch-slate { background: linear-gradient(135deg, #1e293b, #475569); }
.swatch-indigo { background: linear-gradient(135deg, #312e81, #6366f1); }
.swatch-purple { background: linear-gradient(135deg, #581c87, #9333ea); }
.swatch-crimson { background: linear-gradient(135deg, #7f1d1d, #dc2626); }
.swatch-amber { background: linear-gradient(135deg, #78350f, #d97706); }

/* ==========================================================================
   Core Fintech UI Components
   ========================================================================== */
.hero-card {
  background: linear-gradient(135deg, #0b2545 0%, #0f4c81 55%, #067a5c 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 26px rgba(11, 37, 69, 0.22);
}

.hero-card::after {
  content: '';
  position: absolute;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  top: -65px;
  right: -45px;
  pointer-events: none;
}

.hero-label { font-size: 12px; opacity: 0.85; font-weight: 500; display: flex; align-items: center; justify-content: space-between; }
.hero-amount { font-size: 31px; font-weight: 800; margin: 4px 0 14px; line-height: 1.1; }
.hero-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.16); }
.hero-metric-label { font-size: 11px; opacity: 0.78; }
.hero-metric-val { font-size: 15px; font-weight: 700; margin-top: 2px; }

.section-head { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 10px; }
.section-title { font-size: 14px; font-weight: 800; color: var(--text-primary); }
.section-action { border: none; background: transparent; color: var(--brand-primary); font-family: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }

.card-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-card);
  margin-bottom: 12px;
}

.pro-lock-card {
  background: linear-gradient(135deg, rgba(15, 98, 254, 0.08), rgba(5, 150, 105, 0.1));
  border: 1.5px solid rgba(15, 98, 254, 0.25);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  margin-bottom: 12px;
}

.pro-lock-card h4 { font-size: 15px; font-weight: 800; margin: 6px 0 5px; }
.pro-lock-card p { font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; margin-bottom: 12px; }

.pricing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 14px; }
.pricing-opt {
  border: 2px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
  background: var(--bg-surface-soft);
  position: relative;
  text-align: left;
  font-family: inherit;
  color: var(--text-primary);
}
.pricing-opt.selected { border-color: var(--brand-primary); background: var(--brand-primary-soft); }
.pricing-ribbon {
  position: absolute;
  top: -9px;
  right: 10px;
  background: var(--brand-emerald);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 99px;
  text-transform: uppercase;
}

.alert-card {
  display: flex;
  gap: 11px;
  padding: 13px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  margin-bottom: 10px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
}
.alert-card:hover { border-color: var(--brand-primary); }
.alert-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; font-size: 15px; font-weight: 800; }
.alert-card.sev-high .alert-icon { background: var(--status-danger-soft); color: var(--status-danger); }
.alert-card.sev-medium .alert-icon { background: var(--status-warn-soft); color: var(--status-warn); }
.alert-card.sev-info .alert-icon { background: var(--status-info-soft); color: var(--status-info); }
.alert-card.sev-good .alert-icon { background: var(--status-good-soft); color: var(--status-good); }
.alert-cat { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px; }
.sev-high .alert-cat { color: var(--status-danger); }
.sev-medium .alert-cat { color: var(--status-warn); }
.sev-info .alert-cat { color: var(--status-info); }
.sev-good .alert-cat { color: var(--status-good); }
.alert-title { font-size: 13.5px; font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.alert-body { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: var(--radius-pill); }
.badge-blue { background: var(--brand-primary-soft); color: var(--brand-primary); }
.badge-green { background: var(--status-good-soft); color: var(--status-good); }
.badge-warn { background: var(--status-warn-soft); color: var(--status-warn); }
.badge-danger { background: var(--status-danger-soft); color: var(--status-danger); }
.badge-neutral { background: var(--bg-surface-soft); color: var(--text-secondary); }

.util-bar { width: 100%; height: 7px; background: var(--bg-surface-soft); border-radius: 99px; overflow: hidden; margin: 8px 0 6px; }
.util-fill { height: 100%; border-radius: 99px; transition: width 0.3s ease; }
.util-fill.low { background: var(--brand-emerald); }
.util-fill.mid { background: var(--status-warn); }
.util-fill.high { background: var(--status-danger); }

.cc-visual {
  border-radius: 18px;
  padding: 16px;
  color: #fff;
  margin-bottom: 12px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease;
}
.cc-visual:hover { transform: translateY(-2px); }
.cc-visual.ocean { background: linear-gradient(135deg, #0b3b75, #0f62fe); }
.cc-visual.emerald { background: linear-gradient(135deg, #065f46, #10b981); }
.cc-visual.slate { background: linear-gradient(135deg, #1e293b, #475569); }
.cc-visual.indigo { background: linear-gradient(135deg, #312e81, #6366f1); }
.cc-visual.purple { background: linear-gradient(135deg, #581c87, #9333ea); }
.cc-visual.crimson { background: linear-gradient(135deg, #7f1d1d, #dc2626); }
.cc-visual.amber { background: linear-gradient(135deg, #78350f, #d97706); }

.cc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.cc-bank { font-size: 11.5px; font-weight: 700; opacity: 0.88; text-transform: uppercase; letter-spacing: 0.06em; }
.cc-last4 { font-size: 12px; font-weight: 600; opacity: 0.92; font-variant-numeric: tabular-nums; }
.cc-name { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.cc-balance-row { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 10px; }
.cc-debt { font-size: 22px; font-weight: 800; }
.cc-meta-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.22); font-size: 11px; }
.cc-meta-grid span { display: block; opacity: 0.78; }
.cc-meta-grid strong { font-size: 12.5px; }

.row-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-subtle); }
.row-item:last-child { border-bottom: none; padding-bottom: 0; }
.row-item:first-child { padding-top: 0; }
.row-title { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.row-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.row-right { text-align: right; flex-shrink: 0; }
.row-amount { font-size: 14px; font-weight: 800; }

/* Charts */
.chart-scroll { overflow-x: auto; padding-bottom: 6px; }
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 165px; padding-top: 18px; min-width: 100%; }
.bar-col { flex: 1; min-width: 34px; display: flex; flex-direction: column; align-items: center; cursor: pointer; height: 100%; justify-content: flex-end; }
.bar-val-top { font-size: 9.5px; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; white-space: nowrap; }
.bar-stack { width: 24px; border-radius: 7px 7px 3px 3px; overflow: hidden; display: flex; flex-direction: column-reverse; background: var(--bg-surface-soft); }
.bar-col.selected .bar-stack { box-shadow: 0 0 0 2.5px var(--brand-primary); transform: scaleX(1.08); }
.bar-seg-msi { background: var(--series-msi); }
.bar-seg-regular { background: var(--series-regular); }
.bar-seg-revolving { background: var(--series-revolving); }
.bar-seg-interest { background: var(--series-interest); }
.bar-seg-fees { background: var(--series-fees); }
.bar-label { font-size: 10.5px; font-weight: 600; color: var(--text-muted); margin-top: 6px; }
.bar-col.selected .bar-label { color: var(--brand-primary); font-weight: 800; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-subtle); font-size: 11px; color: var(--text-secondary); }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-swatch { width: 9px; height: 9px; border-radius: 3px; }

/* Strategy */
.strategy-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: var(--bg-surface-soft); padding: 4px; border-radius: 12px; margin-bottom: 12px; }
.strategy-tab { border: none; background: transparent; font-family: inherit; font-size: 11.5px; font-weight: 700; color: var(--text-secondary); padding: 8px 4px; border-radius: 9px; cursor: pointer; }
.strategy-tab.active { background: var(--bg-surface); color: var(--brand-primary); box-shadow: var(--shadow-card); }
.budget-slider { width: 100%; accent-color: var(--brand-primary); margin: 10px 0 4px; cursor: pointer; }
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.kpi-box { background: var(--bg-surface-soft); border-radius: 12px; padding: 11px 12px; }
.kpi-box.highlight { background: var(--brand-emerald-soft); border: 1px solid rgba(5, 150, 105, 0.25); }
.kpi-label { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.kpi-value { font-size: 18px; font-weight: 800; margin-top: 2px; color: var(--text-primary); }
.kpi-box.highlight .kpi-value { color: var(--brand-emerald); }
.comparison-banner { background: var(--status-danger-soft); border: 1px solid rgba(220, 38, 38, 0.2); border-radius: 12px; padding: 11px 12px; font-size: 12px; color: var(--text-primary); line-height: 1.45; margin-bottom: 12px; }

/* Forms & Modals */
.btn { width: 100%; font-family: inherit; font-size: 13.5px; font-weight: 700; padding: 12px 16px; border-radius: 13px; border: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:active { transform: scale(0.99); }
.btn-primary { background: var(--brand-primary); color: #fff; }
.btn-emerald { background: var(--brand-emerald); color: #fff; }
.btn-gradient { background: linear-gradient(135deg, var(--brand-primary), var(--brand-emerald)); color: #fff; }
.btn-soft { background: var(--bg-surface-soft); color: var(--text-primary); border: 1px solid var(--border-subtle); }
.btn-danger-soft { background: var(--status-danger-soft); color: var(--status-danger); }
.btn-sm { width: auto; padding: 6px 11px; font-size: 12px; border-radius: 9px; }

.form-group { margin-bottom: 12px; }
.form-label { display: block; font-size: 12px; font-weight: 700; color: var(--text-secondary); margin-bottom: 5px; }
.form-input, .form-select {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-surface-soft);
  border: 1.5px solid var(--border-subtle);
  border-radius: 11px;
  padding: 10px 12px;
  outline: none;
}
.form-input:focus, .form-select:focus { border-color: var(--brand-primary); background: var(--bg-surface); }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { font-family: inherit; font-size: 12px; font-weight: 700; padding: 7px 11px; border-radius: 10px; border: 1.5px solid var(--border-subtle); background: var(--bg-surface); color: var(--text-secondary); cursor: pointer; }
.chip-btn.active { border-color: var(--brand-primary); background: var(--brand-primary-soft); color: var(--brand-primary); }

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  margin: -4px 0 12px;
  cursor: pointer;
}

.impact-box { border-radius: 13px; padding: 12px; margin: 12px 0; font-size: 12.5px; line-height: 1.45; border: 1px solid var(--border-subtle); }
.impact-box.good { background: var(--status-good-soft); border-color: rgba(5, 150, 105, 0.3); }
.impact-box.medium { background: var(--status-warn-soft); border-color: rgba(217, 119, 6, 0.3); }
.impact-box.high { background: var(--status-danger-soft); border-color: rgba(220, 38, 38, 0.35); }

.sheet-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.55); z-index: 40; display: flex; align-items: flex-end; animation: fadeIn 0.15s ease; }
.sheet-panel { width: 100%; max-height: 92%; background: var(--bg-surface); border-radius: 24px 24px 0 0; padding: 14px 18px calc(24px + env(safe-area-inset-bottom)); overflow-y: auto; animation: slideUp 0.2s ease; }
.sheet-handle { width: 38px; height: 4px; border-radius: 4px; background: var(--border-strong); margin: 0 auto 12px; }
.sheet-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.sheet-title { font-size: 16px; font-weight: 800; }
.icon-close { width: 30px; height: 30px; border-radius: 50%; border: none; background: var(--bg-surface-soft); color: var(--text-secondary); font-size: 16px; cursor: pointer; }

.settings-footer { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border-subtle); text-align: center; font-size: 11.5px; color: var(--text-muted); }
.settings-footer a { color: var(--brand-primary); font-weight: 700; text-decoration: none; }

.empty-state { text-align: center; padding: 34px 18px; background: var(--bg-surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); }
.empty-state h3 { font-size: 16px; margin: 8px 0 6px; }
.empty-state p { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.45; }

.toast {
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  background: #0f172a;
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 600;
  z-index: 60;
  box-shadow: var(--shadow-float);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(28px); opacity: 0.7; } to { transform: translateY(0); opacity: 1; } }

/* ==========================================================================
   Kardo Receipt Scanner, Voice Dictation & Google Drive Backup Styles
   ========================================================================== */
.scan-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 12px;
}

.scan-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 8px;
  border-radius: 12px;
  border: 1.5px dashed var(--brand-primary);
  background: var(--brand-primary-soft);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.scan-btn:hover {
  border-style: solid;
}

.scan-preview {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 13px;
  background: var(--bg-surface-soft);
  border: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}

.scan-thumb {
  width: 52px;
  height: 66px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.drive-card {
  background: var(--brand-primary-soft);
  border: 1px solid rgba(15, 98, 254, 0.24);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
}
