:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --bg-dark: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(30, 41, 59, 0.9);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --success: #22c55e;
  --danger: #ef4444;
  --border: rgba(255, 255, 255, 0.1);
  --sidebar-width: 260px;
  --shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --glass-bg: rgba(15, 23, 42, 0.8);
}

/* ============================================
   MULTI-THEME COLOR SCHEMES
   ============================================ */

/* Theme: Emerald Finance */
body.theme-emerald {
  --primary: #10b981;
  --primary-hover: #059669;
  --bg-dark: #064e3b;
  --bg-card: rgba(6, 78, 59, 0.7);
  --bg-card-hover: rgba(6, 78, 59, 0.9);
  --text-main: #ecfdf5;
  --text-muted: #6ee7b7;
  --success: #34d399;
  --danger: #f87171;
  --glass-bg: rgba(6, 78, 59, 0.8);
  background-image:
    radial-gradient(circle at 0% 0%, rgba(16, 185, 129, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(52, 211, 153, 0.15) 0%, transparent 50%);
}

/* Theme: Cyberpunk Neon */
body.theme-cyberpunk {
  --primary: #f43f5e;
  --primary-hover: #e11d48;
  --bg-dark: #09090b;
  --bg-card: rgba(24, 24, 27, 0.8);
  --bg-card-hover: rgba(39, 39, 42, 0.9);
  --text-main: #fafafa;
  --text-muted: #a1a1aa;
  --success: #2dd4bf;
  --danger: #ef4444;
  --border: rgba(244, 63, 94, 0.2);
  --glass-bg: rgba(9, 9, 11, 0.8);
  background-image:
    radial-gradient(circle at 0% 0%, rgba(244, 63, 94, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(45, 212, 191, 0.15) 0%, transparent 50%);
}

/* Theme: Deep Ocean */
body.theme-ocean {
  --primary: #0ea5e9;
  --primary-hover: #0284c7;
  --bg-dark: #082f49;
  --bg-card: rgba(12, 74, 110, 0.7);
  --bg-card-hover: rgba(12, 74, 110, 0.9);
  --text-main: #f0f9ff;
  --text-muted: #7dd3fc;
  --success: #22c55e;
  --danger: #f43f5e;
  --glass-bg: rgba(8, 47, 73, 0.8);
  background-image:
    radial-gradient(circle at 0% 0%, rgba(14, 165, 233, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(56, 189, 248, 0.1) 0%, transparent 50%);
}

/* Theme: Sunset Orange */
body.theme-sunset {
  --primary: #f97316;
  --primary-hover: #ea580c;
  --bg-dark: #431407;
  --bg-card: rgba(67, 20, 7, 0.7);
  --bg-card-hover: rgba(124, 45, 18, 0.8);
  --text-main: #fff7ed;
  --text-muted: #fdba74;
  --success: #4ade80;
  --danger: #ef4444;
  --glass-bg: rgba(67, 20, 7, 0.8);
  background-image:
    radial-gradient(circle at 0% 0%, rgba(249, 115, 22, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(234, 179, 8, 0.1) 0%, transparent 50%);
}

html {
  scroll-behavior: smooth;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Outfit", sans-serif;
}

/* Type Toggle / Segmented Control */
.type-toggle {
  display: flex;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  overflow: hidden;
  padding: 4px;
}

.type-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: transparent;
  border: none;
  border-radius: 0.4rem;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.type-btn.active[data-value="expense"] {
  background: var(--danger);
  color: white;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.type-btn.active[data-value="income"] {
  background: var(--success);
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  color-scheme: dark;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 0% 0%,
      rgba(99, 102, 241, 0.1) 0%,
      transparent 50%),
    radial-gradient(circle at 100% 100%,
      rgba(168, 85, 247, 0.1) 0%,
      transparent 50%);
  min-height: 100vh;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(99, 102, 241, 0.15);
}

/* ============================================
   PREFERS REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================
   AUTH SCREEN STYLES
   ============================================ */

.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.auth-bg-effects {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: orbFloat 8s ease-in-out infinite;
}

.auth-orb-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.6), transparent);
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}

.auth-orb-2 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.5), transparent);
  bottom: -50px;
  right: -50px;
  animation-delay: -3s;
}

.auth-orb-3 {
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.4), transparent);
  top: 50%;
  left: 60%;
  animation-delay: -5s;
}

@keyframes orbFloat {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  25% {
    transform: translate(30px, -20px) scale(1.1);
  }

  50% {
    transform: translate(-20px, 30px) scale(0.95);
  }

  75% {
    transform: translate(15px, 15px) scale(1.05);
  }
}

.auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  padding: 2rem;
}

.auth-brand {
  text-align: center;
  margin-bottom: 2.5rem;
}

.auth-logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 1.25rem;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  margin-bottom: 1rem;
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
  animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {

  0%,
  100% {
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
  }

  50% {
    box-shadow: 0 8px 48px rgba(99, 102, 241, 0.7);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spin {
  animation: spin 1s linear infinite;
}

.auth-logo-icon i,
.auth-logo-icon svg {
  color: white;
  width: 32px;
  height: 32px;
}

.auth-brand h1 {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-brand p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.auth-card {
  background: rgba(30, 41, 59, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 2.5rem;
  animation: authCardEnter 0.6s ease-out;
}

@keyframes authCardEnter {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-slide-in {
  animation: authCardEnter 0.4s ease-out;
}

.auth-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.auth-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

.auth-error-shake {
  animation: errorShake 0.5s ease-out;
}

@keyframes errorShake {

  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-8px);
  }

  40% {
    transform: translateX(8px);
  }

  60% {
    transform: translateX(-5px);
  }

  80% {
    transform: translateX(5px);
  }
}

.auth-form-group {
  margin-bottom: 1rem;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-wrapper>i,
.auth-input-wrapper>svg {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
  z-index: 2;
}

.auth-input-wrapper input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 3rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s ease;
}

.auth-input-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.auth-input-wrapper input::placeholder {
  color: rgba(148, 163, 184, 0.6);
}

.toggle-password {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  z-index: 2;
  display: flex;
  align-items: center;
}

.toggle-password i,
.toggle-password svg {
  width: 18px;
  height: 18px;
}

.auth-btn-primary {
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: white;
  border: none;
  border-radius: 0.85rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.auth-btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transition: left 0.5s ease;
}

.auth-btn-primary:hover::before {
  left: 100%;
}

.auth-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.auth-btn-primary:active {
  transform: translateY(0);
}

/* Google Config Modal Steps */
.google-config-steps {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.config-step {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.65rem 0;
}

.config-step-number {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 2px;
}

.config-step strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}

.config-step p {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.4;
  margin: 0;
}

.config-step a {
  word-break: break-all;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.google-btn-wrapper {
  width: 100%;
}

.auth-btn-google {
  width: 100%;
  padding: 0.8rem 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: all 0.3s ease;
}

.auth-btn-google:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-link {
  background: transparent;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.2s;
}

.auth-link:hover {
  color: #818cf8;
  text-decoration: underline;
}

/* ============================================
   PROFILE PAGE STYLES
   ============================================ */

.profile-page {
  max-width: 900px;
  margin: 0 auto;
}

.profile-header-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  overflow: hidden;
  margin-bottom: 2rem;
}

.profile-cover {
  height: 140px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6, #ec4899);
  position: relative;
}

.profile-cover::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(transparent, rgba(30, 41, 59, 0.5));
}

.profile-main-info {
  display: flex;
  align-items: flex-end;
  gap: 1.5rem;
  padding: 0 2rem 2rem;
  margin-top: -50px;
  position: relative;
  z-index: 1;
}

.profile-avatar-large {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  border: 4px solid var(--bg-dark);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
}

.profile-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.profile-avatar-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  top: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  cursor: pointer;
  border-radius: 50%;
}

.profile-avatar-overlay i,
.profile-avatar-overlay svg {
  width: 24px;
  height: 24px;
  color: white;
}

.profile-avatar-overlay span {
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-avatar-large:hover .profile-avatar-overlay {
  opacity: 1;
}

.profile-name-section {
  padding-bottom: 0.5rem;
}

.profile-name-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.profile-name-section p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
  margin-top: 0.5rem;
}

.profile-badge i,
.profile-badge svg {
  width: 14px;
  height: 14px;
}

.profile-badge-google {
  background: rgba(52, 168, 83, 0.15);
  color: #34a853;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 2rem;
  backdrop-filter: blur(10px);
}

.profile-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.profile-card-header h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.profile-card-header h3 i,
.profile-card-header h3 svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.profile-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.profile-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.profile-info-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.profile-info-value {
  font-weight: 500;
  font-size: 0.95rem;
}

.profile-form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  justify-content: flex-end;
}

.danger-zone-card {
  border-color: rgba(239, 68, 68, 0.2);
}

.danger-zone-card .profile-card-header h3 {
  color: var(--danger);
}

.danger-zone-card .profile-card-header h3 i,
.danger-zone-card .profile-card-header h3 svg {
  color: var(--danger);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  transform: translateY(-1px);
}

/* ============================================
   AVATAR MODAL STYLES
   ============================================ */

.avatar-modal-body {
  text-align: center;
}

.avatar-preview-container {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.avatar-preview-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  font-weight: 700;
  color: white;
  border: 3px solid var(--border);
  overflow: hidden;
  position: relative;
}

.avatar-preview-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.avatar-option-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border);
  border-radius: 1rem;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  width: 100%;
}

.avatar-option-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--primary);
  transform: translateX(4px);
}

.avatar-option-btn.remove:hover {
  border-color: var(--danger);
}

.avatar-option-icon {
  width: 44px;
  height: 44px;
  border-radius: 0.75rem;
  background: rgba(99, 102, 241, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.avatar-option-icon.camera-icon {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.avatar-option-icon.remove-icon {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.avatar-option-icon i,
.avatar-option-icon svg {
  width: 20px;
  height: 20px;
}

.avatar-option-btn strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.1rem;
}

.avatar-option-btn small {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.camera-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  justify-content: center;
}

/* ============================================
   ORIGINAL APP STYLES
   ============================================ */

.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
  width: var(--sidebar-width);
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  position: fixed;
  height: 100vh;
  z-index: 1000;
  transition: transform 0.3s ease;
}

.sidebar.mobile-active {
  transform: translateX(0);
}

.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 999;
}

.mobile-overlay.active {
  display: block;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 3rem;
  color: var(--primary);
}

.logo-icon {
  width: 32px;
  height: 32px;
}

.nav-menu {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  font-size: 1rem;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.nav-item.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
}

.sidebar-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: 0.75rem;
  transition: background 0.3s ease;
}

.user-profile:hover {
  background: rgba(255, 255, 255, 0.05);
}

.avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  overflow: hidden;
  flex-shrink: 0;
}

.user-info .name {
  display: block;
  font-weight: 500;
}

.user-info .status {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Main Content Area */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem 3rem;
}

.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  gap: 1rem;
}

.menu-toggle {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.75rem;
  border-radius: 0.75rem;
  color: var(--text-main);
  cursor: pointer;
}

.header-search {
  position: relative !important;
  max-width: 400px;
  width: 100%;
}

.header-search i,
.header-search svg {
  position: absolute !important;
  left: 1.1rem !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: var(--text-muted) !important;
  width: 18px !important;
  height: 18px !important;
  pointer-events: none !important;
  margin: 0 !important;
  z-index: 10 !important;
}

.header-search input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 3rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  outline: none;
}

.header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.75rem;
  border-radius: 50%;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--border);
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  backdrop-filter: blur(10px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.35s ease,
    border-color 0.35s ease;
  opacity: 0;
  animation: statCardEnter 0.6s ease-out forwards;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
  transition: left 0.6s ease;
}

.stat-card:hover::after {
  left: 150%;
}

.stat-card:nth-child(1) {
  animation-delay: 0s;
}

.stat-card:nth-child(2) {
  animation-delay: 0.1s;
}

.stat-card:nth-child(3) {
  animation-delay: 0.2s;
}

@keyframes statCardEnter {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.stat-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.15);
}

.stat-card.income:hover {
  box-shadow: 0 12px 32px rgba(34, 197, 94, 0.15),
    0 0 0 1px rgba(34, 197, 94, 0.2);
}

.stat-card.expense:hover {
  box-shadow: 0 12px 32px rgba(239, 68, 68, 0.15),
    0 0 0 1px rgba(239, 68, 68, 0.2);
}

.stat-card.balance:hover {
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.15),
    0 0 0 1px rgba(99, 102, 241, 0.2);
}

.stat-icon {
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.05);
  transition: transform 0.3s ease;
}

.stat-card:hover .stat-icon {
  transform: scale(1.1) rotate(-3deg);
}

.income .stat-icon {
  color: var(--success);
  background: rgba(34, 197, 94, 0.1);
}

.expense .stat-icon {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.balance .stat-icon {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.stat-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Charts */
.charts-container {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: 1.25rem;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  min-height: 400px;
  height: auto;
  max-height: none;
  overflow: visible;
  position: relative;
}

.chart-container-inner {
  flex: 1;
  width: 100%;
  position: relative;
}

.chart-card canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.chart-card h3 {
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 1rem;
}

.chart-card.full-width {
  grid-column: span 2;
}

/* Tables */
.recent-transactions {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 1.25rem;
  border: 1px solid var(--border);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-weight: 500;
}

.table-container {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 1rem;
  color: var(--text-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}

tr:last-child td {
  border-bottom: none;
}

.status-badge {
  padding: 0.35rem 0.75rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-income {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.status-expense {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* Views Visibility */
.content-view {
  display: none;
  animation: viewEnter 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.content-view.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes viewEnter {
  from {
    opacity: 0;
    transform: translateY(16px);
    filter: blur(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* Modals */
.modal {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-content {
  background: #1e293b;
  padding: 2.5rem;
  border-radius: 1.5rem;
  width: 90%;
  max-width: 500px;
  border: 1px solid var(--border);
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 2rem;
  cursor: pointer;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

input,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  color: white;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--primary);
}

.btn-submit {
  width: 100%;
  padding: 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1rem;
}

/* Simulations */
.simulation-controls {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 1rem;
}

.control-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

#sim-expense-range {
  cursor: pointer;
  width: 100%;
}

/* History */
.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.history-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 1.5rem;
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease;
}

.history-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
}

.history-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

.history-card-header h4 {
  font-size: 1.25rem;
  color: var(--primary);
}

.history-stats {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.history-stat-label {
  color: var(--text-muted);
}

.history-stat-value {
  font-weight: 600;
}

/* AI Advisor Styles */
.ai-container {
  max-width: 1000px;
  margin: 0 auto;
}

.ai-hero-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(168, 85, 247, 0.2) 100%);
  border: 1px solid var(--primary);
  border-radius: 2rem;
  padding: 3rem;
  display: flex;
  align-items: center;
  gap: 3rem;
  margin-bottom: 3rem;
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}

.ai-hero-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
  animation: rotate 20s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.ai-avatar-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.ai-icon {
  width: 100%;
  height: 100%;
  color: var(--primary);
  position: relative;
  z-index: 2;
}

.ai-pulse {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary);
  border-radius: 50%;
  filter: blur(20px);
  opacity: 0.3;
  animation: pulse-ai 2s infinite;
}

@keyframes pulse-ai {
  0% {
    transform: scale(0.8);
    opacity: 0.3;
  }

  50% {
    transform: scale(1.2);
    opacity: 0.5;
  }

  100% {
    transform: scale(0.8);
    opacity: 0.3;
  }
}

.ai-hero-content {
  position: relative;
  z-index: 2;
}

.ai-hero-content h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
  background: linear-gradient(to right, #fff, var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ai-hero-content p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 2rem;
  max-width: 500px;
  line-height: 1.6;
}

.ai-analyze-btn {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.ai-insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  animation: fadeIn 0.8s ease-out;
}

.insight-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 2rem;
  border-radius: 1.5rem;
  transition: all 0.3s ease;
}

.insight-card:hover {
  border-color: var(--primary);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.insight-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.insight-icon {
  padding: 0.75rem;
  border-radius: 1rem;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
}

.insight-header h4 {
  font-size: 1.2rem;
  font-weight: 600;
}

.insight-body p {
  color: var(--text-muted);
  line-height: 1.5;
  font-size: 0.95rem;
}

.insight-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.badge-positive {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.badge-warning {
  background: rgba(249, 115, 22, 0.1);
  color: #f97316;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

@media (max-width: 768px) {
  .ai-hero-card {
    flex-direction: column;
    text-align: center;
    padding: 2rem;
    gap: 2rem;
  }

  .ai-hero-content p {
    margin-left: auto;
    margin-right: auto;
  }

  .chart-card {
    height: 300px;
    min-height: auto;
  }
}

/* API Key Input Styling */
.api-key-container {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.api-key-input-wrapper {
  display: flex;
  gap: 0.5rem;
}

.api-key-input {
  flex: 1;
  font-family: monospace;
  font-size: 0.85rem;
  letter-spacing: 2px;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: var(--border);
}

/* Responsiveness - Deep Overhaul */
@media (max-width: 1400px) {
  :root {
    --sidebar-width: 240px;
  }

  .main-content {
    padding: 2rem;
  }
}

@media (max-width: 1200px) {
  .charts-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .chart-card {
    height: 45vh;
    min-height: 380px;
  }

  .chart-card.full-width {
    grid-column: span 1;
  }
}

@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .sidebar {
    width: 80px;
    padding: 2rem 0.5rem;
  }

  .sidebar .logo span,
  .sidebar .nav-item span,
  .sidebar .user-info,
  .sidebar .logo-icon {
    display: none;
  }

  .sidebar .nav-item {
    justify-content: center;
    padding: 1rem;
  }

  .sidebar .logo {
    justify-content: center;
    margin-bottom: 2rem;
  }

  .sidebar .avatar {
    margin: 0 auto;
  }

  .main-content {
    margin-left: 80px;
  }

  .profile-info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: var(--sidebar-width);
    transform: translateX(-100%);
    display: flex !important;
  }

  .sidebar .logo span,
  .sidebar .nav-item span,
  .sidebar .logo-icon {
    display: flex;
  }

  .sidebar .user-info {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 2px !important;
  }

  .sidebar .nav-item {
    justify-content: flex-start;
  }

  .main-content {
    margin-left: 0;
    padding: 1rem;
    padding-top: 5rem;
  }

  .top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 900;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    padding: 1rem;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border);
  }

  .menu-toggle {
    display: flex;
    padding: 0.6rem;
  }

  .header-actions {
    gap: 0.5rem;
  }

  .btn-primary,
  .btn-secondary {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 0.5rem;
  }

  .btn-primary span,
  .btn-secondary span {
    display: none;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    padding: 1.25rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  /* Table Responsiveness */
  .table-container {
    border-radius: 1rem;
    background: rgba(0, 0, 0, 0.2);
  }

  table thead {
    display: none;
  }

  table,
  table tbody,
  table tr,
  table td {
    display: block;
    width: 100%;
  }

  table tr {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 0.75rem;
    border: 1px solid var(--border);
  }

  table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: right;
  }

  table td:last-child {
    border-bottom: none;
  }

  table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-muted);
    text-align: left;
  }

  .chart-card {
    height: 350px;
    min-height: auto;
  }

  .simulation-controls {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  /* Profile Responsive */
  .profile-main-info {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 1.5rem 1.5rem;
  }

  .profile-avatar-large {
    width: 90px;
    height: 90px;
    font-size: 2rem;
  }

  .profile-info-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .profile-form-actions {
    flex-direction: column;
  }

  /* Auth Responsive */
  .auth-container {
    padding: 1rem;
  }

  .auth-card {
    padding: 1.75rem;
  }
}

@media (max-width: 480px) {
  .header-search {
    display: none;
  }

  .btn-primary i,
  .btn-secondary i {
    margin: 0;
  }

  .page-title {
    font-size: 1.25rem;
  }

  .auth-brand h1 {
    font-size: 1.5rem;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Category Separator in Tables */
.category-row {
  background: rgba(99, 102, 241, 0.1) !important;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.75rem;
}

.category-row td {
  padding: 0.5rem 1rem !important;
  border-left: 4px solid var(--primary);
}

.status-badge.status-pending {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.btn-confirm {
  background: var(--success);
  color: white;
  border: none;
  padding: 0.3rem 0.6rem;
  border-radius: 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-confirm:hover {
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}

.unconfirmed-row {
  background: rgba(245, 158, 11, 0.05) !important;
}

/* ============================================
   TABLE TOOLBAR
   ============================================ */
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1rem 1rem 0 0;
  border-bottom: none;
  margin-bottom: 0;
}

.table-toolbar+.table-container.large {
  border-radius: 0 0 1rem 1rem;
  border: 1px solid var(--border);
  border-top: none;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.toolbar-count {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  background: rgba(99, 102, 241, 0.1);
  padding: 0.35rem 0.9rem;
  border-radius: 2rem;
}

.toolbar-right {
  display: flex;
  gap: 0.5rem;
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: 0.65rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
}

.toolbar-btn:hover {
  transform: translateY(-2px);
}

.toolbar-btn-print {
  border-color: rgba(99, 102, 241, 0.3);
  color: var(--primary);
}

.toolbar-btn-print:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.toolbar-btn-excel {
  border-color: rgba(34, 197, 94, 0.3);
  color: var(--success);
}

.toolbar-btn-excel:hover {
  background: rgba(34, 197, 94, 0.15);
  border-color: var(--success);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

.toolbar-btn-csv {
  border-color: rgba(249, 115, 22, 0.3);
  color: #f97316;
}

.toolbar-btn-csv:hover {
  background: rgba(249, 115, 22, 0.15);
  border-color: #f97316;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
}

.toolbar-btn-clear {
  padding: 0.4rem 0.6rem;
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--danger);
  border-radius: 0.5rem;
}

.toolbar-btn-clear:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--danger);
}

/* ============================================
   COLUMN FILTERS
   ============================================ */
.filter-row th {
  padding: 0.4rem 0.5rem 0.65rem;
  border-bottom: 2px solid var(--primary);
}

.column-filter {
  width: 100%;
  padding: 0.45rem 0.65rem !important;
  background: rgba(15, 23, 42, 0.6) !important;
  border: 1px solid var(--border) !important;
  border-radius: 0.5rem !important;
  color: var(--text-main) !important;
  font-size: 0.78rem !important;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.column-filter:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15) !important;
}

.column-filter::placeholder {
  color: rgba(148, 163, 184, 0.5);
}

/* ============================================
   AI CHAT MODAL
   ============================================ */
.ai-chat-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

.ai-chat-overlay.active {
  display: flex;
}

.ai-chat-modal {
  width: 95%;
  max-width: 620px;
  height: 80vh;
  max-height: 700px;
  background: linear-gradient(180deg, #1a1f38 0%, #0f172a 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 1.5rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(99, 102, 241, 0.1);
  animation: chatSlideUp 0.4s ease-out;
}

@keyframes chatSlideUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(99, 102, 241, 0.08);
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.ai-chat-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ai-chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.ai-chat-header h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 0;
}

.ai-chat-status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--success);
}

.ai-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  animation: dotPulse 2s infinite;
}

@keyframes dotPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

.ai-chat-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.ai-chat-close:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--danger);
  color: var(--danger);
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ai-chat-welcome {
  text-align: center;
  padding: 2rem 1rem;
}

.ai-chat-welcome-icon {
  margin-bottom: 1rem;
}

.ai-chat-welcome h4 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(to right, #fff, var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ai-chat-welcome p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  max-width: 400px;
  margin: 0 auto 1.25rem;
}

.ai-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.ai-suggestion-chip {
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: var(--text-main);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-suggestion-chip:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.ai-msg {
  max-width: 85%;
  padding: 0.85rem 1.15rem;
  border-radius: 1.15rem;
  font-size: 0.9rem;
  line-height: 1.55;
  animation: msgAppear 0.3s ease-out;
  word-wrap: break-word;
}

@keyframes msgAppear {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: white;
  border-bottom-right-radius: 0.3rem;
}

.ai-msg-bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-main);
  border-bottom-left-radius: 0.3rem;
}

.ai-msg-bot strong {
  color: var(--primary);
}

.ai-msg-bot em {
  color: #a78bfa;
}

.ai-msg-typing {
  align-self: flex-start;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 1.15rem;
  border-bottom-left-radius: 0.3rem;
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  animation: typingBounce 1.4s infinite both;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

.ai-chat-input-area {
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.7);
}

.ai-chat-input-wrapper {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.ai-chat-input-wrapper input {
  flex: 1;
  padding: 0.85rem 1.15rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.ai-chat-input-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.ai-chat-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s;
  flex-shrink: 0;
}

.ai-chat-send:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.ai-chat-send:active {
  transform: scale(0.95);
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  body {
    background: white !important;
    color: #1a1a1a !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-family: 'Inter', system-ui, sans-serif !important;
  }

  .sidebar,
  .top-header,
  .mobile-overlay,
  .modal,
  .table-toolbar,
  .filter-row,
  .ai-chat-overlay,
  .btn-text,
  .btn-confirm,
  .btn-icon,
  #menu-toggle,
  .simulations-header {
    display: none !important;
  }

  .app-container {
    display: block !important;
  }

  .main-content {
    margin-left: 0 !important;
    padding: 0 !important;
  }

  .content-view {
    display: none !important;
  }

  .content-view#expenses {
    display: block !important;
  }

  .section-header h2 {
    color: #4f46e5 !important;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb !important;
  }

  table {
    border: 1px solid #e5e7eb !important;
    width: 100% !important;
    border-collapse: collapse !important;
  }

  th {
    background: #f3f4f6 !important;
    color: #374151 !important;
    border: 1px solid #e5e7eb !important;
    padding: 0.75rem !important;
    font-size: 0.9rem;
    text-align: left;
    font-weight: 600;
  }

  td {
    border: 1px solid #e5e7eb !important;
    padding: 0.75rem !important;
    color: #4b5563 !important;
    font-size: 0.85rem;
  }

  tr:nth-child(even) {
    background-color: #f9fafb !important;
  }

  .category-row {
    background: #eef2ff !important;
  }

  .category-row td {
    color: #4338ca !important;
    font-weight: 700;
  }

  .table-container {
    overflow: visible;
    border: none !important;
    box-shadow: none !important;
  }

  .status-badge {
    border: 1px solid #d1d5db;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    border-radius: 1rem;
    color: #374151;
  }

  @page {
    margin: 1.5cm;
    size: landscape;
  }
}

/* ============================================
   RESPONSIVE ADJUSTMENTS FOR NEW ELEMENTS
   ============================================ */
@media (max-width: 768px) {
  .table-toolbar {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }

  .toolbar-right {
    justify-content: center;
  }

  .toolbar-btn span {
    display: none;
  }

  .ai-chat-modal {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .ai-suggestion-chip {
    font-size: 0.75rem;
    padding: 0.4rem 0.75rem;
  }

  .filter-row {
    display: none;
  }
}

/* ============================================
   CONVERSATION HISTORY LIST
   ============================================ */
.conv-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.25s ease;
  background: rgba(255, 255, 255, 0.02);
}

.conv-item:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.06);
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.12);
}

.conv-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
}

.conv-details {
  flex: 1;
  min-width: 0;
}

.conv-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-main);
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-preview {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 350px;
}

.conv-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
}

.conv-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.conv-msg-count {
  font-size: 0.65rem;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
  padding: 0.15rem 0.55rem;
  border-radius: 1rem;
}

.conv-delete {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(239, 68, 68, 0.2);
  background: transparent;
  color: rgba(239, 68, 68, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.conv-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--danger);
  color: var(--danger);
}

.conv-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.conv-empty i {
  opacity: 0.3;
  margin-bottom: 1rem;
}

.conv-empty p {
  font-size: 0.9rem;
}

/* ========================================= */
/* GOALS (METAS FINANCEIRAS)                 */
/* ========================================= */
.goal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: 1.25rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.goal-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.goal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.goal-progress-bar-container {
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.goal-card .btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background: transparent;
  transition: all 0.2s;
}

.goal-card .btn-icon:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* ============================================
   FOCUS-VISIBLE STATES (Accessibility)
   ============================================ */
*:focus {
  outline: none;
}

*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

button:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-submit:focus-visible,
.nav-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

input:focus-visible,
select:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* ============================================
   BUTTON RIPPLE EFFECT
   ============================================ */
.btn-primary,
.btn-submit,
.auth-btn-primary {
  position: relative;
  overflow: hidden;
}

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: rippleAnim 0.6s ease-out forwards;
  pointer-events: none;
}

@keyframes rippleAnim {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ============================================
   TOAST NOTIFICATION SYSTEM
   ============================================ */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  pointer-events: auto;
  animation: toastEnter 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  min-width: 280px;
  max-width: 420px;
}

.toast.toast-exit {
  animation: toastExit 0.35s ease-in forwards;
}

@keyframes toastEnter {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastExit {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }
}

.toast-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-icon svg,
.toast-icon i {
  width: 18px;
  height: 18px;
}

.toast.toast-success .toast-icon {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.toast.toast-success {
  border-color: rgba(34, 197, 94, 0.25);
}

.toast.toast-error .toast-icon {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.toast.toast-error {
  border-color: rgba(239, 68, 68, 0.25);
}

.toast.toast-warning .toast-icon {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
}

.toast.toast-warning {
  border-color: rgba(249, 115, 22, 0.25);
}

.toast.toast-info .toast-icon {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
}

.toast.toast-info {
  border-color: rgba(99, 102, 241, 0.25);
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.1rem;
}

.toast-message {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  opacity: 0.5;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.toast-close:hover {
  opacity: 1;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 1rem 1rem;
  animation: toastProgressShrink 3.5s linear forwards;
}

.toast.toast-success .toast-progress {
  background: var(--success);
}

.toast.toast-error .toast-progress {
  background: var(--danger);
}

.toast.toast-warning .toast-progress {
  background: #f97316;
}

.toast.toast-info .toast-progress {
  background: var(--primary);
}

@keyframes toastProgressShrink {
  from {
    width: 100%;
  }

  to {
    width: 0%;
  }
}

/* ============================================
   GOAL PROGRESS BAR ANIMATION
   ============================================ */
.goal-progress-bar-container {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.goal-progress-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), var(--success));
  transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.goal-progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: progressShimmer 2s ease-in-out infinite;
}

@keyframes progressShimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

/* ============================================
   CHART CARD HOVER ENHANCEMENT
   ============================================ */
.chart-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.chart-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.12);
}

/* ============================================
   GRID CARD STAGGER ENTRANCE
   ============================================ */
.history-card,
.insight-card,
.goal-card {
  opacity: 0;
  animation: gridCardEnter 0.5s ease-out forwards;
}

.history-card:nth-child(1),
.insight-card:nth-child(1),
.goal-card:nth-child(1) {
  animation-delay: 0s;
}

.history-card:nth-child(2),
.insight-card:nth-child(2),
.goal-card:nth-child(2) {
  animation-delay: 0.08s;
}

.history-card:nth-child(3),
.insight-card:nth-child(3),
.goal-card:nth-child(3) {
  animation-delay: 0.16s;
}

.history-card:nth-child(4),
.insight-card:nth-child(4),
.goal-card:nth-child(4) {
  animation-delay: 0.24s;
}

.history-card:nth-child(5),
.insight-card:nth-child(5),
.goal-card:nth-child(5) {
  animation-delay: 0.32s;
}

.history-card:nth-child(6),
.insight-card:nth-child(6),
.goal-card:nth-child(6) {
  animation-delay: 0.4s;
}

@keyframes gridCardEnter {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ============================================
   NAV ITEM ENHANCED TRANSITIONS
   ============================================ */
.nav-item {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item i,
.nav-item svg {
  transition: transform 0.25s ease;
}

.nav-item:hover i,
.nav-item:hover svg {
  transform: scale(1.15);
}

.nav-item.active i,
.nav-item.active svg {
  transform: scale(1.1);
}

/* ============================================
   TABLE ROW HOVER
   ============================================ */
@media (min-width: 769px) {
  table tbody tr {
    transition: background 0.2s ease;
  }

  table tbody tr:hover {
    background: rgba(99, 102, 241, 0.04);
  }
}

/* ============================================
   MODAL ENTRANCE ENHANCEMENT
   ============================================ */
.modal.active .modal-content {
  animation: modalEnter 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

}

/* ============================================
   PREMIUM ADVANCED SWITCH & STYLES
   ============================================ */
.premium-switch input:checked + .premium-slider {
  background-color: var(--primary) !important;
}

.premium-switch input:checked + .premium-slider::before {
  transform: translateX(24px) !important;
  background-color: #ffffff !important;
}

.premium-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #94a3b8;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.premium-switch input:focus + .premium-slider {
  box-shadow: 0 0 1px var(--primary);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.advanced-group-section {
  animation: slideDown 0.25s ease-out;
  padding: 10px 0 5px 0;
}

.advanced-group-section .form-row {
  display: flex;
  gap: 12px;
}

.advanced-group-section label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
}

.advanced-group-section select,
.advanced-group-section input {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.advanced-group-section select:focus,
.advanced-group-section input:focus {
  border-color: var(--primary);
}

/* Overdraft glow styling */
.stat-card.overdraft-active {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(15, 23, 42, 0.4) 100%) !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.15) !important;
}

.stat-card.overdraft-active .stat-value {
  color: #f87171 !important;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

/* ============================================
   MOBILE INTERACTIVITY PREMIUM UPGRADES
   ============================================ */

/* iOS Style Bottom Navigation Bar */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 68px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 998;
  justify-content: space-around;
  align-items: center;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.4);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  gap: 3px;
  padding: 6px 10px;
  border-radius: 12px;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  min-width: 62px;
  cursor: pointer;
}

.bottom-nav-item i,
.bottom-nav-item svg {
  width: 20px;
  height: 20px;
  color: #94a3b8;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), color 0.25s ease;
}

.bottom-nav-item:focus {
  outline: none;
}

.bottom-nav-item:active {
  transform: scale(0.92);
}

.bottom-nav-item.active {
  color: var(--primary);
  font-weight: 600;
}

.bottom-nav-item.active i,
.bottom-nav-item.active svg {
  transform: translateY(-3px) scale(1.1);
  color: var(--primary);
}

/* Modals to Bottom Sheets (Mobile iOS style) */
@media (max-width: 768px) {
  .bottom-nav {
    display: flex;
  }

  .main-content {
    padding-bottom: 90px !important;
  }

  .modal {
    align-items: flex-end;
    background: rgba(8, 10, 16, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 24px 24px 0 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
    max-height: 85vh !important;
    margin-bottom: 0 !important;
    padding: 2.2rem 1.25rem 2rem 1.25rem !important;
    position: relative;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  }

  /* IOS indicator pill */
  .modal-content::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 5px;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 3px;
  }

  .modal.active .modal-content {
    transform: translateY(0);
  }

  /* Prevent automatic iOS input zoom */
  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Collapsible table filters in mobile */
  tr.filter-row {
    display: none !important;
    padding: 0.5rem !important;
    background: rgba(15, 23, 42, 0.6) !important;
    border-radius: 8px !important;
    border: 1px dashed var(--border) !important;
    margin-bottom: 1rem !important;
  }

  tr.filter-row.active {
    display: block !important;
  }

  tr.filter-row th {
    display: block !important;
    width: 100% !important;
    padding: 4px 0 !important;
  }

  tr.filter-row th input,
  tr.filter-row th select {
    width: 100% !important;
    background: rgba(15, 23, 42, 0.8) !important;
  }

  tr.filter-row th button {
    width: 100% !important;
    padding: 8px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }
}