/* navoneel Financial Dashboard */
:root {
  --db-bg: #0a0e1a;
  --db-surface: rgba(15, 20, 35, 0.85);
  --db-surface2: rgba(20, 26, 45, 0.9);
  --db-border: rgba(255, 255, 255, 0.08);
  --db-border2: rgba(255, 255, 255, 0.12);
  --db-text: #f1f5f9;
  --db-text2: #94a3b8;
  --db-text3: #64748b;
  --db-or: #ff6b1a;
  --db-or-glow: rgba(255, 107, 26, 0.35);
  --db-purple: #a855f7;
  --db-purple-glow: rgba(168, 85, 247, 0.3);
  --db-green: #10b981;
  --db-red: #ef4444;
  --db-sidebar: 220px;
  --db-topbar: 56px;
  --db-aibar: 72px;
  --db-r: 12px;
  --db-r-sm: 8px;
}

body.dashboard-active {
  cursor: auto !important;
  background: var(--db-bg);
  color: var(--db-text);
}

#app {
  display: none;
  flex-direction: row;
  width: 100%;
  height: 100dvh;
  background: var(--db-bg);
  opacity: 0;
  transition: opacity 0.5s ease;
  overflow: hidden;
}
#app.in { opacity: 1; }

/* Sidebar */
.db-sidebar {
  width: var(--db-sidebar);
  min-width: var(--db-sidebar);
  height: 100%;
  background: rgba(8, 12, 24, 0.95);
  border-right: 1px solid var(--db-border);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  z-index: 10;
}
.db-brand {
  padding: 0 20px 24px;
  border-bottom: 1px solid var(--db-border);
  margin-bottom: 16px;
}
.db-brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.db-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--db-or), #f97316);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
}
.db-brand-name { font-size: 15px; font-weight: 700; color: var(--db-text); }
.db-brand-sub { font-size: 9px; letter-spacing: 0.2em; color: var(--db-text3); text-transform: uppercase; }

.db-nav { flex: 1; padding: 0 12px; overflow-y: auto; }
.db-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--db-r-sm);
  color: var(--db-text2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.db-nav-item:hover { background: rgba(255,255,255,0.05); color: var(--db-text); }
.db-nav-item.active {
  background: rgba(255, 107, 26, 0.12);
  color: var(--db-or);
  box-shadow: inset 3px 0 0 var(--db-or);
}
.db-nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; }
.db-nav-item.active svg { opacity: 1; }

.db-user {
  padding: 16px 20px;
  border-top: 1px solid var(--db-border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.db-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--db-purple), var(--db-or));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.db-user-info { flex: 1; min-width: 0; }
.db-user-name { font-size: 12px; font-weight: 600; color: var(--db-text); }
.db-user-role { font-size: 10px; color: var(--db-text3); }
.db-user-status { display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--db-green); }
.db-status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--db-green); }

/* Main area */
.db-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  position: relative;
}

/* Topbar */
.db-topbar {
  height: var(--db-topbar);
  min-height: var(--db-topbar);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 20px;
  border-bottom: 1px solid var(--db-border);
  background: rgba(10, 14, 26, 0.8);
  backdrop-filter: blur(12px);
}
.db-greeting { font-size: 14px; font-weight: 600; white-space: nowrap; }
.db-greeting span { color: var(--db-text2); font-weight: 400; }
.db-datetime { font-size: 11px; color: var(--db-text3); margin-left: 8px; }

.db-search {
  flex: 1;
  max-width: 360px;
  margin: 0 auto;
  position: relative;
}
.db-search input {
  width: 100%;
  padding: 8px 36px 8px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--db-border);
  border-radius: 99px;
  color: var(--db-text);
  font-size: 12px;
  font-family: inherit;
  outline: none;
}
.db-search input::placeholder { color: var(--db-text3); }
.db-search input:focus { border-color: var(--db-or); }
.db-search-kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--db-text3);
  background: rgba(255,255,255,0.06);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--db-border);
}

.db-tickers { display: flex; gap: 16px; align-items: center; }
.db-ticker {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.db-ticker-name { font-size: 9px; color: var(--db-text3); text-transform: uppercase; letter-spacing: 0.05em; }
.db-ticker-val { font-size: 12px; font-weight: 600; font-family: 'JetBrains Mono', monospace; }
.db-ticker-chg { font-size: 10px; font-family: 'JetBrains Mono', monospace; }
.db-ticker-chg.up { color: var(--db-green); }
.db-ticker-chg.down { color: var(--db-red); }
.db-ticker-spark { width: 48px; height: 16px; }

.db-topbar-actions { display: flex; gap: 8px; align-items: center; }
.db-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--db-border);
  background: rgba(255,255,255,0.04);
  color: var(--db-text2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}
.db-icon-btn:hover { background: rgba(255,255,255,0.08); color: var(--db-text); }
.db-icon-btn svg { width: 16px; height: 16px; }
.db-notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: var(--db-red);
  border-radius: 50%;
  border: 2px solid var(--db-bg);
}

/* Content scroll area */
.db-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 88px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Jarvis bar */
.db-jarvis {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: var(--db-surface);
  border: 1px solid var(--db-border);
  border-radius: var(--db-r);
  backdrop-filter: blur(16px);
}
.db-jarvis-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--db-or) 0%, #cc4f0a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}
.db-jarvis-icon::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(255,107,26,0.3);
  animation: jarvisPulse 2s ease-in-out infinite;
}
@keyframes jarvisPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 1; }
}
.db-jarvis-label { font-size: 9px; font-weight: 700; letter-spacing: 0.15em; color: var(--db-or); }
.db-jarvis-text { flex: 1; font-size: 15px; font-weight: 500; }
.db-jarvis-wave {
  flex: 1;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 2px;
  justify-content: center;
}
.db-wave-bar {
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(to top, var(--db-or), var(--db-purple));
  animation: waveAnim 1.2s ease-in-out infinite;
}
@keyframes waveAnim {
  0%, 100% { height: 8px; }
  50% { height: 28px; }
}
.db-jarvis-mic {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--db-border);
  background: rgba(255,255,255,0.05);
  color: var(--db-text2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.db-jarvis-mic:hover { border-color: var(--db-or); color: var(--db-or); }

/* Grid */
.db-grid { display: grid; gap: 16px; }
.db-grid-row2 { grid-template-columns: 1.2fr 1fr 0.9fr; }
.db-grid-row3 { grid-template-columns: 1fr 1fr 0.85fr; }

/* Widget card */
.db-widget {
  background: var(--db-surface);
  border: 1px solid var(--db-border);
  border-radius: var(--db-r);
  backdrop-filter: blur(16px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.db-widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--db-border);
}
.db-widget-title { font-size: 13px; font-weight: 600; }
.db-widget-tabs { display: flex; gap: 4px; }
.db-tab {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--db-text3);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.db-tab:hover { color: var(--db-text2); }
.db-tab.active { background: rgba(255,107,26,0.15); color: var(--db-or); }

.db-widget-body { flex: 1; padding: 8px 0; overflow: auto; }

/* Market table */
.db-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.db-table th {
  text-align: left;
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 600;
  color: var(--db-text3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.db-table td { padding: 8px 12px; border-top: 1px solid var(--db-border); }
.db-table tr:hover td { background: rgba(255,255,255,0.02); }
.db-table .name { font-weight: 500; }
.db-table .val { font-family: 'JetBrains Mono', monospace; font-weight: 500; }
.db-table .chg.up { color: var(--db-green); }
.db-table .chg.down { color: var(--db-red); }
.db-range-bar {
  width: 60px;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  position: relative;
}
.db-range-dot {
  position: absolute;
  top: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--db-or);
  transform: translateX(-50%);
}
.db-sparkline { width: 50px; height: 20px; }

/* Live chart */
.db-chart-head {
  padding: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.db-chart-symbol { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.db-live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--db-green);
  animation: livePulse 1.5s ease-in-out infinite;
}
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.db-live-label { font-size: 10px; color: var(--db-green); font-weight: 600; }
.db-chart-price { font-size: 28px; font-weight: 700; font-family: 'JetBrains Mono', monospace; letter-spacing: -0.02em; }
.db-chart-change { font-size: 13px; font-family: 'JetBrains Mono', monospace; margin-top: 4px; }
.db-chart-change.up { color: var(--db-green); }
.db-chart-change.down { color: var(--db-red); }
.db-chart-tf { display: flex; gap: 4px; }
.db-tf-btn {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--db-text3);
  background: rgba(255,255,255,0.04);
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
}
.db-tf-btn.active { border-color: var(--db-or); color: var(--db-or); background: rgba(255,107,26,0.1); }
.db-chart-canvas-wrap { padding: 0 12px 12px; height: 200px; position: relative; }
.db-chart-canvas-wrap canvas { width: 100% !important; height: 100% !important; }

/* News */
.db-news-list { padding: 0 12px; }
.db-news-item {
  display: flex;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--db-border);
  cursor: pointer;
  transition: background 0.15s;
}
.db-news-item:hover { background: rgba(255,255,255,0.02); }
.db-news-item:last-child { border-bottom: none; }
.db-news-img {
  width: 64px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  background: rgba(255,255,255,0.05);
  flex-shrink: 0;
}
.db-news-img-placeholder {
  width: 64px;
  height: 48px;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(255,107,26,0.2), rgba(168,85,247,0.2));
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.db-news-meta { font-size: 10px; color: var(--db-text3); margin-bottom: 4px; }
.db-news-title { font-size: 12px; font-weight: 500; line-height: 1.4; flex: 1; }
.db-news-bookmark {
  color: var(--db-text3);
  cursor: pointer;
  flex-shrink: 0;
  padding: 4px;
}
.db-news-bookmark:hover { color: var(--db-or); }
.db-news-bookmark.saved { color: var(--db-or); }

/* Commodities */
.db-commodity-visual {
  height: 60px;
  margin-top: auto;
  background: linear-gradient(to top, rgba(255,107,26,0.15), transparent);
  position: relative;
  overflow: hidden;
}
.db-commodity-visual::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 60px;
  background: radial-gradient(ellipse, rgba(255,200,100,0.4) 0%, transparent 70%);
}

/* Heatmap */
.db-heatmap-wrap { display: flex; gap: 12px; padding: 12px; height: 220px; }
.db-heatmap-map {
  flex: 1;
  position: relative;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  overflow: hidden;
}
.db-heatmap-map svg { width: 100%; height: 100%; }
.db-heatmap-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 10px;
  color: var(--db-text3);
}
.db-legend-bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #312e81, #6366f1, #a855f7, #f59e0b, #ff6b1a);
}
.db-heatmap-indices { width: 140px; overflow-y: auto; }
.db-hm-index {
  display: flex;
  justify-content: space-between;
  padding: 6px 8px;
  font-size: 11px;
  border-bottom: 1px solid var(--db-border);
}
.db-hm-index .name { color: var(--db-text2); font-size: 10px; }
.db-hm-index .pct.up { color: var(--db-green); }
.db-hm-index .pct.down { color: var(--db-red); }

/* Todos */
.db-todo-head { display: flex; align-items: center; justify-content: space-between; }
.db-add-btn {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--db-or);
  background: rgba(255,107,26,0.1);
  border: 1px solid rgba(255,107,26,0.3);
  cursor: pointer;
  font-family: inherit;
}
.db-add-btn:hover { background: rgba(255,107,26,0.2); }
.db-todo-list { padding: 4px 12px; }
.db-todo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--db-border);
}
.db-todo-item.done .db-todo-text { text-decoration: line-through; color: var(--db-text3); }
.db-todo-check {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1.5px solid var(--db-border2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.db-todo-check.checked { background: var(--db-or); border-color: var(--db-or); }
.db-todo-check.checked::after { content: '✓'; color: #fff; font-size: 11px; }
.db-todo-text { flex: 1; font-size: 12px; }
.db-todo-priority {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}
.db-todo-priority.high { background: rgba(239,68,68,0.15); color: var(--db-red); }
.db-todo-priority.medium { background: rgba(245,158,11,0.15); color: #f59e0b; }
.db-todo-priority.low { background: rgba(16,185,129,0.15); color: var(--db-green); }
.db-todo-time { font-size: 10px; color: var(--db-text3); font-family: 'JetBrains Mono', monospace; }
.db-todo-menu {
  color: var(--db-text3);
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
  font-size: 14px;
}
.db-todo-menu:hover { color: var(--db-text); }

/* AI bottom bar */
.db-ai-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 20px;
  background: rgba(8, 12, 24, 0.95);
  border-top: 1px solid var(--db-border);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 20;
}
.db-ai-input {
  flex: 1;
  padding: 10px 18px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--db-border);
  border-radius: 99px;
  color: var(--db-text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.db-ai-input::placeholder { color: var(--db-text3); }
.db-ai-input:focus { border-color: var(--db-purple); }
.db-ai-actions { display: flex; gap: 8px; }
.db-ai-action {
  padding: 8px 14px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 500;
  color: var(--db-text2);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--db-border);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: all 0.15s;
}
.db-ai-action:hover { border-color: var(--db-or); color: var(--db-or); }
.db-ai-mic {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--db-purple), var(--db-or));
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* AI response panel */
.db-ai-response {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 400px;
  max-height: 300px;
  background: var(--db-surface2);
  border: 1px solid var(--db-border);
  border-radius: var(--db-r);
  padding: 16px;
  overflow-y: auto;
  z-index: 30;
  display: none;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
.db-ai-response.show { display: block; }
.db-ai-response-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--db-text3);
  cursor: pointer;
  font-size: 16px;
}
.db-ai-response-text { font-size: 13px; line-height: 1.6; color: var(--db-text2); }
.db-ai-typing { display: flex; gap: 4px; padding: 8px 0; }
.db-ai-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--db-or);
  animation: typingDot 1.2s ease-in-out infinite;
}
.db-ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.db-ai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

/* Skeleton loading */
.db-skel {
  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: skelShimmer 1.4s infinite;
  border-radius: 4px;
}
@keyframes skelShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Modal for add task */
.db-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.db-modal-overlay.show { display: flex; }
.db-modal {
  background: var(--db-surface2);
  border: 1px solid var(--db-border);
  border-radius: var(--db-r);
  padding: 24px;
  width: 360px;
  max-width: 90vw;
}
.db-modal h3 { font-size: 16px; margin-bottom: 16px; }
.db-modal input, .db-modal select {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--db-border);
  border-radius: 8px;
  color: var(--db-text);
  font-size: 13px;
  font-family: inherit;
  margin-bottom: 12px;
  outline: none;
}
.db-modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.db-modal-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  border: 1px solid var(--db-border);
  background: rgba(255,255,255,0.05);
  color: var(--db-text2);
}
.db-modal-btn.primary { background: var(--db-or); border-color: var(--db-or); color: #fff; }

/* Responsive */
@media (max-width: 1200px) {
  .db-grid-row2, .db-grid-row3 { grid-template-columns: 1fr 1fr; }
  .db-grid-row2 > :last-child, .db-grid-row3 > :last-child { grid-column: span 2; }
}
@media (max-width: 900px) {
  .db-sidebar { display: none; }
  .db-grid-row2, .db-grid-row3 { grid-template-columns: 1fr; }
  .db-grid-row2 > :last-child, .db-grid-row3 > :last-child { grid-column: span 1; }
  .db-tickers { display: none; }
  .db-ai-actions { display: none; }
}

.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 20, 35, 0.95);
  border: 1px solid var(--db-border);
  color: var(--db-text);
  padding: 10px 20px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 500;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
