/* ============================================
   СЕМЕЙНЫЙ БЮДЖЕТ — ГЛАВНЫЕ СТИЛИ
   Glassmorphism + Dark/Light themes 2026
   ============================================ */

/* ── ПЕРЕМЕННЫЕ ── */
:root {
  /* Акцентные цвета по схемам */
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-dark: #4f46e5;
  --accent-rgb: 99, 102, 241;

  --success: #22c55e;
  --success-rgb: 34, 197, 94;
  --danger: #ef4444;
  --danger-rgb: 239, 68, 68;
  --warning: #f59e0b;
  --warning-rgb: 245, 158, 11;
  --info: #06b6d4;
  --info-rgb: 6, 182, 212;

  /* Темная тема (по умолчанию) */
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-tertiary: #16213e;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --bg-input: rgba(255, 255, 255, 0.06);
  --bg-input-focus: rgba(255, 255, 255, 0.09);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f0f1a;

  --border: rgba(255, 255, 255, 0.08);
  --border-active: rgba(99, 102, 241, 0.5);
  --border-strong: rgba(255, 255, 255, 0.15);

  --glass-bg: rgba(15, 15, 26, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-blur: blur(20px);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
  --shadow-accent: 0 8px 32px rgba(99, 102, 241, 0.3);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  --sidebar-width: 280px;
  --header-height: 64px;
  --fab-size: 60px;
  --nav-height: 70px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Светлая тема */
[data-theme="light"] {
  --bg-primary: #f0f4ff;
  --bg-secondary: #e8eef9;
  --bg-tertiary: #dce6f5;
  --bg-card: rgba(255, 255, 255, 0.7);
  --bg-card-hover: rgba(255, 255, 255, 0.9);
  --bg-input: rgba(0, 0, 0, 0.04);
  --bg-input-focus: rgba(0, 0, 0, 0.07);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #f1f5f9;

  --border: rgba(0, 0, 0, 0.08);
  --border-active: rgba(99, 102, 241, 0.4);
  --border-strong: rgba(0, 0, 0, 0.15);

  --glass-bg: rgba(240, 244, 255, 0.8);
  --glass-border: rgba(255, 255, 255, 0.6);

  --shadow-sm: 0 2px 8px rgba(99, 102, 241, 0.08);
  --shadow-md: 0 8px 24px rgba(99, 102, 241, 0.12);
  --shadow-lg: 0 20px 60px rgba(99, 102, 241, 0.15);
}

/* Цветовые схемы */
[data-scheme="purple"] { --accent: #a855f7; --accent-light: #c084fc; --accent-dark: #9333ea; --accent-rgb: 168,85,247; }
[data-scheme="green"]  { --accent: #22c55e; --accent-light: #4ade80; --accent-dark: #16a34a; --accent-rgb: 34,197,94; }
[data-scheme="pink"]   { --accent: #ec4899; --accent-light: #f472b6; --accent-dark: #db2777; --accent-rgb: 236,72,153; }
[data-scheme="cyan"]   { --accent: #06b6d4; --accent-light: #22d3ee; --accent-dark: #0891b2; --accent-rgb: 6,182,212; }
[data-scheme="orange"] { --accent: #f97316; --accent-light: #fb923c; --accent-dark: #ea580c; --accent-rgb: 249,115,22; }
[data-scheme="red"]    { --accent: #ef4444; --accent-light: #f87171; --accent-dark: #dc2626; --accent-rgb: 239,68,68; }

/* ── СБРОС И БАЗА ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Размеры шрифта */
[data-font-size="small"]  { font-size: 14px; }
[data-font-size="large"]  { font-size: 18px; }

/* ── ФОН С ГРАДИЕНТОМ ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(var(--accent-rgb), 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(var(--success-rgb), 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 50% 50%, rgba(var(--accent-rgb), 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── SPLASH SCREEN ── */
.splash-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s, visibility 0.5s;
}

.splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-logo {
  text-align: center;
  margin-bottom: 48px;
}

.splash-icon {
  font-size: 72px;
  margin-bottom: 16px;
  animation: splashPulse 1.5s ease-in-out infinite;
}

.splash-title {
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.splash-loader {
  width: 200px;
  height: 3px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.splash-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: var(--radius-full);
  animation: splashLoad 1.5s ease-in-out forwards;
}

@keyframes splashPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@keyframes splashLoad {
  0% { width: 0%; }
  100% { width: 100%; }
}

/* ── GLASSMORPHISM КАРТОЧКИ ── */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.06) 0%,
    transparent 50%,
    rgba(255,255,255,0.02) 100%
  );
  pointer-events: none;
}

.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ── SIDEBAR ── */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  height: 100dvh;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--glass-border);
  z-index: 1000;
  transform: translateX(-100%);
  transition: transform var(--transition);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar.open {
  transform: translateX(0);
  box-shadow: var(--shadow-lg);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  padding-top: max(20px, env(safe-area-inset-top));
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo-icon {
  font-size: 28px;
}

.sidebar-logo-text {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-close {
  background: var(--bg-input);
  border: none;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}

.sidebar-close:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

/* Пользователь в сайдбаре */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  margin: 8px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.sidebar-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.sidebar-user-role {
  font-size: 11px;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* Навигация */
.sidebar-nav {
  flex: 1;
  list-style: none;
  padding: 8px 12px;
  overflow-y: auto;
  scrollbar-width: none;
}

.sidebar-nav::-webkit-scrollbar { display: none; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
  position: relative;
}

.sidebar-link:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  transform: translateX(4px);
}

.sidebar-link.active {
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.2), rgba(var(--accent-rgb), 0.1));
  color: var(--accent-light);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
}

.sidebar-link.active .nav-icon { filter: none; }

.nav-icon {
  font-size: 20px;
  width: 24px;
  text-align: center;
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.sidebar-footer {
  padding: 16px 12px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  background: rgba(var(--danger-rgb), 0.1);
  border: 1px solid rgba(var(--danger-rgb), 0.2);
  border-radius: var(--radius-md);
  color: var(--danger);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.sidebar-logout:hover {
  background: rgba(var(--danger-rgb), 0.2);
}

/* ── TOP HEADER ── */
.glass-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: var(--header-height);
  padding-top: env(safe-area-inset-top);
  height: calc(var(--header-height) + env(safe-area-inset-top));
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
}

.header-menu-btn {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  flex-shrink: 0;
}

.header-menu-btn:hover { background: var(--bg-card); }

.header-menu-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition);
}

.header-title {
  flex: 1;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  position: relative;
}

.header-btn:hover { background: var(--bg-card-hover); transform: scale(1.05); }

.notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-primary);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

.header-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  cursor: pointer;
  transition: transform var(--transition);
  overflow: hidden;
  border: 2px solid rgba(var(--accent-rgb), 0.4);
}

.header-avatar:hover { transform: scale(1.08); }
.header-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── MAIN CONTENT ── */
.main-content {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
}

.pages-container {
  position: relative;
}

.page {
  display: none;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.3s, transform 0.3s;
}

.page.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.page-content {
  padding: 16px;
  padding-bottom: calc(var(--fab-size) + 32px + env(safe-area-inset-bottom));
  max-width: 768px;
  margin: 0 auto;
}

/* ── DASHBOARD WIDGETS ── */
/* Баланс-герой */
.balance-hero {
  padding: 24px;
  margin-bottom: 16px;
  background: linear-gradient(
    135deg,
    rgba(var(--accent-rgb), 0.15) 0%,
    rgba(var(--accent-rgb), 0.05) 50%,
    rgba(var(--success-rgb), 0.08) 100%
  );
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  position: relative;
  overflow: hidden;
}

.balance-hero::after {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.15), transparent 70%);
  border-radius: var(--radius-full);
}

.balance-greeting {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-weight: 500;
}

.balance-label {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 8px;
}

.balance-amount {
  font-size: clamp(32px, 8vw, 48px);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.balance-period-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.balance-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.income .stat-icon { background: rgba(var(--success-rgb), 0.2); color: var(--success); }
.expense .stat-icon { background: rgba(var(--danger-rgb), 0.2); color: var(--danger); }

.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.stat-value { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.income .stat-value { color: var(--success); }
.expense .stat-value { color: var(--danger); }

.balance-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

/* Period selector */
.period-selector {
  display: flex;
  gap: 6px;
  background: var(--bg-input);
  padding: 4px;
  border-radius: var(--radius-md);
}

.period-btn {
  flex: 1;
  padding: 6px 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}

.period-btn.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.4);
}

/* Виджеты */
.widget {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 12px;
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.widget::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.widget-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.widget-action {
  background: none;
  border: none;
  color: var(--accent-light);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition);
  font-family: var(--font);
}

.widget-action:hover { color: var(--accent); }

/* ── ACCOUNTS SLIDER ── */
.accounts-slider {
  overflow: hidden;
  border-radius: var(--radius-md);
  margin: 0 -4px;
}

.accounts-track {
  display: flex;
  gap: 12px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 4px;
}

.account-card-slide {
  min-width: calc(100% - 32px);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition);
  aspect-ratio: 1.7 / 1;
  max-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.account-card-slide::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.15) 0%,
    transparent 50%,
    rgba(0,0,0,0.2) 100%
  );
}

.account-card-slide::after {
  content: '';
  position: absolute;
  bottom: -20px;
  right: -20px;
  width: 120px;
  height: 120px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.08);
}

.acc-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.acc-card-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.acc-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.acc-card-type {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.acc-card-logo {
  font-size: 24px;
}

.acc-card-balance {
  font-size: 24px;
  font-weight: 800;
  color: white;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.acc-card-name {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
}

.acc-card-stats {
  display: flex;
  gap: 16px;
}

.acc-card-stat {
  font-size: 12px;
  color: rgba(255,255,255,0.75);
}

.acc-card-stat span {
  font-weight: 600;
  color: white;
}

.slider-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}

.slider-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--border-strong);
  transition: all var(--transition);
  cursor: pointer;
}

.slider-dot.active {
  width: 20px;
  background: var(--accent);
}

/* ── BUDGET WIDGET ── */
.budget-item {
  margin-bottom: 12px;
}

.budget-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.budget-item-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.budget-item-icon {
  font-size: 18px;
}

.budget-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.budget-item-amounts {
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
}

.budget-item-spent {
  font-weight: 600;
  color: var(--text-primary);
}

.progress-bar {
  height: 6px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-fill.ok { background: linear-gradient(90deg, var(--success), #4ade80); }
.progress-fill.warning { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.progress-fill.danger { background: linear-gradient(90deg, var(--danger), #f87171); }

/* ── TOP CATEGORIES ── */
.category-bar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.cat-bar-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.cat-bar-info { flex: 1; min-width: 0; }

.cat-bar-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-bar-track {
  height: 4px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.cat-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.cat-bar-amount {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

/* ── GOALS WIDGET ── */
.goal-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.goal-item:hover {
  border-color: rgba(var(--accent-rgb), 0.3);
  background: var(--bg-card-hover);
}

.goal-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.goal-info { flex: 1; min-width: 0; }

.goal-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.goal-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.goal-progress-bar {
  flex: 1;
  height: 5px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.goal-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.goal-percent {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-light);
  min-width: 32px;
  text-align: right;
}

.goal-remaining {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── AI INSIGHTS ── */
.insight-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  border-left: 3px solid var(--accent);
  transition: all var(--transition);
}

.insight-item.warning { border-left-color: var(--warning); }
.insight-item.success { border-left-color: var(--success); }
.insight-item.info { border-left-color: var(--info); }

.insight-icon { font-size: 22px; flex-shrink: 0; }

.insight-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── UPCOMING PAYMENTS ── */
.upcoming-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.upcoming-item:last-child { border-bottom: none; }

.upcoming-date {
  min-width: 44px;
  text-align: center;
}

.upcoming-date-day {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.upcoming-date-month {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.upcoming-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.upcoming-info { flex: 1; min-width: 0; }

.upcoming-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.upcoming-freq {
  font-size: 11px;
  color: var(--text-muted);
}

.upcoming-amount {
  font-size: 14px;
  font-weight: 700;
  color: var(--danger);
}

/* ── TRANSACTIONS LIST ── */
.transaction-group-date {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 0 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tx-group-total {
  font-size: 12px;
  font-weight: 600;
}

.tx-group-total.positive { color: var(--success); }
.tx-group-total.negative { color: var(--danger); }

.transaction-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  transform: translateX(0);
}

.transaction-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--transition);
}

.transaction-item:hover {
  background: var(--bg-card-hover);
  border-color: rgba(var(--accent-rgb), 0.3);
  transform: translateX(2px);
}

.transaction-item:hover::before { opacity: 1; }

/* Swipe actions */
.transaction-item.swiping {
  transition: none;
}

.tx-swipe-actions {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  overflow: hidden;
}

.tx-swipe-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 16px;
  border: none;
  cursor: pointer;
  font-size: 18px;
  font-family: var(--font);
  transition: filter var(--transition);
}

.tx-swipe-btn:hover { filter: brightness(1.2); }
.tx-swipe-btn span { font-size: 10px; font-weight: 600; color: white; }
.tx-swipe-btn.edit { background: var(--info); }
.tx-swipe-btn.duplicate { background: var(--warning); }
.tx-swipe-btn.delete { background: var(--danger); }

.tx-category-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.tx-info { flex: 1; min-width: 0; }

.tx-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.tx-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-weight: 500;
}

.tx-amount-col {
  text-align: right;
  flex-shrink: 0;
}

.tx-amount {
  font-size: 15px;
  font-weight: 700;
}

.tx-amount.income { color: var(--success); }
.tx-amount.expense { color: var(--danger); }
.tx-amount.transfer { color: var(--info); }
.tx-amount.debt { color: var(--warning); }

.tx-account-name {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.tx-receipt-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 12px;
}

/* ── ACCOUNTS GRID ── */
.accounts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.account-full-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
}

.account-full-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(var(--accent-rgb), 0.3);
}

.account-card-visual {
  height: 130px;
  padding: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-size: cover;
  background-position: center;
}

.account-card-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(0,0,0,0.2) 0%,
    transparent 100%
  );
}

.acc-full-name {
  font-size: 16px;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
  position: relative;
}

.acc-full-balance {
  font-size: 22px;
  font-weight: 800;
  color: white;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
  position: relative;
}

.account-card-body {
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.acc-month-stat {
  text-align: center;
}

.acc-month-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.acc-month-value {
  font-size: 14px;
  font-weight: 700;
}

.acc-month-value.income { color: var(--success); }
.acc-month-value.expense { color: var(--danger); }

.account-card-actions {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
}

.btn-xs {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* ── GOALS GRID ── */
.goals-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.goal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
}

.goal-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(var(--accent-rgb), 0.3);
}

.goal-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.goal-card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.goal-card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.goal-card-deadline {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.goal-card-amounts {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 12px;
}

.goal-card-current {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
}

.goal-card-target {
  font-size: 13px;
  color: var(--text-muted);
}

.goal-card-target span {
  font-weight: 600;
  color: var(--text-secondary);
}

.goal-card-progress {
  height: 8px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 8px;
}

.goal-card-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.goal-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.goal-card-percent {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-light);
}

.goal-card-monthly {
  font-size: 12px;
  color: var(--text-muted);
}

.goal-card-monthly span {
  color: var(--warning);
  font-weight: 600;
}

.goal-contribute-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3);
}

.goal-contribute-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(var(--accent-rgb), 0.4);
}

/* ── ANALYTICS ── */
.analytics-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-input);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.analytics-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  flex: 1;
  min-width: max-content;
  padding: 8px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}

.tab-btn.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.4);
}

.analytics-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 12px;
}

.analytics-chart-wrapper {
  position: relative;
  height: 240px;
  margin: 0 -4px;
}

/* ── CALENDAR ── */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.calendar-month {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.calendar-nav {
  display: flex;
  gap: 8px;
}

.calendar-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.calendar-nav-btn:hover { background: var(--accent); border-color: var(--accent); }

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 8px;
}

.calendar-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 4px 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.calendar-day {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  padding: 2px;
}

.calendar-day:hover {
  background: var(--bg-card-hover);
}

.calendar-day.today {
  background: rgba(var(--accent-rgb), 0.15);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
}

.calendar-day.has-transactions::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--accent);
}

.calendar-day.selected {
  background: var(--accent);
}

.calendar-day.selected .cal-day-num { color: white; }

.cal-day-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
}

.cal-day-num.muted { color: var(--text-muted); }

.cal-day-amount {
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  margin-top: 1px;
}

.cal-day-amount.expense { color: var(--danger); }
.cal-day-amount.income { color: var(--success); }

/* ── FORMS ── */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-label.required::after {
  content: ' *';
  color: var(--danger);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 12px;
  font-size: 18px;
  pointer-events: none;
  z-index: 1;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  font-family: var(--font);
  transition: all var(--transition);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.input-wrapper .form-input {
  padding-left: 42px;
}

.form-input:focus {
  border-color: var(--accent);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
}

.form-input::placeholder { color: var(--text-muted); }

.form-input.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(var(--danger-rgb), 0.15);
}

.form-select {
  width: 100%;
  padding: 12px 40px 12px 16px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  font-family: var(--font);
  cursor: pointer;
  outline: none;
  transition: all var(--transition);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.form-select:focus {
  border-color: var(--accent);
  background-color: var(--bg-input-focus);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
}

textarea.form-input {
  resize: vertical;
  min-height: 80px;
  padding: 12px 16px;
}

.input-toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color var(--transition);
}

.input-toggle-password:hover { color: var(--text-primary); }

/* Calculator input */
.calc-input-wrap {
  position: relative;
}

.calc-display {
  width: 100%;
  padding: 16px 120px 16px 16px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 28px;
  font-weight: 800;
  font-family: var(--font);
  text-align: left;
  outline: none;
  transition: all var(--transition);
}

.calc-display:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
}

.calc-currency {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-muted);
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.calc-btn {
  aspect-ratio: 1.2;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
  display: flex;
  align-items: center;
  justify-content: center;
}

.calc-btn:active {
  transform: scale(0.95);
  background: var(--bg-card-hover);
}

.calc-btn.operator {
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent-light);
  border-color: rgba(var(--accent-rgb), 0.2);
}

.calc-btn.equals {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3);
}

.calc-btn.backspace {
  background: rgba(var(--danger-rgb), 0.1);
  color: var(--danger);
  border-color: rgba(var(--danger-rgb), 0.2);
}

.calc-btn.zero { grid-column: span 2; aspect-ratio: auto; padding: 12px; }

/* Checkbox */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
}

.checkbox-input { display: none; }

.checkbox-custom {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border-strong);
  background: var(--bg-input);
  flex-shrink: 0;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkbox-input:checked + .checkbox-custom {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-input:checked + .checkbox-custom::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: 700;
}

/* Toggle switch */
.toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

.toggle-info { flex: 1; }
.toggle-label { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.toggle-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.toggle {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle input { display: none; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border-strong);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: var(--radius-full);
  transition: transform var(--transition);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

/* Color picker */
.color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-option {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  cursor: pointer;
  border: 3px solid transparent;
  transition: all var(--transition);
  position: relative;
}

.color-option.selected {
  border-color: white;
  transform: scale(1.15);
}

.color-option::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  font-weight: 700;
  opacity: 0;
  transition: opacity var(--transition);
}

.color-option.selected::after { opacity: 1; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  outline: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  opacity: 0;
  transition: opacity var(--transition);
}

.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.4);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #16a34a);
  color: white;
  box-shadow: 0 4px 12px rgba(var(--success-rgb), 0.3);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: white;
  box-shadow: 0 4px 12px rgba(var(--danger-rgb), 0.3);
}

.btn-ghost {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

.btn-outline:hover {
  background: rgba(var(--accent-rgb), 0.1);
}

.btn-full { width: 100%; }
.btn-lg { padding: 14px 24px; font-size: 16px; border-radius: var(--radius-lg); }
.btn-sm { padding: 7px 14px; font-size: 12px; border-radius: var(--radius-sm); }

.btn-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.btn-icon-round {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.btn-icon-round:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: rotate(15deg);
}

/* ── FAB ── */
.fab {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom));
  right: 20px;
  width: var(--fab-size);
  height: var(--fab-size);
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  z-index: 500;
  box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.5);
  transition: all var(--transition-spring);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fab:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 32px rgba(var(--accent-rgb), 0.6);
}

.fab.open {
  transform: rotate(45deg);
  background: linear-gradient(135deg, var(--danger), #dc2626);
}

.fab-icon { transition: transform var(--transition); }

.fab-menu {
  position: fixed;
  bottom: calc(24px + var(--fab-size) + 12px + env(safe-area-inset-bottom));
  right: 20px;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  z-index: 499;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition);
}

.fab-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.fab-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  justify-content: flex-end;
  animation: fabItemIn 0.3s ease both;
}

@keyframes fabItemIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.fab-item-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: white;
  box-shadow: var(--shadow-md);
}

.fab-item-label {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  white-space: nowrap;
  font-family: var(--font);
}

.fab-overlay {
  position: fixed;
  inset: 0;
  z-index: 498;
  display: none;
}

.fab-overlay.active { display: block; }

/* ── MODALS ── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.modal.open {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
}

.modal-sheet {
  position: relative;
  width: 100%;
  max-width: 600px;
  max-height: 92dvh;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding-bottom: env(safe-area-inset-bottom);
  transform: translateY(100%);
  transition: transform var(--transition-spring);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal.open .modal-sheet {
  transform: translateY(0);
}

.modal-dialog {
  position: relative;
  width: calc(100% - 32px);
  max-width: 400px;
  border-radius: var(--radius-xl);
  padding: 24px;
  transform: scale(0.9) translateY(20px);
  transition: transform var(--transition-spring);
  text-align: center;
  margin: auto;
}

.modal.open .modal-dialog {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-drag-handle {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 4px;
  background: var(--border-strong);
  border-radius: var(--radius-full);
}

.modal-title {
  flex: 1;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.modal-close:hover { background: var(--bg-card-hover); color: var(--text-primary); }

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.modal-body::-webkit-scrollbar { width: 4px; }
.modal-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Dialog */
.dialog-icon { font-size: 48px; margin-bottom: 12px; }
.dialog-title { font-size: 20px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.dialog-text { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; line-height: 1.6; }
.dialog-actions { display: flex; gap: 12px; justify-content: center; }

/* ── TOASTS ── */
.toast-container {
  position: fixed;
  top: max(80px, calc(64px + env(safe-area-inset-top)));
  right: 16px;
  left: 16px;
  max-width: 400px;
  margin: 0 auto;
  z-index: 3000;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-md);
  pointer-events: all;
  transform: translateX(calc(100% + 20px));
  transition: transform var(--transition-spring), opacity 0.3s;
  opacity: 0;
}

.toast.show { transform: translateX(0); opacity: 1; }
.toast.hide { transform: translateX(calc(100% + 20px)); opacity: 0; }

.toast-icon { font-size: 20px; flex-shrink: 0; }
.toast-content { flex: 1; }
.toast-title { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.toast-message { font-size: 12px; color: var(--text-secondary); margin-top: 1px; }

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info { border-left: 3px solid var(--info); }

/* ── LOGIN PAGE ── */
.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.login-orb {
  position: absolute;
  border-radius: var(--radius-full);
  filter: blur(80px);
  opacity: 0.5;
  animation: orbFloat 8s ease-in-out infinite;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.4), transparent);
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}

.orb-2 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(var(--success-rgb), 0.3), transparent);
  bottom: -50px;
  right: -50px;
  animation-delay: -3s;
}

.orb-3 {
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(var(--warning-rgb), 0.2), transparent);
  top: 50%;
  left: 50%;
  animation-delay: -6s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

.login-container {
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}

.login-card {
  padding: 32px 28px;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.logo-icon {
  font-size: 56px;
  margin-bottom: 12px;
  display: block;
  animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.logo-title {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.logo-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

.login-form .form-group { margin-bottom: 20px; }

.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: 20px;
}

.alert-error {
  background: rgba(var(--danger-rgb), 0.1);
  border: 1px solid rgba(var(--danger-rgb), 0.3);
  color: var(--danger);
}

.alert-icon { font-size: 18px; }

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.login-footer {
  margin-top: 24px;
  text-align: center;
}

.login-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── SETTINGS ── */
.settings-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  overflow: hidden;
}

.settings-section-title {
  padding: 14px 16px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--border);
}

.settings-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}

.settings-item:last-child { border-bottom: none; }
.settings-item:hover { background: var(--bg-card-hover); }

.settings-item-icon {
  font-size: 22px;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.settings-item-info { flex: 1; }
.settings-item-label { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.settings-item-value { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

.settings-item-action {
  color: var(--text-muted);
  font-size: 18px;
}

/* Avatar uploader */
.avatar-uploader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px;
}

.avatar-preview {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 700;
  color: white;
  position: relative;
  overflow: hidden;
  border: 3px solid rgba(var(--accent-rgb), 0.4);
  cursor: pointer;
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-edit-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.avatar-preview:hover .avatar-edit-overlay { opacity: 1; }

/* ── NOTIFICATIONS ── */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.notif-item.unread {
  border-left: 3px solid var(--accent);
  background: rgba(var(--accent-rgb), 0.04);
}

.notif-item:hover { background: var(--bg-card-hover); }

.notif-item-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.notif-item-content { flex: 1; min-width: 0; }
.notif-item-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 3px; }
.notif-item-message { font-size: 13px; color: var(--text-secondary); line-height: 1.4; }
.notif-item-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.notif-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 6px;
}

/* ── USERS PAGE ── */
.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 8px;
  transition: all var(--transition);
}

.user-card:hover {
  border-color: rgba(var(--accent-rgb), 0.3);
  transform: translateY(-1px);
}

.user-card-avatar {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
}

.user-card-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-card-info { flex: 1; min-width: 0; }
.user-card-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.user-card-login { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.user-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.role-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.role-badge.owner {
  background: rgba(var(--warning-rgb), 0.15);
  color: var(--warning);
  border: 1px solid rgba(var(--warning-rgb), 0.3);
}

.role-badge.member {
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--accent-light);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
}

/* ── MISC ── */
.page-top-actions {
  margin-bottom: 16px;
  display: flex;
  justify-content: flex-end;
}

.page-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.search-box {
  position: relative;
  flex: 1;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: all var(--transition);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
}

.filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.filter-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-light);
  cursor: pointer;
}

.filter-chip:hover { background: rgba(var(--accent-rgb), 0.2); }

.empty-state {
  text-align: center;
  padding: 48px 20px;
}

.empty-state-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.5; }
.empty-state-title { font-size: 18px; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state-text { font-size: 14px; color: var(--text-muted); }

.empty-state-sm {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.load-more {
  text-align: center;
  padding: 16px 0;
}

.section-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* Amount display colors */
.amount-income { color: var(--success); }
.amount-expense { color: var(--danger); }
.amount-transfer { color: var(--info); }
.amount-debt { color: var(--warning); }

/* Category chips for transaction form */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.cat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.cat-chip:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.cat-chip.selected {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
}

.cat-chip-icon { font-size: 22px; }

.cat-chip-name {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.2;
  word-break: break-word;
}

/* Tags input */
.tags-input-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  min-height: 48px;
  cursor: text;
  transition: all var(--transition);
}

.tags-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
}

.tag-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  color: white;
}

.tag-badge-remove {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 0 0 2px;
}

.tag-badge-remove:hover { color: white; }

.tags-real-input {
  border: none;
  background: none;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  flex: 1;
  min-width: 100px;
}

/* Type selector */
.type-selector {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
  margin-bottom: 20px;
}

.type-btn {
  flex: 1;
  padding: 8px 4px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
  white-space: nowrap;
}

.type-btn.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.3);
}

.type-btn[data-type="income"].active { background: var(--success); box-shadow: 0 2px 8px rgba(var(--success-rgb), 0.3); }
.type-btn[data-type="expense"].active { background: var(--danger); box-shadow: 0 2px 8px rgba(var(--danger-rgb), 0.3); }
.type-btn[data-type="transfer"].active { background: var(--info); box-shadow: 0 2px 8px rgba(var(--info-rgb), 0.3); }

/* ── RESPONSIVE ── */
@media (min-width: 768px) {
  .sidebar {
    transform: translateX(0);
    position: fixed;
  }

  .main-content {
    margin-left: var(--sidebar-width);
  }

  .sidebar-close,
  .sidebar-overlay,
  .header-menu-btn {
    display: none;
  }

  .page-content {
    padding: 24px;
    padding-bottom: 40px;
  }

  .accounts-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .goals-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .account-card-slide {
    min-width: calc(50% - 6px);
  }

  .fab {
    right: 32px;
    bottom: 32px;
  }
}

@media (min-width: 1024px) {
  :root { --sidebar-width: 300px; }
  .accounts-grid { grid-template-columns: repeat(3, 1fr); }
  .goals-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── ANIMATIONS ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.animate-in { animation: fadeIn 0.3s ease both; }

/* Skeleton loader */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-input) 25%,
    var(--bg-card-hover) 50%,
    var(--bg-input) 75%
  );
  background-size: 200% 100%;
  animation: skeleton 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 20px; width: 60%; margin-bottom: 12px; }
.skeleton-amount { height: 36px; width: 40%; }
.skeleton-circle { border-radius: var(--radius-full); }

/* Pull to refresh */
.ptr-indicator {
  text-align: center;
  padding: 12px;
  color: var(--text-muted);
  font-size: 13px;
  transition: all var(--transition);
}

/* Scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

*::-webkit-scrollbar { width: 4px; height: 4px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Safe areas */
.safe-top { padding-top: env(safe-area-inset-top); }
.safe-bottom { padding-bottom: env(safe-area-inset-bottom); }

/* ── PRINT ── */
@media print {
  .sidebar, .fab, .fab-menu, .glass-header, .modal { display: none !important; }
  .main-content { margin: 0; }
}