﻿/*
 * â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
 * style.css â€” My Money Track global stylesheet
 * â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
 *
 * TABLE OF CONTENTS
 * â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
 *   1.  Variables â€” Dark / Light
 *   2.  Base & Reset
 *   3.  Card
 *   4.  Header
 *   5.  Tab Nav
 *   6.  Trends Range Buttons
 *   7.  Category Dropdown
 *   8.  Selected Category Chips
 *   9.  Info Tooltip
 *  10.  Transaction Type Toggle
 *  11.  Inputs
 *  12.  Buttons
 *  13.  KPI Cards
 *  14.  Table
 *  15.  Modal
 *  16.  Drop Zone
 *  17.  Badges
 *  18.  Colour Utilities
 *  19.  Table Cards (constrained height)
 *  20.  Advisor Tab
 *  21.  Table Sticky Footer
 *  22.  Progress Bar
 *  23.  Keyword Chip
 *  24.  Info Tooltip (detailed popup)
 *  25.  Tab Fade-In
 *  26.  Sortable Table Headers
 *  27.  Scrollbar
 *  28.  Hamburger
 *  29.  App Menu Dropdown
 *  30.  Sidebar Open Button
 *  31.  Sidebar Layout
 *  32.  Sidebar Tips (Slideshow)
 *  33.  Transaction Side Panel
 *  34.  Empty States
 *  35.  Onboarding
 *  36.  Toast Undo Button
 *  37.  Mobile FAB
 *  38.  Mobile Layout (â‰¤767px)
 *  39.  Advisor
 *  40.  Dashboard Visual Enhancements
 *  41.  Rules Stats Row
 *  42.  Import Stepper
 *  43.  Transaction Summary Bar
 *  44.  Budget Header Stats
 *  45.  KPI Sparkline SVG
 *  46.  Header â€” Bell + Avatar
 *  47.  KPI Sparkline Canvas
 *  48.  Budget â€” Extra Stat Blocks + Table Layout
 *  49.  Budget Limits Modal
 *  50.  Advisor â€” Circular Gauge
 *  51.  Import â€” Source Badge
 * â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
 */

/* â”€â”€ Variables â€” Dark (default) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
:root {
  --bg: #07090f;
  --s1: #0c0f1d;
  --s2: #111526;
  --s3: #171c30;
  --border: #1d2440;
  --text: #dde3f0;
  --muted: #667096;
  --accent: #1e6fcc;
  --accent-dim: rgba(30, 111, 204, 0.16);
  --green: #34d399;
  --red: #f87171;
  --amber: #fbbf24;
  --blue: #60a5fa;

  --chart-grid: #1d2440;
  --chart-label: #667096;
  --chart-doughnut: #0c0f1d;

  --mono: "JetBrains Mono", monospace;
}

/* â”€â”€ Variables â€” Light â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
html[data-theme="light"] {
  --bg: #f0f2fa;
  --s1: #ffffff;
  --s2: #f4f6fd;
  --s3: #eaedf8;
  --border: #dde3f4;
  --text: #1a2040;
  --muted: #8491b8;
  --accent: #1557a0;
  --accent-dim: rgba(21, 87, 160, 0.1);
  --green: #059669;
  --red: #dc2626;
  --amber: #b45309;
  --blue: #1d4ed8;

  --chart-grid: #dde3f4;
  --chart-label: #8491b8;
  --chart-doughnut: #ffffff;
}

/* â”€â”€ Base â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: "Outfit", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  background-image:
    radial-gradient(
      ellipse 65% 45% at 12% 100%,
      rgba(30, 111, 204, 0.09) 0%,
      transparent 70%
    ),
    radial-gradient(
      ellipse 45% 35% at 88% 0%,
      rgba(59, 130, 246, 0.06) 0%,
      transparent 65%
    );
  transition:
    background-color 0.25s,
    color 0.25s;
}

html[data-theme="light"] body {
  background-image:
    radial-gradient(
      ellipse 65% 45% at 12% 100%,
      rgba(21, 87, 160, 0.05) 0%,
      transparent 70%
    ),
    radial-gradient(
      ellipse 45% 35% at 88% 0%,
      rgba(29, 78, 216, 0.04) 0%,
      transparent 65%
    );
}

.mono {
  font-family: "JetBrains Mono", monospace;
}
.no-spin::-webkit-inner-spin-button,
.no-spin::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.no-spin {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* â”€â”€ Card â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.card {
  background: linear-gradient(
    145deg,
    rgba(14, 25, 46, 0.94),
    rgba(8, 17, 33, 0.94)
  );
  border: 1px solid #24324a;
  border-radius: 1rem;
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.22),
    0 1px 3px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.022);
  transition:
    background-color 0.25s,
    border-color 0.25s;
}
html[data-theme="light"] .card {
  background: var(--s1);
  border-color: var(--border);
  box-shadow:
    0 2px 10px rgba(26, 32, 64, 0.07),
    0 1px 3px rgba(26, 32, 64, 0.04);
}
.card-hdr {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
}
html[data-theme="light"] .card-hdr {
  background: rgba(0, 0, 0, 0.018);
}

/* â”€â”€ Header â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#app-header {
  background: rgba(4, 10, 23, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  box-shadow:
    0 1px 0 var(--border),
    0 6px 30px rgba(0, 0, 0, 0.3);
  transition:
    background 0.25s,
    border-color 0.25s;
}
html[data-theme="light"] #app-header {
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 1px 0 var(--border);
}
html[data-theme="light"] #app-header .app-wordmark {
  color: var(--text);
}

.app-wordmark {
  color: #fff;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  font-weight: 600;
}
.app-wordmark img {
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
}

.acct-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.35rem;
  font-size: 0.72rem;
  background: rgba(8, 14, 29, 0.75);
  border: 1px solid #2a3652;
  color: var(--text);
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  transition:
    background 0.25s,
    color 0.25s;
}
.acct-badge strong {
  color: #5ab4f5;
  background: var(--accent-dim);
  border-radius: 999px;
  padding: 0.08rem 0.35rem;
}
html[data-theme="light"] .acct-badge {
  background: rgba(21, 87, 160, 0.08);
  border-color: rgba(21, 87, 160, 0.18);
  color: var(--accent);
}
html[data-theme="light"] .acct-badge strong {
  color: #0d2d4a;
  background: rgba(13, 45, 74, 0.08);
}

/* Header custom dropdowns */
.hdr-dd {
  position: relative;
}
.hdr-dd-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-radius: 0.5rem;
  padding: 0.3rem 0.75rem;
  height: 2.35rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  font-family: "Outfit", sans-serif;
  white-space: nowrap;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.hdr-dd-btn--wide {
  min-width: 9rem;
}
.hdr-dd-btn:focus {
  outline: none;
}
.hdr-dd-btn:hover,
.hdr-dd.open .hdr-dd-btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(30, 111, 204, 0.45);
}
.hdr-dd-btn svg {
  transition: transform 0.18s;
  opacity: 0.55;
  flex-shrink: 0;
}
.hdr-dd.open .hdr-dd-btn svg {
  transform: rotate(180deg);
}
.hdr-dd-val {
  flex: 1;
}
.hdr-dd-panel {
  top: calc(100% + 0.3rem);
  left: 0;
  min-width: 100%;
  padding: 0.25rem;
  z-index: 350;
  max-height: 16rem;
  overflow-y: auto;
}
.hdr-dd-item {
  width: 100%;
  padding: 0.42rem 0.7rem;
  border: none;
  background: none;
  color: var(--muted);
  border-radius: 0.38rem;
  text-align: left;
  white-space: nowrap;
}
html[data-theme="light"] .hdr-dd-btn {
  background: var(--s2);
  border-color: var(--border);
}
html[data-theme="light"] .hdr-dd-btn:hover,
html[data-theme="light"] .hdr-dd.open .hdr-dd-btn {
  background: var(--s3);
  border-color: rgba(21, 87, 160, 0.4);
}

/* Theme toggle */
.theme-toggle {
  width: 3.25rem;
  height: 2.35rem;
  border-radius: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
html[data-theme="light"] .theme-toggle {
  border-color: var(--border);
  background: var(--s2);
  color: var(--muted);
}
html[data-theme="light"] .theme-toggle:hover {
  background: var(--s3);
  color: var(--text);
}

/* â”€â”€ Tab nav â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#tab-nav {
  background: var(--s1);
  border-bottom: 1px solid var(--border);
  transition:
    background-color 0.25s,
    border-color 0.25s;
}

/* â”€â”€ Trends range buttons â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.trends-range-btn {
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: 0.45rem;
  border: 1px solid var(--border);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
  font-family: "Outfit", sans-serif;
}
.trends-range-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}
.trends-range-btn.active {
  border-color: rgba(30, 111, 204, 0.45);
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}
html[data-theme="light"] .trends-range-btn.active {
  color: var(--accent);
}

/* â”€â”€ Shared dropdown base â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.hdr-dd-panel,
.cat-dd-panel,
.app-menu {
  position: absolute;
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  overflow-x: hidden;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.32),
    0 2px 8px rgba(0, 0, 0, 0.16);
  animation: ddPanelIn 0.15s ease;
}
html[data-theme="light"] .hdr-dd-panel,
html[data-theme="light"] .cat-dd-panel,
html[data-theme="light"] .app-menu {
  box-shadow:
    0 8px 30px rgba(26, 32, 64, 0.12),
    0 2px 6px rgba(26, 32, 64, 0.07);
}
@keyframes ddPanelIn {
  from {
    opacity: 0;
    transform: translateY(-5px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.hdr-dd-item,
.cat-dd-item,
.menu-item {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: "Outfit", sans-serif;
  transition:
    background 0.1s,
    color 0.1s;
}
.hdr-dd-item:hover,
.cat-dd-item:hover,
.menu-item:hover {
  background: var(--s2);
  color: var(--text);
}
html[data-theme="light"] .hdr-dd-item:hover,
html[data-theme="light"] .cat-dd-item:hover,
html[data-theme="light"] .menu-item:hover {
  background: var(--s3);
}
.hdr-dd-item.active,
.cat-dd-item.selected {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}

/* â”€â”€ Category dropdown â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.cat-dd-wrapper {
  position: relative;
}
.cat-dd-trigger {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.7rem;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  cursor: pointer;
  color: var(--text);
  font-size: 0.8rem;
  font-family: "Outfit", sans-serif;
  white-space: nowrap;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  min-width: 11rem;
}
.cat-dd-trigger:hover {
  border-color: rgba(30, 111, 204, 0.4);
}
.cat-dd-trigger.open {
  border-color: rgba(30, 111, 204, 0.55);
  box-shadow: 0 0 0 3px rgba(30, 111, 204, 0.08);
}
html[data-theme="light"] .cat-dd-trigger.open {
  box-shadow: 0 0 0 3px rgba(21, 87, 160, 0.1);
}
.cat-dd-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--muted);
  transition: background 0.2s;
}
.cat-dd-chevron {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.2s;
}
.cat-dd-trigger.open .cat-dd-chevron {
  transform: rotate(180deg);
}

.cat-dd-panel {
  top: calc(100% + 5px);
  left: 0;
  width: 15rem;
  z-index: 300;
}
.cat-dd-search-wrap {
  padding: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.cat-dd-search {
  width: 100%;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  padding: 0.35rem 0.55rem;
  color: var(--text);
  font-size: 0.78rem;
  font-family: "Outfit", sans-serif;
  outline: none;
  transition: border-color 0.15s;
}
.cat-dd-search:focus {
  border-color: rgba(30, 111, 204, 0.45);
}
.cat-dd-search::placeholder {
  color: var(--muted);
}
.cat-dd-list {
  max-height: 240px;
  overflow-y: auto;
  padding: 0.3rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.cat-dd-item {
  gap: 0.5rem;
  padding: 0.38rem 0.55rem;
  border-radius: 0.4rem;
  color: var(--text);
  user-select: none;
}
.cat-dd-item.selected {
  font-weight: 600;
}
.cat-dd-item-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cat-dd-empty {
  padding: 0.75rem 0.55rem;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  font-family: "Outfit", sans-serif;
}
.cat-dd-group-lbl {
  padding: 0.45rem 0.55rem 0.15rem;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-top: 0.1rem;
  font-family: “Outfit”, sans-serif;
}

/* ── Category Picker (form dropdowns) ────────────────────────────────────── */
.cat-picker {
  position: relative;
}
.cat-picker-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--s2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 0.5rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
  font-family: “Outfit”, sans-serif;
  cursor: pointer;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  text-align: left;
}
.cat-picker-trigger:hover {
  border-color: rgba(30, 111, 204, 0.4);
}
.cat-picker-trigger.open {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.cat-picker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--muted);
}
.cat-picker-lbl {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cat-picker-chevron {
  flex-shrink: 0;
  opacity: 0.5;
  transition: transform 0.2s;
}
.cat-picker-trigger.open .cat-picker-chevron {
  transform: rotate(180deg);
}
.cat-picker-panel {
  position: fixed;
  z-index: 99999;
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}
html[data-theme="”light”"] .cat-picker-panel {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}
.cat-picker-search-wrap {
  padding: 0.45rem;
  border-bottom: 1px solid var(--border);
}
.cat-picker-search {
  width: 100%;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  padding: 0.3rem 0.55rem;
  font-size: 0.78rem;
  color: var(--text);
  font-family: “Outfit”, sans-serif;
  outline: none;
  transition: border-color 0.15s;
}
.cat-picker-search:focus {
  border-color: rgba(30, 111, 204, 0.45);
}
.cat-picker-search::placeholder {
  color: var(--muted);
}
.cat-picker-list {
  max-height: 210px;
  overflow-y: auto;
  padding: 0.2rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.cat-picker-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.38rem 0.6rem;
  font-size: 0.82rem;
  cursor: pointer;
  user-select: none;
}
.cat-picker-item:hover {
  background: var(--s2);
}
html[data-theme="”light”"] .cat-picker-item:hover {
  background: var(--s3);
}
.cat-picker-item.selected {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}
.cat-picker-group-lbl {
  padding: 0.45rem 0.6rem 0.15rem;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-family: “Outfit”, sans-serif;
}
.cat-picker-empty {
  padding: 0.75rem 0.6rem;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  font-family: “Outfit”, sans-serif;
}

/* â”€â”€ Selected category chips â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#cat-chips-row {
  padding-top: 0.1rem;
}
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.42rem 0.2rem 0.38rem;
  border-radius: 2rem;
  font-size: 0.72rem;
  font-family: "Outfit", sans-serif;
  font-weight: 500;
  cursor: default;
  user-select: none;
  border: 1px solid;
  animation: chipPop 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes chipPop {
  from {
    opacity: 0;
    transform: scale(0.65);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.cat-chip-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cat-chip-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  margin-left: 0.08rem;
  cursor: pointer;
  opacity: 0.5;
  font-size: 0.6rem;
  transition:
    opacity 0.1s,
    background 0.1s;
}
.cat-chip-x:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.2);
}
html[data-theme="light"] .cat-chip-x:hover {
  background: rgba(0, 0, 0, 0.12);
}
.cat-chips-clear-btn {
  font-size: 0.71rem;
  font-family: "Outfit", sans-serif;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.1rem 0.25rem;
  border-radius: 0.3rem;
  transition: color 0.15s;
  white-space: nowrap;
}
.cat-chips-clear-btn:hover {
  color: var(--accent);
}

/* â”€â”€ Info tooltip â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.info-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  cursor: default;
  transition: color 0.15s;
  flex-shrink: 0;
}
.info-tip:hover {
  color: var(--accent);
}
.info-tip[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%) translateY(3px);
  background: var(--s2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 400;
  font-family: "Outfit", sans-serif;
  line-height: 1.45;
  padding: 0.4rem 0.65rem;
  border-radius: 0.5rem;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: normal;
  pointer-events: none;
  z-index: 99;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transition:
    opacity 0.14s,
    transform 0.14s;
}
html[data-theme="light"] .info-tip[data-tip]::after {
  box-shadow: 0 4px 14px rgba(26, 32, 64, 0.12);
}
.info-tip[data-tip]::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) translateY(3px);
  border: 5px solid transparent;
  border-top-color: var(--border);
  pointer-events: none;
  z-index: 100;
  opacity: 0;
  transition:
    opacity 0.14s,
    transform 0.14s;
}
.info-tip[data-tip]:hover::after,
.info-tip[data-tip]:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* â”€â”€ Transaction type toggle â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.txn-type-btn {
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 0.45rem;
  border: 1px solid var(--border);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
  font-family: "Outfit", sans-serif;
  flex: 1;
}
.txn-type-btn:hover:not(.active-expense):not(.active-income) {
  border-color: var(--accent);
  color: var(--text);
}
.txn-type-btn.active-expense {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  font-weight: 600;
}
.txn-type-btn.active-income {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.08);
  color: #22c55e;
  font-weight: 600;
}

/* â”€â”€ Inputs â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.inp {
  background: var(--s2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 0.5rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
  font-family: "Outfit", sans-serif;
  width: 100%;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    background-color 0.25s;
}
.inp:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.inp::placeholder {
  color: var(--muted);
}
.inp option {
  background: var(--s2);
  color: var(--text);
}
select.inp {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23aaaaaa' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-color: var(--s2);
  padding-right: 1.8rem;
  cursor: pointer;
}
select.inp:hover {
  border-color: rgba(30, 111, 204, 0.45);
  background-color: var(--s3);
}
html[data-theme="light"] select.inp {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}
html[data-theme="light"] select.inp:hover {
  background-color: var(--s3);
  border-color: rgba(21, 87, 160, 0.4);
}

/* ── Source custom dropdown ──────────────────────────────────────────────── */
.src-select {
  position: relative;
}
.src-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.45rem 0.75rem;
  color: var(--text);
  font-size: 0.8rem;
  font-family: "Outfit", sans-serif;
  cursor: pointer;
  text-align: left;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    background-color 0.25s;
}
.src-select-trigger:hover {
  border-color: rgba(30, 111, 204, 0.45);
  background: var(--s3);
}
.src-select-trigger:focus,
.src-select-trigger.open {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.src-select-placeholder {
  color: var(--muted);
}
.src-select-chevron {
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.2s;
}
.src-select-trigger.open .src-select-chevron {
  transform: rotate(180deg);
}
.src-select-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  z-index: 200;
  overflow: hidden;
}
.src-select-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.75rem;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.8rem;
  font-family: "Outfit", sans-serif;
  color: var(--text);
  transition: background 0.1s;
  text-align: left;
}
.src-select-option:last-child {
  border-bottom: none;
}
.src-select-option:hover {
  background: var(--s3);
}
.src-select-option.selected {
  background: var(--accent-dim);
}
.src-badge {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}
.src-select-option-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.src-select-option-name {
  font-weight: 500;
  line-height: 1.2;
}
.src-select-option-ext {
  font-size: 0.7rem;
  color: var(--muted);
}

/* â”€â”€ Buttons â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.btn-p {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 0.6rem;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    opacity 0.15s,
    box-shadow 0.15s;
  font-family: "Outfit", sans-serif;
}
.btn-p:hover:not(:disabled) {
  opacity: 0.85;
  box-shadow: 0 0 18px var(--accent-dim);
}
.btn-p:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

.btn-g {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition:
    color 0.15s,
    border-color 0.15s,
    background-color 0.15s;
  font-family: "Outfit", sans-serif;
}
.btn-g:hover {
  color: var(--text);
  border-color: var(--muted);
}
.btn-sm {
  padding: 0.22rem 0.6rem;
  font-size: 0.7rem;
  border-radius: 0.4rem;
}

/* Secondary button â€” solid surface, full text colour, visible border */
.btn-secondary {
  background: var(--s3);
  color: var(--text);
  border: 1px solid var(--muted);
  border-radius: 0.5rem;
  padding: 0.35rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  font-family: "Outfit", sans-serif;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    background-color 0.15s;
}
.btn-secondary:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.btn-secondary.btn-sm {
  padding: 0.28rem 0.65rem;
  font-size: 0.72rem;
  border-radius: 0.4rem;
}

/* Nav variant â€” accent-tinted border for directional actions (e.g. â† Voltar) */
.btn-secondary.btn-nav {
  border-color: rgba(30, 111, 204, 0.4);
}
.btn-secondary.btn-nav:hover {
  border-color: var(--accent);
}

/* â”€â”€ KPI cards â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.kpi {
  background: linear-gradient(
    145deg,
    rgba(14, 25, 46, 0.94),
    rgba(8, 17, 33, 0.94)
  );
  border: 1px solid #24324a;
  border-radius: 1rem;
  padding: 1.15rem 1.35rem;
  position: relative;
  min-height: 7rem;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.022);
  transition:
    transform 0.22s cubic-bezier(0.34, 1, 0.64, 1),
    box-shadow 0.22s ease,
    border-color 0.25s,
    background-color 0.25s;
}
html[data-theme="light"] .kpi {
  background: var(--s1);
  border-color: var(--border);
}
.kpi::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 70px;
  height: 70px;
  border-radius: 0 1rem 0 80%;
  pointer-events: none;
}
.kpi.k-income::after {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.2), transparent 72%);
}
.kpi.k-expense::after {
  background: linear-gradient(
    135deg,
    rgba(248, 113, 113, 0.2),
    transparent 72%
  );
}
.kpi.k-savings::after {
  background: linear-gradient(
    135deg,
    rgba(30, 111, 204, 0.26),
    transparent 72%
  );
}
.kpi.k-balance::after {
  background: linear-gradient(135deg, rgba(30, 111, 204, 0.25), transparent);
}

html[data-theme="light"] .kpi.k-income::after {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.14), transparent 72%);
}
html[data-theme="light"] .kpi.k-expense::after {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.12), transparent 72%);
}
html[data-theme="light"] .kpi.k-savings::after {
  background: linear-gradient(135deg, rgba(21, 87, 160, 0.14), transparent 72%);
}
html[data-theme="light"] .kpi.k-balance::after {
  background: linear-gradient(135deg, rgba(21, 87, 160, 0.15), transparent);
}

.kpi-lbl {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.45rem;
}
.kpi-val {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.025em;
  margin-top: 0.35rem;
}
.kpi-sub {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.55rem;
}

/* â”€â”€ Table â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.dtbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.dtbl thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--s2);
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.25s;
}
.dtbl tbody tr {
  border-bottom: 1px solid rgba(29, 36, 64, 0.7);
  transition: background 0.1s;
}
html[data-theme="light"] .dtbl tbody tr {
  border-bottom: 1px solid var(--border);
}
.dtbl tbody tr:hover {
  background: rgba(255, 255, 255, 0.022);
}
html[data-theme="light"] .dtbl tbody tr:hover {
  background: rgba(0, 0, 0, 0.025);
}
.dtbl tbody tr:last-child {
  border-bottom: none;
}
.dtbl thead th {
  text-align: center;
}
.dtbl tbody td {
  padding: 0.65rem 1rem;
  vertical-align: middle;
  text-align: center;
}

/* â”€â”€ Modal â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.mbg {
  background: rgba(3, 5, 12, 0.8);
  backdrop-filter: blur(10px);
}
html[data-theme="light"] .mbg {
  background: rgba(10, 15, 40, 0.5);
}
.mbox {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(30, 111, 204, 0.07);
  transition:
    background-color 0.25s,
    border-color 0.25s;
}
html[data-theme="light"] .mbox {
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(21, 87, 160, 0.06);
}
.mlbl {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 0.32rem;
}

/* â”€â”€ Drop zone â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#drop-zone {
  border: 2px dashed var(--border);
  border-radius: 0.875rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}
#drop-zone:hover,
#drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* â”€â”€ Badges â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.bdg {
  display: inline-flex;
  align-items: center;
  padding: 0.14rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.67rem;
  font-weight: 600;
}
.bdg-new {
  background: rgba(52, 211, 153, 0.1);
  color: var(--green);
  border: 1px solid rgba(52, 211, 153, 0.22);
}
.bdg-dup {
  background: rgba(251, 191, 36, 0.1);
  color: var(--amber);
  border: 1px solid rgba(251, 191, 36, 0.22);
}
.bdg-ok {
  background: rgba(52, 211, 153, 0.08);
  color: var(--green);
  border: 1px solid rgba(52, 211, 153, 0.18);
}
.bdg-err {
  background: rgba(248, 113, 113, 0.08);
  color: var(--red);
  border: 1px solid rgba(248, 113, 113, 0.18);
}

html[data-theme="light"] .bdg-new {
  background: rgba(5, 150, 105, 0.08);
  border-color: rgba(5, 150, 105, 0.2);
}
html[data-theme="light"] .bdg-dup {
  background: rgba(180, 83, 9, 0.08);
  border-color: rgba(180, 83, 9, 0.2);
}
html[data-theme="light"] .bdg-ok {
  background: rgba(5, 150, 105, 0.07);
  border-color: rgba(5, 150, 105, 0.18);
}
html[data-theme="light"] .bdg-err {
  background: rgba(220, 38, 38, 0.07);
  border-color: rgba(220, 38, 38, 0.18);
}

/* â”€â”€ Colour utilities â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.c-green {
  color: var(--green);
}
.c-red {
  color: var(--red);
}
.c-blue {
  color: var(--blue);
}
.c-amber {
  color: var(--amber);
}
.c-accent {
  color: var(--accent);
}
.c-muted {
  color: var(--muted);
}
.c-dim {
  color: #3a4460;
}
html[data-theme="light"] .c-dim {
  color: #b0bbd8;
}

/* â”€â”€ Table cards â€” constrained height so footer sticks â”€â”€â”€ */
/* 8rem â‰ˆ app header (3.5rem) + tab nav (2.625rem) + main padding (1.5rem) + buffer */
#tab-transactions .card,
#tab-rules .card {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 5.5rem);
}
#tab-rules .rules-tbl-card {
  max-width: 56rem;
}

/* â”€â”€ Advisor tab â€” card fills remaining viewport â”€â”€â”€ */
#tab-advisor:not(.hidden) {
  min-height: calc(100vh - 6.5rem);
  display: flex;
  flex-direction: column;
}
#tab-advisor .card {
  flex: 1;
  display: flex;
  flex-direction: column;
}
#tab-advisor #advisor-output {
  flex: 1;
  display: flex;
  flex-direction: column;
}
#tab-advisor #advisor-output .empty-state {
  flex: 1;
}

/* Empty-state fills full table-wrap height */
#tab-transactions #txn-table-wrap.txn-is-empty .dtbl {
  height: 100%;
}
#tab-transactions #txn-table-wrap.txn-is-empty #txn-tbody {
  height: 100%;
}
#tab-transactions #txn-table-wrap.txn-is-empty #txn-tbody > tr {
  height: 100%;
}
#tab-transactions #txn-table-wrap.txn-is-empty #txn-tbody td {
  height: 100%;
  padding: 0;
}
#tab-transactions #txn-table-wrap.txn-is-empty .empty-state {
  height: 100%;
}
/* â”€â”€ Budget tab â€” list scrolls, headers stay fixed â”€â”€â”€ */
#tab-budget .card {
  display: flex;
  flex-direction: column;
}
#budget-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
#tab-transactions .overflow-x-auto,
#tab-rules .overflow-x-auto {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

/* â”€â”€ Table sticky footer â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.tbl-footer {
  flex-shrink: 0;
  background: var(--s1);
  border-top: 1px solid var(--border);
}
.rules-range-mob {
  display: none;
}

/* â”€â”€ Progress â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.pg-track {
  background: var(--s3);
  border-radius: 9999px;
  overflow: hidden;
}
.pg-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.5s ease;
}

/* â”€â”€ Keyword chip â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.kw {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(30, 111, 204, 0.22);
  padding: 0.15rem 0.5rem;
  border-radius: 0.35rem;
  display: inline-block;
}
html[data-theme="light"] .kw {
  border-color: rgba(21, 87, 160, 0.2);
}
td:has(.kw) {
  text-align: left;
}

/* â”€â”€ Rule Tester panel â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.rules-main-layout {
  display: flex;
  gap: 1rem;
}
.tester-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}
.tester-inp {
  resize: none;
  width: 100%;
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  min-height: 4.5rem;
  line-height: 1.5;
}
.tester-result {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.tester-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 2rem 1rem;
  text-align: center;
}
.tester-no-match {
  border-radius: 0.75rem;
  background: rgba(248, 113, 113, 0.06);
  border: 1px solid rgba(248, 113, 113, 0.22);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  color: var(--red);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}
.tester-no-match .tester-sub {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.73rem;
}
.tester-match-card {
  border-radius: 0.75rem;
  background: rgba(30, 111, 204, 0.06);
  border: 1px solid rgba(30, 111, 204, 0.22);
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}
html[data-theme="light"] .tester-match-card {
  background: rgba(21, 87, 160, 0.05);
  border-color: rgba(21, 87, 160, 0.18);
}
.tester-section-label {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.tester-match-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.tester-desc-wrap {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  line-height: 1.65;
  word-break: break-all;
  color: var(--text);
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  padding: 0.5rem 0.65rem;
}
.kw-highlight {
  background: rgba(30, 111, 204, 0.22);
  color: var(--accent);
  border-radius: 0.2rem;
  padding: 0.05rem 0.15rem;
  font-weight: 700;
}
html[data-theme="light"] .kw-highlight {
  background: rgba(21, 87, 160, 0.15);
}
.tester-also {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

/* â”€â”€ Rule row inline edit â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#rules-tbody tr.rule-row {
  cursor: pointer;
}
.rule-inline-edit {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.rule-inline-edit .kw-edit {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  flex: 1 1 8rem;
  min-width: 6rem;
  text-transform: uppercase;
}
.rule-inline-edit .cat-select {
  flex: 0 1 auto;
  min-width: 8rem;
}
.rule-inline-btns {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-shrink: 0;
}
.rule-delete-btn {
  color: var(--red);
  border-color: rgba(248, 113, 113, 0.3);
  margin-left: 0.25rem;
}

/* â”€â”€ Info tooltip â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.info-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: default;
  z-index: 9999;
}
.info-tip-icon {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 1px solid var(--muted);
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
  transition:
    border-color 0.15s,
    color 0.15s;
}
.info-tip:hover .info-tip-icon {
  border-color: var(--accent);
  color: var(--accent);
}
.info-tip-box {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  transform: none;
  width: min(18rem, 90vw);
  height: auto;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 0.65rem 0.8rem;
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 9999;
  pointer-events: none;
}
.info-tip:hover .info-tip-box {
  display: block;
}
.kpi:has(.info-tip:hover) {
  z-index: 10000;
}
.info-tip-box--left {
  left: auto;
  right: 0;
  transform: none;
}

/* â”€â”€ Tab fade-in â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@keyframes tabFadeUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.tab-content:not(.hidden) {
  animation: tabFadeUp 0.18s ease;
}

/* â”€â”€ Sortable table headers â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.th-sort {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.th-sort:hover {
  color: var(--text);
}
.sort-icon {
  display: inline-block;
  margin-left: 0.3em;
  font-size: 0.6rem;
  opacity: 0.35;
  vertical-align: middle;
  transition: opacity 0.15s;
}
.th-sort.sort-active .sort-icon {
  opacity: 1;
  color: var(--accent);
}

/* â”€â”€ Scrollbar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.55) brightness(1.3);
  cursor: pointer;
}
html[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator {
  filter: none;
  opacity: 0.5;
}

/* â”€â”€ Hamburger â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.ham-bar {
  display: block;
  width: 14px;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transition:
    transform 0.22s ease,
    opacity 0.22s ease;
}
#menu-btn.open .ham-bar:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}
#menu-btn.open .ham-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
#menu-btn.open .ham-bar:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

/* â”€â”€ App menu dropdown â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.app-menu {
  top: calc(100% + 8px);
  right: 0;
  width: 210px;
  z-index: 200;
}

.menu-user {
  padding: 0.85rem 1rem 0.7rem;
}
.menu-username {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.menu-user-sub {
  display: block;
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 0.15rem;
}
.menu-divider {
  height: 1px;
  background: var(--border);
}
.menu-item {
  gap: 0.65rem;
  width: 100%;
  padding: 0.6rem 1rem;
  color: var(--muted);
  background: transparent;
  border: none;
  text-align: left;
}
.menu-item-danger:hover {
  background: rgba(248, 113, 113, 0.08);
  color: var(--red);
}
html[data-theme="light"] .menu-item-danger:hover {
  background: rgba(220, 38, 38, 0.07);
}
.menu-item-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.menu-item-label {
  line-height: 1;
}

/* Theme label text swaps with CSS */
html[data-theme="dark"] .menu-theme-light {
  display: none;
}
html[data-theme="light"] .menu-theme-dark {
  display: none;
}

/* Icon visibility (reuse existing sun/moon IDs now inside the menu) */
html[data-theme="dark"] #icon-moon {
  display: none;
}
html[data-theme="dark"] #icon-sun {
  display: block;
}
html[data-theme="light"] #icon-sun {
  display: none;
}
html[data-theme="light"] #icon-moon {
  display: block;
}

/* â”€â”€ Sidebar open button (header) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#sidebar-open-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
#sidebar-open-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
html[data-theme="light"] #sidebar-open-btn {
  border-color: var(--border);
  background: var(--s2);
  color: var(--muted);
}
html[data-theme="light"] #sidebar-open-btn:hover {
  background: var(--s3);
  color: var(--text);
}

/* â”€â”€ Sidebar Layout â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#app-layout {
  display: flex;
}

#sidebar {
  position: fixed;
  top: 3.5rem;
  left: 0;
  bottom: 0;
  width: 216px;
  background: var(--s1);
  border-right: 1px solid var(--border);
  z-index: 40;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  transition:
    width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.25s,
    border-color 0.25s;
  scrollbar-width: none;
}
#sidebar::-webkit-scrollbar {
  display: none;
}
#app-layout.sidebar-collapsed #sidebar {
  width: 0;
  border-right: none;
}

#app-body {
  flex: 1;
  margin-left: 216px;
  min-width: 0;
  transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
#app-layout.sidebar-collapsed #app-body {
  margin-left: 0;
}

.sidebar-nav {
  padding: 0.9rem 0.65rem;
  flex: 1;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.65rem;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: "Outfit", sans-serif;
  transition:
    color 0.15s,
    background 0.15s;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  min-height: 2.85rem;
  margin-bottom: 0.25rem;
}
.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.042);
}
html[data-theme="light"] .sidebar-item:hover {
  background: rgba(0, 0, 0, 0.04);
}
.sidebar-item.active {
  color: var(--text);
  background: var(--accent-dim);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--accent);
}
.sidebar-item-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-item-label {
  transition: opacity 0.18s;
}
#app-layout.sidebar-collapsed .sidebar-item-label {
  opacity: 0;
  pointer-events: none;
}
#app-layout.sidebar-collapsed .sidebar-item {
  justify-content: center;
  padding: 0.625rem;
}

/* Tooltip for collapsed items */
#app-layout.sidebar-collapsed .sidebar-item::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--s2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.3rem 0.65rem;
  border-radius: 0.4rem;
  white-space: nowrap;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 0.15s;
}
#app-layout.sidebar-collapsed .sidebar-item:hover::after {
  opacity: 1;
}

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 0.5rem;
  flex-shrink: 0;
  transition: border-color 0.25s;
}
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: transparent;
  border-radius: 0.5rem;
  font-size: 0.72rem;
  font-family: "Outfit", sans-serif;
  transition:
    color 0.15s,
    background 0.15s;
}
.sidebar-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
html[data-theme="light"] .sidebar-toggle:hover {
  background: rgba(0, 0, 0, 0.04);
}
#sidebar-toggle-label {
  transition: opacity 0.18s;
}
#app-layout.sidebar-collapsed #sidebar-toggle-label {
  opacity: 0;
  pointer-events: none;
  width: 0;
  overflow: hidden;
}
.sidebar-toggle-icon {
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
#app-layout.sidebar-collapsed .sidebar-toggle-icon {
  transform: rotate(180deg);
}

/* â”€â”€ Sidebar Tips â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.sidebar-tips {
  padding: 0.5rem;
  flex-shrink: 0;
  overflow: hidden;
  max-height: 240px;
  transition:
    opacity 0.2s,
    max-height 0.3s,
    padding 0.2s;
}
#app-layout.sidebar-collapsed .sidebar-tips {
  opacity: 0;
  max-height: 0;
  padding: 0;
  pointer-events: none;
}
.sidebar-tip-card {
  background: rgba(30, 111, 204, 0.07);
  border: 1px solid rgba(30, 111, 204, 0.18);
  border-radius: 0.65rem;
  padding: 0.65rem 0.7rem;
  margin-bottom: 0.4rem;
  width: 100%;
  box-sizing: border-box;
  height: 7rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
html[data-theme="light"] .sidebar-tip-card {
  background: rgba(21, 87, 160, 0.05);
  border-color: rgba(21, 87, 160, 0.14);
}
.sidebar-tip-card:last-child {
  margin-bottom: 0;
}
.sidebar-tip-slides {
  position: relative;
  flex: 1;
  overflow: hidden;
}
.sidebar-tip-slide {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.sidebar-tip-slide.active {
  opacity: 1;
  pointer-events: auto;
}
.sidebar-tip-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.4rem;
  flex-shrink: 0;
}
.sidebar-tip-arrow {
  background: none;
  border: none;
  color: rgba(30, 111, 204, 0.45);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  transition: color 0.15s;
}
.sidebar-tip-arrow:hover {
  color: var(--accent);
}
.sidebar-tip-dots {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}
.sidebar-tip-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(30, 111, 204, 0.25);
  transition: background 0.3s;
  cursor: pointer;
}
.sidebar-tip-dot.active {
  background: var(--accent);
}
.sidebar-tip-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
  color: var(--accent);
}
.sidebar-tip-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  font-family: "Outfit", sans-serif;
}
.sidebar-tip-text {
  font-size: 0.69rem;
  line-height: 1.5;
  color: var(--muted);
  font-family: "Outfit", sans-serif;
}

/* â”€â”€ Transaction Side Panel â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#txn-panel-backdrop {
  position: fixed;
  inset: 0;
  top: 3.5rem;
  z-index: 44;
  display: none;
}
#txn-panel-backdrop.open {
  display: block;
}

#txn-panel {
  position: fixed;
  top: 3.5rem;
  right: 0;
  bottom: 0;
  width: 360px;
  background: var(--s1);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition:
    transform 0.26s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.25s,
    border-color 0.25s;
  z-index: 45;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
#txn-panel.open {
  transform: translateX(0);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.22);
}
html[data-theme="light"] #txn-panel.open {
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.09);
}

.panel-hdr {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.012);
  transition: border-color 0.25s;
}
html[data-theme="light"] .panel-hdr {
  background: rgba(0, 0, 0, 0.018);
}

.panel-close {
  width: 1.65rem;
  height: 1.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  transition:
    color 0.15s,
    background 0.15s;
}
.panel-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}
html[data-theme="light"] .panel-close:hover {
  background: rgba(0, 0, 0, 0.06);
}

.panel-body {
  flex: 1;
  padding: 1.1rem;
}

.panel-meta {
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
  margin-bottom: 1.1rem;
  transition:
    background-color 0.25s,
    border-color 0.25s;
}
.panel-amount {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.35rem;
}
.panel-date-desc {
  font-size: 0.76rem;
  color: var(--muted);
}
.panel-merchant {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.18rem;
  opacity: 0.8;
}

.panel-section-title {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin-bottom: 0.75rem;
  margin-top: 0;
}

.panel-actions {
  display: flex;
  gap: 0.55rem;
  padding: 0.9rem 1.1rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.012);
  transition: border-color 0.25s;
}
html[data-theme="light"] .panel-actions {
  background: rgba(0, 0, 0, 0.012);
}

.dtbl tbody tr.panel-row-active {
  background: var(--accent-dim) !important;
}
html[data-theme="light"] .dtbl tbody tr.panel-row-active {
  background: rgba(21, 87, 160, 0.06) !important;
}
.dtbl tbody tr {
  cursor: pointer;
}

/* â”€â”€ Empty States â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 2rem;
  text-align: center;
}
.empty-icon {
  width: 60px;
  height: 60px;
  border-radius: 1rem;
  background: var(--accent-dim);
  border: 1px solid rgba(30, 111, 204, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 1.1rem;
  flex-shrink: 0;
}
html[data-theme="light"] .empty-icon {
  border-color: rgba(21, 87, 160, 0.18);
}
.empty-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
}
.empty-desc {
  font-size: 0.77rem;
  color: var(--muted);
  margin-bottom: 1.35rem;
  line-height: 1.55;
  max-width: 26rem;
}
.empty-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* â”€â”€ Onboarding â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(3, 5, 12, 0.88);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: onbFadeIn 0.3s ease;
}
#onboarding-overlay.hidden {
  display: none;
  animation: none;
}
@keyframes onbFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.onb-card {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  width: 100%;
  max-width: 420px;
  padding: 2rem;
  box-shadow:
    0 40px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(30, 111, 204, 0.12);
  animation: onbSlideUp 0.38s cubic-bezier(0.34, 1.36, 0.64, 1);
}
html[data-theme="light"] .onb-card {
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(21, 87, 160, 0.08);
}
@keyframes onbSlideUp {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.onb-progress {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1.75rem;
}
.onb-dot {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  transition: background 0.35s;
}
.onb-dot.active {
  background: var(--accent);
}

.onb-icon {
  width: 52px;
  height: 52px;
  border-radius: 0.875rem;
  background: var(--accent-dim);
  border: 1px solid rgba(30, 111, 204, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.15rem;
  color: var(--accent);
}
.onb-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.onb-desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 1.65rem;
}
.onb-step {
  display: none;
}
.onb-step.active {
  display: block;
  animation: onbStepIn 0.25s ease;
}
@keyframes onbStepIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.onb-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

/* â”€â”€ Toast undo button â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.toast-undo-btn {
  background: none;
  border: 1px solid rgba(30, 111, 204, 0.38);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 0.35rem;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  font-family: "Outfit", sans-serif;
  flex-shrink: 0;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.toast-undo-btn:hover {
  background: var(--accent-dim);
  border-color: rgba(30, 111, 204, 0.6);
}

/* â”€â”€ Mobile FAB (hidden on desktop) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#mob-txn-fab,
#mob-rule-fab {
  display: none;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Mobile Layout  (â‰¤767px)
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

#mobile-nav {
  display: none;
}

@media (max-width: 767px) {
  /* â”€â”€ Sidebar hidden, body full-width â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
  #sidebar {
    display: none !important;
  }
  #sidebar-open-btn {
    display: none;
  }
  #app-body {
    margin-left: 0 !important;
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  }

  /* â”€â”€ Header: hide account badges to save space â”€â”€â”€â”€â”€ */
  #accountBadges {
    display: none;
  }

  /* â”€â”€ Shared mobile chrome bars (top + bottom) â”€â”€â”€â”€â”€â”€â”€ */
  #app-header,
  #mobile-nav {
    background: var(--s1);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition:
      background 0.25s,
      border-color 0.25s;
  }
  #app-header {
    box-shadow: none;
  }

  /* â”€â”€ Hamburger: pushed to far right of header â”€â”€â”€â”€â”€ */
  #app-header > div > div:last-child {
    flex: 1;
  }
  #menu-anchor {
    margin-left: auto;
  }

  /* â”€â”€ Bottom nav â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
  #mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(58px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border);
    z-index: 200;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .mob-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    border: none;
    background: none;
    color: var(--muted);
    cursor: pointer;
    padding: 0.5rem 0.25rem;
    font-size: 0.68rem;
    font-weight: 500;
    font-family: "Outfit", sans-serif;
    letter-spacing: 0.01em;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
    position: relative;
  }
  .mob-nav-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    border-radius: 0 0 2px 2px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
  }
  .mob-nav-item.active {
    color: var(--accent);
  }
  .mob-nav-item.active::before {
    transform: scaleX(1);
  }
  .mob-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .mob-nav-icon svg {
    transition: transform 0.15s;
  }
  .mob-nav-item.active .mob-nav-icon svg {
    transform: scale(1.12);
  }

  /* â”€â”€ More sheet backdrop â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
  #mob-more-backdrop {
    position: fixed;
    inset: 0;
    bottom: calc(58px + env(safe-area-inset-bottom, 0px));
    z-index: 199;
    background: rgba(0, 0, 0, 0.35);
  }
  #mob-more-backdrop.hidden {
    display: none;
  }

  /* â”€â”€ More sheet â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
  #mob-more-sheet {
    position: fixed;
    bottom: calc(58px + env(safe-area-inset-bottom, 0px));
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--s1);
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    padding: 0.75rem;
    gap: 0.5rem;
  }
  #mob-more-sheet:not(.hidden) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    animation: mob-sheet-up 0.22s cubic-bezier(0.34, 1.3, 0.64, 1);
  }
  @keyframes mob-sheet-up {
    from {
      transform: translateY(100%);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
  .mob-more-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.9rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--s2);
    color: var(--muted);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 500;
    font-family: "Outfit", sans-serif;
    letter-spacing: 0.01em;
    transition:
      color 0.15s,
      background 0.15s,
      border-color 0.15s;
    -webkit-tap-highlight-color: transparent;
  }
  .mob-more-item.active {
    color: var(--accent);
    background: var(--accent-dim);
    border-color: var(--accent);
  }
  .mob-more-icon {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* â”€â”€ Larger touch targets â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
  .btn-p,
  .btn-g,
  .btn-secondary {
    min-height: 44px;
  }
  .inp {
    min-height: 44px;
  }

  /* â”€â”€ Toast above mobile nav â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
  #toast {
    bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px)) !important;
    right: 0.75rem !important;
    left: 0.75rem !important;
    max-width: none !important;
  }

  /* â”€â”€ Transaction panel full-width â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
  #txn-panel {
    width: 100% !important;
    border-left: none !important;
  }

  /* â”€â”€ Tap-to-expand row â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
  .txn-expand-row > td {
    padding: 0 !important;
  }
  .txn-expand-inner {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--s2);
    border-top: 1px solid var(--border);
  }
  .txn-expand-inner.open {
    max-height: 400px;
  }
  .txn-expand-content {
    padding: 0.75rem 1rem 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
  }
  .txn-expand-meta {
    display: flex;
    flex-direction: column;
    gap: 0.32rem;
  }
  .txn-expand-field {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    font-size: 0.78rem;
  }
  .txn-expand-label {
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
    white-space: nowrap;
    min-width: 5.2rem;
    flex-shrink: 0;
  }
  .txn-expand-actions {
    display: flex;
    gap: 0.5rem;
  }
  .txn-expand-actions button {
    flex: 1;
  }

  /* â”€â”€ Row tap highlight â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
  .dtbl tbody tr {
    -webkit-tap-highlight-color: transparent;
  }

  /* â”€â”€ Hide Category + Actions cols so Amount is visible */
  #tab-transactions .dtbl th:nth-child(5),
  #tab-transactions .dtbl td:nth-child(5),
  #tab-transactions .dtbl th:nth-child(8),
  #tab-transactions .dtbl td:nth-child(8) {
    display: none;
  }

  /* â”€â”€ Tighter table cell padding â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
  .dtbl thead th,
  .dtbl tbody td {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  /* â”€â”€ Table card height: 1rem gap top and bottom, JS sets --mob-header-h â”€â”€ */
  #tab-transactions .card {
    height: calc(
      100dvh - var(--mob-header-h, 5rem) - 2rem - 58px -
        env(safe-area-inset-bottom, 0px)
    );
    overflow: hidden;
  }
  #tab-rules .page-header {
    display: none;
  }
  .rules-page-size-ctrl {
    display: none !important;
  }
  .rules-range-mob {
    display: inline;
  }
  #tab-rules .card {
    height: calc(
      100dvh - var(--mob-header-h, 5rem) - 2rem - 58px -
        env(safe-area-inset-bottom, 0px)
    );
    overflow: hidden;
  }

  /* â”€â”€ Txn panel stops above bottom nav â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
  #txn-panel {
    bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  }

  /* â”€â”€ Budget tab mobile â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
  #tab-budget .page-header {
    display: none;
  }
  #tab-budget:not(.hidden) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  #tab-budget .card {
    height: calc(
      100dvh - var(--mob-header-h, 5rem) - 2rem - 58px -
        env(safe-area-inset-bottom, 0px)
    );
    overflow: hidden;
    flex: 1 1 auto;
    min-height: 0;
    padding: 1rem;
  }
  #tab-budget .budget-header-row,
  #tab-budget .flex.items-center.justify-between {
    flex-shrink: 0;
  }

  /* A: Restructure hero stats â€” stack vertically, remove redundant variaÃ§Ã£o block */
  #tab-budget .budget-header-row {
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
  }
  #budget-block-delta {
    display: none;
  }
  #budget-block-cats {
    border-left: none;
    padding-left: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
  }
  #budget-block-cats .budget-stat-lbl {
    display: none;
  }
  #budget-block-cats .budget-stat-val {
    font-size: 0.8rem;
    font-family: inherit;
    font-weight: 600;
  }
  #budget-block-cats .budget-stat-sub {
    font-size: 0.75rem;
    margin-top: 0;
  }

  /* â”€â”€ Modals: backdrop scrolls so all content is reachable â”€â”€ */
  .mbg {
    align-items: flex-start !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1.5rem 0.75rem;
  }
  #rule-modal,
  #delta-modal,
  #new-txn-modal {
    align-items: center !important;
    padding: 0 1rem;
  }
  .mbox {
    max-height: none;
    margin: 0 auto;
  }

  /* â”€â”€ FAB (transactions + rules tabs) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
  #mob-txn-fab,
  #mob-rule-fab {
    display: none;
    position: fixed;
    right: 1.1rem;
    bottom: calc(58px + env(safe-area-inset-bottom, 0px) + 5rem);
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    color: #fff;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow:
      0 4px 20px rgba(30, 111, 204, 0.42),
      0 2px 8px rgba(0, 0, 0, 0.22);
    transition:
      transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1),
      box-shadow 0.15s;
    z-index: 190;
    -webkit-tap-highlight-color: transparent;
  }
  #mob-txn-fab.fab-visible,
  #mob-rule-fab.fab-visible {
    display: flex;
  }
  #mob-txn-fab:active,
  #mob-rule-fab:active {
    transform: scale(0.91);
    box-shadow: 0 2px 10px rgba(30, 111, 204, 0.28);
  }

  /* Hide "Nova Regra" button on mobile (FAB replaces it) */
  #tab-rules .btn-p[onclick="openRuleModal()"] {
    display: none;
  }

  /* â”€â”€ Hide desktop filter extras â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
  #tab-transactions .card-hdr .btn-p {
    display: none;
  }
  /* â”€â”€ Show cards, hide table â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
  #txn-table-wrap {
    display: none;
  }
  #txn-mobile-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.625rem 0.75rem;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
  }

  /* â”€â”€ Footer inline at bottom of card â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
  #txn-footer {
    flex-shrink: 0;
    position: static;
  }

  /* â”€â”€ Transaction card â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
  .mob-txn-card {
    display: flex;
    align-items: stretch;
    background: var(--s1);
    border: 1px solid var(--border);
    border-radius: 0.875rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition:
      background 0.12s,
      border-color 0.12s,
      transform 0.18s ease,
      opacity 0.18s ease;
    will-change: transform;
  }
  .mob-txn-card:active {
    background: var(--s2);
  }
  .mob-txn-card.mob-txn-card-active {
    background: var(--accent-dim);
    border-color: rgba(30, 111, 204, 0.3);
  }
  html[data-theme="light"] .mob-txn-card.mob-txn-card-active {
    background: rgba(21, 87, 160, 0.06);
    border-color: rgba(21, 87, 160, 0.25);
  }
  .mob-txn-card-accent {
    width: 4px;
    flex-shrink: 0;
  }
  .mob-txn-card-body {
    flex: 1;
    padding: 0.75rem 1rem;
    min-width: 0;
  }
  .mob-txn-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.625rem;
    margin-bottom: 0.4rem;
  }
  .mob-txn-desc {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .mob-txn-amount {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.35;
  }
  .mob-txn-meta {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
    row-gap: 0.25rem;
  }
  .mob-txn-date {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    color: var(--muted);
    white-space: nowrap;
  }
  .mob-txn-cat-chip {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    border: 1px solid;
    white-space: nowrap;
    line-height: 1.4;
  }
  .mob-txn-merchant {
    font-size: 0.72rem;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 8rem;
  }
  .mob-txn-notes {
    margin-top: 0.3rem;
    font-size: 0.72rem;
    color: var(--muted);
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* â”€â”€ Card expand â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
  .mob-txn-expand {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 0.5rem;
  }
  .mob-txn-expand.open {
    max-height: 400px;
  }
  .mob-txn-expand-inner {
    background: var(--s2);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 0.875rem 0.875rem;
    padding: 0.65rem 0.875rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  .mob-txn-expand-meta {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
  }
  .mob-txn-expand-field {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    font-size: 0.75rem;
  }
  .mob-txn-expand-label {
    font-size: 0.58rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
    min-width: 4.5rem;
    flex-shrink: 0;
  }
  .mob-txn-expand-actions {
    display: flex;
    gap: 0.45rem;
  }
  .mob-txn-expand-actions button {
    flex: 1;
  }
}

/* â”€â”€ Advisor â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.advisor-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1rem;
  color: var(--muted);
}
.advisor-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  animation: advisor-spin 0.8s linear infinite;
}
@keyframes advisor-spin {
  to {
    transform: rotate(360deg);
  }
}

.advisor-summary {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1rem 0 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.advisor-score {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  min-width: 3.5rem;
}
.advisor-summary-text {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
  padding-top: 0.2rem;
}
.advisor-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 0.65rem;
}
.advisor-recs-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}
.advisor-recs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.advisor-rec {
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 0.85rem 1rem;
}
.advisor-rec-hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}
.advisor-rec-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}
.advisor-rec-detail {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}
.advisor-footer {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.advisor-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.advisor-stat-card {
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.advisor-stat-label {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 500;
}
.advisor-stat-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  font-family: var(--mono);
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Dashboard Visual Enhancements
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* Richer background mesh */
body {
  background-image:
    radial-gradient(
      ellipse 80% 60% at 7% 108%,
      rgba(30, 111, 204, 0.17) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 58% 48% at 93% -6%,
      rgba(59, 130, 246, 0.11) 0%,
      transparent 63%
    ),
    radial-gradient(
      ellipse 32% 42% at 48% 56%,
      rgba(30, 111, 204, 0.04) 0%,
      transparent 100%
    );
}

html[data-theme="light"] body {
  background-image:
    radial-gradient(
      ellipse 80% 60% at 7% 108%,
      rgba(21, 87, 160, 0.07) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 58% 48% at 93% -6%,
      rgba(29, 78, 216, 0.05) 0%,
      transparent 63%
    );
}

.dash-page-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
}
.dash-page-subtitle {
  font-size: 0.73rem;
  color: var(--muted);
  margin-top: 0.28rem;
  letter-spacing: 0.01em;
}

.kpi:hover {
  transform: translateY(-2px);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
html[data-theme="light"] .kpi:hover {
  box-shadow: 0 6px 20px rgba(26, 32, 64, 0.12);
}

/* Colored top accent border by KPI type */
.kpi.k-income {
  border-top: 2px solid rgba(52, 211, 153, 0.52);
}
.kpi.k-expense {
  border-top: 2px solid rgba(248, 113, 113, 0.5);
}
.kpi.k-savings {
  border-top: 2px solid rgba(30, 111, 204, 0.55);
}
.kpi.k-balance {
  border-top: 2px solid rgba(96, 165, 250, 0.5);
}

html[data-theme="light"] .kpi.k-income {
  border-top-color: rgba(5, 150, 105, 0.52);
}
html[data-theme="light"] .kpi.k-expense {
  border-top-color: rgba(220, 38, 38, 0.48);
}
html[data-theme="light"] .kpi.k-savings {
  border-top-color: rgba(21, 87, 160, 0.52);
}
html[data-theme="light"] .kpi.k-balance {
  border-top-color: rgba(29, 78, 216, 0.48);
}

/* Staggered dashboard entrance â€” disable parent fade, animate children */
#tab-dashboard:not(.hidden) {
  animation: none;
  overflow: hidden;
}

@keyframes kpiIn {
  from {
    opacity: 0;
    transform: translateY(11px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes chartIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#tab-dashboard:not(.hidden) .kpi-grid .kpi:nth-child(1) {
  animation: kpiIn 0.42s cubic-bezier(0.34, 1.12, 0.64, 1) both;
  animation-delay: 0.06s;
}
#tab-dashboard:not(.hidden) .kpi-grid .kpi:nth-child(2) {
  animation: kpiIn 0.42s cubic-bezier(0.34, 1.12, 0.64, 1) both;
  animation-delay: 0.13s;
}
#tab-dashboard:not(.hidden) .kpi-grid .kpi:nth-child(3) {
  animation: kpiIn 0.42s cubic-bezier(0.34, 1.12, 0.64, 1) both;
  animation-delay: 0.2s;
}
#tab-dashboard:not(.hidden) .card:nth-of-type(1) {
  animation: chartIn 0.44s ease both;
  animation-delay: 0.28s;
}
#tab-dashboard:not(.hidden) .card:nth-of-type(2) {
  animation: chartIn 0.44s ease both;
  animation-delay: 0.36s;
}

/* Chart section h3 labels â€” slightly more refined */
#tab-dashboard .card > h3 {
  font-size: 0.76rem;
  letter-spacing: 0.008em;
}

/* â”€â”€ Rules Stats Row â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.rules-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.r-stat-card {
  background: linear-gradient(
    145deg,
    rgba(14, 25, 46, 0.94),
    rgba(8, 17, 33, 0.94)
  );
  border: 1px solid #24324a;
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  position: relative;
  overflow: hidden;
  transition:
    background-color 0.25s,
    border-color 0.25s;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.022);
}
html[data-theme="light"] .r-stat-card {
  background: var(--s1);
  border-color: var(--border);
}
.r-stat-card:nth-child(1) {
  border-top: 2px solid rgba(30, 111, 204, 0.52);
}
.r-stat-card:nth-child(2) {
  border-top: 2px solid rgba(52, 211, 153, 0.52);
}
.r-stat-card:nth-child(3) {
  border-top: 2px solid rgba(251, 191, 36, 0.52);
}
html[data-theme="light"] .r-stat-card:nth-child(1) {
  border-top-color: rgba(21, 87, 160, 0.52);
}
html[data-theme="light"] .r-stat-card:nth-child(2) {
  border-top-color: rgba(5, 150, 105, 0.52);
}
html[data-theme="light"] .r-stat-card:nth-child(3) {
  border-top-color: rgba(180, 83, 9, 0.52);
}

.r-stat-spark {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  opacity: 0.55;
}

@media (max-width: 640px) {
  .rules-stats-row {
    display: none;
  }

  /* KPI cards â†’ compact 3-col grid on mobile */
  .kpi-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.5rem !important;
  }

  .kpi-grid .kpi {
    padding: 0.75rem 0.6rem !important;
    min-height: unset !important;
  }

  .kpi-grid .kpi::after {
    width: 36px !important;
    height: 36px !important;
  }

  .kpi-grid .kpi-val {
    font-size: clamp(0.7rem, 3.6vw, 0.95rem) !important;
    letter-spacing: -0.02em;
    margin-top: 0.2rem;
  }

  .kpi-grid .kpi-lbl {
    font-size: 0.62rem !important;
    margin-bottom: 0.15rem;
    letter-spacing: 0.06em;
  }

  .kpi-grid .kpi-sub {
    font-size: 0.65rem !important;
    margin-top: 0.2rem;
  }
}

/* â”€â”€ Import Stepper â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.import-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
}
.import-step-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.import-step-item:not(.active):not(.done) {
  opacity: 0.38;
}
.import-step-num {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--s2);
  flex-shrink: 0;
  transition: all 0.2s;
}
.import-step-item.active .import-step-num {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 12px rgba(30, 111, 204, 0.38);
}
.import-step-item.done .import-step-num {
  border-color: var(--green);
  background: rgba(52, 211, 153, 0.12);
  color: var(--green);
}
.import-step-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s;
}
.import-step-item.active .import-step-label {
  color: var(--text);
  font-weight: 600;
}
.import-step-item.done .import-step-label {
  color: var(--green);
}
.import-step-connector {
  flex: 1;
  height: 1.5px;
  background: var(--border);
  min-width: 2rem;
  max-width: 5rem;
  margin: 0 0.75rem;
  transition: background 0.2s;
}
.import-step-connector.done {
  background: var(--green);
}

@media (max-width: 540px) {
  .import-step-label {
    display: none;
  }
  .import-step-connector {
    min-width: 1rem;
    margin: 0 0.4rem;
  }
}

/* â”€â”€ Transaction Summary Bar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.txn-summary-bar {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.01);
}
html[data-theme="light"] .txn-summary-bar {
  background: rgba(0, 0, 0, 0.015);
}

.txn-sum-item {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding: 0.3rem 1rem 0.3rem 0;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}
.txn-sum-item:last-child {
  border-right: none;
  padding-right: 0;
}
.txn-sum-lbl {
  font-size: 0.58rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}
.txn-sum-val {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1;
}

@media (max-width: 767px) {
  .txn-summary-bar {
    display: none;
  }
}

/* â”€â”€ Budget Header Stats â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.budget-header-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.budget-total-block {
  flex: 1;
  min-width: 0;
}
.budget-total-lbl {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.budget-total-val {
  font-family: "JetBrains Mono", monospace;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--red);
  letter-spacing: -0.02em;
}
html[data-theme="light"] .budget-total-val {
  color: var(--red);
}
.budget-total-sub {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.35rem;
}
.budget-total-delta {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 0.35rem;
}
.budget-delta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  letter-spacing: 0.01em;
}
.budget-delta-pill.c-red {
  background: rgba(248, 113, 113, 0.12);
  color: var(--red);
}
.budget-delta-pill.c-green {
  background: rgba(52, 211, 153, 0.12);
  color: var(--green);
}
.budget-delta-pill.c-muted {
  background: var(--s3);
  color: var(--muted);
}
.budget-sub-vs {
  font-size: 0.72rem;
  color: var(--muted);
}
/* Mobile category inline bar â€” hidden on desktop, shown when col-dist column hides */
.mob-cat-bar-wrap {
  display: none;
}
@media (max-width: 900px) {
  .mob-cat-bar-wrap {
    display: block;
    height: 3px;
    border-radius: 9999px;
    background: var(--s3);
    overflow: hidden;
    margin-top: 0.35rem;
    margin-left: 1.35rem;
  }
  .mob-cat-bar-fill {
    height: 3px;
    border-radius: 9999px;
    transition: width 0.5s ease;
  }
}

/* â”€â”€ KPI sparkline SVG (inline, used in dashboard KPI cards) â”€â”€ */
.kpi-spark {
  position: absolute;
  bottom: 0.6rem;
  right: 0.6rem;
  opacity: 0.45;
  pointer-events: none;
}

@media (max-width: 767px) {
  #tab-rules .rules-tester {
    display: none !important;
  }
}

/* Reference-driven desktop shell */
@media (min-width: 768px) {
  #app-header > div {
    min-height: 4.75rem;
    padding: 0.9rem 1.35rem;
  }

  #sidebar {
    top: 4.75rem;
    bottom: 0;
    left: 0;
    width: 214px;
    border: none;
    border-right: 1px solid var(--border);
    border-radius: 0;
    background: rgba(8, 14, 29, 0.95);
    box-shadow: none;
    backdrop-filter: blur(14px);
  }

  html[data-theme="light"] #sidebar {
    background: rgba(255, 255, 255, 0.98);
    border-right-color: var(--border);
  }

  #app-body {
    height: calc(100dvh - 4.75rem);
    margin-left: 214px;
    overflow: hidden;
  }
  .app-main {
    width: 100%;
    max-width: 1540px;
    height: 100%;
    padding: 0.75rem 1.25rem 1.25rem;
    overflow: hidden;
  }
  .app-main > .tab-content {
    height: 100%;
    min-height: 0;
    padding: 1rem;
    padding-bottom: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: rgba(5, 10, 23, 0.34);
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
  }
  html[data-theme="light"] .app-main > .tab-content {
    background: rgba(255, 255, 255, 0.32);
  }

  #txn-panel,
  #txn-panel-backdrop {
    top: 4.75rem;
  }

  #tab-transactions:not(.hidden),
  #tab-rules:not(.hidden) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #tab-import:not(.hidden) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #tab-import .page-header,
  #tab-import .import-subnav {
    flex-shrink: 0;
  }

  #import-subtab-wizard:not(.hidden) {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  #import-subtab-wizard .import-stepper {
    flex-shrink: 0;
  }

  #import-step-preview:not(.hidden) {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  #import-step-preview:not(.hidden) .card {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #import-step-preview:not(.hidden) .card .card-hdr {
    flex-shrink: 0;
  }

  #import-step-preview:not(.hidden) .preview-table-scroll {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
  }

  #import-step-preview:not(.hidden) #preview-pagination {
    flex-shrink: 0;
  }

  #tab-transactions .page-header,
  #tab-rules .page-header,
  #tab-rules .rules-stats-row {
    flex-shrink: 0;
  }

  #tab-transactions .card,
  #tab-rules .card {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
    margin-bottom: 0;
  }
  .rules-main-layout {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    align-items: stretch;
  }
  #tab-rules .rules-tbl-card {
    flex: 0 0 auto;
    width: min(56rem, 62%);
  }
  #tab-rules .rules-tester {
    flex: 1 1 0;
    min-width: 14rem;
    max-width: none;
  }
  #tab-transactions.tab-content,
  #tab-rules.tab-content {
    padding-bottom: 0.5rem;
  }

  #tab-dashboard.tab-content,
  #tab-budget.tab-content {
    overflow: hidden;
  }
  #tab-dashboard:not(.hidden),
  #tab-budget:not(.hidden) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  #tab-budget .page-header {
    flex-shrink: 0;
  }
  #tab-budget .card {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
    margin-bottom: 0;
  }

  #txn-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: auto;
    overflow-y: auto;
  }

  #tab-advisor.tab-content {
    overflow: hidden;
  }
  #tab-advisor:not(.hidden) {
    height: 100%;
    min-height: 0;
  }
  #tab-advisor .card {
    min-height: 0;
  }
  #tab-advisor #advisor-output {
    min-height: 0;
  }
}

.page-header,
.dash-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding: 0;
  border: 0;
}
.page-title,
.dash-page-title {
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.035em;
}
.page-subtitle,
.dash-page-subtitle {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.kpi-grid {
  gap: 1rem;
}

#tab-dashboard > .grid .card {
  min-height: 330px;
}
#tab-dashboard > .grid .card:last-child {
  min-height: 330px;
}
#categoryLegend {
  max-height: 160px;
  overflow: auto;
  padding-right: 0.25rem;
}

#tab-transactions .page-header + .card,
#tab-rules .card {
  border-radius: 0.85rem;
}
.txn-summary-bar {
  justify-content: space-around;
  padding: 0.8rem 1rem;
  margin: 0.75rem 0;
  border: 1px solid var(--border);
  border-left: 0;
  border-right: 0;
}
.txn-sum-item {
  flex: 1;
  padding-left: 1rem;
}
.txn-sum-val {
  margin-top: 0.2rem;
  font-size: 1.05rem;
}
.dtbl th {
  height: 2.75rem;
  color: #8290b1;
  letter-spacing: 0.06em;
}
.dtbl td {
  height: 2.65rem;
}
.dtbl tbody tr:hover {
  background: rgba(30, 111, 204, 0.055);
}

#tab-budget .card {
  padding: 1.25rem;
}
#budget-list > div {
  margin: 0 !important;
  padding: 0.9rem 0;
  border-bottom: 1px solid rgba(36, 50, 74, 0.75);
}
#budget-list > div:last-child {
  border-bottom: 0;
}
.budget-total-val {
  font-size: 2.15rem;
}

#tab-import .import-stepper {
  max-width: 1120px;
  margin: 0 auto 1.25rem;
  padding: 0.65rem 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.import-step1-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.25rem;
  max-width: 1120px;
  margin: 0 auto;
  align-items: start;
}
.import-step1-layout.hidden {
  display: none;
}
.preview-table-scroll {
  /* max-height leaves room above (nav+header+stepper+card-hdr ≈ 290px)
     and below (pagination ≈ 50px) the scroll container */
  max-height: calc(100vh - 420px);
}
@media (max-width: 720px) {
  .preview-table-scroll {
    max-height: calc(100svh - 300px);
  }
}
@media (max-width: 720px) {
  .import-step1-layout {
    grid-template-columns: 1fr;
  }
  .import-sidebar {
    display: none;
  }
  .preview-table-scroll {
    /* Mobile native selects use full-screen OS pickers so overlap is not
       an issue; use svh to account for collapsible browser chrome. */
    max-height: calc(100svh - 180px);
    padding-bottom: 0;
  }
}
.recent-import-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  column-gap: 0.75rem;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}
.recent-import-row:last-child {
  border-bottom: 0;
}
.recent-import-label {
  font-size: 0.78rem;
  font-weight: 600;
}
.recent-import-meta {
  font-size: 0.72rem;
}
.recent-import-date {
  font-size: 0.72rem;
  text-align: right;
  white-space: nowrap;
}
/* ── Import sub-tabs ─────────────────────────────────── */
.import-subnav {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.import-subnav-btn {
  padding: 0.45rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 0.4rem 0.4rem 0 0;
  color: var(--muted);
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  cursor: pointer;
  position: relative;
  bottom: -1px;
  transition:
    color 0.15s,
    border-color 0.15s,
    background 0.15s;
}
.import-subnav-btn:hover {
  color: var(--fg);
}
.import-subnav-btn.active {
  color: var(--accent);
  border-color: var(--border);
  background: var(--card-bg);
  border-bottom-color: var(--card-bg);
}

/* ── Import batch history ─────────────────────────────── */
.import-batch-row {
  display: grid;
  grid-template-columns: 2.4rem 1fr auto;
  column-gap: 0.85rem;
  align-items: center;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.import-batch-row:last-child {
  border-bottom: 0;
}
.import-batch-row:hover {
  background: rgba(255, 255, 255, 0.025);
}
.import-batch-row--rolled-back {
  opacity: 0.55;
}
.import-batch-badge {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.45rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.import-batch-info {
  min-width: 0;
}
.import-batch-name {
  font-size: 0.8rem;
  font-weight: 600;
}
.import-batch-filename {
  max-width: 24ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 0.1rem;
}
.import-batch-counts {
  margin-top: 0.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.import-batch-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.import-batch-meta {
  text-align: right;
  flex-shrink: 0;
}
.import-batch-actions {
  flex-shrink: 0;
}

/* Mobile: badge + info row, then footer (date/badge + button) in one compact row */
@media (max-width: 640px) {
  .import-batch-row {
    grid-template-columns: 2.1rem 1fr;
    grid-template-rows: auto auto;
    row-gap: 0.5rem;
    padding: 0.85rem 1rem;
  }
  .import-batch-footer {
    grid-column: 2;
    justify-content: space-between;
    align-items: center;
  }
  .import-batch-meta {
    text-align: left;
  }
  .import-batch-filename {
    max-width: 100%;
  }
}

#tab-import .import-step1-layout .card {
  padding: 1.4rem;
  overflow: visible;
}
#drop-zone {
  min-height: 235px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-color: #41516e;
  background: rgba(7, 15, 30, 0.35);
}
html[data-theme="light"] #drop-zone {
  background: #f7f8fd;
  border-color: #b8c3dc;
}
html[data-theme="light"] #drop-zone:hover,
html[data-theme="light"] #drop-zone.drag-over {
  background: var(--accent-dim);
  border-color: var(--accent);
}
#import-preview-btn {
  background: linear-gradient(90deg, #1456a0, #1e6fcc);
  min-height: 2.65rem;
}

.rules-stats-row {
  gap: 1.25rem;
}
.r-stat-card {
  min-height: 6.5rem;
  padding: 1.15rem 1.35rem;
}
.kw {
  background: rgba(30, 111, 204, 0.13);
  border: 1px solid rgba(30, 111, 204, 0.24);
  color: #a99dff;
  border-radius: 0.35rem;
  padding: 0.18rem 0.5rem;
}

@media (max-width: 767px) {
  .app-main {
    padding-top: 1rem;
  }
  .page-header {
    margin-bottom: 1rem;
  }
  .page-title,
  .dash-page-title {
    font-size: 1.3rem;
  }
  .page-subtitle,
  .dash-page-subtitle {
    font-size: 0.75rem;
  }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Header â€” bell + avatar
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.hdr-icon-btn {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s;
  flex-shrink: 0;
}
.hdr-icon-btn:hover {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
}
html[data-theme="light"] .hdr-icon-btn {
  background: var(--s2);
  border-color: var(--border);
  color: var(--muted);
}
html[data-theme="light"] .hdr-icon-btn:hover {
  background: var(--s3);
  color: var(--text);
}

.hdr-avatar {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e6fcc, #6ac0ff);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0;
  cursor: pointer;
  transition:
    transform 0.18s,
    box-shadow 0.18s;
  flex-shrink: 0;
  font-family: "Outfit", sans-serif;
}
.hdr-avatar:hover {
  transform: scale(1.07);
  box-shadow: 0 0 18px rgba(30, 111, 204, 0.45);
}
@media (min-width: 768px) {
  #menu-btn {
    display: none !important;
  }
  #hdr-avatar {
    display: flex !important;
  }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   KPI sparkline canvas
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.kpi-spark-canvas {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  opacity: 0.5;
  pointer-events: none;
  border-radius: 4px;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Budget â€” extra stat blocks + table layout
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.budget-stat-block {
  min-width: 7rem;
  padding-left: 1.25rem;
  border-left: 1px solid var(--border);
}
.budget-stat-lbl {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.budget-stat-val {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}
.budget-stat-sub {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

/* Budget table */
.budget-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.budget-tbl thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--s1);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.5rem 0.75rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
  white-space: nowrap;
}
.budget-tbl thead th.text-right {
  text-align: center;
}
.budget-tbl tbody tr {
  border-bottom: 1px solid rgba(36, 50, 74, 0.6);
  cursor: pointer;
  transition: background 0.1s;
}
html[data-theme="light"] .budget-tbl tbody tr {
  border-bottom-color: var(--border);
}
.budget-tbl tbody tr:hover {
  background: rgba(30, 111, 204, 0.045);
}
html[data-theme="light"] .budget-tbl tbody tr:hover {
  background: rgba(21, 87, 160, 0.04);
}
.budget-tbl tbody tr:last-child {
  border-bottom: 0;
}
.budget-tbl tbody td {
  padding: 0.75rem 0.75rem;
  vertical-align: middle;
  text-align: center;
}
.budget-tbl td.text-right {
  text-align: center;
}

.budget-cat-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 8rem;
}
.budget-cat-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.budget-cat-name {
  font-size: 0.82rem;
  font-weight: 500;
}

.budget-bar-cell {
  min-width: 100px;
  max-width: 180px;
}
.budget-bar-track {
  height: 5px;
  border-radius: 9999px;
  background: var(--s3);
  overflow: hidden;
}
.budget-bar-fill {
  height: 5px;
  border-radius: 9999px;
  transition: width 0.5s ease;
}

/* â”€â”€ Transactions table: responsive description width â”€â”€ */
.txn-desc-cell {
  max-width: 20rem;
}
@media (max-width: 1024px) {
  .txn-desc-cell {
    max-width: 14rem;
  }
}
@media (max-width: 767px) {
  .txn-desc-cell {
    max-width: 8rem;
  }
}

/* â”€â”€ Budget table responsive column hiding â”€â”€â”€â”€â”€â”€ */
@media (max-width: 900px) {
  .budget-tbl .col-dist {
    display: none;
  }
}
@media (max-width: 750px) {
  .budget-tbl .col-vs {
    display: none;
  }
}
@media (max-width: 600px) {
  .budget-tbl .col-vezes {
    display: none;
  }
}
@media (max-width: 480px) {
  .budget-tbl .col-pct {
    display: none;
  }
}

/* â”€â”€ Budget Limits Modal â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.budget-limit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.25rem;
  border-bottom: 1px solid rgba(36, 50, 74, 0.5);
  gap: 0.75rem;
}
html[data-theme="light"] .budget-limit-row {
  border-bottom-color: var(--border);
}
.budget-limit-row:last-child {
  border-bottom: 0;
}

.budget-limit-cat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}
.budget-limit-cat .budget-cat-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.budget-limit-inputs {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.budget-limit-input {
  width: 6.5rem;
  background: var(--s2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  padding: 0.3rem 0.5rem;
  font-size: 0.78rem;
  outline: none;
  transition: border-color 0.15s;
  font-family: var(--mono);
}
.budget-limit-input:focus {
  border-color: var(--accent);
}
html[data-theme="light"] .budget-limit-input {
  background: var(--s1);
}

/* email alert toggle */
.budget-limit-email-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}
.budget-limit-email-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.budget-limit-toggle {
  display: inline-block;
  width: 32px;
  height: 18px;
  border-radius: 9999px;
  background: var(--s3);
  transition: background 0.2s;
  position: relative;
  flex-shrink: 0;
}
.budget-limit-toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
  transition:
    transform 0.2s,
    background 0.2s;
}
.budget-limit-email-label input:checked + .budget-limit-toggle {
  background: var(--accent);
}
.budget-limit-email-label input:checked + .budget-limit-toggle::after {
  transform: translateX(14px);
  background: #fff;
}
.budget-limit-email-label input:disabled + .budget-limit-toggle {
  opacity: 0.35;
  cursor: not-allowed;
}
.budget-limit-email-label:has(input:disabled) {
  cursor: not-allowed;
}
.budget-limit-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border: none;
  border-radius: 0.35rem;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition:
    background 0.12s,
    color 0.12s;
}
.budget-limit-delete:hover {
  background: rgba(248, 113, 113, 0.1);
  color: var(--red);
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Advisor â€” circular gauge
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.advisor-gauge-wrap {
  position: relative;
  width: 88px;
  height: 88px;
  flex-shrink: 0;
}
.advisor-gauge-svg {
  width: 88px;
  height: 88px;
  transform: rotate(-90deg);
}
.advisor-gauge-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
}
.advisor-gauge-score {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}
.advisor-gauge-denom {
  font-size: 0.65rem;
  color: var(--muted);
  font-weight: 500;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Import â€” source badge
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.source-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.4rem;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0;
  flex-shrink: 0;
  font-family: "Outfit", sans-serif;
}

/* â”€â”€ Transaction Filter Modal â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.txn-filter-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.txn-filter-modal.hidden {
  display: none;
}
.txn-filter-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.txn-filter-modal-panel {
  position: relative;
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 1rem;
  width: 100%;
  max-width: 26rem;
  max-height: calc(100dvh - 2rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.38);
  animation: txnFilterPop 0.2s cubic-bezier(0.34, 1.3, 0.64, 1);
}
@keyframes txnFilterPop {
  from {
    transform: translateY(-10px) scale(0.97);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}
.txn-filter-modal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.txn-filter-modal-close {
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.txn-filter-modal-close:hover {
  color: var(--text);
}
.txn-filter-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.875rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.txn-filter-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.txn-filter-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.txn-filter-clear-btn {
  font-size: 0.7rem;
  color: var(--muted);
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  font-family: "Outfit", sans-serif;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
.txn-filter-clear-btn:hover {
  color: var(--text);
}
.txn-filter-cat-list {
  min-height: 9rem;
  max-height: 9rem;
}
.txn-filter-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  gap: 0.5rem;
  flex-shrink: 0;
}

@media (max-width: 767px) {
  .txn-filter-modal {
    padding: 1rem;
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px) + 1rem);
  }
  .txn-filter-modal-panel {
    max-width: 100%;
    max-height: 80dvh;
  }
}
