/* VestAlchemy skins: light (default) and Nasdaq-style deep blue.
   Enabled by <html data-theme="dark">; the toggle lives in the navbar (top right). */

[data-theme="dark"] body {
  background: #0a1526 !important;
  color: #e6edf7;
}

/* Navbar + footer + sidebar */
[data-theme="dark"] .navbar,
[data-theme="dark"] .navbar.bg-light {
  background: #0f1e36 !important;
  border-color: #1d3454 !important;
}
[data-theme="dark"] .navbar .navbar-brand,
[data-theme="dark"] .navbar .nav-link { color: #e6edf7 !important; }
[data-theme="dark"] .navbar .nav-link.active { color: #4da3ff !important; }
[data-theme="dark"] .navbar .btn-outline-secondary,
[data-theme="dark"] #themeToggle {
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}
[data-theme="dark"] footer,
[data-theme="dark"] .bg-white { background: #0f1e36 !important; }
[data-theme="dark"] #sidebar,
[data-theme="dark"] .sidebar { background: #0f1e36 !important; border-color: #1d3454 !important; }
[data-theme="dark"] #sidebar a,
[data-theme="dark"] .sidebar a { color: #cbd5e1 !important; }
[data-theme="dark"] #sidebar a:hover,
[data-theme="dark"] .sidebar a:hover { color: #ffffff !important; }

/* Headings, text and links */
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3,
[data-theme="dark"] h4, [data-theme="dark"] h5, [data-theme="dark"] h6 { color: #e6edf7 !important; }
[data-theme="dark"] .text-muted, [data-theme="dark"] .relation { color: #ffffff !important; }
[data-theme="dark"] a { color: #4da3ff; }

/* Cards, tables and grids */
[data-theme="dark"] .card,
[data-theme="dark"] .summary-card {
  background: #10203a !important;
  border-color: #1d3454 !important;
}
[data-theme="dark"] table { color: #e6edf7; }
[data-theme="dark"] th {
  background: #0f1e36 !important;
  color: #a9bcd8 !important;
  border-color: #1d3454 !important;
}
[data-theme="dark"] td { border-color: #1a2c47 !important; }
[data-theme="dark"] tbody tr:nth-child(even) { background: #0d1a30 !important; }
[data-theme="dark"] tbody tr:hover { background: #14294a !important; }

/* Forms */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] .form-select {
  background-color: #0f1e36 !important;
  color: #e6edf7 !important;
  border-color: #1d3454 !important;
}
[data-theme="dark"] .form-select {
  --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23e6edf7' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}
[data-theme="dark"] option {
  background: #0f1e36 !important;
  color: #e6edf7 !important;
}

/* Filter pills on the stock 13F page */
[data-theme="dark"] .filters button {
  background: #10203a !important;
  border-color: #1d3454 !important;
  color: #cbd5e1 !important;
}
[data-theme="dark"] .filters button:hover {
  border-color: #4da3ff !important;
  color: #ffffff !important;
}
[data-theme="dark"] .filters button.active {
  background: #4da3ff !important;
  border-color: #4da3ff !important;
  color: #0a1526 !important;
  font-weight: 600 !important;
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #e6edf7 !important;
  opacity: .8;
}
[data-theme="dark"] label,
[data-theme="dark"] .form-label {
  color: #e6edf7 !important;
}

/* Insider Activity specifics */
[data-theme="dark"] .insider-table { background: #10203a !important; }
[data-theme="dark"] .insider-table .empty { background: #10203a !important; color: #93a7c4 !important; }
[data-theme="dark"] .summary-table th { background: #0f1e36 !important; }
[data-theme="dark"] .summary-table td { border-color: #1a2c47 !important; }
[data-theme="dark"] .tabs { border-color: #1d3454 !important; }
[data-theme="dark"] .tabs a { color: #93a7c4 !important; }
[data-theme="dark"] .tabs a.active { color: #4da3ff !important; border-color: #4da3ff !important; }
[data-theme="dark"] .pagination { color: #93a7c4 !important; }

/* Selected / hovered sidebar item: light-white highlight (like Nasdaq's dark nav) */
[data-theme="dark"] #sidebar .nav-link.vx-active {
  background-color: rgba(255, 255, 255, 0.10) !important;
  color: #4da3ff !important;
  box-shadow: inset 3px 0 0 #4da3ff !important;
}
[data-theme="dark"] #sidebar .nav-link:hover,
[data-theme="dark"] #sidebar .nav-link:focus-visible {
  background-color: rgba(255, 255, 255, 0.06) !important;
  color: #ffffff !important;
}

/* Summary total rows inherit the same light text as the other rows */
[data-theme="dark"] .summary-table tr.total td {
  color: #ffffff !important;
}

/* Institutions grid (has its own .inst-table style with a white background) */
[data-theme="dark"] .inst-table {
  background: #10203a !important;
  color: #e6edf7 !important;
}
[data-theme="dark"] .inst-table th,
[data-theme="dark"] .inst-table td {
  border-bottom-color: #1a2c47 !important;
}
[data-theme="dark"] .inst-table thead th {
  background: linear-gradient(180deg, #12233d 0%, #0f1e36 100%) !important;
  color: #a9bcd8 !important;
}
[data-theme="dark"] .inst-table tbody tr:hover {
  background: #14294a !important;
}
[data-theme="dark"] .inst-table a {
  color: #4da3ff !important;
}

/* Financials statement grid: sticky first (label) column has a white background */
[data-theme="dark"] .fin-table td:first-child {
  background: #10203a !important;
}
[data-theme="dark"] .fin-table thead th:first-child {
  background: #0f1e36 !important;
  color: #a9bcd8 !important;
}
[data-theme="dark"] .fin-table tr.fin-section td:first-child {
  background: #12233d !important;
}
[data-theme="dark"] .fin-table tbody tr:hover td:first-child {
  background: #14294a !important;
}
[data-theme="dark"] .fin-table {
  background: #10203a !important;
}
[data-theme="dark"] .fin-table tr.fin-section td {
  background: #12233d !important;
  color: #a9bcd8 !important;
}

/* Squeeze-zone portfolio: own white cards / table / empty state */
[data-theme="dark"] .sz-card {
  background: #10203a !important;
  border-color: #1d3454 !important;
  box-shadow: none !important;
}
[data-theme="dark"] .sz-table {
  background: #10203a !important;
}
[data-theme="dark"] .empty-state {
  background: #10203a !important;
  border-color: #1d3454 !important;
  color: #93a7c4 !important;
}

/* Bootstrap tabs and pills: the active item has a white background by default */
[data-theme="dark"] .nav-tabs {
  border-bottom-color: #1d3454 !important;
}
[data-theme="dark"] .nav-tabs .nav-link {
  color: #93a7c4 !important;
}
[data-theme="dark"] .nav-tabs .nav-link.active,
[data-theme="dark"] .nav-tabs .nav-link:hover {
  background-color: #10203a !important;
  border-color: #1d3454 !important;
  color: #4da3ff !important;
}
[data-theme="dark"] .nav-pills .nav-link {
  color: #93a7c4 !important;
}
[data-theme="dark"] .nav-pills .nav-link.active {
  background-color: #1d3454 !important;
  color: #ffffff !important;
}

/* Light alerts are near-white by default (e.g. the strategy "Rules" banner) */
[data-theme="dark"] .alert-light {
  background-color: #10203a !important;
  border-color: #1d3454 !important;
  color: #e6edf7 !important;
}

/* KPI numbers and card headers (e.g. the Top Picks stat boxes and "Ranked picks") */
[data-theme="dark"] .fs-1,
[data-theme="dark"] .fs-2,
[data-theme="dark"] .fs-3,
[data-theme="dark"] .fs-4,
[data-theme="dark"] .fs-5,
[data-theme="dark"] .fs-6 {
  color: #ffffff !important;
}
[data-theme="dark"] .card-header {
  color: #ffffff !important;
}

/* Home dashboard: AI badge, secondary alerts and secondary text */
[data-theme="dark"] .ai-mark {
  color: #e6edf7 !important;
  border-color: #1d3454 !important;
}
[data-theme="dark"] .alert-secondary {
  background-color: #10203a !important;
  border-color: #1d3454 !important;
  color: #e6edf7 !important;
}
[data-theme="dark"] .text-secondary,
[data-theme="dark"] .text-body-secondary {
  color: #e6edf7 !important;
}

/* Table light accents (e.g. the Top Picks funnel "Returned" row) */
[data-theme="dark"] tr.table-light,
[data-theme="dark"] tr.table-light > td,
[data-theme="dark"] tr.table-light > th {
  background-color: #12233d !important;
  color: #ffffff !important;
}

/* Card body copy (e.g. the home "Market summary" briefing text) */
[data-theme="dark"] .card-body,
[data-theme="dark"] .card-body p,
[data-theme="dark"] .card-body div:not(.text-muted):not(.help-block) {
  color: #ffffff !important;
}

/* 13F institution detail: own white surfaces (.tbl / .risk-card) */
[data-theme="dark"] .tbl,
[data-theme="dark"] .risk-card {
  background: #10203a !important;
  border-color: #1d3454 !important;
  box-shadow: none !important;
}

/* Pages that set <body class="bg-light"> (or any .bg-light block) */
[data-theme="dark"] .bg-light {
  background-color: #0a1526 !important;
}

/* Bootstrap alerts: default backgrounds are light pastels */
[data-theme="dark"] .alert {
  background-color: #10203a !important;
  border-color: #1d3454 !important;
  color: #e6edf7 !important;
}
[data-theme="dark"] .alert-warning {
  background-color: #2b2412 !important;
  border-color: #4d411f !important;
  color: #ffffff !important;
}
[data-theme="dark"] .alert-danger {
  background-color: #2e1519 !important;
  border-color: #5a2830 !important;
  color: #ff8f9c !important;
}
[data-theme="dark"] .alert-info {
  background-color: #0e2630 !important;
  border-color: #1d4757 !important;
  color: #7fd8ea !important;
}
[data-theme="dark"] .alert-success {
  background-color: #10281a !important;
  border-color: #1d4a2d !important;
  color: #7fe0a3 !important;
}
