/* ======================================================================
   FinanceInsight Premium -- style.css  v5.0
   Aurora dark glassmorphism . Live animated background . Neon accents
   ====================================================================== */

/* -- CSS Custom Properties ------------------------------------------------- */
:root {
  /* Backgrounds */
  --bg-base:    #050810;
  --bg-surface: #0a0f1e;
  --bg-panel:   rgba(15, 20, 40, 0.75);
  --bg-card:    rgba(18, 24, 48, 0.65);
  --bg-hover:   rgba(30, 40, 70, 0.6);
  --bg-active:  rgba(40, 55, 90, 0.5);

  /* Borders */
  --border:      rgba(255,255,255,0.05);
  --border-md:   rgba(255,255,255,0.08);
  --border-hi:   rgba(255,255,255,0.15);

  /* Text */
  --text:        #eaf0ff;
  --text-muted:  #8b95a9;
  --text-dim:    #4a5568;

  /* Accent palette */
  --indigo:      #818cf8;
  --indigo-glow: rgba(129,140,248,0.35);
  --green:       #34d399;
  --green-glow:  rgba(52,211,153,0.25);
  --amber:       #fbbf24;
  --amber-glow:  rgba(251,191,36,0.25);
  --red:         #f87171;
  --red-glow:    rgba(248,113,113,0.25);
  --sky:         #38bdf8;
  --sky-glow:    rgba(56,189,248,0.25);
  --purple:      #c084fc;
  --rose:        #fb7185;
  --teal:        #2dd4bf;

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

  /* Transitions */
  --t-fast: 0.15s ease;
  --t-mid:  0.25s cubic-bezier(.4,0,.2,1);
  --t-slow: 0.45s cubic-bezier(.4,0,.2,1);

  /* Radius */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 22px;
}

/* -- Reset ----------------------------------------------------------------- */
*,*::before,*::after { margin:0; padding:0; box-sizing:border-box; }
html { height:100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* -- Animated Aurora Background -------------------------------------------- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 10% 20%, rgba(99,102,241,0.15), transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 75%, rgba(168,85,247,0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 50% 50%, rgba(56,189,248,0.06), transparent 50%);
  animation: auroraDrift 12s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes auroraDrift {
  0%   { filter: hue-rotate(0deg)   brightness(1);   }
  50%  { filter: hue-rotate(15deg)  brightness(1.1);  }
  100% { filter: hue-rotate(-10deg) brightness(0.95); }
}

/* Floating orb particles */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent 72%);
  animation: gridDrift 16s linear infinite;
  pointer-events: none;
}
@keyframes gridDrift {
  0% { background-position: 0 0; }
  100% { background-position: 44px 44px; }
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input { font-family: inherit; }
ul { list-style: none; }
img { display: block; max-width: 100%; }

/* ── Scrollbar ──────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-md); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hi); }

/* -- App Shell ------------------------------------------------------------- */
.app-shell {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* ══════════════════════════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(10,16,32,0.92) 0%, rgba(6,10,22,0.96) 100%);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-right: 1px solid rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  position: relative;
  z-index: 20;
}

/* animated sidebar glow */
.sidebar::before {
  content: '';
  position: absolute;
  top: -50px; left: -30px; right: -30px;
  height: 350px;
  background: radial-gradient(ellipse at 50% 0%, rgba(129,140,248,0.14), transparent 70%);
  pointer-events: none;
  animation: sidebarGlow 6s ease-in-out infinite alternate;
}
@keyframes sidebarGlow {
  0%   { opacity: 0.7; }
  100% { opacity: 1; }
}

.sidebar-header { padding: 20px 18px 8px; }

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  box-shadow: 0 0 16px rgba(99,102,241,0.5);
  flex-shrink: 0;
}

.logo-title { display: block; font-size: 15px; font-weight: 700; letter-spacing: -0.3px; }
.logo-sub   { display: block; font-size: 10px; color: var(--text-dim); letter-spacing: 0.3px; }

/* Nav sections */
.nav-section { padding: 14px 10px 4px; }

.nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  padding: 0 8px 6px;
}

.nav-list { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 14px;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-mid);
  position: relative;
  user-select: none;
}

.nav-item:hover {
  background: rgba(129,140,248,0.08);
  color: var(--text);
  transform: translateX(3px);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(99,102,241,0.18), rgba(99,102,241,0.05));
  color: #818cf8;
  border-left: 2px solid #6366f1;
  padding-left: 12px;
}

.nav-item.active i { text-shadow: 0 0 10px rgba(99,102,241,0.6); }

.nav-item i { width: 18px; text-align: center; font-size: 14px; }
.nav-item span { flex: 1; }

/* Live badge */
.nav-badge { font-size: 9px; font-weight: 700; letter-spacing: 0.8px; }
.live-badge {
  background: rgba(16,185,129,0.15);
  color: var(--green);
  border: 1px solid rgba(16,185,129,0.3);
  padding: 2px 7px;
  border-radius: 20px;
}

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  padding: 14px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-hover);
  border-radius: var(--r-sm);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4a5568;
  transition: background 0.5s;
}
.status-dot.online  { background: var(--green); box-shadow: 0 0 8px var(--green-glow); }
.status-dot.offline { background: var(--red); }

.status-label { font-size: 12px; color: var(--text-muted); }

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg-card);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  cursor: pointer;
}
.user-card:hover { border-color: var(--border-md); }

.user-avatar img { width: 32px; height: 32px; border-radius: 50%; }
.user-info { flex: 1; }
.user-info strong { display: block; font-size: 12.5px; font-weight: 600; }
.user-info small   { font-size: 11px; color: var(--text-muted); }
.user-menu-icon    { color: var(--text-dim); font-size: 12px; }

/* ══════════════════════════════════════════════════════════════════════════════
   MAIN AREA
   ══════════════════════════════════════════════════════════════════════════════ */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-surface);
}

/* ── Topbar ─────────────────────────────────────────────────────────────────── */
.topbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(10,14,24,0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  z-index: 10;
}

.search-wrapper {
  flex: 1;
  max-width: 600px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 50px;
  transition: var(--t-fast);
}
.search-wrapper:focus-within {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px var(--indigo-glow);
}

.search-icon { color: var(--text-dim); font-size: 13px; }

#ticker-search {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13.5px;
}
#ticker-search::placeholder { color: var(--text-dim); }

.search-hint {
  background: var(--bg-hover);
  color: var(--text-dim);
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 5px;
  border: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
}

.search-spinner { color: var(--indigo); }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--r-md);
  border: none;
  font-size: 13px;
  font-weight: 500;
  transition: var(--t-fast);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  box-shadow: 0 4px 18px rgba(99,102,241,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.btn-primary:hover::before { opacity: 1; }
.btn-primary:hover { filter: brightness(1.15); box-shadow: 0 6px 25px rgba(99,102,241,0.6); transform: translateY(-1px); }

.btn-ghost {
  background: var(--bg-hover);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-md); background: var(--bg-active); }

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-md);
}
.btn-outline:hover { color: var(--text); border-color: var(--border-hi); }

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: var(--r-sm); }
.icon-btn {
  width: 34px;
  height: 34px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-size: 13px;
  transition: var(--t-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-md); }

.full-btn { width: 100%; justify-content: center; }

/* ── Views ─────────────────────────────────────────────────────────────────── */
.views-container { flex: 1; position: relative; overflow: hidden; }

.view {
  position: absolute;
  inset: 0;
  display: none;
}
.view.active { display: flex; flex-direction: column; }

.view-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ══════════════════════════════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════════════════════════════ */
.card {
  background: rgba(18, 24, 48, 0.55);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all var(--t-mid);
  position: relative;
}
.card:hover {
  border-color: rgba(129,140,248,0.18);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.25), 0 0 0 1px rgba(129,140,248,0.06);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-header h3 {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-header h3 i { color: var(--indigo); }
.card-title-group { display: flex; align-items: center; gap: 12px; }
.card-actions { display: flex; align-items: center; gap: 8px; }

/* ══════════════════════════════════════════════════════════════════════════════
   DASHBOARD
   ══════════════════════════════════════════════════════════════════════════════ */

/* Hero Banner */
.hero-banner {
  position: relative;
  background: linear-gradient(135deg, rgba(15,22,40,0.8) 0%, rgba(21,31,56,0.7) 60%, rgba(14,26,48,0.8) 100%);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid rgba(129,140,248,0.1);
  border-radius: var(--r-xl);
  padding: 34px 38px;
  margin-bottom: 22px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
/* Animated shimmer sweep */
.hero-banner::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(129,140,248,0.05), transparent);
  animation: heroShimmer 5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes heroShimmer {
  0%   { left: -100%; }
  50%  { left: 150%; }
  100% { left: 150%; }
}

.hero-glow {
  position: absolute;
  top: -60px; left: -60px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(99,102,241,0.25), transparent 60%);
  pointer-events: none;
  animation: heroGlow 6s ease-in-out infinite alternate;
}
@keyframes heroGlow {
  from { transform: translate(0,0); opacity: 0.6; }
  to   { transform: translate(30px, 20px); opacity: 1; }
}

.hero-content { flex: 1; position: relative; z-index: 1; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #818cf8;
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.25);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.hero-content h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 8px;
}

.hero-gradient {
  background: linear-gradient(90deg, #6366f1, #a855f7, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-content p {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.6;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.hero-stat { text-align: center; padding: 0 28px; }
.h-stat-val {
  display: block;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #f0f4ff, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.h-stat-label { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

.hero-stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

/* Dashboard Grid */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  grid-template-rows: auto auto;
  gap: 18px;
}

.card-wide { grid-column: 1; }
#insights-card { grid-column: 2; grid-row: 1; }
#stock-card    { grid-column: 2; grid-row: 2; }

/* Feed Table */
.feed-table-wrap { overflow-x: auto; overflow-y: auto; max-height: 380px; }

.feed-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.feed-table thead tr { background: rgba(255,255,255,0.02); }
.feed-table th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.feed-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  vertical-align: middle;
}
.feed-table tbody tr:hover td { background: rgba(255,255,255,0.025); }
.feed-table tbody tr.new-row { animation: rowIn 0.35s ease; }

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

.entity-name { font-weight: 600; color: var(--text); }
.entity-context { color: var(--text-muted); font-size: 12px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Confidence bar in table */
.conf-cell { display: flex; flex-direction: column; gap: 4px; min-width: 100px; }
.conf-nums { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); }
.conf-bar { height: 3px; background: var(--bg-hover); border-radius: 10px; overflow: hidden; }
.conf-fill { height: 100%; border-radius: 10px; transition: width 0.8s ease; }

/* Filter pills */
.filter-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  transition: var(--t-fast);
  cursor: pointer;
}
.pill:hover { border-color: var(--border-md); color: var(--text); }
.pill.active { background: var(--bg-hover); color: var(--text); border-color: var(--border-md); }

/* Entity type badges */
.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 3px 9px;
  border-radius: 5px;
}
.type-ORG    { background: rgba( 56,189,248,0.12); color: var(--sky);    border: 1px solid rgba( 56,189,248,0.2); }
.type-MONEY  { background: rgba( 16,185,129,0.12); color: var(--green);  border: 1px solid rgba( 16,185,129,0.2); }
.type-EVENT  { background: rgba(245,158, 11,0.12); color: var(--amber);  border: 1px solid rgba(245,158, 11,0.2); }
.type-DATE   { background: rgba(168,85 ,247,0.12); color: var(--purple); border: 1px solid rgba(168,85 ,247,0.2); }
.type-METRIC { background: rgba( 99,102,241,0.12); color: #818cf8;       border: 1px solid rgba( 99,102,241,0.2); }
.type-TICKER { background: rgba(244, 63, 94,0.12); color: var(--rose);   border: 1px solid rgba(244, 63, 94,0.2); }
.type-PER    { background: rgba( 20,184,166,0.12); color: var(--teal);   border: 1px solid rgba( 20,184,166,0.2); }

.source-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
}
.source-model     { background: rgba(99,102,241,0.1); color: #818cf8; }
.source-heuristic { background: rgba(16,185,129,0.1); color: var(--green); }

/* Live chip */
.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.25);
  padding: 3px 10px;
  border-radius: 20px;
}
.live-dot {
  width: 7px; height: 7px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.85); }
}

/* Chart */
.chart-area {
  padding: 16px;
  height: 220px;
  position: relative;
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 10px 18px 16px;
}
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-muted); }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; }

/* Insights Panel */
.insights-body { padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; }
.insight-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-hover);
  border-radius: var(--r-sm);
  font-size: 12.5px;
  line-height: 1.5;
  animation: fadeSlideIn 0.4s ease;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.insight-icon { width: 24px; height: 24px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; }
.insight-placeholder, .stock-placeholder { color: var(--text-dim); font-size: 13px; text-align: center; padding: 30px 20px; }

/* Stock Panel */
.stock-body { padding: 16px 18px; }
.stock-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; }
.stock-price { font-size: 28px; font-weight: 800; letter-spacing: -1px; }
.stock-change { font-size: 13px; font-weight: 600; padding: 3px 8px; border-radius: 6px; }
.stock-change.up   { background: rgba(16,185,129,0.15); color: var(--green); }
.stock-change.down { background: rgba(239,68,68,0.15);  color: var(--red);   }
.stock-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stock-row { display: flex; flex-direction: column; gap: 2px; }
.stock-row-label { font-size: 11px; color: var(--text-dim); }
.stock-row-val   { font-size: 13px; font-weight: 600; font-family: 'JetBrains Mono', monospace; }
.card-ticker-label { font-size: 12px; color: var(--text-muted); font-family: 'JetBrains Mono'; }

/* Empty state */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 20px; color: var(--text-dim); text-align: center; }
.empty-state i { opacity: 0.4; }
.empty-state p { font-size: 13px; max-width: 280px; line-height: 1.6; }

/* ══════════════════════════════════════════════════════════════════════════════
   NER ANALYSIS
   ══════════════════════════════════════════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}
.page-header h2 { font-size: 20px; font-weight: 700; }
.page-sub { font-size: 13px; color: var(--text-muted); margin-top: 3px; }

.ner-layout { display: grid; grid-template-columns: 260px 1fr; gap: 18px; }

.ner-controls { padding: 18px; display: flex; flex-direction: column; gap: 10px; align-self: flex-start; position: sticky; top: 0; }
.ctrl-title { font-size: 13px; font-weight: 600; }
.ctrl-sub { font-size: 12px; color: var(--text-muted); }
.ctrl-divider { height: 1px; background: var(--border); }

.entity-checkboxes { display: flex; flex-direction: column; gap: 8px; }
.chk-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--t-fast);
}
.chk-row:hover { color: var(--text); }
.chk-row input[type="checkbox"] { accent-color: var(--indigo); width: 14px; height: 14px; cursor: pointer; }
.chk-badge { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 4px; }

.sections-list { display: flex; flex-direction: column; gap: 5px; }
.section-btn {
  width: 100%;
  text-align: left;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--t-fast);
}
.section-btn:hover { color: var(--text); border-color: var(--border-md); }

.ner-main { display: flex; flex-direction: column; gap: 18px; }

.ner-text-card { flex: 1; }
.ner-text-area {
  padding: 20px;
  min-height: 300px;
  max-height: 400px;
  overflow-y: auto;
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--text-muted);
}
.ner-placeholder { color: var(--text-dim); display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 20px; text-align: center; }
.ner-placeholder h4 { font-size: 16px; color: var(--text-muted); }

.entity-count-label { font-size: 12px; color: var(--text-dim); font-family: 'JetBrains Mono'; }

/* Highlighted entities in text */
mark.ent-highlight {
  padding: 2px 4px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: filter var(--t-fast);
}
mark.ent-highlight:hover { filter: brightness(1.2); }
mark.hl-ORG    { background: rgba( 56,189,248,0.15); color: var(--sky); }
mark.hl-MONEY  { background: rgba( 16,185,129,0.15); color: var(--green); }
mark.hl-EVENT  { background: rgba(245,158, 11,0.15); color: var(--amber); }
mark.hl-DATE   { background: rgba(168,85 ,247,0.15); color: var(--purple); }
mark.hl-METRIC { background: rgba( 99,102,241,0.15); color: #818cf8; }
mark.hl-TICKER { background: rgba(244, 63, 94,0.15); color: var(--rose); }
mark.hl-PER    { background: rgba( 20,184,166,0.15); color: var(--teal); }

.ner-entities-card { min-height: 200px; }
.entity-grid { padding: 16px; display: flex; flex-wrap: wrap; gap: 8px; min-height: 60px; }
.entity-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 12.5px;
  transition: var(--t-fast);
  cursor: default;
  animation: chipIn 0.3s ease;
}
@keyframes chipIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}
.entity-chip:hover { border-color: var(--border-md); background: var(--bg-active); }
.chip-label { font-weight: 600; }
.chip-conf  { font-size: 10px; color: var(--text-dim); font-family: 'JetBrains Mono'; }

/* ══════════════════════════════════════════════════════════════════════════════
   EVENT RADAR
   ══════════════════════════════════════════════════════════════════════════════ */
.events-layout { display: grid; grid-template-columns: 220px 1fr; gap: 18px; }
.event-type-legend { padding: 16px; align-self: flex-start; }
.event-type-legend h4 { font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.event-legend-list { display: flex; flex-direction: column; gap: 8px; }
.event-legend-item { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-muted); }
.event-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

.events-main { display: flex; flex-direction: column; gap: 18px; }
.events-card { min-height: 200px; }
.card-header .event-count { font-size: 12px; color: var(--text-dim); font-family: 'JetBrains Mono'; }

.events-timeline { padding: 10px 18px; display: flex; flex-direction: column; gap: 0; max-height: 400px; overflow-y: auto; }
.event-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  animation: rowIn 0.3s ease;
}
.event-row:last-child { border-bottom: none; }
.event-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.event-body { flex: 1; }
.event-name { font-size: 13.5px; font-weight: 600; margin-bottom: 3px; }
.event-detail { font-size: 12px; color: var(--text-muted); }
.event-conf { font-size: 11px; font-family: 'JetBrains Mono'; color: var(--text-dim); align-self: center; }

/* ══════════════════════════════════════════════════════════════════════════════
   DOCUMENTS
   ══════════════════════════════════════════════════════════════════════════════ */
.doc-tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.doc-tab {
  padding: 8px 18px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  transition: var(--t-fast);
}
.doc-tab:hover { color: var(--text); border-color: var(--border-md); }
.doc-tab.active { background: var(--bg-hover); color: var(--text); border-color: var(--border-md); }

.doc-tab-content { display: flex; flex-direction: column; gap: 12px; }
.doc-tab-content.hidden { display: none; }

.sections-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.section-card { padding: 18px; }
.section-card h4 { font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #818cf8; }
.section-preview { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; }
.section-meta { font-size: 11px; color: var(--text-dim); margin-top: 8px; font-family: 'JetBrains Mono'; }

.tables-wrap { padding: 18px; overflow-x: auto; }

.history-list { padding: 12px; }
.history-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  transition: var(--t-fast);
}
.history-item:hover { background: var(--bg-hover); }
.history-ticker { font-size: 14px; font-weight: 700; font-family: 'JetBrains Mono'; color: #818cf8; width: 60px; }
.history-meta   { flex: 1; font-size: 12px; color: var(--text-muted); }
.history-count  { font-size: 12px; color: var(--text-dim); font-family: 'JetBrains Mono'; }

/* ══════════════════════════════════════════════════════════════════════════════
   COMPARE
   ══════════════════════════════════════════════════════════════════════════════ */
.compare-input-card { padding: 18px 20px; margin-bottom: 18px; }
.compare-input-card h4 { font-size: 13px; font-weight: 600; margin-bottom: 12px; color: var(--text-muted); }
.compare-input-row { display: flex; gap: 10px; align-items: center; }
.compare-text-input {
  flex: 1;
  padding: 10px 16px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 13.5px;
  outline: none;
  font-family: 'JetBrains Mono', monospace;
  transition: var(--t-fast);
}
.compare-text-input:focus { border-color: var(--indigo); }

.compare-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.compare-ticker-card { padding: 18px; }
.compare-ticker-card h4 { font-size: 16px; font-weight: 700; font-family: 'JetBrains Mono'; color: #818cf8; margin-bottom: 12px; }
.compare-stat { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.compare-stat:last-child { border-bottom: none; }
.compare-stat-label { color: var(--text-muted); }
.compare-stat-val { font-weight: 600; font-family: 'JetBrains Mono'; font-size: 13px; }

.active-badge {
  background: rgba(16,185,129,0.15);
  color: var(--green);
  border: 1px solid rgba(16,185,129,0.25);
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 8px;
}

/* ══════════════════════════════════════════════════════════════════════════════
   MODEL METRICS
   ══════════════════════════════════════════════════════════════════════════════ */
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.metric-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.metric-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.metric-info { display: flex; flex-direction: column; gap: 3px; }
.metric-label { font-size: 12px; color: var(--text-muted); }
.metric-val { font-size: 26px; font-weight: 800; letter-spacing: -1px; }
.metric-bar-wrap { height: 4px; background: var(--bg-hover); border-radius: 10px; overflow: hidden; }
.metric-bar { height: 100%; background: var(--indigo); border-radius: 10px; transition: width 1s ease; width: 0%; }

.type-breakdown { padding: 16px; display: flex; flex-wrap: wrap; gap: 10px; }
.type-breakdown-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--bg-hover);
  border-radius: var(--r-sm);
  font-size: 13px;
  flex: 1;
  min-width: 150px;
}
.type-count-val { font-weight: 700; font-family: 'JetBrains Mono'; margin-left: auto; }

.model-compare-table { overflow-x: auto; padding: 4px; }

/* ══════════════════════════════════════════════════════════════════════════════
   CHAT
   ══════════════════════════════════════════════════════════════════════════════ */
#view-chat .view-scroll {
  display: flex;
  flex-direction: column;
  padding: 24px;
}
.chat-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.chat-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  flex-shrink: 0;
}
.chat-top h3 { font-size: 15px; font-weight: 600; }
.chat-doc-label { margin-left: auto; font-size: 12px; color: var(--text-dim); font-family: 'JetBrains Mono'; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-bubble {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 75%;
  animation: fadeSlideIn 0.3s ease;
}
.chat-bubble.ai   { align-self: flex-start; }
.chat-bubble.user { align-self: flex-end; flex-direction: row-reverse; }

.bubble-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  color: var(--indigo);
}
.chat-bubble.user .bubble-icon { background: rgba(99,102,241,0.15); color: #818cf8; }

.bubble-text {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.6;
}
.chat-bubble.ai   .bubble-text { background: var(--bg-hover); border: 1px solid var(--border); color: var(--text); border-radius: 0 14px 14px 14px; }
.chat-bubble.user .bubble-text { background: rgba(99,102,241,0.15); border: 1px solid rgba(99,102,241,0.25); color: var(--text); border-radius: 14px 0 14px 14px; }

.chat-typing {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 12px;
}
.chat-typing.hidden { display: none; }
.typing-dots { display: flex; gap: 5px; padding: 12px 16px; background: var(--bg-hover); border-radius: 14px; }
.typing-dots span { width: 7px; height: 7px; background: var(--text-dim); border-radius: 50%; animation: bounce 1.4s ease infinite; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }

.chat-input-row {
  display: flex;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}
.chat-input-wrap { flex: 1; }
.chat-input-wrap input {
  width: 100%;
  padding: 12px 18px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 13.5px;
  outline: none;
  transition: var(--t-fast);
}
.chat-input-wrap input:focus { border-color: var(--indigo); }
.chat-input-wrap input::placeholder { color: var(--text-dim); }

/* ══════════════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ══════════════════════════════════════════════════════════════════════════════ */
.toast-stack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--bg-panel);
  border: 1px solid var(--border-md);
  border-radius: var(--r-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  font-size: 13px;
  min-width: 240px;
  max-width: 360px;
  animation: toastIn 0.3s ease;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--indigo); }
.toast i { flex-shrink: 0; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(20px); }
}

/* ══════════════════════════════════════════════════════════════════════════════
   LOADING OVERLAY
   ══════════════════════════════════════════════════════════════════════════════ */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(7,9,15,0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.loading-overlay.hidden { display: none; }

.loading-card {
  background: var(--bg-card);
  border: 1px solid var(--border-md);
  border-radius: var(--r-xl);
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-width: 320px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.loading-spinner { width: 52px; height: 52px; position: relative; }
.spinner-ring {
  width: 100%;
  height: 100%;
  border: 3px solid var(--border);
  border-top-color: var(--indigo);
  border-right-color: var(--purple);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-title { font-size: 17px; font-weight: 700; }
.loading-sub   { font-size: 13px; color: var(--text-muted); }

.loading-progress { width: 100%; height: 4px; background: var(--bg-hover); border-radius: 10px; overflow: hidden; }
.loading-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--indigo), var(--purple));
  border-radius: 10px;
  transition: width 0.5s ease;
  animation: loadPulse 2s ease-in-out infinite;
}
@keyframes loadPulse {
  0%   { width: 5%; }
  50%  { width: 75%; }
  100% { width: 95%; }
}

/* ── Utilities ───────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.mono   { font-family: 'JetBrains Mono', monospace; }


/* ═══════════════════════════════════════════════════════════════════════════
    v4.0 — AI Intelligence Engine Styles
    ═══════════════════════════════════════════════════════════════════════════ */

/* ── Nav Badges ─────────────────────────────────────────────────────────────── */
.nav-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: auto;
  letter-spacing: 0.5px;
}
.ai-badge {
  background: linear-gradient(135deg, var(--indigo), var(--purple));
  color: #fff;
  animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.alert-count-badge {
  background: var(--red);
  color: #fff;
  min-width: 18px;
  text-align: center;
}
.alert-count-badge:empty { display: none; }

/* ── AI Verdict Banner (Dashboard) ──────────────────────────────────────────── */
.ai-verdict-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 28px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(168,85,247,0.08));
  border: 1px solid rgba(99,102,241,0.25);
  margin-bottom: 20px;
  animation: fadeSlideUp 0.5s ease;
}
.verdict-signal {
  font-size: 15px;
  font-weight: 800;
  padding: 8px 18px;
  border-radius: var(--r-sm);
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}
.verdict-signal.bullish  { background: rgba(16,185,129,0.2); color: var(--green); border: 1px solid rgba(16,185,129,0.3); }
.verdict-signal.bearish  { background: rgba(239,68,68,0.2);  color: var(--red);   border: 1px solid rgba(239,68,68,0.3); }
.verdict-signal.neutral  { background: rgba(245,158,11,0.15); color: var(--amber); border: 1px solid rgba(245,158,11,0.25); }
.verdict-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.verdict-score-label { font-size: 14px; color: var(--text); }
.verdict-conf { font-size: 12px; color: var(--text-muted); }
.verdict-takeaway {
  flex: 1;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  padding-left: 20px;
  border-left: 2px solid rgba(99,102,241,0.3);
}

/* ── Intel Hero Row ─────────────────────────────────────────────────────────── */
.intel-hero {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 20px;
}

/* Signal Card */
.signal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  text-align: center;
}
.signal-badge {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 12px 28px;
  border-radius: var(--r-md);
  margin-bottom: 12px;
  transition: all var(--t-mid);
}
.signal-badge.bullish  { background: rgba(16,185,129,0.15); color: var(--green); border: 2px solid rgba(16,185,129,0.35); text-shadow: 0 0 20px rgba(16,185,129,0.3); }
.signal-badge.bearish  { background: rgba(239,68,68,0.15);  color: var(--red);   border: 2px solid rgba(239,68,68,0.35);  text-shadow: 0 0 20px rgba(239,68,68,0.3); }
.signal-badge.neutral  { background: rgba(245,158,11,0.12); color: var(--amber); border: 2px solid rgba(245,158,11,0.3);  text-shadow: 0 0 20px rgba(245,158,11,0.3); }
.signal-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 6px; }
.signal-conf  { font-size: 12px; color: var(--text-dim); }

/* Score Gauge */
.score-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.score-gauge { position: relative; width: 130px; height: 130px; }
.gauge-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge-bg {
  fill: none;
  stroke: rgba(255,255,255,0.06);
  stroke-width: 8;
}
.gauge-fill {
  fill: none;
  stroke: url(#gaugeGrad);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4,0,0.2,1);
}
.gauge-value {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  font-family: 'Inter', sans-serif;
}
.score-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 10px;
}

/* Breakdown Card */
.breakdown-card { padding: 24px; }
.breakdown-card h4 { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; text-transform: uppercase; letter-spacing: 1px; }
.breakdown-bars { display: flex; flex-direction: column; gap: 12px; }
.breakdown-row { display: flex; align-items: center; gap: 12px; }
.breakdown-label { width: 90px; font-size: 12px; color: var(--text-muted); }
.breakdown-track { flex: 1; height: 8px; background: rgba(255,255,255,0.06); border-radius: 10px; overflow: hidden; }
.breakdown-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 1s cubic-bezier(0.4,0,0.2,1);
}
.breakdown-val { width: 45px; text-align: right; font-size: 12px; font-weight: 600; }

/* ── Takeaways List ─────────────────────────────────────────────────────────── */
.takeaways-list { padding: 16px 20px; }
.takeaway-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  animation: fadeSlideUp 0.4s ease;
}
.takeaway-item:last-child { border-bottom: none; }
.takeaway-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.takeaway-text { font-size: 13px; line-height: 1.6; color: var(--text-muted); }

/* ── Why It Matters (Insights Deep) ──────────────────────────────────────────── */
.insights-deep { padding: 16px 20px; }
.insight-deep-item {
  padding: 14px 16px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.02);
  border-left: 3px solid var(--indigo);
  margin-bottom: 12px;
  animation: fadeSlideUp 0.4s ease;
}
.insight-deep-item:last-child { margin-bottom: 0; }
.insight-deep-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.insight-deep-body  { font-size: 12px; color: var(--text-muted); line-height: 1.6; }

/* ── Relationship Graph Area ─────────────────────────────────────────────────── */
.graph-area { min-height: 320px; position: relative; padding: 20px; }
.graph-node {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  margin: 4px;
  border: 1px solid var(--border-md);
  transition: all var(--t-fast);
  cursor: default;
}
.graph-node:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.graph-node.org    { background: rgba(56,189,248,0.1);  color: var(--sky); border-color: rgba(56,189,248,0.2); }
.graph-node.person { background: rgba(20,184,166,0.1);  color: var(--teal); border-color: rgba(20,184,166,0.2); }
.graph-node.event  { background: rgba(245,158,11,0.1);  color: var(--amber); border-color: rgba(245,158,11,0.2); }
.graph-edge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-dim);
  background: rgba(255,255,255,0.02);
  margin: 2px;
}

/* ── Alerts Timeline ─────────────────────────────────────────────────────────── */
.alerts-timeline { display: flex; flex-direction: column; gap: 14px; }
.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--r-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  animation: fadeSlideUp 0.4s ease;
  transition: border-color var(--t-fast);
}
.alert-item:hover { border-color: var(--border-hi); }
.alert-item.high   { border-left: 3px solid var(--red); }
.alert-item.medium { border-left: 3px solid var(--amber); }
.alert-item.low    { border-left: 3px solid var(--sky); }
.alert-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.alert-icon.high   { background: rgba(239,68,68,0.15); color: var(--red); }
.alert-icon.medium { background: rgba(245,158,11,0.15); color: var(--amber); }
.alert-icon.low    { background: rgba(56,189,248,0.12); color: var(--sky); }
.alert-body { flex: 1; }
.alert-type { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.alert-message { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.alert-severity {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.alert-severity.high   { background: rgba(239,68,68,0.15); color: var(--red); }
.alert-severity.medium { background: rgba(245,158,11,0.12); color: var(--amber); }
.alert-severity.low    { background: rgba(56,189,248,0.1);  color: var(--sky); }

/* ── AI Conclusion Card ─────────────────────────────────────────────────────── */
.ai-conclusion-card { margin-top: 20px; }
.ai-conclusion-text {
  padding: 16px 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
}

/* ── Animations ──────────────────────────────────────────────────────────────── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Premium command briefing */
.briefing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr) minmax(260px, 0.65fr);
  gap: 18px;
  margin-bottom: 22px;
}

.briefing-card {
  min-height: 172px;
  border-radius: var(--r-lg);
}

.briefing-main {
  background:
    linear-gradient(135deg, rgba(21,30,52,0.86), rgba(8,18,34,0.72)),
    linear-gradient(90deg, rgba(45,212,191,0.10), rgba(251,191,36,0.08));
}

.briefing-main::after,
.quality-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,0.055) 45%, transparent 60%);
  transform: translateX(-130%);
  animation: premiumSweep 7s ease-in-out infinite;
  pointer-events: none;
}

@keyframes premiumSweep {
  0%, 35% { transform: translateX(-130%); }
  70%, 100% { transform: translateX(130%); }
}

.briefing-kicker {
  color: var(--text-dim);
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
}

.briefing-summary,
.best-extracts {
  padding: 16px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.briefing-line {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  animation: fadeSlideUp 0.42s ease both;
}

.briefing-index {
  color: var(--teal);
  font: 700 11px/1 'JetBrains Mono', monospace;
  padding-top: 4px;
}

.briefing-line p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.briefing-placeholder {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.6;
  padding: 8px 0;
}

.best-extract {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 42px;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.best-extract:last-child { border-bottom: none; }
.best-name { color: var(--text-muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.best-conf { font: 700 12px 'JetBrains Mono', monospace; text-align: right; }

.quality-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(16,185,129,0.10), rgba(251,191,36,0.08)),
    rgba(18, 24, 48, 0.55);
}

.quality-card h3 { font-size: 14px; margin-bottom: 7px; }
.quality-card p { color: var(--text-muted); font-size: 12.5px; line-height: 1.55; }

.quality-ring {
  --score: 0;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, var(--bg-surface) 0 57%, transparent 58%),
    conic-gradient(var(--green) calc(var(--score) * 1%), rgba(255,255,255,0.08) 0);
  box-shadow: inset 0 0 20px rgba(255,255,255,0.04), 0 0 28px rgba(45,212,191,0.12);
}

.quality-ring span {
  font-size: 24px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
}

.api-config-btn {
  flex-shrink: 0;
}

@media (max-width: 1180px) {
  :root { --sidebar-w: 220px; }
  .hero-banner { align-items: flex-start; flex-direction: column; }
  .hero-stats { width: 100%; justify-content: space-between; }
  .briefing-grid,
  .dash-grid,
  .intel-hero {
    grid-template-columns: 1fr;
  }
  #insights-card,
  #stock-card,
  .card-wide {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 780px) {
  body { overflow: auto; }
  .app-shell { min-height: 100vh; height: auto; flex-direction: column; overflow: visible; }
  .sidebar {
    width: 100%;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-header,
  .sidebar-footer { display: none; }
  .nav-section { padding: 8px 10px; }
  .nav-label { display: none; }
  .nav-list { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .nav-item { min-width: max-content; padding: 9px 12px; }
  .main-area { min-height: 100vh; overflow: visible; }
  .topbar { flex-direction: column; align-items: stretch; padding: 12px; }
  .search-wrapper { max-width: none; border-radius: var(--r-md); }
  .topbar-actions { overflow-x: auto; padding-bottom: 2px; }
  .view { position: relative; display: none; min-height: 100vh; }
  .view.active { display: block; }
  .view-scroll { padding: 14px; overflow: visible; }
  .hero-banner { padding: 22px; border-radius: var(--r-lg); }
  .hero-content h1 { font-size: 23px; }
  .hero-stats { flex-direction: column; align-items: stretch; }
  .hero-stat-divider { display: none; }
  .ai-verdict-banner { align-items: flex-start; flex-direction: column; }
  .verdict-takeaway { padding-left: 0; border-left: none; }
  .briefing-grid { gap: 14px; }
  .quality-card { grid-template-columns: 76px minmax(0, 1fr); padding: 18px; }
  .quality-ring { width: 72px; height: 72px; }
  .feed-table-wrap { max-height: none; }
  .feed-table { min-width: 720px; }
  .sections-grid,
  .compare-results,
  .metrics-grid { grid-template-columns: 1fr; }
  .loading-card { min-width: 0; width: calc(100vw - 32px); padding: 28px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
