/* ============================================================
   FinTrack360 — GLOBAL STYLESHEET
   File: assets/css/app.css
   Dark theme • Glassmorphism • Indian finance aesthetic
   Fonts: Clash Display (headings) + Satoshi (body)
   ============================================================ */

/* ── GOOGLE FONTS IMPORT ──────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&display=swap');
@import url('https://api.fontshare.com/v2/css?f[]=clash-display@400,500,600,700&f[]=satoshi@300,400,500,700&display=swap');

/* ════════════════════════════════════════════════════════════
   CSS CUSTOM PROPERTIES (Design Tokens)
   ════════════════════════════════════════════════════════════ */
:root {
  /* Backgrounds */
  --bg-base:        #06080F;
  --bg-card:        #0C1018;
  --bg-card-hover:  #111620;
  --bg-elevated:    #141B26;
  --bg-input:       rgba(255,255,255,0.04);
  --bg-sidebar:     rgba(6,8,15,0.98);

  /* Borders */
  --border:         rgba(255,255,255,0.07);
  --border-focus:   rgba(99,102,241,0.5);
  --border-accent:  rgba(99,102,241,0.2);

  /* Brand Colors */
  --indigo:         #6366F1;
  --indigo-light:   #818CF8;
  --indigo-dim:     rgba(99,102,241,0.15);
  --violet:         #8B5CF6;
  --violet-dim:     rgba(139,92,246,0.15);

  /* Semantic Colors */
  --green:          #10B981;
  --green-dim:      rgba(16,185,129,0.12);
  --red:            #EF4444;
  --red-dim:        rgba(239,68,68,0.12);
  --yellow:         #F59E0B;
  --yellow-dim:     rgba(245,158,11,0.12);
  --orange:         #F97316;
  --orange-dim:     rgba(249,115,22,0.12);
  --cyan:           #06B6D4;
  --cyan-dim:       rgba(6,182,212,0.12);
  --pink:           #EC4899;
  --pink-dim:       rgba(236,72,153,0.12);
  --lime:           #84CC16;
  --lime-dim:       rgba(132,204,22,0.12);
  --teal:           #14B8A6;

  /* Text */
  --text-primary:   #E2E8F0;
  --text-secondary: #94A3B8;
  --text-muted:     #475569;
  --text-faint:     #1E293B;
  --text-white:     #FFFFFF;

  /* Sidebar */
  --sidebar-w:      232px;

  /* Radii */
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   20px;
  --r-2xl:  24px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:  0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg:  0 20px 60px rgba(0,0,0,0.5);
  --shadow-glow:0 0 30px rgba(99,102,241,0.25);

  /* Transitions */
  --transition: 0.2s ease;
  --transition-slow: 0.4s ease;

  /* Typography */
  --font-display: 'Clash Display', 'Syne', sans-serif;
  --font-body:    'Satoshi', 'DM Sans', sans-serif;
  --font-mono:    'DM Mono', 'Fira Code', monospace;
}

/* ════════════════════════════════════════════════════════════
   RESET & BASE
   ════════════════════════════════════════════════════════════ */
*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html { scroll-behavior: smooth; }

body {
  background:  var(--bg-base);
  color:       var(--text-secondary);
  font-family: var(--font-body);
  font-size:   15px;
  line-height: 1.6;
  min-height:  100vh;
  overflow-x:  hidden;
}

/* Typography hierarchy */
h1, h2, h3, h4, h5, h6,
.font-display {
  font-family: var(--font-display);
  color:       var(--text-white);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem);   font-weight: 600; }
h3 { font-size: 1.2rem;  font-weight: 600; }
h4 { font-size: 1rem;    font-weight: 600; }

a { color: var(--indigo-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--text-white); }

p { color: var(--text-secondary); }

code, pre, .mono {
  font-family: var(--font-mono);
  font-size:   0.875em;
}

/* ════════════════════════════════════════════════════════════
   SCROLLBAR
   ════════════════════════════════════════════════════════════ */
::-webkit-scrollbar       { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1E293B; border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: #334155; }

/* ════════════════════════════════════════════════════════════
   LAYOUT — SIDEBAR + MAIN
   ════════════════════════════════════════════════════════════ */
.sidebar {
  width:      var(--sidebar-w);
  height:     100vh;
  position:   fixed;
  left:       0; top: 0;
  z-index:    100;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display:    flex;
  flex-direction: column;
  padding:    20px 12px;
  overflow-y: auto;
  transition: transform var(--transition-slow);
}

.main-content {
  margin-left: var(--sidebar-w);
  padding:     28px 32px;
  min-height:  100vh;
}

/* ════════════════════════════════════════════════════════════
   SIDEBAR NAVIGATION
   ════════════════════════════════════════════════════════════ */
.sidebar-brand {
  display:      flex;
  align-items:  center;
  gap:          10px;
  padding:      0 4px;
  margin-bottom: 28px;
  flex-shrink:  0;
}

.sidebar-brand-icon {
  width:  36px; height: 36px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(99,102,241,0.4);
  animation: brandGlow 3s ease infinite;
}

.sidebar-brand-name {
  font-family: var(--font-display);
  font-size:   1.1rem;
  font-weight: 700;
  color:       var(--text-white);
  letter-spacing: -0.03em;
}

.sidebar-brand-name span {
  background: linear-gradient(135deg, var(--indigo-light), #A78BFA, #34D399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-section { margin-bottom: 8px; }

.nav-label {
  font-size:      10px;
  font-weight:    600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color:          var(--text-faint);
  padding:        0 10px;
  margin:         16px 0 4px;
}

.nav-link {
  display:       flex;
  align-items:   center;
  gap:           10px;
  padding:       9px 12px;
  border-radius: var(--r-md);
  color:         var(--text-muted);
  font-size:     13px;
  font-weight:   500;
  transition:    all var(--transition);
  cursor:        pointer;
  border:        1px solid transparent;
  text-decoration: none;
  margin-bottom: 2px;
  white-space:   nowrap;
}

.nav-link:hover {
  background: rgba(99,102,241,0.08);
  color:      var(--text-secondary);
  border-color: var(--border-accent);
}

.nav-link.active {
  background:   var(--indigo-dim);
  color:        var(--text-primary);
  border-color: var(--border-accent);
}

.nav-dot {
  width:  6px; height: 6px;
  border-radius: var(--r-full);
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  font-size:   10px;
  font-weight: 700;
  padding:     2px 7px;
  border-radius: var(--r-full);
  background:  var(--indigo-dim);
  color:       var(--indigo-light);
}

.sidebar-footer {
  margin-top:  auto;
  padding-top: 16px;
  border-top:  1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}

/* Upgrade CTA in sidebar */
.sidebar-upgrade {
  padding:     14px;
  border-radius: var(--r-xl);
  background:  linear-gradient(135deg,rgba(99,102,241,0.18),rgba(139,92,246,0.12));
  border:      1px solid rgba(99,102,241,0.25);
  text-align:  center;
  margin-bottom: 12px;
  text-decoration: none;
  display:     block;
  transition:  all var(--transition);
}

.sidebar-upgrade:hover {
  border-color: rgba(99,102,241,0.5);
  transform:    translateY(-1px);
}

/* ════════════════════════════════════════════════════════════
   CARDS
   ════════════════════════════════════════════════════════════ */
.card {
  background:    var(--bg-card);
  border:        1px solid var(--border);
  border-radius: var(--r-2xl);
  transition:    border-color var(--transition), transform var(--transition);
}

.card:hover  { border-color: rgba(99,102,241,0.2); }
.card.lift:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.card-p   { padding: 20px; }
.card-p-lg{ padding: 28px; }

.glass {
  background:     rgba(12,16,24,0.85);
  border:         1px solid var(--border-accent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Stat card */
.stat-card {
  background:    var(--bg-card);
  border:        1px solid var(--border);
  border-radius: var(--r-xl);
  padding:       20px;
  transition:    all var(--transition);
  position:      relative;
  overflow:      hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent-color, var(--indigo));
  opacity: 0.6;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}

.stat-card:hover {
  border-color: rgba(99,102,241,0.25);
  transform: translateY(-2px);
}

/* Asset card (clickable) */
.asset-card {
  border-radius: var(--r-lg);
  padding:       18px;
  border:        1px solid rgba(255,255,255,0.05);
  background:    rgba(255,255,255,0.02);
  transition:    all 0.25s;
  cursor:        pointer;
}

.asset-card:hover {
  border-color: rgba(99,102,241,0.3);
  background:   rgba(99,102,241,0.05);
  transform:    translateY(-3px);
  box-shadow:   var(--shadow-sm);
}

/* ════════════════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════════════════ */
.btn {
  display:        inline-flex;
  align-items:    center;
  justify-content: center;
  gap:            8px;
  padding:        10px 20px;
  border-radius:  var(--r-md);
  font-family:    var(--font-display);
  font-size:      13px;
  font-weight:    600;
  cursor:         pointer;
  border:         none;
  transition:     all var(--transition);
  text-decoration: none;
  white-space:    nowrap;
  letter-spacing: 0;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  color:      white;
}
.btn-primary:hover {
  transform:  translateY(-2px);
  box-shadow: 0 10px 25px rgba(99,102,241,0.4);
  color:      white;
}

.btn-secondary {
  background:   transparent;
  border:       1px solid var(--border-accent);
  color:        var(--indigo-light);
}
.btn-secondary:hover {
  background:  var(--indigo-dim);
  color:       var(--text-white);
}

.btn-ghost {
  background:  transparent;
  color:       var(--text-muted);
}
.btn-ghost:hover {
  background:  rgba(255,255,255,0.05);
  color:       var(--text-secondary);
}

.btn-danger {
  background: rgba(239,68,68,0.15);
  border:     1px solid rgba(239,68,68,0.3);
  color:      var(--red);
}
.btn-danger:hover { background: rgba(239,68,68,0.25); }

.btn-sm  { padding: 6px 14px; font-size: 12px; border-radius: var(--r-sm); }
.btn-lg  { padding: 14px 28px; font-size: 15px; border-radius: var(--r-lg); }
.btn-xl  { padding: 16px 36px; font-size: 16px; border-radius: var(--r-xl); }
.btn-full{ width: 100%; }

/* Icon button */
.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: var(--r-md);
  background: var(--bg-card);
  border:     1px solid var(--border);
  color:      var(--text-muted);
  display:    flex; align-items: center; justify-content: center;
  cursor:     pointer;
  transition: all var(--transition);
  position:   relative;   /* ← anchor for notification badge */
  overflow:   visible;    /* ← let badge overflow the button bounds */
}
.btn-icon:hover { border-color: var(--border-accent); color: var(--text-white); }

/* ════════════════════════════════════════════════════════════
   FORM ELEMENTS
   ════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }

.form-label {
  display:     block;
  font-size:   12px;
  font-weight: 500;
  color:       var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.form-control {
  width:         100%;
  background:    var(--bg-input);
  border:        1px solid rgba(99,102,241,0.18);
  border-radius: var(--r-md);
  padding:       11px 14px;
  color:         var(--text-white);
  font-size:     14px;
  font-family:   var(--font-body);
  transition:    all var(--transition);
  outline:       none;
}

.form-control:focus {
  border-color: var(--indigo);
  box-shadow:   0 0 0 3px rgba(99,102,241,0.12);
  background:   rgba(99,102,241,0.04);
}

.form-control::placeholder { color: var(--text-faint); }

.form-control:disabled {
  opacity: 0.5;
  cursor:  not-allowed;
}

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

textarea.form-control {
  resize:     vertical;
  min-height: 80px;
}

.form-control.is-error { border-color: var(--red); }
.form-control.is-success { border-color: var(--green); }

.form-error {
  font-size:  11px;
  color:      var(--red);
  margin-top: 4px;
}

.form-hint {
  font-size:  11px;
  color:      var(--text-muted);
  margin-top: 4px;
}

/* Input with prefix (₹) */
.input-group {
  position: relative;
  display:  flex;
  align-items: stretch;
}

.input-prefix, .input-suffix {
  padding:       0 12px;
  background:    rgba(255,255,255,0.04);
  border:        1px solid rgba(99,102,241,0.18);
  color:         var(--text-muted);
  font-size:     14px;
  display:       flex;
  align-items:   center;
  white-space:   nowrap;
}

.input-prefix { border-right: none; border-radius: var(--r-md) 0 0 var(--r-md); }
.input-suffix { border-left: none;  border-radius: 0 var(--r-md) var(--r-md) 0; }

.input-group .form-control {
  border-radius: 0;
  flex: 1;
}
.input-group .form-control:first-child { border-radius: var(--r-md) 0 0 var(--r-md); }
.input-group .form-control:last-child  { border-radius: 0 var(--r-md) var(--r-md) 0; }

/* ════════════════════════════════════════════════════════════
   BADGES
   ════════════════════════════════════════════════════════════ */
.badge {
  display:     inline-flex;
  align-items: center;
  gap:         4px;
  padding:     3px 9px;
  border-radius: var(--r-full);
  font-size:   11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-green   { background: var(--green-dim);  color: var(--green);  }
.badge-red     { background: var(--red-dim);    color: var(--red);    }
.badge-yellow  { background: var(--yellow-dim); color: var(--yellow); }
.badge-blue    { background: var(--indigo-dim); color: var(--indigo-light); }
.badge-violet  { background: var(--violet-dim); color: #A78BFA;       }
.badge-orange  { background: var(--orange-dim); color: var(--orange); }
.badge-cyan    { background: var(--cyan-dim);   color: var(--cyan);   }
.badge-pink    { background: var(--pink-dim);   color: var(--pink);   }
.badge-lime    { background: var(--lime-dim);   color: var(--lime);   }

/* Tax badges */
.badge-eee     { background: rgba(16,185,129,0.15); color: #10B981; border: 1px solid rgba(16,185,129,0.3); }
.badge-taxable { background: var(--red-dim);  color: var(--red);   }
.badge-partial { background: var(--yellow-dim); color: var(--yellow); }

/* Plan badge */
.plan-badge {
  background:  linear-gradient(135deg, var(--indigo), var(--violet));
  color:       white;
  padding:     3px 10px;
  border-radius: var(--r-full);
  font-size:   10px;
  font-weight: 700;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ════════════════════════════════════════════════════════════
   TABLES
   ════════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }

.data-table {
  width:           100%;
  border-collapse: collapse;
}

.data-table th {
  font-size:      11px;
  font-weight:    600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color:          var(--text-faint);
  padding:        10px 16px;
  text-align:     left;
  border-bottom:  1px solid var(--border);
  white-space:    nowrap;
}

.data-table td {
  padding:     13px 16px;
  font-size:   13px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  vertical-align: middle;
}

.data-table tbody tr:hover td {
  background: rgba(99,102,241,0.04);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* ════════════════════════════════════════════════════════════
   PROGRESS BARS
   ════════════════════════════════════════════════════════════ */
.progress-track {
  height:        6px;
  background:    rgba(255,255,255,0.06);
  border-radius: var(--r-full);
  overflow:      hidden;
}

.progress-fill {
  height:        100%;
  border-radius: var(--r-full);
  transition:    width 1s ease;
}

.progress-sm .progress-track { height: 3px; }
.progress-lg .progress-track { height: 10px; }

/* ════════════════════════════════════════════════════════════
   MODAL
   ════════════════════════════════════════════════════════════ */
.modal-overlay {
  position:       fixed;
  inset:          0;
  background:     rgba(0,0,0,0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index:        200;
  display:        flex;
  align-items:    center;
  justify-content: center;
  padding:        20px;
  animation:      overlayIn 0.2s ease;
}

.modal-box {
  background:     var(--bg-card);
  border:         1px solid rgba(99,102,241,0.25);
  border-radius:  var(--r-2xl);
  padding:        0;
  width:          100%;
  max-width:      540px;
  max-height:     90vh;
  overflow-y:     auto;   /* modal itself scrolls */
  overflow-x:     hidden;
  display:        flex;
  flex-direction: column;
  animation:      modalIn 0.25s ease;
  position:       relative;
}
.modal-header {
  padding:         24px 32px 0;
  flex-shrink:     0;
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  margin-bottom:   20px;
  position:        sticky;  /* sticks to top when modal scrolls */
  top:             0;
  background:      var(--bg-card);
  z-index:         1;
}
.modal-body {
  padding:   0 32px 32px;
  flex:      1;
}
/* The fund search dropdown uses position:fixed so it escapes overflow:hidden */
.ac-list {
  position:   fixed !important;  /* KEY: fixed escapes ALL overflow ancestors */
  z-index:    99999 !important;
  background: #0d0e1a;
  border:     1px solid rgba(99,102,241,.55);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0,0,0,.98);
  max-height: 340px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(99,102,241,.3) transparent;
  /* width/top/left set by JS via reposition() */
}

.modal-box.modal-lg { max-width: 720px; }
.modal-box.modal-sm { max-width: 400px; }

.modal-close {
  width:  32px; height: 32px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { color: var(--text-white); border-color: var(--border-accent); }

/* ════════════════════════════════════════════════════════════
   TABS
   ════════════════════════════════════════════════════════════ */
.tabs {
  display:       flex;
  gap:           4px;
  padding:       4px;
  background:    rgba(255,255,255,0.03);
  border:        1px solid var(--border);
  border-radius: var(--r-md);
  width:         fit-content;
}

.tab-btn {
  padding:       7px 14px;
  border-radius: var(--r-sm);
  font-size:     12px;
  font-weight:   500;
  border:        none;
  cursor:        pointer;
  transition:    all var(--transition);
  background:    transparent;
  color:         var(--text-muted);
  font-family:   var(--font-body);
  white-space:   nowrap;
}

.tab-btn:hover  { color: var(--text-secondary); }
.tab-btn.active {
  background:   var(--indigo-dim);
  color:        var(--text-primary);
  border:       1px solid var(--border-accent);
}

/* ════════════════════════════════════════════════════════════
   TOPBAR
   ════════════════════════════════════════════════════════════ */
.topbar {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  margin-bottom:   28px;
  gap:             16px;
}

.topbar-left h1 {
  font-size:   1.4rem;
  font-weight: 700;
  color:       var(--text-white);
  line-height: 1.2;
}

.topbar-left p {
  font-size: 12px;
  color:     var(--text-muted);
  margin-top: 2px;
}

.topbar-right {
  display:     flex;
  align-items: center;
  gap:         10px;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════
   AVATAR
   ════════════════════════════════════════════════════════════ */
.avatar {
  width:          36px; height: 36px;
  border-radius:  var(--r-md);
  background:     linear-gradient(135deg, var(--indigo), var(--violet));
  display:        flex;
  align-items:    center;
  justify-content: center;
  font-size:      13px;
  font-weight:    700;
  font-family:    var(--font-display);
  color:          white;
  flex-shrink:    0;
}

.avatar-sm { width: 28px; height: 28px; font-size: 11px; border-radius: var(--r-sm); }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; border-radius: var(--r-lg); }

/* ════════════════════════════════════════════════════════════
   GRADIENT TEXT
   ════════════════════════════════════════════════════════════ */
.grad-text {
  background:                  linear-gradient(135deg, #818CF8, #A78BFA 50%, #34D399);
  -webkit-background-clip:     text;
  -webkit-text-fill-color:     transparent;
  background-clip:             text;
}

.grad-text-gold {
  background:              linear-gradient(135deg, #F59E0B, #F97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip:         text;
}

/* ════════════════════════════════════════════════════════════
   MESH BACKGROUND
   ════════════════════════════════════════════════════════════ */
.mesh-bg {
  position:       fixed;
  inset:          0;
  z-index:        0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 20% 10%, rgba(99,102,241,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 85% 70%, rgba(139,92,246,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 60% 30%, rgba(16,185,129,0.03) 0%, transparent 60%);
}

/* ════════════════════════════════════════════════════════════
   ALERTS / FLASH MESSAGES
   ════════════════════════════════════════════════════════════ */
.alert {
  display:       flex;
  align-items:   center;
  gap:           12px;
  padding:       14px 16px;
  border-radius: var(--r-lg);
  margin-bottom: 20px;
  font-size:     13px;
}

.alert-success { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.25); color: #6EE7B7; }
.alert-error   { background: rgba(239,68,68,0.08);  border: 1px solid rgba(239,68,68,0.25);  color: #FCA5A5; }
.alert-warning { background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.25); color: #FCD34D; }
.alert-info    { background: var(--indigo-dim);      border: 1px solid var(--border-accent);  color: var(--indigo-light); }

/* ════════════════════════════════════════════════════════════
   EMPTY STATES
   ════════════════════════════════════════════════════════════ */
.empty-state {
  text-align:  center;
  padding:     40px 20px;
}

.empty-state .empty-icon {
  font-size:     3rem;
  margin-bottom: 12px;
  display:       block;
  opacity:       0.7;
}

.empty-state h3 {
  font-size:   1rem;
  color:       var(--text-secondary);
  margin-bottom: 6px;
}

.empty-state p {
  font-size:   13px;
  color:       var(--text-muted);
  margin-bottom: 16px;
}

/* ════════════════════════════════════════════════════════════
   LOADING / SKELETON
   ════════════════════════════════════════════════════════════ */
.skeleton {
  background:  linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation:   shimmer 1.5s infinite;
  border-radius: var(--r-sm);
}

.spinner {
  width:  24px; height: 24px;
  border: 2px solid rgba(99,102,241,0.2);
  border-top-color: var(--indigo);
  border-radius: var(--r-full);
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

/* ════════════════════════════════════════════════════════════
   DIVIDERS & SEPARATORS
   ════════════════════════════════════════════════════════════ */
.divider {
  height:     1px;
  background: var(--border);
  margin:     16px 0;
}

.divider-vertical {
  width:      1px;
  background: var(--border);
  align-self: stretch;
}

/* ════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ════════════════════════════════════════════════════════════ */
.text-white       { color: var(--text-white) !important; }
.text-primary     { color: var(--text-primary) !important; }
.text-secondary   { color: var(--text-secondary) !important; }
.text-muted       { color: var(--text-muted) !important; }
.text-green       { color: var(--green) !important; }
.text-red         { color: var(--red) !important; }
.text-yellow      { color: var(--yellow) !important; }
.text-indigo      { color: var(--indigo-light) !important; }
.text-cyan        { color: var(--cyan) !important; }

.text-xs  { font-size: 11px !important; }
.text-sm  { font-size: 13px !important; }
.text-base{ font-size: 15px !important; }
.text-lg  { font-size: 18px !important; }
.text-xl  { font-size: 22px !important; }
.text-2xl { font-size: 28px !important; }

.font-medium { font-weight: 500 !important; }
.font-600    { font-weight: 600 !important; }
.font-700    { font-weight: 700 !important; }
.font-800    { font-weight: 800 !important; }
.font-display{ font-family: var(--font-display) !important; }
.font-mono   { font-family: var(--font-mono) !important; }

.truncate     { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.no-select    { user-select: none; }
.pointer      { cursor: pointer; }
.hidden       { display: none !important; }
.invisible    { visibility: hidden; }
.opacity-50   { opacity: 0.5; }

/* ════════════════════════════════════════════════════════════
   ANIMATIONS
   ════════════════════════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);   }
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

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

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

@keyframes brandGlow {
  0%, 100% { box-shadow: 0 0 12px rgba(99,102,241,0.4); }
  50%       { box-shadow: 0 0 28px rgba(99,102,241,0.7); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

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

/* Animation utility classes */
.au  { animation: fadeUp 0.5s ease both; }
.au1 { animation-delay: 0.05s; }
.au2 { animation-delay: 0.10s; }
.au3 { animation-delay: 0.15s; }
.au4 { animation-delay: 0.20s; }
.au5 { animation-delay: 0.25s; }
.au6 { animation-delay: 0.30s; }
.au7 { animation-delay: 0.35s; }
.au8 { animation-delay: 0.40s; }

.fade-in   { animation: fadeIn 0.4s ease both; }
.slide-in  { animation: slideIn 0.4s ease both; }
.scale-in  { animation: scaleIn 0.3s ease both; }
.floating  { animation: float 4s ease infinite; }

/* ════════════════════════════════════════════════════════════
   CHART CONTAINERS
   ════════════════════════════════════════════════════════════ */
.chart-wrap {
  position: relative;
  width: 100%;
}

.chart-wrap canvas {
  max-width: 100%;
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE
   ════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .main-content { padding: 20px 24px; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    transform:  translateX(-100%);
    transition: transform var(--transition-slow);
    width:      260px;
    z-index:    300;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .main-content {
    margin-left: 0;
    padding:     16px;
  }

  .modal-box { padding: 20px; }

  .topbar { flex-wrap: wrap; gap: 12px; }
  .topbar-right { flex-wrap: wrap; }

  .data-table td, .data-table th { padding: 10px 12px; }
}

@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.2rem; }
  .card-p-lg { padding: 16px; }
  .btn { padding: 9px 16px; }
  .btn-lg { padding: 12px 20px; font-size: 14px; }
}

/* Mobile overlay (when sidebar is open) */
.sidebar-overlay {
  display:    none;
  position:   fixed;
  inset:      0;
  background: rgba(0,0,0,0.6);
  z-index:    250;
}

.sidebar-overlay.active { display: block; }

/* ════════════════════════════════════════════════════════════
   PRINT
   ════════════════════════════════════════════════════════════ */
@media print {
  .sidebar, .topbar-right, .btn, .modal-overlay { display: none !important; }
  .main-content { margin: 0; padding: 20px; }
  body { background: white; color: black; }
  .card { border: 1px solid #ddd; box-shadow: none; }
}
