@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400&family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ═══════════════════════════════════════════
   REVA DESIGN SYSTEM — LUXURY DARK THEME
   ═══════════════════════════════════════════ */
:root {
  --obsidian: #08080e;
  --void: #0c0c16;
  --deep: #101020;
  --surface: #14142a;
  --surface2: #1a1a35;
  --surface3: #20203f;
  --panel: #1e1e38;
  --glass: rgba(255,255,255,0.04);
  --glass2: rgba(255,255,255,0.07);
  --glass3: rgba(255,255,255,0.11);

  --gold: #c9a84c;
  --gold-light: #e8c96a;
  --gold-dim: rgba(201,168,76,0.15);
  --gold-border: rgba(201,168,76,0.25);
  --gold-glow: rgba(201,168,76,0.08);

  --emerald: #00c896;
  --emerald-dim: rgba(0,200,150,0.12);
  --emerald-border: rgba(0,200,150,0.25);

  --ruby: #e8455a;
  --ruby-dim: rgba(232,69,90,0.12);
  --ruby-border: rgba(232,69,90,0.25);

  --sapphire: #4d7cff;
  --sapphire-dim: rgba(77,124,255,0.12);
  --sapphire-border: rgba(77,124,255,0.25);

  --text: #f0f0fa;
  --text2: #a0a0c8;
  --text3: #606090;
  --text4: #404070;

  --border: rgba(255,255,255,0.08);
  --border2: rgba(255,255,255,0.14);

  --font-display: 'Cormorant Garamond', serif;
  --font-body: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 16px;
  --r-xl: 24px;

  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-gold: 0 0 40px rgba(201,168,76,0.1);
  --shadow-panel: 0 8px 40px rgba(0,0,0,0.5);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--obsidian);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 2px; opacity: 0.5; }

/* TYPOGRAPHY */
.display { font-family: var(--font-display); font-weight: 300; letter-spacing: -0.5px; }
.display-bold { font-family: var(--font-display); font-weight: 600; }
.mono { font-family: var(--font-mono); }
.label { font-size: 10px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--text3); font-family: var(--font-mono); }
.label-gold { color: var(--gold); }
.muted { color: var(--text2); }
.muted2 { color: var(--text3); }

/* GOLD ACCENT LINE */
.gold-line { height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: 0.4; }
.gold-line-v { width: 1px; background: linear-gradient(180deg, transparent, var(--gold), transparent); opacity: 0.4; }

/* CARDS */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-border), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.card:hover::before { opacity: 1; }
.card-glass {
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass3);
  border-radius: var(--r-lg);
  padding: 20px 22px;
}
.card-gold {
  background: linear-gradient(135deg, rgba(201,168,76,0.08), rgba(201,168,76,0.03));
  border: 1px solid var(--gold-border);
  border-radius: var(--r-lg);
  padding: 20px 22px;
}

/* STAT CARDS */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}
.stat-card:hover { border-color: var(--gold-border); transform: translateY(-1px); }
.stat-label { font-size: 10px; font-weight: 600; letter-spacing: 1.8px; text-transform: uppercase; color: var(--text3); font-family: var(--font-mono); margin-bottom: 8px; }
.stat-value { font-family: var(--font-display); font-size: 28px; font-weight: 600; letter-spacing: -0.5px; line-height: 1; }
.stat-delta { font-size: 11px; margin-top: 5px; font-family: var(--font-mono); font-weight: 500; }
.stat-bar { height: 2px; background: var(--border); border-radius: 1px; margin-top: 10px; overflow: hidden; }
.stat-bar-fill { height: 100%; border-radius: 1px; background: linear-gradient(90deg, var(--gold), var(--gold-light)); transition: width 1s ease; }

/* SIGNALS */
.signal { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: 20px; font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.5px; }
.sig-buy { background: var(--emerald-dim); border: 1px solid var(--emerald-border); color: var(--emerald); }
.sig-hold { background: rgba(201,168,76,0.1); border: 1px solid rgba(201,168,76,0.25); color: var(--gold); }
.sig-rotate { background: var(--sapphire-dim); border: 1px solid var(--sapphire-border); color: var(--sapphire); }
.sig-sell { background: var(--ruby-dim); border: 1px solid var(--ruby-border); color: var(--ruby); }
.sig-live { background: var(--emerald-dim); border: 1px solid var(--emerald-border); color: var(--emerald); }
.sig-sim { background: rgba(201,168,76,0.08); border: 1px solid rgba(201,168,76,0.2); color: var(--gold); }

/* COLOR UTILITIES */
.up { color: var(--emerald); }
.down { color: var(--ruby); }
.warn { color: var(--gold); }
.info { color: var(--sapphire); }
.neutral { color: var(--text3); }

/* INPUTS */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 10px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text3); margin-bottom: 6px; font-family: var(--font-mono); }
.form-input, .form-select {
  width: 100%;
  background: var(--deep);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--r);
  font-size: 13px;
  font-family: var(--font-body);
  font-weight: 400;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}
.form-input:focus, .form-select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-dim);
}
.form-select option { background: var(--deep); color: var(--text); }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: var(--r);
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: none; transition: all 0.2s; font-family: var(--font-body);
  letter-spacing: 0.3px; text-decoration: none;
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--obsidian);
}
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(201,168,76,0.3); }
.btn-ghost {
  background: transparent; color: var(--text2);
  border: 1px solid var(--border2);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-danger {
  background: var(--ruby-dim); color: var(--ruby);
  border: 1px solid var(--ruby-border);
}
.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-icon { padding: 8px; border-radius: var(--r-sm); }

/* TABLES */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
  font-size: 9px; font-family: var(--font-mono); font-weight: 600;
  color: var(--text3); padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left; letter-spacing: 2px; text-transform: uppercase;
}
.data-table tbody td {
  padding: 12px 14px; font-size: 12px; font-weight: 500;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
}
.data-table tbody tr:hover td { background: var(--glass); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ALERTS */
.alert { display: flex; gap: 12px; border-radius: var(--r); padding: 12px 14px; margin-bottom: 12px; }
.alert-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.alert-body { font-size: 12px; line-height: 1.6; }
.alert-title { font-weight: 600; font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 2px; }
.alert-warn { background: var(--ruby-dim); border: 1px solid var(--ruby-border); }
.alert-warn .alert-title { color: var(--ruby); }
.alert-info { background: var(--sapphire-dim); border: 1px solid var(--sapphire-border); }
.alert-info .alert-title { color: var(--sapphire); }
.alert-ok { background: var(--emerald-dim); border: 1px solid var(--emerald-border); }
.alert-ok .alert-title { color: var(--emerald); }
.alert-gold { background: var(--gold-glow); border: 1px solid var(--gold-border); }
.alert-gold .alert-title { color: var(--gold); }

/* RANGE SLIDER */
input[type=range] { -webkit-appearance: none; width: 100%; height: 4px; background: var(--glass3); border-radius: 2px; outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--gold); cursor: pointer; box-shadow: 0 0 8px rgba(201,168,76,0.4); }

/* PROGRESS RING */
.progress-ring { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.progress-ring svg { transform: rotate(-90deg); }
.progress-ring .ring-bg { fill: none; stroke: rgba(255,255,255,0.06); }
.progress-ring .ring-fill { fill: none; stroke-linecap: round; transition: stroke-dashoffset 1.2s cubic-bezier(0.34, 1.56, 0.64, 1), stroke 0.5s; }
.progress-ring .ring-text { position: absolute; text-align: center; pointer-events: none; }

/* FACTOR BARS */
.factor-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.factor-name { font-size: 11px; font-weight: 600; color: var(--text3); width: 85px; flex-shrink: 0; font-family: var(--font-mono); }
.factor-track { flex: 1; height: 5px; background: rgba(255,255,255,0.05); border-radius: 3px; overflow: hidden; }
.factor-fill { height: 100%; border-radius: 3px; transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1); }
.factor-pct { font-size: 11px; font-weight: 600; color: var(--text); width: 28px; text-align: right; font-family: var(--font-mono); }

/* TOOLTIPS */
.tooltip { position: relative; cursor: help; }
.tooltip::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--surface3); border: 1px solid var(--border2); color: var(--text2);
  padding: 6px 10px; border-radius: var(--r-sm); font-size: 11px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.2s; z-index: 100;
}
.tooltip:hover::after { opacity: 1; }

/* SKELETON LOADING */
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--r-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* LOADING OVERLAY */
.loading-screen {
  position: fixed; inset: 0;
  background: var(--obsidian);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 9999; gap: 20px;
  transition: opacity 0.5s, visibility 0.5s;
}
.loading-screen.hide { opacity: 0; visibility: hidden; }
.loading-orb { width: 60px; height: 60px; border-radius: 50%; border: 1px solid var(--gold-border); position: relative; animation: orb-spin 2s linear infinite; }
.loading-orb::after { content: ''; position: absolute; top: 5px; left: 5px; right: 5px; bottom: 5px; border-radius: 50%; border: 1px solid var(--gold); border-top-color: transparent; animation: orb-spin 1s linear infinite; }
@keyframes orb-spin { to { transform: rotate(360deg); } }
.loading-text { font-family: var(--font-mono); font-size: 11px; color: var(--text3); letter-spacing: 2px; text-transform: uppercase; }

/* APP SHELL */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--void);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 50;
  transition: transform 0.3s;
}
.sidebar-logo { padding: 24px 20px 20px; }
.sidebar-logo-mark {
  font-family: var(--font-display); font-size: 32px; font-weight: 300;
  letter-spacing: 4px; color: var(--gold);
  display: block; margin-bottom: 2px;
}
.sidebar-logo-sub { font-family: var(--font-mono); font-size: 8px; letter-spacing: 3px; color: var(--text3); text-transform: uppercase; }
.sidebar-divider { height: 1px; margin: 0 20px; background: var(--border); }
.nav-section-title { font-size: 8px; font-family: var(--font-mono); letter-spacing: 3px; color: var(--text4); text-transform: uppercase; padding: 16px 20px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; cursor: pointer;
  color: var(--text3); font-size: 13px; font-weight: 500;
  border-left: 2px solid transparent;
  transition: all 0.15s; position: relative;
}
.nav-item:hover { color: var(--text2); background: var(--glass); }
.nav-item.active { color: var(--gold); border-left-color: var(--gold); background: var(--gold-glow); }
.nav-icon { font-size: 14px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge { margin-left: auto; background: var(--gold); color: var(--obsidian); font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 10px; font-family: var(--font-mono); }
.nav-item.has-dot::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--emerald); margin-left: auto; animation: blink 2s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }
.sidebar-bottom { margin-top: auto; padding: 16px 20px; border-top: 1px solid var(--border); }
.user-card { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--gold-light)); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--obsidian); flex-shrink: 0; }
.user-name { font-size: 12px; font-weight: 600; line-height: 1.3; }
.user-role { font-size: 10px; color: var(--text3); font-family: var(--font-mono); }
.logout-btn { margin-left: auto; cursor: pointer; color: var(--text3); font-size: 16px; transition: color 0.2s; }
.logout-btn:hover { color: var(--ruby); }

/* MAIN CONTENT */
.main-content { flex: 1; margin-left: 240px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  background: var(--void); border-bottom: 1px solid var(--border);
  padding: 0 24px; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 40;
}
.topbar-title { font-family: var(--font-display); font-size: 18px; font-weight: 400; letter-spacing: 0.5px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.live-pill { display: flex; align-items: center; gap: 6px; background: var(--emerald-dim); border: 1px solid var(--emerald-border); color: var(--emerald); padding: 4px 10px; border-radius: 20px; font-size: 10px; font-family: var(--font-mono); letter-spacing: 1px; }
.live-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: blink 2s infinite; }
.time-pill { font-family: var(--font-mono); font-size: 11px; color: var(--text3); background: var(--glass); border: 1px solid var(--border); padding: 4px 10px; border-radius: 20px; }
.mobile-menu-btn { display: none; background: none; border: none; color: var(--text2); cursor: pointer; font-size: 20px; padding: 4px; }

.page-content { flex: 1; padding: 24px; overflow-y: auto; }
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.page-header { margin-bottom: 24px; }
.page-title { font-family: var(--font-display); font-size: 32px; font-weight: 300; letter-spacing: -0.5px; margin-bottom: 4px; }
.page-title span { color: var(--gold); font-style: italic; }
.page-subtitle { color: var(--text3); font-size: 13px; }

/* GRIDS */
.g-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.g-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.g-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.g-main { display: grid; grid-template-columns: 1fr 340px; gap: 14px; margin-bottom: 18px; }
.g-main-r { display: grid; grid-template-columns: 300px 1fr; gap: 14px; margin-bottom: 18px; }
.mb18 { margin-bottom: 18px; }
.mb14 { margin-bottom: 14px; }

/* CHART CONTAINERS */
.chart-wrap { position: relative; }

/* TABS */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab-btn { padding: 10px 18px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--text3); border-bottom: 2px solid transparent; transition: all 0.15s; white-space: nowrap; font-family: var(--font-mono); letter-spacing: 0.5px; background: none; border-top: none; border-left: none; border-right: none; }
.tab-btn:hover { color: var(--text2); }
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn 0.2s; }

/* PRICE DROP WIDGET */
.drop-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.drop-item:last-child { border-bottom: none; }
.drop-district { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.drop-info { flex: 1; }
.drop-name { font-size: 12px; font-weight: 600; line-height: 1.3; }
.drop-meta { font-size: 10px; color: var(--text3); font-family: var(--font-mono); margin-top: 2px; }
.drop-pct { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--emerald); }

/* CODE BLOCKS */
.code-block { background: var(--deep); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; font-family: var(--font-mono); font-size: 11px; line-height: 2; overflow-x: auto; margin: 10px 0; }
.ck { color: var(--sapphire); }
.cv { color: var(--gold); }
.cs { color: var(--emerald); }
.cc { color: var(--text3); }

/* NOTIFICATION DOT */
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ruby); position: absolute; top: 6px; right: 6px; animation: blink 2s infinite; }

/* MOBILE OVERLAY */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 49; }

/* RESPONSIVE */
@media (max-width: 1024px) {
  .g-4 { grid-template-columns: repeat(2, 1fr); }
  .g-main { grid-template-columns: 1fr; }
  .g-main-r { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main-content { margin-left: 0; }
  .mobile-menu-btn { display: flex; }
  .g-3 { grid-template-columns: 1fr 1fr; }
  .g-2 { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .page-title { font-size: 24px; }
}
@media (max-width: 480px) {
  .g-4 { grid-template-columns: 1fr; }
  .g-3 { grid-template-columns: 1fr; }
}
