/* =========================================================================
   JADE — Premium Wealth OS
   Дизайн-система: изумрудно-нефритовая тёмная тема (luxury / premium)
   Шрифты: Space Grotesk (дисплей + цифры) · Inter (текст)
   ========================================================================= */

:root {
  /* ---- Brand / accent ---- */
  --emerald:        #10b981;
  --emerald-bright: #34d399;
  --mint:           #6ee7b7;
  --emerald-deep:   #047857;
  --gold:           #e7c277;   /* luxury-акцент, очень дозированно */
  --gold-soft:      #f0d7a0;

  /* ---- Semantics ---- */
  --pos:        #34d399;       /* доход / рост */
  --pos-soft:   rgba(52, 211, 153, 0.14);
  --neg:        #fb7185;       /* расход / падение */
  --neg-soft:   rgba(251, 113, 133, 0.14);
  --info:       #5eb3f6;
  --warn:       #e7c277;

  /* ---- Surfaces (deep green-black) ---- */
  --bg-base:    #07130d;
  --bg-deep:    #050d09;
  --surface-1:  #0d1c15;       /* секции / панели */
  --surface-2:  #112318;       /* карточки */
  --surface-3:  #14291d;       /* вложенные / hover */
  --surface-4:  #193324;       /* акцентные вложенные */

  /* ---- Lines / borders ---- */
  --border:        rgba(110, 231, 183, 0.10);
  --border-soft:   rgba(110, 231, 183, 0.06);
  --border-strong: rgba(110, 231, 183, 0.20);
  --hairline:      rgba(255, 255, 255, 0.04);

  /* ---- Text ---- */
  --text:    #ecf5f0;
  --text-2:  #9db3a8;
  --text-3:  #62786d;
  --text-on-emerald: #04231a;

  /* ---- Gradients (сдержанно) ---- */
  --grad-emerald: linear-gradient(135deg, #34d399 0%, #10b981 55%, #059669 100%);
  --grad-gold:    linear-gradient(135deg, #f0d7a0 0%, #e7c277 100%);
  --grad-surface: linear-gradient(160deg, rgba(110,231,183,0.05), rgba(110,231,183,0));

  /* ---- Shadows ---- */
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.4);
  --shadow-md:  0 8px 24px -10px rgba(0,0,0,0.55);
  --shadow-lg:  0 24px 60px -24px rgba(0,0,0,0.65);
  --glow-emerald: 0 0 0 1px rgba(52,211,153,0.25), 0 12px 40px -12px rgba(16,185,129,0.45);
  --glow-gold:    0 8px 30px -10px rgba(231,194,119,0.4);

  /* ---- Radii ---- */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 999px;

  /* ---- Type ---- */
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-text:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-text);
  background: var(--bg-base);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(52,211,153,0.3); color: #fff; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }

button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

.hidden { display: none !important; }

.tabular { font-variant-numeric: tabular-nums; }

/* =========================================================================
   Background — спокойный, без анимированных орбов
   ========================================================================= */
.animated-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1100px 700px at 82% -8%, rgba(16,185,129,0.10), transparent 60%),
    radial-gradient(900px 600px at -5% 100%, rgba(4,120,87,0.12), transparent 55%),
    linear-gradient(180deg, #081711 0%, #06110c 100%);
}
.animated-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  opacity: 0.6;
}
/* старые орбы выключаем */
.gradient-orbs, .bg-particles, .orb { display: none !important; }

/* =========================================================================
   Layout container
   ========================================================================= */
.app-container { width: 100%; min-height: 100vh; }

.premium-dashboard,
.dashboard-header,
.dashboard-nav,
.premium-header .nav-container {
  max-width: 1320px;
  margin: 0 auto;
  padding-left: 40px;
  padding-right: 40px;
}

/* =========================================================================
   Header
   ========================================================================= */
.premium-header {
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: blur(18px) saturate(140%);
  background: linear-gradient(180deg, rgba(7,19,13,0.85), rgba(7,19,13,0.55));
  border-bottom: 1px solid var(--hairline);
}
.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.nav-brand { display: flex; align-items: center; gap: 14px; }

.logo-master { position: relative; display: grid; place-items: center; }
.logo-icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 13px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 8px 24px -14px rgba(16,185,129,0.6);
}
.brand-logo { width: 30px; height: 30px; display: block; }
.logo-pulse { display: none; }

.brand-text { display: flex; align-items: baseline; gap: 9px; }
.brand-name {
  font-size: 1.42rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
}
.pro-tag {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-on-emerald);
  background: var(--grad-gold);
  padding: 3px 8px;
  border-radius: var(--r-pill);
  align-self: center;
  box-shadow: var(--glow-gold);
}

/* user pill + logout */
.auth-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-pill {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 14px 6px 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
}
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-on-emerald);
  background: var(--grad-emerald);
  box-shadow: 0 4px 14px -4px rgba(16,185,129,0.6);
}
.user-meta { line-height: 1.1; }
.user-name { font-weight: 600; font-size: 0.92rem; color: var(--text); }
.user-meta .user-role { font-size: 0.72rem; color: var(--text-3); }

.logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  transition: all 0.25s var(--ease);
}
.logout-btn:hover {
  color: var(--neg);
  border-color: var(--neg-soft);
  background: var(--neg-soft);
}

/* =========================================================================
   Dashboard navigation (tabs)
   ========================================================================= */
.dashboard-nav { padding-top: 22px; padding-bottom: 6px; }
.nav-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-pill);
  padding: 6px;
  width: fit-content;
}
.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--r-pill);
  transition: all 0.28s var(--ease);
  white-space: nowrap;
}
.nav-tab i { font-size: 0.95rem; opacity: 0.8; }
.nav-tab:hover { color: var(--text); background: var(--surface-3); }
.nav-tab.active {
  color: var(--text-on-emerald);
  background: var(--grad-emerald);
  box-shadow: 0 8px 24px -10px rgba(16,185,129,0.7);
}
.nav-tab.active i { opacity: 1; }

/* =========================================================================
   Dashboard header / greeting
   ========================================================================= */
.dashboard-header { padding-top: 30px; padding-bottom: 18px; }
.header-content {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.welcome-title {
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.05;
}
.welcome-title .accent { color: var(--emerald-bright); }
.welcome-subtitle {
  margin-top: 8px;
  color: var(--text-3);
  font-size: 0.95rem;
  text-transform: capitalize;
}

.header-actions .quick-actions { display: flex; gap: 12px; }
.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 20px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: all 0.25s var(--ease);
}
.btn-action i { color: var(--emerald-bright); }
.btn-action:hover { border-color: var(--border-strong); background: var(--surface-3); transform: translateY(-1px); }
.btn-action#quick-add {
  color: var(--text-on-emerald);
  background: var(--grad-emerald);
  border-color: transparent;
  box-shadow: 0 10px 28px -12px rgba(16,185,129,0.7);
}
.btn-action#quick-add i { color: var(--text-on-emerald); }
.btn-action#quick-add:hover { box-shadow: var(--glow-emerald); }

/* =========================================================================
   Tab content
   ========================================================================= */
.tab-content-container { padding: 14px 40px 80px; max-width: 1320px; margin: 0 auto; }
.tab-content { display: none; animation: fadeUp 0.5s var(--ease); }
.tab-content.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================================
   Content sections / cards
   ========================================================================= */
.content-section {
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-xl);
  padding: 26px 28px;
  position: relative;
  overflow: hidden;
}
.content-section::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(110,231,183,0.25), transparent);
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.section-title { display: flex; align-items: center; gap: 12px; }
.section-title i {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  font-size: 0.9rem;
  color: var(--emerald-bright);
  background: var(--pos-soft);
}
.section-title h3 { font-size: 1.12rem; font-weight: 600; }

.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  color: var(--emerald-bright);
  font-size: 0.85rem;
  font-weight: 500;
  transition: gap 0.25s var(--ease);
}
.btn-text:hover { gap: 11px; }

/* =========================================================================
   Overview — metric cards
   ========================================================================= */
.financial-overview { margin-bottom: 22px; }
.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.metric-card {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 22px 22px 18px;
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.metric-card:hover { transform: translateY(-3px); border-color: var(--border); box-shadow: var(--shadow-md); }
.metric-card::after {
  content: "";
  position: absolute;
  right: -30px; top: -30px;
  width: 120px; height: 120px;
  border-radius: 50%;
  opacity: 0.10;
  filter: blur(8px);
  background: var(--accent-c, var(--emerald));
}
.metric-card.income  { --accent-c: var(--emerald-bright); }
.metric-card.expense { --accent-c: var(--neg); }
.metric-card.balance { --accent-c: var(--info); }
.metric-card.savings { --accent-c: var(--gold); }

.metric-header { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.metric-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  font-size: 1.05rem;
  color: var(--accent-c);
  background: color-mix(in srgb, var(--accent-c) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-c) 22%, transparent);
}
.metric-info { display: flex; flex-direction: column; gap: 3px; }
.metric-label {
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.metric-value {
  font-family: var(--font-display);
  font-size: 1.72rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.metric-trend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 4px 9px;
  border-radius: var(--r-pill);
  width: fit-content;
}
.metric-trend.positive { color: var(--pos); background: var(--pos-soft); }
.metric-trend.negative { color: var(--neg); background: var(--neg-soft); }

/* mini sparkline */
.metric-spark { width: 100%; height: 34px; margin-top: 12px; display: block; }

.savings-gauge { margin-top: 14px; }
.gauge-track {
  height: 7px;
  border-radius: var(--r-pill);
  background: var(--surface-4);
  overflow: hidden;
}
.gauge-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--grad-gold);
  width: 0;
  transition: width 1s var(--ease);
}

/* =========================================================================
   Overview lower grid
   ========================================================================= */
.dashboard-content {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 18px;
}

/* recent transactions list */
.transactions-list { display: flex; flex-direction: column; }
.tx-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--hairline);
  transition: background 0.2s var(--ease);
}
.tx-row:last-child { border-bottom: none; }
.tx-row:hover { background: var(--surface-2); border-radius: var(--r-sm); }
.tx-ic {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 1rem;
}
.tx-ic.income  { color: var(--pos); background: var(--pos-soft); }
.tx-ic.expense { color: var(--neg); background: var(--neg-soft); }
.tx-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tx-title { font-weight: 500; font-size: 0.94rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-sub { font-size: 0.78rem; color: var(--text-3); }
.tx-amt {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.tx-amt.income  { color: var(--pos); }
.tx-amt.expense { color: var(--text); }

/* exchange rates compact */
.exchange-rates-grid { display: flex; flex-direction: column; gap: 10px; }
.exchange-rate-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  transition: border-color 0.25s var(--ease);
}
.exchange-rate-item:hover { border-color: var(--border); }
.currency-pair, .rate-pair { font-family: var(--font-display); font-weight: 600; font-size: 0.92rem; letter-spacing: 0.01em; }
.exchange-rate-item .rate-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.rate-change {
  font-size: 0.76rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 3px 8px;
  border-radius: var(--r-pill);
}
.rate-change.positive, .rate-change.up { color: var(--pos); background: var(--pos-soft); }
.rate-change.negative, .rate-change.down { color: var(--neg); background: var(--neg-soft); }
.rate-change.neutral { color: var(--text-3); background: var(--surface-3); }

/* =========================================================================
   Empty states
   ========================================================================= */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 56px 20px;
  color: var(--text-3);
}
.empty-state.compact { padding: 40px 20px; }
.empty-icon, .empty-state > i {
  width: 64px; height: 64px;
  display: grid; place-items: center;
  font-size: 1.5rem;
  border-radius: var(--r-lg);
  color: var(--emerald-bright);
  background: var(--pos-soft);
  margin-bottom: 16px;
}
.empty-state.compact > i { width: 52px; height: 52px; font-size: 1.2rem; }
.empty-state h4 { font-size: 1.05rem; color: var(--text); margin-bottom: 6px; }
.empty-state p { font-size: 0.88rem; }

/* =========================================================================
   Buttons (shared)
   ========================================================================= */
.btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 22px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-on-emerald);
  background: var(--grad-emerald);
  border: none;
  border-radius: var(--r-md);
  overflow: hidden;
  transition: transform 0.2s var(--ease), box-shadow 0.3s var(--ease);
  box-shadow: 0 10px 28px -12px rgba(16,185,129,0.7);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--glow-emerald); }
.btn-primary:active { transform: translateY(0); }
.btn-primary.btn-sm { padding: 10px 16px; font-size: 0.84rem; border-radius: var(--r-sm); }
.btn-primary.btn-full { width: 100%; padding: 15px; }
.btn-content { display: inline-flex; align-items: center; gap: 9px; z-index: 1; }
.btn-shine {
  position: absolute;
  top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.4), transparent);
  transform: skewX(-18deg);
  transition: left 0.7s var(--ease);
}
.btn-primary:hover .btn-shine { left: 130%; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: all 0.25s var(--ease);
}
.btn-secondary:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn-secondary.btn-sm { padding: 9px 14px; font-size: 0.82rem; }

/* icon-only sync button */
.section-header .btn-secondary.btn-sm i { color: var(--emerald-bright); }

/* =========================================================================
   Forms / inputs
   ========================================================================= */
.input-group {
  position: relative;
  margin-bottom: 16px;
}
.input-group i:first-child {
  position: absolute;
  left: 16px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 0.9rem;
  pointer-events: none;
  z-index: 2;
}
.input-group input,
.input-group select {
  width: 100%;
  padding: 15px 16px 15px 44px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 0.92rem;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
  outline: none;
}
.input-group input::placeholder { color: transparent; }
.input-group select { cursor: pointer; appearance: none; padding-right: 40px; }
.input-group input:focus,
.input-group select:focus {
  border-color: var(--emerald);
  background: var(--surface-3);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.15);
}
/* floating label */
.input-group label {
  position: absolute;
  left: 44px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 0.92rem;
  pointer-events: none;
  transition: all 0.2s var(--ease);
  background: var(--surface-2);
  padding: 0 6px;
}
.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
  top: 0;
  font-size: 0.72rem;
  color: var(--emerald-bright);
}
.input-highlight { display: none; }
.input-action {
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--text-3);
  z-index: 2;
}
.input-action:hover { color: var(--text); }

.input-group.compact { margin-bottom: 0; }
.input-group.compact select,
.input-group.compact input { padding-left: 16px; }
.input-group.compact label { left: 16px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.form-grid.compact { grid-template-columns: repeat(4, 1fr); align-items: end; }
.form-grid .full-width,
.input-group.full-width { grid-column: 1 / -1; }
.form-grid .btn-primary { grid-column: 1 / -1; }
.form-grid.compact .btn-primary { grid-column: auto; }

.form-header { margin-bottom: 18px; }
.form-header h3 { font-size: 1.3rem; }
.form-header p { color: var(--text-3); font-size: 0.9rem; margin-top: 4px; }

/* password strength */
.password-strength { margin-top: 12px; }
.strength-bar { height: 5px; border-radius: var(--r-pill); background: var(--surface-4); overflow: hidden; }
.strength-bar > div { height: 100%; width: 0; border-radius: var(--r-pill); transition: width 0.3s var(--ease), background 0.3s var(--ease); }
.strength-text { font-size: 0.74rem; color: var(--text-3); margin-top: 6px; }

/* =========================================================================
   Transactions tab
   ========================================================================= */
.section-controls { display: flex; align-items: center; gap: 12px; }
.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.25s var(--ease);
}
.filter-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.filter-toggle i { color: var(--emerald-bright); }

.filters-panel {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
  align-items: end;
  padding: 22px;
  margin-bottom: 20px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
}
.filters-panel.open { display: grid; }
.filter-section h4 { font-size: 0.82rem; color: var(--text-2); margin-bottom: 10px; font-family: var(--font-text); font-weight: 600; }
.date-range { display: flex; align-items: center; gap: 10px; }
.date-range input { flex: 1; padding: 10px 12px; background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--text); font-size: 0.85rem; }
.date-range span { color: var(--text-3); font-size: 0.82rem; }
.type-filters { display: flex; gap: 10px; }
.filter-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 0.84rem;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.filter-option input { accent-color: var(--emerald); }
.filter-option:has(input:checked) { color: var(--text); border-color: var(--border-strong); background: var(--surface-4); }

.transaction-form {
  padding: 22px;
  margin-bottom: 20px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
}

/* full transaction rows */
.transactions-container { display: flex; flex-direction: column; }

/* =========================================================================
   Analytics
   ========================================================================= */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.period-select {
  padding: 9px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 0.84rem;
  cursor: pointer;
  outline: none;
}
.period-select:focus { border-color: var(--emerald); }
.chart-container { position: relative; height: 300px; }
.chart-container canvas { max-width: 100%; }

/* category breakdown */
.breakdown-list { display: flex; flex-direction: column; gap: 16px; }
.breakdown-item { display: flex; flex-direction: column; gap: 8px; }
.breakdown-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.breakdown-name { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; font-weight: 500; }
.breakdown-dot { width: 10px; height: 10px; border-radius: 3px; }
.breakdown-val { font-family: var(--font-display); font-weight: 600; font-variant-numeric: tabular-nums; }
.breakdown-bar { height: 7px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.breakdown-bar > span { display: block; height: 100%; border-radius: var(--r-pill); }

/* =========================================================================
   Accounts
   ========================================================================= */
.accounts-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  grid-auto-rows: min-content;
  gap: 18px;
}
.accounts-grid > section:first-child { grid-row: span 2; }
.accounts-container { display: flex; flex-direction: column; gap: 14px; }

.account-card {
  position: relative;
  padding: 22px;
  border-radius: var(--r-lg);
  background:
    linear-gradient(135deg, rgba(52,211,153,0.10), rgba(4,120,87,0.04)),
    var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.account-card:hover, .account-card.selected { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.account-card.selected { box-shadow: var(--glow-emerald); }
.account-card .acc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.account-card .acc-name { font-weight: 600; font-size: 1.05rem; font-family: var(--font-display); }
.acc-primary-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 0.72rem; font-weight: 600; color: var(--gold); }
.acc-currency-tag {
  font-family: var(--font-display);
  font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-2);
  background: var(--surface-4);
  padding: 4px 10px;
  border-radius: var(--r-pill);
}
.acc-balance {
  font-family: var(--font-display);
  font-size: 1.9rem; font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin-bottom: 8px;
}
.acc-balance .cur { color: var(--text-3); font-size: 1.1rem; }
.acc-converted { display: flex; flex-direction: column; gap: 2px; font-size: 0.84rem; color: var(--text-3); }
.acc-updated { margin-top: 12px; font-size: 0.74rem; color: var(--text-3); }

.account-details .det-row { display: flex; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--hairline); font-size: 0.9rem; }
.account-details .det-row:last-child { border-bottom: none; }
.account-details .det-label { color: var(--text-3); }
.account-details .det-val { font-weight: 500; font-variant-numeric: tabular-nums; }

.balances-container { display: flex; flex-direction: column; gap: 12px; }
.balance-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  transition: border-color 0.25s var(--ease);
}
.balance-item:hover { border-color: var(--border); }
.balance-item .bal-cur { display: flex; align-items: center; gap: 12px; }
.balance-item .bal-flag {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--emerald-bright);
  background: var(--pos-soft);
}
.balance-item .bal-code { font-family: var(--font-display); font-weight: 600; }
.balance-item .bal-amt { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; font-variant-numeric: tabular-nums; }

/* =========================================================================
   Categories
   ========================================================================= */
.categories-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.4fr;
  align-items: start;
  gap: 18px;
}
.categories-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.category-card {
  position: relative;
  padding: 20px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.category-card:hover { transform: translateY(-2px); border-color: var(--border); }
.category-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--cat-c, var(--emerald));
}
.category-card.income  { --cat-c: var(--pos); }
.category-card.expense { --cat-c: var(--neg); }
.cat-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cat-name { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.cat-type {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.74rem; font-weight: 600;
  padding: 4px 10px; border-radius: var(--r-pill);
}
.cat-type.income  { color: var(--pos); background: var(--pos-soft); }
.cat-type.expense { color: var(--neg); background: var(--neg-soft); }
.cat-desc { font-size: 0.85rem; color: var(--text-2); margin-bottom: 16px; }
.cat-foot { display: flex; align-items: center; justify-content: space-between; }
.cat-date { font-size: 0.76rem; color: var(--text-3); }
.cat-date b { color: var(--text-2); font-weight: 600; }
.btn-delete {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 500;
  color: var(--neg);
  background: var(--neg-soft);
  border: 1px solid transparent;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  transition: all 0.2s var(--ease);
}
.btn-delete:hover { background: var(--neg); color: #fff; }

/* =========================================================================
   Exchange tab
   ========================================================================= */
.exchange-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  align-items: start;
  gap: 18px;
}
.exchange-rates-container { display: flex; flex-direction: column; gap: 12px; }
.fx-card {
  padding: 18px 20px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  transition: border-color 0.25s var(--ease);
}
.fx-card:hover { border-color: var(--border); }
.fx-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.fx-pair { font-family: var(--font-display); font-weight: 600; }
.fx-rate { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.fx-meta { font-size: 0.74rem; color: var(--text-3); margin-top: 4px; }

/* converter */
.converter-card { display: flex; flex-direction: column; gap: 20px; }
.converter-inputs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
}
.currency-input-group {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
}
.input-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.input-label { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.currency-select-wrapper { position: relative; }
.currency-select {
  appearance: none;
  background: var(--surface-4);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 28px 7px 12px;
  cursor: pointer;
  outline: none;
}
.currency-select-wrapper i { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 0.7rem; pointer-events: none; }
.amount-input-wrapper { position: relative; display: flex; align-items: center; }
.amount-input {
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  outline: none;
  padding-right: 32px;
}
.amount-input.result-input { color: var(--emerald-bright); }
.currency-symbol {
  position: absolute;
  right: 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-3);
}
.swap-button-container { display: grid; place-items: center; }
.swap-btn {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text-on-emerald);
  background: var(--grad-emerald);
  border: 3px solid var(--surface-1);
  box-shadow: 0 8px 22px -8px rgba(16,185,129,0.7);
  transition: transform 0.4s var(--ease);
}
.swap-btn:hover { transform: rotate(180deg); }

.conversion-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
}
.exchange-rate-info { display: flex; align-items: center; gap: 10px; }
.rate-label { color: var(--text-3); font-size: 0.85rem; }
.conversion-details .rate-value { font-family: var(--font-display); font-weight: 600; font-variant-numeric: tabular-nums; }
.last-updated { display: flex; align-items: center; gap: 7px; font-size: 0.78rem; color: var(--text-3); }
.last-updated i { color: var(--emerald-bright); }

.quick-rates-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.quick-rate-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
}
.quick-rate-item .rate-value { font-family: var(--font-display); font-weight: 600; font-variant-numeric: tabular-nums; }

/* =========================================================================
   Auth screen
   ========================================================================= */
.auth-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  max-width: 1040px;
  margin: 4vh auto 7vh;
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.auth-hero {
  position: relative;
  background:
    radial-gradient(600px 400px at 30% 20%, rgba(52,211,153,0.18), transparent 60%),
    linear-gradient(160deg, #0c2a1f, #07150f);
  display: grid;
  place-items: center;
  padding: 48px;
  overflow: hidden;
}
.hero-scene { display: none; text-align: center; }
.hero-scene.active { display: block; }
.hero-card { position: relative; z-index: 2; }
.hero-icon {
  width: 96px; height: 96px;
  margin: 0 auto 24px;
  border-radius: var(--r-xl);
  display: grid; place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: var(--glow-emerald);
}
.hero-icon img { width: 56px; height: 56px; }
.hero-icon i { font-size: 2.5rem; color: var(--emerald-bright); }
.hero-card h3 { font-size: 1.9rem; margin-bottom: 10px; }
.hero-card p { color: var(--text-2); font-size: 1rem; }
.hero-coins, .hero-sparks { display: none; }

.auth-forms-container { padding: 44px 40px; }
.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border-radius: var(--r-pill);
  padding: 5px;
  margin-bottom: 28px;
}
.tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: var(--r-pill);
  transition: all 0.25s var(--ease);
}
.tab-btn.active { color: var(--text-on-emerald); background: var(--grad-emerald); }
.auth-form .tab-content { display: none; }
#login-tab.active, #register-tab.active { display: block; }
.tab-content > .auth-form { animation: fadeUp 0.4s var(--ease); }

/* =========================================================================
   Modals
   ========================================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(4,9,7,0.7);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.25s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
  width: min(520px, 92vw);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  animation: modalPop 0.35s var(--ease);
  overflow: hidden;
}
@keyframes modalPop { from { opacity: 0; transform: translateY(20px) scale(0.97); } to { opacity: 1; transform: none; } }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px;
  border-bottom: 1px solid var(--hairline);
}
.modal-header h3 { font-size: 1.2rem; }
.modal-close {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: all 0.2s var(--ease);
}
.modal-close:hover { color: var(--neg); border-color: var(--neg-soft); }
.modal-body { padding: 26px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 26px 24px;
}

/* =========================================================================
   Notifications
   ========================================================================= */
.notifications-container {
  position: fixed;
  top: 90px; right: 28px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  padding: 15px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--emerald);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  animation: toastIn 0.4s var(--ease);
}
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
.toast.success { border-left-color: var(--emerald); }
.toast.error { border-left-color: var(--neg); }
.toast i { color: var(--emerald-bright); }
.toast.error i { color: var(--neg); }

/* =========================================================================
   Loading
   ========================================================================= */
.loading-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center;
  background: rgba(5,13,9,0.85);
  backdrop-filter: blur(8px);
}
.loader-content { text-align: center; color: var(--text-2); }
.loader-spinner { position: relative; width: 56px; height: 56px; margin: 0 auto 18px; }
.spinner-ring {
  position: absolute; inset: 0;
  border: 3px solid var(--surface-3);
  border-top-color: var(--emerald-bright);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.spinner-dot { position: absolute; inset: 40%; border-radius: 50%; background: var(--emerald-bright); }
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================================
   Notifications (.notification — used by NotificationSystem in script.js)
   ========================================================================= */
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(48px); }
  to   { opacity: 1; transform: translateX(0); }
}

.notification {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 300px;
  max-width: 380px;
  padding: 16px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  animation: slideInRight 0.35s var(--ease);
  position: relative;
  overflow: hidden;
}
.notification::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--emerald);
  border-radius: 3px 0 0 3px;
}
.notification.success::before { background: var(--emerald-bright); }
.notification.error::before   { background: var(--neg); }
.notification.info::before    { background: var(--info); }

.notification > i {
  font-size: 1.05rem;
  margin-top: 2px;
  flex-shrink: 0;
  color: var(--emerald-bright);
}
.notification.error > i  { color: var(--neg); }
.notification.info > i   { color: var(--info); }

.notification-content { flex: 1; min-width: 0; }
.notification-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 3px;
}
.notification-message {
  font-size: 0.83rem;
  color: var(--text-2);
  line-height: 1.4;
  word-break: break-word;
}

.notification-close {
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: none;
  border: none;
  color: var(--text-3);
  border-radius: var(--r-sm);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
  margin-top: -2px;
}
.notification-close:hover { background: var(--surface-3); color: var(--text); }

/* =========================================================================
   Currency Picker Modal (.currency-modal / .currency-grid / .currency-card)
   ========================================================================= */
.currency-modal .modal-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 28px 28px 20px;
  border-bottom: 1px solid var(--hairline);
}
.currency-modal .modal-header h3 {
  font-size: 1.35rem;
  color: var(--text);
}
.currency-modal .modal-header p {
  font-size: 0.88rem;
  color: var(--text-3);
  margin: 0;
}
.currency-modal .modal-body { padding: 24px 28px; }
.currency-modal .modal-footer {
  padding: 0 28px 24px;
  border-top: none;
  justify-content: flex-start;
}
.currency-modal .help-text {
  font-size: 0.82rem;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 7px;
}
.currency-modal .help-text::before {
  content: "";
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--pos-soft);
  border: 1px solid rgba(52,211,153,0.3);
  flex-shrink: 0;
}

/* grid of cards */
.currency-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.currency-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 20px 18px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.28s var(--ease), border-color 0.28s var(--ease), box-shadow 0.28s var(--ease);
  user-select: none;
}
.currency-card::after {
  content: "";
  position: absolute;
  right: -18px; top: -18px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--emerald);
  opacity: 0.06;
  filter: blur(6px);
  transition: opacity 0.3s var(--ease);
}
.currency-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
.currency-card:hover::after { opacity: 0.12; }

.currency-card.selected,
.currency-card.success {
  border-color: var(--emerald);
  box-shadow: var(--glow-emerald);
  background: linear-gradient(135deg, rgba(52,211,153,0.10), rgba(4,120,87,0.04)), var(--surface-2);
}
.currency-card.loading { pointer-events: none; opacity: 0.7; }

.currency-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.currency-icon {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 12px;
  font-size: 1.1rem;
  color: var(--emerald-bright);
  background: var(--pos-soft);
  border: 1px solid rgba(52,211,153,0.15);
}
.currency-badge {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--surface-4);
  padding: 4px 9px;
  border-radius: var(--r-pill);
}
.currency-card.selected .currency-badge,
.currency-card.success .currency-badge {
  color: var(--text-on-emerald);
  background: var(--grad-emerald);
}

.currency-card__body { margin-bottom: 16px; }
.currency-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 4px;
}
.currency-symbol {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-3);
  line-height: 1;
}
.currency-card.selected .currency-symbol,
.currency-card.success .currency-symbol { color: var(--emerald-bright); }

.currency-card__footer { margin-top: auto; }
.select-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-3);
  transition: color 0.2s var(--ease);
}
.currency-card:hover .select-hint { color: var(--emerald-bright); }
.currency-card.selected .select-hint,
.currency-card.success .select-hint { color: var(--pos); }

/* =========================================================================
   Category cards — class names used by script.js renderCategories()
   ========================================================================= */
.category-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}
.category-info { display: flex; flex-direction: column; gap: 6px; }
.category-info h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
}
.category-type {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  width: fit-content;
}
.category-type.income { color: var(--pos); background: var(--pos-soft); }
.category-type.expense { color: var(--neg); background: var(--neg-soft); }
.category-type i { font-size: 0.7rem; }

.category-desc {
  font-size: 0.84rem;
  color: var(--text-2);
  margin-bottom: 14px;
  line-height: 1.4;
}
.category-stats { margin-bottom: 16px; }
.category-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
}
.stat-label { color: var(--text-3); }
.stat-value { color: var(--text-2); font-weight: 500; }

.category-actions { display: flex; gap: 8px; margin-top: auto; }

/* btn-danger used by script.js delete buttons */
.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--neg);
  background: var(--neg-soft);
  border: 1px solid transparent;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  font-family: inherit;
}
.btn-danger.btn-sm { padding: 7px 12px; font-size: 0.78rem; }
.btn-danger:hover { background: var(--neg); color: #fff; border-color: var(--neg); }

/* =========================================================================
   Transaction items — class names used by script.js renderTransactions()
   ========================================================================= */
.transaction-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--hairline);
  transition: background 0.2s var(--ease);
}
.transaction-item:last-child { border-bottom: none; }
.transaction-item:hover { background: var(--surface-2); border-radius: var(--r-sm); padding-left: 8px; padding-right: 8px; }
.transaction-item.compact { padding: 12px 4px; }

.transaction-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.transaction-income .transaction-icon,
.transaction-item.transaction-income .transaction-icon { color: var(--pos); background: var(--pos-soft); }
.transaction-expense .transaction-icon,
.transaction-item.transaction-expense .transaction-icon { color: var(--neg); background: var(--neg-soft); }

.transaction-details { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.transaction-title {
  font-weight: 500;
  font-size: 0.94rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.transaction-meta {
  display: flex;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-3);
  flex-wrap: wrap;
}
.transaction-meta span { white-space: nowrap; }

.transaction-amount {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.amount-income { color: var(--pos); }
.amount-expense { color: var(--text); }

/* =========================================================================
   Account cards — class names used by script.js updateAccountsDisplay()
   ========================================================================= */
.account-card {
  position: relative;
  padding: 22px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, rgba(52,211,153,0.08), rgba(4,120,87,0.03)), var(--surface-2);
  border: 1px solid var(--border-soft);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.account-card:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.account-card.default,
.account-card.selected { border-color: var(--emerald); box-shadow: var(--glow-emerald); }

.account-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.account-info { display: flex; flex-direction: column; gap: 4px; }
.account-info h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
}
.currency-code {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-3);
  background: var(--surface-4);
  padding: 3px 9px;
  border-radius: var(--r-pill);
  width: fit-content;
}
.account-card.default .currency-code { color: var(--gold); background: rgba(231,194,119,0.12); }

.account-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.default-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--gold);
  background: rgba(231,194,119,0.12);
  padding: 5px 10px;
  border-radius: var(--r-pill);
}

.account-balance {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 10px;
}
.balance-amount {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.balance-currency {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-3);
}

.account-equivalents { display: flex; flex-direction: column; gap: 3px; margin-bottom: 12px; }
.equivalent-line { font-size: 0.82rem; color: var(--text-3); font-variant-numeric: tabular-nums; }

.account-meta { font-size: 0.74rem; color: var(--text-3); margin-top: 4px; }

/* account details modal */
.account-details-content { display: flex; flex-direction: column; gap: 0; }
.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 0.9rem;
}
.detail-item:last-child { border-bottom: none; }
.detail-label { color: var(--text-3); }
.detail-value { font-weight: 500; font-variant-numeric: tabular-nums; }

/* =========================================================================
   Balance cards — updateBalancesDisplay()
   ========================================================================= */
.balance-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  transition: border-color 0.25s var(--ease);
}
.balance-card:hover { border-color: var(--border); }
.balance-info { display: flex; flex-direction: column; gap: 4px; }
.balance-info h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--emerald-bright);
  background: var(--pos-soft);
  display: inline-block;
  padding: 3px 9px;
  border-radius: var(--r-pill);
}
.balance-info .balance-amount {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.balance-usd { font-size: 0.82rem; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* =========================================================================
   Exchange rate cards — updateExchangeRatesDisplay()
   ========================================================================= */
.exchange-rate-card {
  padding: 18px 20px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  transition: border-color 0.25s var(--ease);
}
.exchange-rate-card:hover { border-color: var(--border); }
.exchange-rate-card .rate-pair {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
}
.exchange-rate-card .rate-pair i { font-size: 0.7rem; color: var(--text-3); }
.base-currency { color: var(--text); }
.target-currency { color: var(--emerald-bright); }
.exchange-rate-card .rate-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  margin-bottom: 6px;
}
.rate-updated { font-size: 0.74rem; color: var(--text-3); }

/* =========================================================================
   Category breakdown — renderCategoryBreakdown()
   ========================================================================= */
.breakdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
}
.breakdown-item:last-child { border-bottom: none; }
.breakdown-info { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.breakdown-name {
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.type-income { color: var(--pos); font-size: 0.74rem; font-weight: 600; }
.type-expense { color: var(--neg); font-size: 0.74rem; font-weight: 600; }
.breakdown-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.breakdown-amount {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.breakdown-percentage {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* =========================================================================
   Modal active state (script.js opens with .active not removing .hidden)
   ========================================================================= */
.modal-overlay.active { display: grid !important; }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 1100px) {
  .overview-grid { grid-template-columns: repeat(2, 1fr); }
  .analytics-grid, .accounts-grid, .categories-grid, .exchange-grid, .dashboard-content { grid-template-columns: 1fr; }
  .accounts-grid > section:first-child { grid-row: auto; }
}
@media (max-width: 760px) {
  .premium-dashboard, .dashboard-header, .dashboard-nav, .premium-header .nav-container, .tab-content-container { padding-left: 18px; padding-right: 18px; }
  .nav-tabs { width: 100%; overflow-x: auto; }
  .nav-tab span { display: none; }
  .nav-tab { padding: 11px 14px; }
  .overview-grid { grid-template-columns: 1fr; }
  .welcome-title { font-size: 1.9rem; }
  .header-content { flex-direction: column; align-items: stretch; }
  .quick-actions { width: 100%; }
  .btn-action { flex: 1; justify-content: center; }
  .converter-inputs { grid-template-columns: 1fr; }
  .swap-btn { transform: rotate(90deg); }
  .categories-container, .form-grid, .form-grid.compact, .quick-rates-grid { grid-template-columns: 1fr; }
  .auth-section { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
}
