/* ============================================
   BUDGENEFITS — Design System
   Kişisel Bütçe Uygulaması
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ── CSS Custom Properties ── */
:root {
  /* Colors */
  /* Colors - Theme Dependent (Dark is default) */
  --bg-primary: #060918;
  --bg-secondary: #0d1129;
  --bg-card: rgba(18, 24, 58, 0.7);
  --bg-card-hover: rgba(24, 32, 72, 0.85);
  --bg-card-solid: #111638;
  --bg-input: rgba(15, 20, 50, 0.8);
  --bg-modal-backdrop: rgba(3, 5, 15, 0.85);
  --text-primary: #e8ecf4;
  --text-secondary: #8892b0;
  --text-muted: #5a6380;
  --border: rgba(136, 146, 176, 0.12);
  --glass-bg: rgba(13, 17, 41, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);

  /* Colors - Fixed Assets */
  --gold: #d4a843;
  --gold-light: #f0d078;
  --gold-dark: #a07830;
  --gold-glow: rgba(212, 168, 67, 0.3);

  --green: #22c55e;
  --green-light: #4ade80;
  --green-dark: #15803d;
  --green-glow: rgba(34, 197, 94, 0.2);

  --red: #ef4444;
  --red-light: #f87171;
  --red-dark: #b91c1c;
  --red-glow: rgba(239, 68, 68, 0.2);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 50%;

  /* Shadows - Layered for Retina */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  --shadow-retina: 
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 4px 6px -1px rgba(0, 0, 0, 0.5), 
    0 2px 4px -1px rgba(0, 0, 0, 0.3), 
    0 20px 25px -5px rgba(0, 0, 0, 0.4), 
    0 10px 10px -5px rgba(0, 0, 0, 0.2);
  
  --shadow-gold: 0 0 20px rgba(212, 168, 67, 0.15), 0 0 40px rgba(212, 168, 67, 0.05);
  --shadow-green: 0 0 20px rgba(34, 197, 94, 0.15), 0 0 40px rgba(34, 197, 94, 0.05);
  --shadow-red: 0 0 20px rgba(239, 68, 68, 0.15), 0 0 40px rgba(239, 68, 68, 0.05);

  /* Glass - Refined */
  --glass-bg: rgba(13, 17, 41, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08); /* High contrast, thin */
  --glass-blur: 40px;
  --glass-shine: linear-gradient(110deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Sidebar */
  --sidebar-width: 260px;
  --tab-bar-height: 72px;
}

/* ── Light Mode Color Overrides ── */
.light-mode {
  --bg-primary: #f0f2f5;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --bg-card-solid: #ffffff;
  --bg-input: #ffffff;
  --bg-modal-backdrop: rgba(0, 0, 0, 0.3);
  --text-primary: #121212;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --border: rgba(0, 0, 0, 0.08);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 0, 0, 0.1);
  --shadow-retina: 0 4px 6px rgba(0,0,0,0.05), 0 10px 15px rgba(0,0,0,0.03);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.011em;
}

/* Background gradient */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(212, 168, 67, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(34, 197, 94, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(59, 130, 246, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

a { color: var(--gold); text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── Layout ── */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── Sidebar (Desktop) ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  padding: var(--space-lg) 0;
  transition: transform var(--transition-base);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center; /* Center the text logo */
  width: 100%;
  padding: 0;
  margin-bottom: var(--space-2xl);
}

.sidebar-logo img {
  width: 200px;
  height: auto;
  border-radius: 0;
}

.sidebar-logo h1 {
  font-size: 1.25rem;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: 0 var(--space-sm);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  background: transparent;
  border: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  text-align: left;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--gold);
  border-radius: 0 2px 2px 0;
  transition: height var(--transition-fast);
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(212, 168, 67, 0.06);
}

.nav-item.active {
  color: var(--gold);
  background: rgba(212, 168, 67, 0.1);
}

.nav-item.active::before {
  height: 60%;
}

.nav-item .nav-icon {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border);
}

.sidebar-footer .reset-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--red);
  background: none;
  border: none;
  font-size: 0.85rem;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
  padding: var(--space-sm) 0;
}

.sidebar-footer .reset-btn:hover {
  opacity: 1;
}

/* ── Main Content ── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: var(--space-xl);
  min-height: 100vh;
}

/* ── Page Sections ── */
.page-section {
  display: none;
  animation: fadeIn 0.35s ease;
}

.page-section.active {
  display: block;
}

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

.page-header {
  margin-bottom: var(--space-xl);
}

.page-header h2 {
  font-size: 1.75rem;
  margin-bottom: var(--space-xs);
}

.page-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ── Cards ── */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition-base);
}

.card:hover {
  border-color: var(--border-gold);
  box-shadow: var(--shadow-gold);
}

.card-grid {
  display: grid;
  gap: var(--space-lg);
}

.card-grid-2 { grid-template-columns: repeat(2, 1fr); }
.card-grid-3 { grid-template-columns: repeat(3, 1fr); }
.card-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Stat Cards ── */
.stat-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}

.stat-card.gold::after { background: linear-gradient(90deg, var(--gold), var(--gold-light)); }
.stat-card.green::after { background: linear-gradient(90deg, var(--green), var(--green-light)); }
.stat-card.red::after { background: linear-gradient(90deg, var(--red), var(--red-light)); }
.stat-card.blue::after { background: linear-gradient(90deg, var(--blue), var(--cyan)); }

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.stat-value.gold { color: var(--gold); }
.stat-value.green { color: var(--green); }
.stat-value.red { color: var(--red); }
.stat-value.blue { color: var(--blue); }

.stat-change {
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change.positive { color: var(--green); }
.stat-change.negative { color: var(--red); }

/* ── Form Elements ── */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.form-input,
.form-select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-select {
  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='%238892b0' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.form-row {
  display: flex;
  gap: var(--space-md);
}

.form-row > * {
  flex: 1;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #000;
  box-shadow: var(--shadow-gold);
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(212, 168, 67, 0.3);
}

.btn-green {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #fff;
  box-shadow: var(--shadow-green);
}

.btn-green:hover {
  background: linear-gradient(135deg, var(--green-light), var(--green));
  transform: translateY(-1px);
}

.btn-red {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff;
  box-shadow: var(--shadow-red);
}

.btn-red:hover {
  background: linear-gradient(135deg, var(--red-light), var(--red));
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(212, 168, 67, 0.06);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
  font-size: 1.1rem;
}

.btn-block {
  width: 100%;
}

/* ── Lists (Income/Expense items) ── */
.item-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.item-entry {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.item-entry:hover {
  border-color: var(--border-gold);
}

.item-entry .light-mode .logo-nefit {
  color: #1a1a1a;
}

/* Financial Status Readability in Light Mode */
.light-mode .ticker-bar {
  background: #f8fafc !important;
  border: 1px solid rgba(0,0,0,0.06) !important;
}

.light-mode .ticker-bar .ticker-label {
  color: #1e293b !important;
  font-weight: 600 !important;
}

.item-entry .item-info {
  flex: 1;
}

.item-entry .item-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.item-entry .item-detail {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.item-entry .item-amount {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
}

.item-entry .item-amount.income { color: var(--green); }
.item-entry .item-amount.expense { color: var(--red); }

.item-entry .item-actions {
  display: flex;
  gap: var(--space-xs);
}

.item-entry .item-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(212, 168, 67, 0.15);
  color: var(--gold);
  font-weight: 500;
}

/* ── Chart Containers ── */
.chart-container {
  position: relative;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.chart-container canvas {
  max-height: 350px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.chart-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
}

/* ── Ticker (live per-second) ── */
.ticker-bar {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  background: linear-gradient(135deg, rgba(18, 24, 58, 0.8), rgba(12, 16, 42, 0.9));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
  overflow: hidden;
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  white-space: nowrap;
  font-size: 0.85rem;
}

.ticker-item .ticker-label {
  color: var(--text-secondary);
}

.ticker-item .ticker-value {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
}

/* ── Modal System ── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-modal-backdrop);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  padding: var(--space-lg);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: transform var(--transition-base);
  box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}

.modal-header h3 {
  font-size: 1.25rem;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--red);
  color: var(--red);
}

.modal-footer {
  display: flex;
  gap: var(--space-md);
  justify-content: flex-end;
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

/* Modal scrollbar */
.modal-content::-webkit-scrollbar { width: 6px; }
.modal-content::-webkit-scrollbar-track { background: transparent; }
.modal-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Condition Preview Bar Chart ── */
.condition-preview {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-md);
}

.condition-preview .preview-title {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.condition-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 120px;
  padding-top: var(--space-sm);
}

.condition-bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  min-height: 4px;
  transition: height 0.5s ease;
  position: relative;
}

.condition-bar.income { background: linear-gradient(to top, var(--green-dark), var(--green)); }
.condition-bar.expense { background: linear-gradient(to top, var(--red-dark), var(--red)); }

.condition-bar .bar-label {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.condition-bar .bar-value {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  color: var(--text-secondary);
  white-space: nowrap;
  font-weight: 600;
}

/* ── Slider ── */
.range-slider {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  outline: none;
  transition: opacity var(--transition-fast);
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--gold);
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 10px var(--gold-glow);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.range-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--gold);
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 10px var(--gold-glow);
  cursor: pointer;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-sm);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Health Score Gauge ── */
.health-gauge {
  width: 200px;
  height: 200px;
  margin: 0 auto var(--space-lg);
  position: relative;
}

.health-gauge svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.health-gauge .gauge-bg {
  fill: none;
  stroke: rgba(255,255,255,0.05);
  stroke-width: 12;
}

.health-gauge .gauge-fill {
  fill: none;
  stroke-width: 12;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease, stroke 0.5s ease;
}

.health-gauge .gauge-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.health-gauge .gauge-score {
  font-family: 'Outfit', sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
}

.health-gauge .gauge-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── Alert Cards ── */
.alert-card {
  display: flex;
  align-items: start;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  border-left: 3px solid;
}

.alert-card.alert-danger {
  background: rgba(239, 68, 68, 0.08);
  border-color: var(--red);
}

.alert-card.alert-warning {
  background: rgba(234, 179, 8, 0.08);
  border-color: var(--yellow);
}

.alert-card.alert-success {
  background: rgba(34, 197, 94, 0.08);
  border-color: var(--green);
}

.alert-card.alert-info {
  background: rgba(59, 130, 246, 0.08);
  border-color: var(--blue);
}

.alert-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.alert-text {
  font-size: 0.9rem;
  line-height: 1.5;
}

.alert-text strong {
  display: block;
  margin-bottom: 2px;
}

/* ── Status indicator ── */
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  display: inline-block;
  animation: pulse 2s infinite;
}

.status-dot.healthy { background: var(--green); box-shadow: 0 0 8px var(--green-glow); }
.status-dot.warning { background: var(--yellow); box-shadow: 0 0 8px rgba(234,179,8,0.3); }
.status-dot.danger { background: var(--red); box-shadow: 0 0 8px var(--red-glow); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ── Scenario Cards (Playground) ── */
.scenario-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
}

.scenario-card.virtual {
  border-color: rgba(168, 85, 247, 0.3);
  border-style: dashed;
}

.scenario-card.virtual::before {
  content: 'SANAL';
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  font-size: 0.65rem;
  padding: 2px 8px;
  background: rgba(168, 85, 247, 0.2);
  color: var(--purple);
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 1px;
}

/* ── Tabs (within pages) ── */
.tab-group {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-md);
  padding: 4px;
}

.tab-btn {
  flex: 1;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--gold);
}

.tab-btn:hover:not(.active) {
  color: var(--text-primary);
}

/* ── Toast Notifications ── */
.toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease;
  min-width: 280px;
}

.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--blue); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-state p {
  font-size: 0.95rem;
  margin-bottom: var(--space-lg);
}

/* ── Section Divider ── */
.section-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-xl) 0;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.section-divider span {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(136, 146, 176, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(136, 146, 176, 0.3); }

/* ── Exchange Rate Bar ── */
.exchange-bar {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}

.exchange-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
}

.exchange-item .ex-label {
  color: var(--text-muted);
}

.exchange-item .ex-value {
  color: var(--gold);
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
}

/* ── Count Up Animation ── */
.count-up {
  transition: all 0.5s ease;
}

/* ── Milestone Cards ── */
.milestone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
}

.milestone-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  text-align: center;
}

.milestone-period {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.milestone-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
}

/* ── Mobile Bottom Tab Bar ── */
.mobile-tab-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--tab-bar-height);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding: var(--space-sm) 0;
  padding-bottom: env(safe-area-inset-bottom, 8px);
}

.mobile-tab-bar .tab-items {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 100%;
}

.mobile-tab-bar .tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  min-width: 0;
}

.mobile-tab-bar .tab-item .tab-icon {
  font-size: 1.3rem;
}

.mobile-tab-bar .tab-item.active {
  color: var(--gold);
}

.mobile-tab-bar .tab-item.active .tab-icon {
  transform: scale(1.1);
}

/* ── Loading Spinner ── */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .card-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .card-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .mobile-tab-bar {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding: var(--space-md);
    padding-bottom: calc(var(--tab-bar-height) + var(--space-lg));
  }

  .card-grid-2,
  .card-grid-3,
  .card-grid-4 {
    grid-template-columns: 1fr;
  }

  .form-row {
    flex-direction: column;
  }

  .page-header h2 {
    font-size: 1.35rem;
  }

  .stat-value {
    font-size: 1.4rem;
  }

  .modal-content {
    max-width: 100%;
    margin: var(--space-md);
    padding: var(--space-lg);
    max-height: 90vh;
  }

  .ticker-bar {
    flex-wrap: wrap;
    gap: var(--space-md);
  }

  .exchange-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .toast-container {
    top: auto;
    bottom: calc(var(--tab-bar-height) + var(--space-md));
    right: var(--space-md);
    left: var(--space-md);
  }

  .toast {
    min-width: auto;
  }
}

@media (max-width: 480px) {
  .stat-value {
    font-size: 1.2rem;
  }

  .mobile-tab-bar .tab-item {
    font-size: 0.6rem;
  }

  .mobile-tab-bar .tab-item .tab-icon {
    font-size: 1.1rem;
  }
}

/* ── Utility Classes ── */
.text-gold { color: var(--gold); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.hidden { display: none !important; }

/* ════════════════════════════════════════════
   LANDING PAGE
   ════════════════════════════════════════════ */

.landing-page {
  min-height: 100vh;
  background: var(--bg-primary);
  position: relative;
  z-index: 1;
}

/* Hero */
.landing-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  position: relative;
  overflow: hidden;
}

.landing-hero::before {
  content: '';
  position: absolute;
  top: -30%;
  left: -10%;
  width: 60%;
  height: 80%;
  background: radial-gradient(ellipse, rgba(212,168,67,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.landing-hero::after {
  content: '';
  position: absolute;
  bottom: -20%;
  right: -10%;
  width: 50%;
  height: 70%;
  background: radial-gradient(ellipse, rgba(34,197,94,0.05) 0%, transparent 70%);
  pointer-events: none;
}

.landing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  max-width: 1100px;
  width: 100%;
  position: relative;
  z-index: 2;
}

/* Left: Info */
.landing-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
}

.landing-brand img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
}

.landing-brand h1 {
  font-size: 2rem;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-headline {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: var(--space-lg);
}

.landing-headline .accent {
  background: linear-gradient(135deg, var(--gold), var(--green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-2xl);
}

.landing-features {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.landing-feature {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: rgba(18,24,58,0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.landing-feature .feat-icon {
  font-size: 1.4rem;
  width: 40px;
  text-align: center;
  flex-shrink: 0;
}

.landing-feature .feat-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.landing-feature .feat-text strong {
  color: var(--text-primary);
  display: block;
  margin-bottom: 2px;
}

/* Right: Auth */
.landing-auth {
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
}

.auth-card h2 {
  font-size: 1.5rem;
  margin-bottom: var(--space-xs);
}

.auth-card .auth-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: var(--space-xl);
}

.auth-card .auth-toggle {
  text-align: center;
  margin-top: var(--space-lg);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.auth-card .auth-toggle a {
  color: var(--gold);
  font-weight: 600;
}

.auth-card .auth-toggle a:hover {
  text-decoration: underline;
}

.auth-card .auth-forgot {
  text-align: right;
  margin-top: calc(-1 * var(--space-sm));
  margin-bottom: var(--space-md);
}

.auth-card .auth-forgot a {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.auth-card .auth-forgot a:hover {
  color: var(--gold);
}

/* Mobile landing */
@media (max-width: 768px) {
  .landing-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
  .landing-hero {
    padding: var(--space-lg);
    min-height: auto;
    padding-top: 60px;
    padding-bottom: 60px;
  }
  .landing-headline { font-size: 1.8rem; }
  .landing-subtitle { font-size: 0.95rem; }
  .auth-card { max-width: 100%; }
}

/* ════════════════════════════════════════════
   TIER BADGES
   ════════════════════════════════════════════ */

.tier-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.tier-badge.tier-admin {
  background: rgba(212,168,67,0.2);
  color: var(--gold);
  border: 1px solid rgba(212,168,67,0.3);
}

.tier-badge.tier-pro {
  background: rgba(168,85,247,0.2);
  color: var(--purple);
  border: 1px solid rgba(168,85,247,0.3);
}

.tier-badge.tier-lite {
  background: rgba(59,130,246,0.15);
  color: var(--blue);
  border: 1px solid rgba(59,130,246,0.2);
}

/* Sidebar user info */
.sidebar-user {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.sidebar-user .user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #000;
  flex-shrink: 0;
}

.sidebar-user .user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user .user-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ════════════════════════════════════════════
   ADMIN PANEL
   ════════════════════════════════════════════ */

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table th {
  text-align: left;
  padding: var(--space-md);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: var(--space-md);
  border-bottom: 1px solid rgba(136,146,176,0.06);
  color: var(--text-primary);
}

.admin-table tr:hover td {
  background: rgba(212,168,67,0.03);
}

.admin-textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  resize: vertical;
  outline: none;
  font-family: inherit;
}

.admin-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

/* ── Plan Switcher (Home Page) ── */
.plan-switcher-list {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  overflow-x: auto;
  padding-bottom: var(--space-sm);
}

/* Scrollbar for plan list */
.plan-switcher-list::-webkit-scrollbar { height: 6px; }
.plan-switcher-list::-webkit-scrollbar-track { background: transparent; }
.plan-switcher-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.plan-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  min-width: 220px;
  max-width: 260px;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  display: flex;
  flex-direction: column;
}

.plan-chip:hover {
  border-color: var(--border-gold);
  background: var(--bg-card-hover);
}

.plan-chip-active {
  background: rgba(212, 168, 67, 0.08);
  border-color: var(--gold);
  cursor: default;
}

.plan-chip-active:hover {
  background: rgba(212, 168, 67, 0.08);
}

.plan-chip-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.plan-chip-active .plan-chip-name {
  color: var(--gold);
}

.plan-chip-detail {
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex-grow: 1;
}

.plan-chip-switch {
  margin-top: var(--space-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold);
  text-align: right;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.plan-chip:hover .plan-chip-switch {
  opacity: 1;
}

.plan-chip-badge {
  margin-top: var(--space-sm);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--gold);
  color: #000;
  padding: 2px 8px;
  border-radius: 999px;
  align-self: flex-start;
}

.plan-add-btn {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 100%;
  text-align: center;
}

.plan-add-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(212, 168, 67, 0.05);
}

/* ── Pulse Flash Animation (Dashboard real-time) ── */
@keyframes pulseFlash {
  0% { text-shadow: none; }
  50% { text-shadow: 0 0 12px rgba(212, 168, 67, 0.6); }
  100% { text-shadow: none; }
}

.pulse-flash {
  animation: pulseFlash 0.6s ease;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.pulse-value {
  animation: pulseGlow 2s ease-in-out infinite;
}

/* ── Custom Milestone Styles ── */
.milestone-custom {
  border-color: var(--gold) !important;
  background: rgba(212, 168, 67, 0.05) !important;
}

.milestone-remove {
  cursor: pointer;
  color: var(--red);
  font-size: 1rem;
  font-weight: bold;
  margin-left: 4px;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.milestone-remove:hover {
  opacity: 1;
}

.milestone-add {
  cursor: pointer;
  border: 2px dashed var(--border) !important;
  background: transparent !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  transition: all var(--transition-fast);
}

.milestone-add:hover {
  border-color: var(--gold) !important;
  background: rgba(212, 168, 67, 0.05) !important;
}
/* ─────────────────────────────────────────────────────────────────────────────
   MOBILE RESPONSIVENESS (iPhone 14 Pro & Modern Devices)
   ───────────────────────────────────────────────────────────────────────────── */

/* Default hide mobile nav elements on desktop */
.mobile-header, .mobile-bottom-nav { display: none; }

@media (max-width: 991px) {
  :root {
    --sidebar-width: 0px;
    --space-xl: 1.25rem;
  }

  .sidebar { 
    transform: translateX(-100%);
    display: none; 
  }

  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    padding: calc(60px + env(safe-area-inset-top)) var(--space-md) calc(80px + env(safe-area-inset-bottom)) var(--space-md) !important;
  }

  /* Mobile Header */
  .mobile-header {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding-top: env(safe-area-inset-top);
  }

  /* Bottom Nav */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  }

  .m-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 500;
    gap: 4px;
    transition: all 0.2s;
  }

  .m-nav-item.active {
    color: var(--gold);
  }

  .m-nav-icon {
    font-size: 1.35rem;
  }

  /* Responsive Grids */
  .card-grid, .card-grid-3, .card-grid-4 {
    grid-template-columns: 1fr !important;
    gap: var(--space-md) !important;
  }

  .stat-card {
    padding: var(--space-lg) !important;
  }

  .stat-value {
    font-size: 1.5rem !important;
  }

  /* Ticker Bar adjustments */
  .ticker-bar {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 8px;
    padding: 12px !important;
  }
  .ticker-item:last-child {
    margin-left: 0 !important;
  }

  /* Page Header */
  .page-header {
    margin-bottom: var(--space-lg) !important;
  }
  .page-header-title {
    font-size: 1.5rem !important;
  }

  /* Modal Mobile Fix */
  .modal-content {
    width: 95% !important;
    max-height: 90vh;
    padding: var(--space-lg) !important;
    margin: 10px auto !important;
  }
}
