/* IB Deal-Sourcing Platform — Enterprise Financial Theme */

/* Google Fonts — selectable UI fonts (see FONTS in app.py) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Carlito:wght@400;700&family=Roboto:wght@400;500;700&family=Open+Sans:wght@400;500;600;700&family=Lato:wght@400;700&family=Montserrat:wght@400;500;600;700&family=Poppins:wght@400;500;600&family=Nunito:wght@400;600;700&family=Work+Sans:wght@400;500;600&family=Source+Serif+4:wght@400;600;700&family=Merriweather:wght@400;700&family=Playfair+Display:wght@400;600;700&family=Lora:wght@400;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ---- PERFORMANCE ---- */
* {
  -webkit-tap-highlight-color: transparent;
}

/* ---- DESIGN TOKENS ---- */
:root {
  --bg-base:        #ffffff;
  --bg-page:        #ffffff;
  --bg-sidebar:     #000000;
  --bg-card:        #ffffff;
  --bg-input:       #ffffff;
  --bg-hover:       #f8f9fb;

  --border-subtle:  transparent;
  --border-medium:  transparent;

  --text-primary:   #111827;
  --text-secondary: #4b5563;
  --text-muted:     #9ca3af;
  --text-inverse:   #ffffff;

  /* Black header */
  --navy-900:       #000000;
  --navy-800:       #1a1a1a;
  --navy-700:       #333333;
  --navy-600:       #4a4a4a;

  /* Accent colors */
  --accent-blue:    #2563eb;
  --accent-blue-light: #eff6ff;
  --accent-cyan:    #06b6d4;
  --color-green:    #10b981;
  --color-green-light: #d1fae5;
  --color-red:      #ef4444;
  --color-red-light: #fee2e2;
  --color-amber:    #f59e0b;
  --color-amber-light: #fef3c7;

  --shadow-sm:      none;
  --shadow-md:      none;
  --shadow-lg:      none;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* ---- GLOBAL ---- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  background-color: var(--bg-page);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
}
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 600;
  margin: 0;
}
a { color: var(--accent-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- HEADER ---- */
.app-header {
  background: var(--navy-900);
  color: var(--text-inverse);
  padding: 0 32px;
  height: 56px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.app-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}
.app-header .brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: white;
}
.app-header nav {
  display: flex;
  align-items: center;
  margin-left: 48px;
  gap: 4px;
}
.app-header nav a {
  color: rgba(255,255,255,0.7);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: color 0.1s, background 0.1s;
  text-decoration: none;
}
.app-header nav a:hover {
  color: white;
  background: rgba(255,255,255,0.1);
  text-decoration: none;
}
.app-header .user-area {
  display: flex;
  align-items: center;
  gap: 16px;
}
.app-header .user-tier {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: right;
}
.app-header .user-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: white;
}
.app-header .user-avatar {
  width: 36px;
  height: 36px;
  background: var(--navy-700);
  border: 2px solid var(--navy-600);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
  color: white;
}
.app-header .export-btn {
  background: #374151;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}
.app-header .export-btn:hover {
  background: #4b5563;
}

/* Legacy support */
.app-header h3 { display: none; }
.app-header .sub { display: none; }
.app-header .badge-stage { display: none; }

/* ---- CONTAINER ---- */
.container-fluid {
  padding: 24px 32px !important;
  max-width: 1600px;
  margin: 0 auto;
}

/* ---- PAGE HEADER ---- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---- KPI BAR ---- */
.kpi-row {
  display: flex;
  gap: 48px;
  margin-bottom: 32px;
  flex-wrap: wrap;
  padding: 24px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.stat-card {
  background: transparent;
  border: none;
  padding: 0;
  min-width: 120px;
}
.stat-card .stat-value {
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  margin-bottom: 4px;
}
.stat-card .stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* ---- FILTER PANEL ---- */
.filter-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 0;                 /* square edges (screening) */
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.filter-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.filter-panel-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.filter-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.filter-group .form-control {
  height: 38px;
  padding: 0 12px;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--bg-input);
}
.filter-group .form-control:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* ---- DATA TABLE ---- */
.data-table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 0;                 /* square edges (screening) */
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.dash-table-container {
  background: var(--bg-card);
}
.dash-table-container .dash-spreadsheet-container {
  border-radius: 0;                 /* square edges (screening) */
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}
.dash-spreadsheet-inner table {
  background: var(--bg-card) !important;
}
.dash-header {
  background: var(--bg-page) !important;
  color: var(--text-secondary) !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  padding: 12px 16px !important;
}
.dash-table-container td.dash-cell,
.dash-table-container th.dash-header {
  border-left: none !important;
  border-right: none !important;
}
.dash-cell {
  color: var(--text-primary) !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  font-variant-numeric: tabular-nums;
  padding: 12px 16px !important;
  font-size: 0.875rem !important;
}
.dash-spreadsheet tr:hover td.dash-cell {
  background: #f9fafb !important;
}
.dash-spreadsheet-container {
  contain: layout style;
}
.dash-table-container {
  will-change: contents;
}

/* ---- DROPDOWNS ---- */
.Select-control {
  background-color: var(--bg-input) !important;
  border: 1px solid #d1d5db !important;
  border-radius: var(--radius-sm) !important;
  min-height: 38px !important;
}
.Select-control:hover {
  border-color: var(--border-medium) !important;
}
.is-focused:not(.is-open) > .Select-control {
  border-color: var(--accent-blue) !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1) !important;
}
.Select-menu-outer {
  background-color: var(--bg-card) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow-lg) !important;
  z-index: 1000;
}
.Select-option {
  padding: 10px 14px !important;
}
.Select-option.is-focused {
  background-color: var(--bg-hover) !important;
}
.Select-option.is-selected {
  background-color: var(--accent-blue-light) !important;
  color: var(--accent-blue) !important;
}
.Select-placeholder { color: var(--text-muted) !important; }
.Select-value-label { color: var(--text-primary) !important; }
.Select--multi .Select-value {
  background-color: var(--accent-blue-light) !important;
  border: none !important;
  border-radius: 4px !important;
}
.Select--multi .Select-value-label { color: var(--accent-blue) !important; }

/* ---- SLIDERS ---- */
.rc-slider-rail { background-color: var(--border-subtle) !important; height: 4px !important; }
.rc-slider-track { background-color: var(--accent-blue) !important; height: 4px !important; }
.rc-slider-handle {
  border: 2px solid var(--accent-blue) !important;
  background-color: var(--bg-card) !important;
  width: 16px !important;
  height: 16px !important;
  margin-top: -6px !important;
}
.rc-slider-mark-text { color: var(--text-muted) !important; font-size: 0.75rem !important; }

/* ---- BUTTONS ---- */
.btn {
  border-radius: var(--radius-sm) !important;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 10px 20px;
  transition: background 0.1s, transform 0.1s;
  border: none;
  will-change: background;
}
.btn-primary {
  background: var(--accent-blue) !important;
  color: white !important;
}
.btn-primary:hover {
  background: #1d4ed8 !important;
}
.btn:active {
  transform: scale(0.98);
}

/* ---- BADGES ---- */
.badge {
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 600;
}
.badge-success, .bg-success {
  background-color: var(--color-green-light) !important;
  color: #065f46 !important;
}
.badge-warning, .bg-warning {
  background-color: var(--color-amber-light) !important;
  color: #92400e !important;
}
.badge-danger, .bg-danger {
  background-color: var(--color-red-light) !important;
  color: #991b1b !important;
}

/* ---- RESULTS META ---- */
.results-meta {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ---- ALERTS ---- */
.alert {
  border-radius: var(--radius-md);
  border: none;
}
.alert-dark {
  background: var(--bg-page) !important;
  color: var(--text-secondary) !important;
}

/* ---- CART BAR ---- */
.cart-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: var(--navy-900);
  border-top: 1px solid var(--navy-700);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
}
.cart-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: white;
}
.cart-info {
  font-size: 0.9rem;
}
.cart-tickers {
  color: #60a5fa;
  font-weight: 500;
}

/* ---- MODALS ---- */
.modal-content {
  background-color: var(--bg-card) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  border-bottom: 1px solid var(--border-subtle) !important;
  padding: 20px 24px !important;
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bg-card);
}
.modal-title {
  font-weight: 600;
  font-size: 1.1rem;
}
.modal-body {
  padding: 24px !important;
  overflow-y: auto;
}
.modal-footer {
  border-top: 1px solid var(--border-subtle) !important;
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: var(--bg-card);
}

/* Side drawer */
.side-drawer.modal-dialog {
  position: fixed !important;
  right: 0 !important;
  top: 0 !important;
  margin: 0 !important;
  max-width: 800px !important;
  width: 100%;
  height: 100vh !important;
}
.side-drawer .modal-content {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 0 !important;
  border-left: 1px solid var(--border-subtle) !important;
}

.side-drawer .modal-body {
  flex: 1 1 auto;
  max-height: calc(100vh - 144px);
}

/* ---- FORM ELEMENTS ---- */
.form-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-control {
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.875rem;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-check-input:checked {
  background-color: var(--accent-blue);
  border-color: var(--accent-blue);
}

/* ---- PROGRESS ---- */
.progress {
  background-color: var(--border-subtle);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
}
.progress-bar {
  background: var(--accent-blue);
  transition: width 0.3s ease-out;
  will-change: width;
}

/* ---- TEXT UTILITIES ---- */
.text-muted { color: var(--text-muted) !important; }
.text-success { color: var(--color-green) !important; }
.text-danger { color: var(--color-red) !important; }
.text-primary { color: var(--accent-blue) !important; }

/* ---- FOOTER ---- */
.app-footer {
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 24px 0 48px;
  text-align: center;
}
.page-footer {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 32px;
  padding: 16px 0;
  text-align: center;
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-page); }
::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 999px; }

/* ---- PANELS (legacy) ---- */
.panel, .card {
  background: var(--bg-card) !important;
  border: 1px solid #e5e7eb !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
}
.panel-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* ---- PLOTLY ---- */
.js-plotly-plot .plotly text { fill: var(--text-secondary) !important; }
.js-plotly-plot {
  contain: layout style;
}

/* ---- PERFORMANCE OPTIMIZATIONS ---- */
html {
  scroll-behavior: smooth;
}
.container-fluid {
  contain: layout;
}
.app-header {
  will-change: transform;
  backface-visibility: hidden;
}
/* Reduce paint on scroll */
.panel, .card, .filter-panel, .data-table-container {
  contain: layout style;
}
/* Faster loading spinner */
.dash-spinner {
  animation-duration: 0.6s !important;
}
/* Instant interactions */
input, select, button, a {
  touch-action: manipulation;
}
/* Optimize dropdown menus */
.Select-menu-outer {
  will-change: opacity, transform;
  contain: layout style;
}

/* ---- SMOOTH TRANSITIONS ---- */
.btn, a.btn {
  transition: all 0.15s ease-out !important;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0) scale(0.98);
}
.btn-outline-secondary {
  border: 1px solid #d1d5db !important;
  background: transparent !important;
  color: #374151 !important;
}
.btn-outline-secondary:hover {
  background: #f3f4f6 !important;
  border-color: #9ca3af !important;
}
/* Dark mode: grey button text (#374151) is invisible on the dark surface — make it white. */
body.theme-dark .btn-outline-secondary {
  color: #ffffff !important;
  border-color: #4b5563 !important;
}
body.theme-dark .btn-outline-secondary:hover {
  background: #2e2e2e !important;
  border-color: #6b7280 !important;
  color: #ffffff !important;
}

/* Smooth table row hover */
.dash-spreadsheet tr td.dash-cell {
  transition: background 0.1s ease;
}

/* Smooth input focus */
input, .Select-control, textarea {
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

/* Smooth dropdown open */
.Select-menu-outer {
  animation: fadeSlideIn 0.15s ease-out;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Loading bar smooth animation */
.progress-bar {
  transition: width 0.4s ease-out !important;
}

/* Page transitions */
#_pages_content {
  animation: fadeIn 0.2s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0.8; }
  to { opacity: 1; }
}

/* Fix dropdown z-index in tables */
.pipeline-row .Select-menu-outer,
.data-table-container .Select-menu-outer {
  z-index: 1000 !important;
}

/* Smoother chart rendering */
.js-plotly-plot {
  will-change: contents;
}
.js-plotly-plot .main-svg {
  contain: strict;
}

/* Watchlist sidebar styles */
#sidebar-groups > div:hover {
  background-color: #f3f4f6 !important;
}

#select-all-companies:hover {
  background-color: #dbeafe !important;
}

/* Delete button visibility */
.delete-watchlist-btn {
  opacity: 1;
  transition: opacity 0.15s ease;
}

/* Logo styling */
.app-header img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  -ms-interpolation-mode: nearest-neighbor;
}

/* Notes cell hover */
[id*="open-notes"]:hover {
  background-color: #f3f4f6 !important;
  border-color: #9ca3af !important;
}

/* User dropdown menu styles */
.user-dropdown .dropdown-toggle {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.user-dropdown .dropdown-toggle::after {
  display: none;
}

.user-dropdown .dropdown-toggle:hover,
.user-dropdown .dropdown-toggle:focus,
.user-dropdown .dropdown-toggle:active {
  background: transparent !important;
  box-shadow: none !important;
}

.user-dropdown .dropdown-menu {
  min-width: 220px;
  padding: 8px 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  margin-top: 8px;
}

.user-dropdown .dropdown-header {
  font-size: 0.7rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 16px 4px;
}

.user-dropdown .dropdown-item {
  padding: 10px 16px;
  font-size: 0.875rem;
  color: #374151;
  display: flex;
  align-items: center;
}

.user-dropdown .dropdown-item:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.user-dropdown .dropdown-item.active {
  background-color: #eff6ff;
  color: #2563eb;
}

.user-dropdown .dropdown-item i {
  font-size: 0.95rem;
  color: #6b7280;
}

.user-dropdown .dropdown-item:hover i {
  color: #374151;
}

.user-dropdown .dropdown-divider {
  margin: 8px 0;
  border-color: #e5e7eb;
}

/* ============================================
   THEME: Dark Mode
   ============================================ */
body.theme-dark,
body.theme-dark #app-container {
  background-color: #1e1e1e !important;
  color: #ffffff !important;
}

/* Fill the viewport so the themed (dark) background covers short pages — otherwise the
   white <html> background shows beneath, e.g. the pipeline page in dark mode. */
#app-container { min-height: 100vh; }
html:has(body.theme-dark) { background-color: #1e1e1e; }

body.theme-dark .container-fluid {
  background-color: #1e1e1e !important;
}

body.theme-dark .app-header {
  background: linear-gradient(135deg, #000000 0%, #1e1e1e 100%) !important;
  border-bottom: 1px solid #2f2f2f !important;
}

body.theme-dark .filter-panel {
  background-color: #1e1e1e !important;
  border: 1px solid #2f2f2f !important;
}

body.theme-dark .filter-panel-title,
body.theme-dark .page-title {
  color: #ffffff !important;
}

body.theme-dark .filter-panel-header {
  border-bottom-color: #2f2f2f !important;
}

body.theme-dark .form-label,
body.theme-dark label {
  color: #ffffff !important;
}

body.theme-dark .form-control,
body.theme-dark input[type="number"],
body.theme-dark input[type="text"] {
  background-color: #2f2f2f !important;
  border-color: #333333 !important;
  color: #ffffff !important;
}

body.theme-dark .form-control::placeholder {
  color: #ffffff !important;
}

/* Dropdown selects in dark mode */
body.theme-dark .Select-control {
  background-color: #2f2f2f !important;
  border-color: #333333 !important;
}

body.theme-dark .Select-value-label,
body.theme-dark .Select-placeholder {
  color: #ffffff !important;
}

body.theme-dark .Select-menu-outer {
  background-color: #1e1e1e !important;
  border-color: #333333 !important;
}

body.theme-dark .Select-option {
  background-color: #1e1e1e !important;
  color: #ffffff !important;
}

body.theme-dark .Select-option:hover,
body.theme-dark .Select-option.is-focused {
  background-color: #2f2f2f !important;
}

/* Data table in dark mode */
body.theme-dark .data-table-container,
body.theme-dark .dash-table-container,
body.theme-dark .dash-spreadsheet-container {
  background-color: #1e1e1e !important;
}

body.theme-dark .dash-header,
body.theme-dark th {
  background-color: #1e1e1e !important;
  color: #ffffff !important;
  border-color: #2f2f2f !important;
}

body.theme-dark td.dash-cell,
body.theme-dark td {
  background-color: #1e1e1e !important;
  color: #ffffff !important;
  border-bottom-color: #2f2f2f !important;
}

body.theme-dark tr:hover td {
  background-color: #2f2f2f !important;
}

/* KPI cards in dark mode */
body.theme-dark .stat-card,
body.theme-dark .kpi-row > div {
  background-color: #1e1e1e !important;
  border-color: #2f2f2f !important;
}

body.theme-dark .stat-value {
  color: #ffffff !important;
}

body.theme-dark .stat-label {
  color: #ffffff !important;
}

body.theme-dark .page-subtitle {
  color: #ffffff !important;
}

/* Cart bar in dark mode */
body.theme-dark .cart-bar {
  background-color: #1e1e1e !important;
  border-top-color: #2f2f2f !important;
}

body.theme-dark .cart-bar .cart-inner {
  background-color: #000000 !important;
  color: #ffffff !important;
}

/* Modals in dark mode */
body.theme-dark .modal-content {
  background-color: #1e1e1e !important;
  color: #ffffff !important;
  border-color: #333333 !important;
}

body.theme-dark .modal-header {
  background: #1e1e1e !important;        /* --bg-card stays white in dark; force header dark too */
  border-bottom-color: #2f2f2f !important;
  color: #ffffff !important;
}

body.theme-dark .modal-footer {
  border-top-color: #2f2f2f !important;
}

body.theme-dark .modal-title {
  color: #ffffff !important;
}

/* Notes modal — the formatting buttons are <button> elements with no color set, so they
   fall back to black (invisible on the dark modal); the contentEditable editor + last-saved
   text need to track the theme too. var(--c-*) flip with the theme, so this works in both. */
#format-bold, #format-italic, #format-highlight, #format-bullet, #format-number {
  color: var(--c-body) !important;
}
#notes-editor { color: var(--c-strong); }
#notes-editor:empty:before {
  content: "Start typing your notes…";
  color: var(--c-faint);
  pointer-events: none;
}
body.theme-dark #notes-last-saved { color: #b9bcc4 !important; }
body.theme-dark #notes-modal .form-control,
body.theme-dark #notes-editor { border-color: #3a3a3a !important; }

/* Dropdown menu in dark mode */
body.theme-dark .dropdown-menu {
  background-color: #1e1e1e !important;
  border-color: #333333 !important;
}

body.theme-dark .dropdown-item {
  color: #ffffff !important;
}

body.theme-dark .dropdown-item:hover {
  background-color: #2f2f2f !important;
}

body.theme-dark .dropdown-header {
  color: #ffffff !important;
}

body.theme-dark .dropdown-divider {
  border-color: #2f2f2f !important;
}

body.theme-dark .page-footer {
  color: #ffffff !important;
}

/* Slider in dark mode */
body.theme-dark .rc-slider-track {
  background-color: #3b82f6 !important;
}

body.theme-dark .rc-slider-rail {
  background-color: #333333 !important;
}

body.theme-dark .rc-slider-dot {
  border-color: #333333 !important;
  background-color: #1e1e1e !important;
}

body.theme-dark .rc-slider-mark-text {
  color: #ffffff !important;
}

.theme-dark .Select-option {
  background-color: #1e1e1e !important;
  color: #ffffff !important;
}

.theme-dark .Select-option:hover,
.theme-dark .Select-option.is-focused {
  background-color: #2f2f2f !important;
}

/* Cards / list-groups / accordions / popovers were never dark-themed, so in dark mode
   they stayed white while the body text went light — i.e. white text on a white box.
   Give every surface container a dark background + readable text. */
body.theme-dark .card,
body.theme-dark .card-body,
body.theme-dark .list-group,
body.theme-dark .list-group-item,
body.theme-dark .accordion,
body.theme-dark .accordion-item,
body.theme-dark .accordion-body,
body.theme-dark .popover,
body.theme-dark .popover-body,
body.theme-dark .toast,
body.theme-dark .toast-body {
  background-color: #1e1e1e !important;
  color: #ffffff !important;
  border-color: #2f2f2f !important;
}

body.theme-dark .card-header,
body.theme-dark .card-footer,
body.theme-dark .accordion-button,
body.theme-dark .list-group-item-action {
  background-color: #181818 !important;
  color: #ffffff !important;
  border-color: #2f2f2f !important;
}

body.theme-dark .accordion-button:not(.collapsed) {
  background-color: #1a1a1a !important;
  color: #ffffff !important;
}

/* ---- Multi-select chips (Exchange, Priority Bucket, Sector …) ----
   Selected values render as chips with a light background; in dark mode that left
   light text on a light chip. Give the chips a dark surface. */
body.theme-dark .Select--multi .Select-value {
  background-color: #2f2f2f !important;
  border-color: #3a3a3a !important;
  color: #ffffff !important;
}
body.theme-dark .Select--multi .Select-value-label { color: #ffffff !important; }
body.theme-dark .Select--multi .Select-value-icon { border-right-color: #3a3a3a !important; }
body.theme-dark .Select--multi .Select-value-icon:hover {
  background-color: #3a1c1c !important;
  color: #ef4444 !important;
}

/* ---- Theme-aware content tokens ----
   The watchlist, pipeline and deep-dive pages set colors inline. Browsers normalize
   inline hex to rgb(), so matching the inline string in CSS is unreliable — instead the
   pages reference these variables (e.g. style={"color": "var(--c-strong)"}). Light values
   below match the original design; dark mode makes all text white and backgrounds dark. */
:root {
  --c-strong: #111827;   /* headings / primary text */
  --c-body:   #374151;   /* body text */
  --c-muted:  #6b7280;   /* secondary text */
  --c-faint:  #9ca3af;   /* captions / hints */
  --bg-surface:   #ffffff;   /* cards / white panels */
  --bg-soft:      #f5f7fa;   /* subtle grey panels */
  --bg-info:      #eff6ff;   /* blue callout */
  --bg-danger:    #fef2f2;   /* red callout */
  --bg-highlight: #fef08a;   /* yellow highlight */
  --bg-hover:     #ebedf0;   /* row/cell hover + active */
}
body.theme-dark {
  --c-strong: #ffffff;
  --c-body:   #ffffff;
  --c-muted:  #ffffff;
  --c-faint:  #ffffff;
  --bg-surface:   #232323;
  --bg-soft:      #292929;
  --bg-info:      #15233a;
  --bg-danger:    #3a1c1c;
  --bg-highlight: #4a431a;
  --bg-hover:     #2e2e2e;
  /* design tokens used by headings (h1–h6), page titles, panel/filter labels and
     plotly text — were never overridden, so the company name (an <h5>) stayed black. */
  --text-primary:   #ffffff;
  --text-secondary: #ffffff;
  --text-muted:     #ffffff;
}

/* bootstrap muted text → white in dark (no grey, per design) */
body.theme-dark .text-muted { color: #ffffff !important; }

/* Loading screen panel (and any .panel) — was a white box with a light border in dark. */
body.theme-dark .panel {
  background: #1e1e1e !important;
  border-color: #2f2f2f !important;
}

/* Cash/liquidity chart: identical in light & dark — fixed white card + fixed dark text,
   immune to the theme-driven plotly text color. */
.static-chart {
  background: #ffffff;
  border-radius: 8px;
  padding: 8px 6px;
}
.static-chart .js-plotly-plot .plotly text { fill: #4a4a4a !important; }

/* ============================================
   FONTS
   ============================================ */
.font-inter {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.font-inter * {
  font-family: inherit;
}

.font-calibri {
  font-family: 'Calibri', 'Carlito', 'Segoe UI', -apple-system, sans-serif !important;
}

.font-calibri * {
  font-family: inherit;
}

.font-system {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

.font-system * {
  font-family: inherit;
}

.font-roboto {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

.font-roboto * { font-family: inherit; }

.font-lato {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

.font-lato * { font-family: inherit; }

.font-georgia {
  font-family: Georgia, 'Times New Roman', Times, serif !important;
}

.font-georgia * { font-family: inherit; }

.font-merriweather {
  font-family: 'Merriweather', Georgia, 'Times New Roman', serif !important;
}

.font-merriweather * { font-family: inherit; }

.font-open-sans { font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif !important; }
.font-open-sans * { font-family: inherit; }

.font-montserrat { font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif !important; }
.font-montserrat * { font-family: inherit; }

.font-poppins { font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif !important; }
.font-poppins * { font-family: inherit; }

.font-nunito { font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif !important; }
.font-nunito * { font-family: inherit; }

.font-work-sans { font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif !important; }
.font-work-sans * { font-family: inherit; }

.font-source-serif { font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif !important; }
.font-source-serif * { font-family: inherit; }

.font-playfair { font-family: 'Playfair Display', Georgia, 'Times New Roman', serif !important; }
.font-playfair * { font-family: inherit; }

.font-lora { font-family: 'Lora', Georgia, 'Times New Roman', serif !important; }
.font-lora * { font-family: inherit; }

.font-jetbrains { font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace !important; }
.font-jetbrains * { font-family: inherit; }

.font-courier { font-family: 'Courier New', Courier, monospace !important; }
.font-courier * { font-family: inherit; }

/* Compact, scrollable font picker inside the profile dropdown (instead of a tall menu) */
.font-list {
  max-height: 188px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.font-list::-webkit-scrollbar { width: 6px; }
.font-list::-webkit-scrollbar-thumb { background: var(--bg-soft); border-radius: 3px; }
.font-list::-webkit-scrollbar-track { background: transparent; }

/* Analysis page section navigation */
.nav-link-item:hover {
  background-color: #f3f4f6 !important;
  color: #111827 !important;
}

html {
  scroll-behavior: smooth;
}

/* Offset for sticky header when jumping to sections */
[id^="section-"] {
  scroll-margin-top: 120px;
}

/* ───────────────────────── Deep-dive page ───────────────────────── */
/* Sticky toolbar: sits just under the global app header (56px). */
.dd-toolbar {
  position: sticky;
  top: 56px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 4px;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid #e5e7eb;
}
.dd-back { white-space: nowrap; }

/* Company switcher: prev · dropdown · next · counter */
.dd-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  justify-content: center;
  min-width: 0;
}
.dd-company-select { width: 320px; max-width: 42vw; font-size: 0.9rem; }
.dd-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 700;
  color: #374151;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  transition: all 0.15s ease;
}
.dd-arrow:hover {
  background: #f3f4f6;
  color: #111827;
  border-color: #d1d5db;
}
.dd-counter {
  font-size: 0.8rem;
  font-weight: 600;
  color: #9ca3af;
  white-space: nowrap;
  min-width: 48px;
}

/* Body: constrain width so long content doesn't sprawl edge-to-edge. */
.dd-body {
  max-width: 1100px;
  margin: 0 auto;
}

/* ── Smoothness: snappy, GPU-friendly interactions ──────────────────────── */
a, button, .dd-nav-link, .nav-link-item, .al-row, .alerts-nav-btn, .stat-card,
.app-header nav a, .dd-arrow {
  transition: background-color 0.12s ease, color 0.12s ease,
              border-color 0.12s ease, opacity 0.12s ease, box-shadow 0.12s ease;
}
.al-row { cursor: default; }
.al-row:hover { background-color: var(--bg-soft); }     /* Gmail-style row hover */
html { scroll-behavior: smooth; }
body { text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
/* keep the sticky bars on their own compositor layer for jank-free scrolling */
.app-header, .dd-toolbar, .comps-overlay-bar { will-change: transform; transform: translateZ(0); }

/* Live Feed pulsing dot (so it reads as "live") */
.live-dot {
  color: #10b981;
  display: inline-block;
  animation: live-pulse 1.5s ease-in-out infinite;
}
@keyframes live-pulse {
  0%   { opacity: 1;    text-shadow: 0 0 0 rgba(16,185,129,0); }
  50%  { opacity: 0.45; text-shadow: 0 0 7px rgba(16,185,129,0.95); }
  100% { opacity: 1;    text-shadow: 0 0 0 rgba(16,185,129,0); }
}

/* Alerts row: dismiss revealed only on hover (harder to delete by accident) */
.al-dismiss-btn {
  cursor: pointer;
  color: var(--c-faint);
  font-size: 0.74rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.12s ease, color 0.12s ease;
}
.al-row:hover .al-dismiss-btn { opacity: 1; }
.al-dismiss-btn:hover { color: #ef4444; }

/* ── Alerts bell in the header (with notification badge) ─────────────────── */
.alerts-nav-btn {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.12s ease;
}
.alerts-nav-btn:hover { color: #ffffff; text-decoration: none; }
.alerts-badge {
  display: none;
  position: absolute;
  top: -7px;
  right: -10px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  background: #ef4444;
  color: #ffffff;
  border-radius: 9px;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--navy-900);
}
.alerts-badge.show { display: inline-block; }

/* ── Deep-dive section nav (sticky sidebar, scroll-spy) ───────────────────── */
.dd-nav-sidebar {
  position: sticky;
  top: 120px;
  width: 152px;
  flex-shrink: 0;
  padding-right: 16px;
  align-self: flex-start;
}
.dd-nav-title {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--c-faint);
  margin: 0 0 10px 12px;
}
.dd-nav { display: flex; flex-direction: column; gap: 2px; }
.dd-nav-link {
  display: block;
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--c-muted);
  text-decoration: none;
  border-radius: 6px;
  border-left: 2px solid transparent;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.dd-nav-link:hover { color: var(--c-strong); background: var(--bg-soft); text-decoration: none; }
.dd-nav-link.active {
  color: #2563eb;
  background: var(--bg-info);
  border-left-color: #2563eb;
  font-weight: 600;
}

/* Comps company-name hover rationale — box visuals are inline on the element; this single
   rule reveals it on hover (and overrides the inline display:none). */
.comp-tip { position: relative; }
.comp-tip:hover .comp-tip-box { display: block !important; }

/* ── Comps full-screen overlay (Pull Comps) ──────────────────────────────── */
.comps-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--bg-page);
  overflow-y: auto;
}
.comps-overlay-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--bg-soft);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.comps-overlay-body {
  max-width: 1640px;
  margin: 0 auto;
  padding: 28px 40px 64px;
}
body.theme-dark .comps-overlay { background: #1e1e1e; }
body.theme-dark .comps-overlay-bar { background: #232323; border-bottom-color: #2f2f2f; }

/* ============================================================================
   Comps table — clean, professional IB style: navy header band + blue accents.
   Navy (#0d1b33) + blue (#2563eb) match the landing page.
   ============================================================================ */
.comps-wrap { font-size: 0.82rem; --cnavy: #0d1b33; --cblue: #005ce1; }   /* blue sampled from comps.png */

/* Page header (title + classification) */
.comps-head { margin-bottom: 20px; }
.comps-head .t1 { font-size: 1.15rem; font-weight: 700; color: var(--c-strong); letter-spacing: -0.01em; }
.comps-head .t2 { font-size: 0.78rem; color: var(--c-muted); margin-top: 4px; }

/* Headline strip: target value + peer median (blue) — clean rounded KPI tiles */
.comps-strip { display: flex; gap: 13px; flex-wrap: wrap; margin-bottom: 26px; }
.comps-card {
  flex: 1; min-width: 134px; padding: 15px 17px; border-radius: 12px;
  background: #fff; border: 1px solid #e8ebf0; box-shadow: 0 1px 2px rgba(16,24,40,0.05);
}
body.theme-dark .comps-card { background: #20242c; border-color: #2c313b; box-shadow: none; }
.comps-card .lbl { font-size: 0.6rem; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--c-muted); font-weight: 600; margin-bottom: 9px; }
.comps-card .val { font-size: 1.34rem; font-weight: 700; color: var(--c-strong); line-height: 1.0;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
body.theme-dark .comps-card .val { color: #fff; }
.comps-card .med { font-size: 0.72rem; color: var(--c-muted); margin-top: 9px; }
.comps-card .med b { color: var(--cblue); font-weight: 700; }
body.theme-dark .comps-card .med b { color: #7dd3fc; }

/* Table shell */
.comps-scroll { overflow-x: auto; border-radius: 0; border: 1px solid var(--bg-soft); }   /* square edges */
body.theme-dark .comps-scroll { border-color: #2c313b; }
.comps-tbl { width: 100%; border-collapse: collapse; }

/* Navy header band — same in both themes (premium IB-deck look) */
.comps-tbl th {
  padding: 11px 9px; font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--c-body); text-align: right; white-space: normal;
  vertical-align: bottom; line-height: 1.25; background: #f8f9fb;
  border-bottom: 2px solid var(--cnavy); position: sticky; top: 0;
}
body.theme-dark .comps-tbl th { background: #1a1d24; color: #aeb6c2; border-bottom-color: var(--cblue); }
.comps-tbl th.l, .comps-tbl td.l { text-align: left; }

/* Rows — clean hairlines, primary-dark figures, compact so the whole table fits (no h-scroll) */
.comps-tbl td {
  padding: 10px 9px; white-space: nowrap; color: var(--c-strong); font-size: 0.8rem;
  border-top: 1px solid #edf0f4; text-align: right; font-variant-numeric: tabular-nums;
}
body.theme-dark .comps-tbl td { color: #cdd2db; border-top-color: #2a2f38; }
.comps-tbl td.tk { color: var(--c-muted); font-size: 0.76rem; letter-spacing: 0.02em; font-weight: 500; }
/* Niche / proximity tag next to a peer name (colored inline by match level via inline style) */
.cn-niche { font-size: 0.68rem; font-weight: 600; margin-left: 11px; white-space: nowrap; }
.comps-tbl tbody tr:hover td { background: #f8f9fb; }
body.theme-dark .comps-tbl tbody tr:hover td { background: #23272f; }

/* Target (subject) row — site accent-blue band + left accent, navy figures (header rule sits above) */
.comps-tbl tr.comps-target td {
  background: #eff6ff; color: var(--cnavy); font-weight: 700;
  border-top: none; border-bottom: 1px solid #dbe8fb;
}
.comps-tbl tr.comps-target td.l:first-child { box-shadow: inset 3px 0 0 var(--cblue); }
body.theme-dark .comps-tbl tr.comps-target td { background: rgba(37,99,235,0.26); color: #fff;
  border-bottom-color: rgba(37,99,235,0.4); }
.comps-tbl tr.comps-target:hover td { background: #eff6ff; }
body.theme-dark .comps-tbl tr.comps-target:hover td { background: rgba(37,99,235,0.26); }

/* Group separators (Primary / Secondary) — blue label */
.comps-tbl tr.comps-group td {
  padding: 16px 16px 7px; font-size: 0.57rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.11em; color: var(--cblue); text-align: left; border-top: none;
}
.comps-tbl tr.comps-group:hover td { background: transparent; }

/* ── Comps: interactive editing (add / remove) ── */
.comps-warn { font-size: 0.78rem; color: #92400e; background: #fef3c7;
  border: 1px solid #fde68a; border-radius: 8px; padding: 8px 12px; margin-bottom: 16px; }
.comps-foot { font-size: 0.7rem; color: var(--c-faint); margin-top: 16px; line-height: 1.55; }

/* Add-comparable bar — full-width search (ticker or company name) + Add */
.comps-addbar { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; width: 100%; }
.comps-add-ddwrap { flex: 1 1 0; min-width: 0; }
.comps-add-dd, .comps-add-dd .Select-control { border-radius: 4px; min-height: 40px; }
.comps-add-btn { flex: 0 0 auto; padding: 9px 18px; border: none; border-radius: 4px;
  background: var(--cnavy); color: #fff; font-weight: 600; font-size: 0.82rem; cursor: pointer;
  font-family: inherit; white-space: nowrap; }
.comps-add-btn:hover { background: #16243d; }
.comps-add-status { flex: 0 0 auto; font-size: 0.76rem; color: var(--c-muted); }

/* Rationale tooltip (dbc.Tooltip, portal-rendered) */
.comps-tt .tooltip-inner { max-width: 340px; text-align: left; background: #1f2937;
  color: #f9fafb; font-size: 0.76rem; line-height: 1.5; padding: 9px 11px; border-radius: 7px; }
.comps-tt .tt-name { font-weight: 700; margin-bottom: 3px; }
.comps-tt .tt-tag { font-weight: 700; font-size: 0.7rem; margin: 1px 0 6px; }
.comps-tt .tt-sec { margin-top: 5px; font-style: italic; opacity: 0.85; }

/* Pull Comps button — landing-page navy in every state (no blue/green bleed-through) */
.btn-pull-comps, .btn-pull-comps:hover, .btn-pull-comps:focus,
.btn-pull-comps:active, .btn-pull-comps:focus-visible {
  background-color: #0d1b33 !important; border-color: #0d1b33 !important; color: #fff !important;
  box-shadow: 0 1px 3px rgba(13,27,51,0.4) !important; }
.btn-pull-comps:hover { background-color: #16243d !important; border-color: #16243d !important; }

/* ── Redesigned comps: header card + tabs (Primary / Secondary) + stats block ── */
.comps-header2 { display: flex; align-items: center; gap: 16px; margin-bottom: 22px;
  padding-bottom: 20px; border-bottom: 1px solid var(--bg-soft); }
body.theme-dark .comps-header2 { border-bottom-color: #2c313b; }
.comps-ident { flex: 1; min-width: 0; }
.comps-ident .cnamerow { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.comps-ident .cname { font-size: 1.22rem; font-weight: 700; color: var(--c-strong);
  letter-spacing: -0.01em; }
.comps-ident .ctick { font-size: 0.78rem; font-weight: 700; color: var(--cblue);
  background: var(--accent-blue-light); padding: 2px 8px; border-radius: 4px; }
body.theme-dark .comps-ident .ctick { background: rgba(37,99,235,0.2); }
.comps-ident .csub { font-size: 0.65rem; color: var(--c-muted); margin-top: 5px;
  text-transform: uppercase; letter-spacing: 0.09em; font-weight: 600; }
body.theme-dark .comps-ident .cname { color: #ffffff; }
body.theme-dark .comps-ident .csub { color: #8b93a3; }
.comps-tags { display: flex; gap: 8px; flex-shrink: 0; }
.cpill { font-size: 0.66rem; font-weight: 600; padding: 4px 10px; border-radius: 4px;
  background: var(--accent-blue-light); color: var(--cblue); white-space: nowrap; letter-spacing: 0.02em; }
.cpill.ghost { background: #f3f4f6; border: none; color: var(--c-muted); }
body.theme-dark .cpill { background: rgba(37,99,235,0.18); }
body.theme-dark .cpill.ghost { border-color: #2c313b; }

/* Summary stats block (Median / Mean / High / Low) — clean light panel set off from the rows */
.comps-tbl tr.comps-sum td { padding: 9px 9px; background: #f8fafc; color: var(--c-muted);
  font-size: 0.78rem; border-top: 1px solid #edf0f4; }
body.theme-dark .comps-tbl tr.comps-sum td { background: #1c2029; color: #aeb6c2; }
.comps-tbl tr.comps-sum td.lbl { font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  font-size: 0.64rem; color: var(--c-muted); }
/* Median — the headline comp stat: navy + a 2px navy rule separating it from the peer rows */
.comps-tbl tr.comps-sum.median td { font-weight: 700; color: var(--cnavy); font-size: 0.82rem; }
.comps-tbl tr.comps-sum.median td.lbl { color: var(--cnavy); }
body.theme-dark .comps-tbl tr.comps-sum.median td { color: #fff; }
.comps-tbl tr.comps-sum.sum-top td { border-top: 2px solid var(--cblue); }
body.theme-dark .comps-tbl tr.comps-sum.sum-top td { border-top-color: var(--cblue); }
/* Mean — subtly set apart with a soft tint (text stays readable) */
.comps-tbl tr.comps-sum.mean td { font-weight: 600; color: var(--c-body); background: #eef3fa; }
.comps-tbl tr.comps-sum.mean:hover td { background: #eef3fa; }
body.theme-dark .comps-tbl tr.comps-sum.mean td { color: #e3e7ee; background: rgba(255,255,255,0.07); }
body.theme-dark .comps-tbl tr.comps-sum.mean:hover td { background: rgba(255,255,255,0.07); }
.comps-tbl tr.comps-sum:hover td { background: #f8fafc; }
body.theme-dark .comps-tbl tr.comps-sum:hover td { background: #1c2029; }

/* Two clearly-separated comp sections (bold headers, big spacing) */
.comps-section { margin-top: 40px; }
/* Inline section label — a light row with a blue uppercase label ("Primary Companies · 8"),
   sitting in the table body under the target row (matches the reference layout). */
.comps-tbl tr td.comps-grouplbl {
  padding: 13px 16px 12px; font-size: 0.72rem; font-weight: 700; color: var(--cblue);
  text-transform: uppercase; letter-spacing: 0.09em; text-align: left; border-top: none;
  background: #f8f9fb;
}
body.theme-dark .comps-tbl tr td.comps-grouplbl { color: #7dd3fc; background: #15171c; }
.comps-tbl tbody tr:hover td.comps-grouplbl { background: #f8f9fb; }
body.theme-dark .comps-tbl tbody tr:hover td.comps-grouplbl { background: #15171c; }
/* Header for an empty 'Additional Comps' section (no table to host the label) */
.cs-emptyhd { font-size: 0.72rem; font-weight: 700; color: var(--cblue); text-transform: uppercase;
  letter-spacing: 0.09em; margin-bottom: 10px; }
body.theme-dark .cs-emptyhd { color: #fff; }

/* Company cell: name + chip on top, visible rationale sub-line below */
.cn-top { display: flex; align-items: center; white-space: nowrap; }

/* Add-comparable label */
.comps-addlabel { font-size: 0.7rem; font-weight: 700; color: var(--c-muted);
  text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; flex: 0 0 auto; }

/* Rationale tooltip must sit ABOVE the full-screen comps overlay (z-index 2000) */
.comps-tt { z-index: 6000 !important; }

/* P/E basis tag (TTM / FW) — shown on the column header, not per value */
.hdr-basis { font-size: 0.52rem; font-weight: 700; color: #8b97ab; letter-spacing: 0.04em; }

/* Remove (×) on a comp row */
.comps-rm { margin-left: 10px; color: var(--c-faint); cursor: pointer; font-weight: 700;
  font-size: 0.95rem; line-height: 1; opacity: 0; transition: opacity .12s, color .12s; }
.comps-tbl tbody tr:hover .comps-rm { opacity: 1; }
.comps-rm:hover { color: #dc2626; }

/* Empty-secondary note */
.comps-sec-note { font-size: 0.74rem; color: var(--c-muted); margin: 12px 2px 10px;
  line-height: 1.5; }

/* Build loading card — indeterminate bar + live timer (deep-dive-style) */
.comps-loading { padding: 64px 8px; text-align: center; }
.comps-load-title { font-size: 1.02rem; font-weight: 700; color: var(--c-strong); }
.comps-load-sub { font-size: 0.8rem; color: var(--c-muted); margin: 7px 0 20px; }
.comps-loadbar { position: relative; height: 6px; max-width: 440px; margin: 0 auto;
  background: var(--bg-soft); border-radius: 4px; overflow: hidden; }
body.theme-dark .comps-loadbar { background: #2a2f38; }
.comps-loadbar-fill { position: absolute; top: 0; height: 100%; width: 35%; border-radius: 4px;
  background: #2563eb; animation: comps-load-slide 1.05s ease-in-out infinite; }
@keyframes comps-load-slide { 0% { left: -38%; } 100% { left: 100%; } }
.comps-load-timer { font-size: 0.78rem; color: var(--c-muted); margin-top: 16px;
  font-variant-numeric: tabular-nums; }

/* Far-right remove button (with confirm) */
.comps-rm-cell { text-align: right; width: 1%; white-space: nowrap; }
.comps-rm-btn { border: 1px solid var(--bg-soft); background: transparent; color: var(--c-faint);
  font-size: 0.64rem; font-weight: 700; padding: 3px 9px; border-radius: 6px; cursor: pointer;
  opacity: 0.5; transition: opacity .12s, color .12s, border-color .12s; font-family: inherit; }
.comps-tbl tbody tr:hover .comps-rm-btn { opacity: 1; }
.comps-rm-btn:hover { color: #dc2626; border-color: #dc2626; background: rgba(220,38,38,0.06); }
body.theme-dark .comps-rm-btn { border-color: #2c313b; }

/* Company logo tile next to the name in the overview header.
   The tile (white + bordered) is always shown; the image sits inside it.
   If a company has no logo, the tile stays as clean white space. */
.company-logo {
  width: 46px;
  height: 46px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  flex-shrink: 0;
  overflow: hidden;
}
.company-logo-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  /* crisp downscaling of the high-res source logo */
  image-rendering: -webkit-optimize-contrast;
}
body.theme-dark .company-logo {
  background: #fff;            /* keep a light pad so dark logos stay visible */
  border-color: #2f2f2f;
}

/* Mandate page inherits the app's default accent blue (#2563eb) so it matches the
   Screener exactly — no page-scoped override. */

/* Dark mode */
body.theme-dark .dd-toolbar {
  background: rgba(0, 0, 0, 0.92);
  border-bottom-color: #2f2f2f;
}
body.theme-dark .dd-arrow {
  background: #1e1e1e;
  color: #e2e8f0;
  border-color: #2f2f2f;
}
body.theme-dark .dd-arrow:hover { background: #2f2f2f; color: #fff; }

/* ============================================================================
   BRAND HOVER DROPDOWN — header logo -> landing page sections
   ========================================================================= */
.brand-wrap { position: relative; display: flex; align-items: center; }
.brand-menu {
  position: absolute; top: 100%; left: 0; margin-top: 12px;
  background: #ffffff; border: 1px solid #e6e9f0; border-radius: 12px;
  box-shadow: 0 18px 44px rgba(13,27,51,0.22);
  min-width: 234px; padding: 8px; z-index: 300;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
/* transparent bridge so moving the cursor over the gap keeps the menu open */
.brand-menu::before { content: ""; position: absolute; top: -12px; left: 0; right: 0; height: 12px; }
.brand-wrap:hover .brand-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.brand-menu .bm-head {
  font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.13em;
  color: #9aa1b0; font-weight: 700; padding: 8px 12px 8px;
}
.brand-menu a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 12px; border-radius: 8px; text-decoration: none; transition: background .12s ease;
}
.brand-menu .bm-text > span:first-child { display: block; color: #1a2336; font-size: 0.9rem; font-weight: 600; }
.brand-menu .bm-sub { display: block; color: #9aa1b0; font-size: 0.73rem; font-weight: 400; margin-top: 1px; }
.brand-menu .bm-arrow { color: #cbd2e0; font-size: 0.92rem; flex-shrink: 0;
  transition: color .12s ease, transform .12s ease; }
.brand-menu a:hover { background: #f5f7fb; }
.brand-menu a:hover .bm-text > span:first-child { color: #2563eb; }
.brand-menu a:hover .bm-arrow { color: #2563eb; transform: translate(2px, -2px); }
/* dark mode: light menu still reads fine; keep card white for contrast on the dark header */
/* Daily SEC Updates */
.live-feed-state {
  text-decoration: none;
  color: #6b7280;
}

.live-feed-state:hover {
  color: #111827;
}

/* NOTE: the soft gradient background is scoped to the daily page's own shell, NOT the global
   .container-fluid (which would tint every page and break dark mode site-wide). */
.daily-page-shell {
  display: grid;
  gap: 10px;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.06), transparent 30%),
    linear-gradient(180deg, #f7f8fc 0%, #eef2f7 100%);
  border-radius: 14px;
  padding: 18px;
  min-height: calc(100vh - 120px);
}

.daily-title-block {
  display: grid;
  gap: 4px;
}

.daily-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 2px;
}

.daily-summary-card {
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  padding: 18px 20px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 16px;
  min-height: 148px;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.daily-summary-card:hover {
  transform: translateY(-2px);
  text-decoration: none;
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.1);
}

.daily-summary-card:focus {
  outline: 2px solid rgba(37, 99, 235, 0.32);
  outline-offset: 2px;
}

.daily-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  align-self: start;
}

.daily-card-icon-tracked {
  background: linear-gradient(135deg, #dbeafe 0%, #eef2ff 100%);
  color: #2563eb;
}

.daily-card-icon-opportunities {
  background: linear-gradient(135deg, #d1fae5 0%, #ecfeff 100%);
  color: #0f766e;
}

.daily-card-icon-financing {
  background: linear-gradient(135deg, #ede9fe 0%, #eef2ff 100%);
  color: #6d28d9;
}

.daily-card-icon-financial {
  background: linear-gradient(135deg, #fef3c7 0%, #fff7ed 100%);
  color: #d97706;
}

.daily-card-copy {
  display: grid;
  gap: 8px;
  position: relative;
}

.daily-card-arrow {
  position: absolute;
  top: 2px;
  right: 2px;
  color: #64748b;
  font-size: 1.6rem;
  line-height: 1;
}

.daily-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.daily-section-purpose {
  color: #64748b;
  font-size: 0.85rem;
  margin-top: 4px;
}

.daily-business-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
}

.daily-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.daily-freshness {
  color: #475569;
  font-size: 0.88rem;
  text-align: left;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 14px;
  padding: 12px 16px;
  min-width: 0;
  width: max-content;
  max-width: 380px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.daily-freshness-headline {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 4px;
}

.daily-freshness-state {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #d97706;
  font-size: 0.95rem;
}

.daily-update-button {
  border-radius: 999px !important;
  padding: 12px 24px !important;
  min-width: 170px;
  font-size: 0.96rem !important;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

.daily-status-dot {
  color: #f59e0b;
  margin-right: 2px;
}

.daily-operation-line {
  color: #475569;
  font-size: 0.96rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 18px;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
  margin-top: -2px;
}

.daily-operation-main {
  color: #475569;
  line-height: 1.6;
}

.daily-operation-title {
  color: #111827;
  margin-right: 4px;
}

.daily-operation-link {
  color: #2563eb;
  font-weight: 600;
  white-space: nowrap;
  padding-top: 2px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: inherit;
}

.daily-operation-link:hover {
  text-decoration: underline;
}

.daily-board {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 20px;
  padding: 14px 14px 18px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.06);
}

.daily-business-filters {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  padding: 14px 14px 10px;
  position: sticky;
  top: 72px;
  z-index: 20;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.04);
}

.daily-filter-block {
  min-width: 220px;
}

.daily-search {
  width: 100%;
  min-width: 280px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid #dbe4f0;
  padding: 0 14px;
  background: #ffffff;
}

.daily-filter-select {
  min-width: 180px;
}

.daily-priority-select {
  min-width: 180px;
  max-width: 220px;
}

.daily-crm-select {
  min-width: 220px;
  max-width: 240px;
}

.daily-hidden-controls {
  display: none;
}

.daily-export-button {
  min-width: 190px;
  height: 40px;
  border-radius: 12px !important;
}

.daily-filter-row-bottom {
  display: grid;
  grid-template-columns: 220px 190px minmax(260px, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 0;
}

.daily-filter-note {
  justify-self: end;
  white-space: nowrap;
}

.daily-section-jumpnav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  margin-top: 12px;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
  scrollbar-width: none;
}

.daily-section-jumpnav::-webkit-scrollbar {
  display: none;
}

.daily-section-jump-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 10px;
  color: #475569;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-top: 0;
}

.daily-section-jump-link:hover {
  color: #1d4ed8;
  text-decoration: none;
}

.daily-section-jump-link-active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

.daily-jump-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #64748b;
  font-size: 0.82rem;
}

.daily-business-section {
  margin-top: 16px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.04);
  padding: 18px 18px 12px;
}

.daily-section-header {
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.daily-section-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.daily-section-count {
  background: #f8fafc;
  color: #334155;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.daily-section-chevron {
  color: #475569;
  font-size: 1rem;
  line-height: 1;
}

.daily-section-toolbar {
  display: flex;
  gap: 10px;
  margin: 10px 0 6px;
  justify-content: flex-end;
}

.daily-section-body {
  display: grid;
  gap: 12px;
}

.daily-section-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.daily-secondary-section {
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  margin-top: 16px;
  padding: 18px;
}

.daily-secondary-section summary {
  cursor: pointer;
  font-weight: 700;
  color: #111827;
}

.daily-progress-block {
  margin: 12px 0 18px;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  padding: 14px;
}

.daily-progress-title {
  font-weight: 700;
  margin-bottom: 4px;
}

/* Finished/failed status accents inside the Update modal status block. */
.daily-status-done.daily-status-ok {
  color: #15803d;
}
.daily-status-done.daily-status-warn {
  color: #b45309;
}
.daily-status-done.daily-status-error {
  color: #b91c1c;
}
.daily-status-running {
  color: #1d4ed8;
}

.daily-control-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 4px;
}

.daily-card-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: #111827;
  overflow-wrap: anywhere;
  line-height: 1.02;
}

.daily-card-label {
  margin-top: 2px;
  font-size: 0.95rem;
  text-transform: none;
  color: #111827;
  letter-spacing: 0;
  font-weight: 700;
}

.daily-card-description {
  color: #64748b;
  font-size: 0.85rem;
  line-height: 1.45;
}

.daily-card-period {
  margin-top: auto;
  font-size: 0.8rem;
  color: #475569;
}

.daily-toolbar,
.daily-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.daily-filter-row > * {
  min-width: 180px;
}

.daily-control-note,
.daily-action-message {
  color: #64748b;
  font-size: 0.85rem;
}

.daily-errors-panel {
  margin-top: 12px;
  padding: 12px 0;
}

.daily-empty-state {
  color: #475569;
  font-size: 0.96rem;
  padding: 34px 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px dashed #dbe4f0;
  border-radius: 14px;
  margin: 10px 0 14px;
  text-align: center;
}

.daily-status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.74rem;
  font-weight: 700;
  background: #f3f4f6;
  color: #374151;
}

.daily-status-stored,
.daily-status-succeeded {
  background: #dcfce7;
  color: #166534;
}

.daily-status-skipped_weekend,
.daily-status-skipped_holiday,
.daily-status-succeeded_with_warnings {
  background: #fef3c7;
  color: #92400e;
}

.daily-status-unexpected_gap,
.daily-status-request_failed,
.daily-status-parse_failed,
.daily-status-failed,
.daily-status-partial_failure {
  background: #fee2e2;
  color: #991b1b;
}

.daily-day-list {
  display: grid;
  gap: 6px;
  margin: 10px 0 16px;
}

.daily-day-row {
  display: grid;
  grid-template-columns: 120px 220px 1fr;
  gap: 10px;
  align-items: center;
  font-size: 0.86rem;
}

.daily-day-date {
  font-weight: 700;
  color: #111827;
}

.daily-day-detail {
  color: #6b7280;
}

.daily-error-card {
  border: 1px solid #fecaca;
  background: #fff7f7;
  border-radius: 12px;
  padding: 12px;
  margin: 8px 0;
  color: #374151;
}

.daily-error-title {
  font-weight: 800;
  color: #991b1b;
  margin-bottom: 4px;
}

.daily-raw-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
}

.daily-raw-pagination {
  display: flex;
  align-items: center;
  gap: 10px;
}

.daily-raw-page-summary {
  color: #475569;
  font-size: 0.88rem;
}

.daily-raw-page-size {
  min-width: 120px;
}

.daily-operations-card {
  margin-top: 18px;
  padding: 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.daily-issues-list {
  display: grid;
  gap: 10px;
}

.daily-issue-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 12px 14px;
}

.daily-issue-card summary {
  cursor: pointer;
  list-style: none;
}

.daily-issue-card summary::-webkit-details-marker {
  display: none;
}

.daily-issue-preview {
  font-weight: 600;
  color: #0f172a;
  line-height: 1.4;
}

.daily-issue-summary-meta,
.daily-issue-meta-line {
  color: #64748b;
  font-size: 0.82rem;
  margin-top: 6px;
}

.daily-issue-details {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #dbe4f0;
}

.daily-issue-detail {
  color: #334155;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .daily-summary-grid {
    grid-template-columns: 1fr;
  }

  .daily-freshness {
    min-width: 0;
    width: 100%;
    max-width: none;
  }

  .daily-filter-row-top,
  .daily-filter-row-bottom {
    display: flex;
    flex-wrap: wrap;
  }

  .daily-business-header {
    grid-template-columns: 1fr;
  }

  .daily-filter-row > *,
  .daily-toolbar > * {
    width: 100%;
  }

  .daily-business-filters {
    position: static;
    top: auto;
  }

  .daily-header-actions,
  .daily-section-header,
  .daily-raw-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .daily-operation-line {
    display: flex;
    margin-top: 0;
  }

  .daily-operation-link,
  .daily-filter-note {
    justify-self: start;
    white-space: normal;
  }
}

/* ============================================================================
   DAILY UPDATES — DARK MODE (main's daily page shipped without dark support)
   ========================================================================= */
body.theme-dark .daily-page-shell {
  background:
    radial-gradient(circle at top left, rgba(96,165,250,0.06), transparent 30%),
    linear-gradient(180deg, #161616 0%, #1c1c1c 100%) !important;
}
/* panels / cards -> dark surfaces */
body.theme-dark .daily-summary-card,
body.theme-dark .daily-freshness,
body.theme-dark .daily-operation-line,
body.theme-dark .daily-board,
body.theme-dark .daily-business-filters,
body.theme-dark .daily-business-section,
body.theme-dark .daily-secondary-section,
body.theme-dark .daily-operations-card,
body.theme-dark .daily-empty-state {
  background: #232323 !important;
  border-color: #2f2f2f !important;
}
body.theme-dark .daily-section-count,
body.theme-dark .daily-progress-block,
body.theme-dark .daily-issue-card,
body.theme-dark .daily-status-badge,
body.theme-dark .daily-jump-badge {
  background: #2e2e2e !important;
  border-color: #3a3a3a !important;
}
body.theme-dark .daily-search,
body.theme-dark .daily-filter-select,
body.theme-dark .daily-priority-select,
body.theme-dark .daily-crm-select,
body.theme-dark .daily-raw-page-size {
  background: #1e1e1e !important;
  border-color: #2f2f2f !important;
  color: #ffffff !important;
}
body.theme-dark .daily-error-card { background: #2a1a1a !important; border-color: #5b2a2a !important; }
/* strong text -> white */
body.theme-dark .daily-section-title,
body.theme-dark .daily-operation-title,
body.theme-dark .daily-freshness-headline,
body.theme-dark .daily-card-value,
body.theme-dark .daily-card-label,
body.theme-dark .daily-secondary-section summary,
body.theme-dark .daily-raw-summary-title {
  color: #ffffff !important;
}
/* secondary text -> light grey */
body.theme-dark .daily-card-arrow,
body.theme-dark .daily-section-purpose,
body.theme-dark .daily-freshness,
body.theme-dark .daily-operation-main,
body.theme-dark .daily-card-description,
body.theme-dark .daily-card-period,
body.theme-dark .daily-section-count,
body.theme-dark .daily-progress-block,
body.theme-dark .daily-section-chevron,
body.theme-dark .daily-control-label,
body.theme-dark .daily-control-note,
body.theme-dark .daily-action-message,
body.theme-dark .daily-empty-state,
body.theme-dark .daily-jump-badge {
  color: #cbced6 !important;
}
/* accent links/tabs stay readable on dark */
body.theme-dark .daily-operation-link,
body.theme-dark .daily-section-jump-link,
body.theme-dark .daily-section-jump-link-active { color: #60a5fa !important; }
body.theme-dark .daily-section-jumpnav { border-color: #2f2f2f !important; }
/* icon tiles -> subtle dark tint so they don't glow on the dark board */
body.theme-dark .daily-card-icon-tracked,
body.theme-dark .daily-card-icon-opportunities,
body.theme-dark .daily-card-icon-financing,
body.theme-dark .daily-card-icon-financial { background: #1f2a3a !important; }

/* Daily Updates: hide the raw accession-level audit view for the MD-facing view.
   (A callback sets #daily-all-sec-activity.style, so !important is needed to keep it hidden.) */
#daily-all-sec-activity { display: none !important; }
