/* ==========================================================================
   Vriddhi Wealth & Market Intelligence Desk - Modern Executive UI
   ========================================================================== */

:root {
  /* Color System - Premium Obsidian / Slate FinTech Palette */
  --bg-canvas: #070a11;
  --bg-sidebar: #0b101c;
  --bg-surface: #0f1627;
  --bg-card: #131c31;
  --bg-card-hover: #17233d;
  --bg-card-elevated: #1a2744;
  --bg-input: #0a0f1b;

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(255, 255, 255, 0.18);
  --border-focus: #6366f1;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dim: #475569;

  /* Accents */
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.25);
  --indigo: #6366f1;
  --indigo-glow: rgba(99, 102, 241, 0.25);
  --sky: #0ea5e9;
  --sky-glow: rgba(14, 165, 233, 0.25);
  --amber: #f59e0b;
  --amber-glow: rgba(245, 158, 11, 0.25);
  --rose: #f43f5e;

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* Elevation & Curves */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.4), 0 2px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 28px -6px rgba(0, 0, 0, 0.5), 0 4px 12px -2px rgba(0, 0, 0, 0.3);
  --shadow-glow-emerald: 0 0 24px -4px rgba(16, 185, 129, 0.45);
  --shadow-glow-indigo: 0 0 24px -4px rgba(99, 102, 241, 0.45);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.dark-theme {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  overflow: hidden;
}

/* Custom Sleek Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Outer Shell */
.terminal-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.05) 0%, transparent 60%),
              radial-gradient(circle at 90% 90%, rgba(16, 185, 129, 0.04) 0%, transparent 50%),
              var(--bg-canvas);
}

/* ==========================================================================
   1. Modern Top Header
   ========================================================================== */
.terminal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: rgba(11, 16, 28, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  z-index: 40;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.2px;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--emerald);
  box-shadow: 0 0 12px var(--emerald);
  position: relative;
}

.live-dot::after {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 50%;
  border: 1px solid var(--emerald);
  opacity: 0.6;
  animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

.terminal-title {
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.terminal-title span {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.topbar-divider {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.1);
}

.topbar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}

.topbar-label {
  color: var(--text-muted);
  font-weight: 500;
}

.topbar-val {
  color: var(--text-primary);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

#crawler-status-badge {
  color: var(--emerald);
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.25);
  font-weight: 700;
}

.clock-item {
  color: var(--sky);
  background: rgba(14, 165, 233, 0.08);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(14, 165, 233, 0.2);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

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

.terminal-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: 1px solid rgba(16, 185, 129, 0.4);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.terminal-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.45);
  filter: brightness(1.08);
}

.terminal-action-btn:active {
  transform: translateY(0);
}

.terminal-action-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.play-icon {
  font-size: 0.7rem;
  color: #ffffff;
}

/* ==========================================================================
   2. Main Layout (Sidebar + Workspace)
   ========================================================================== */
.terminal-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.terminal-sidebar {
  width: 240px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
  padding: 16px 12px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
  position: relative;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  transform: translateX(2px);
}

.nav-item.active {
  background: rgba(99, 102, 241, 0.12);
  color: #ffffff;
  border-color: rgba(99, 102, 241, 0.25);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 2px;
  background: var(--indigo);
  box-shadow: 0 0 10px var(--indigo);
}

.nav-icon {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
}

.nav-label {
  letter-spacing: -0.1px;
}

.sidebar-footer {
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.75rem;
}

.footer-badge {
  color: var(--emerald);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.footer-badge::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 6px var(--emerald);
}

.footer-sub {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

/* Main Workspace */
.terminal-workspace {
  flex: 1;
  background: transparent;
  overflow-y: auto;
  padding: 24px 32px 40px 32px;
}

.workspace-view {
  display: none;
  flex-direction: column;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
  animation: fadeIn 0.22s ease-out;
}

.workspace-view.active {
  display: flex;
}

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

/* Section Box Framework */
.section-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-header-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ==========================================================================
   3. SYSTEM METRICS (Today) - Modern Executive FinTech KPI Cards
   ========================================================================== */
.metrics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.kpi-card {
  background: linear-gradient(180deg, rgba(26, 36, 58, 0.6) 0%, rgba(15, 22, 38, 0.7) 100%);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  user-select: none;
}

.kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.15) 50%, transparent 100%);
}

.kpi-card:hover {
  border-color: rgba(99, 102, 241, 0.45);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 20px rgba(99, 102, 241, 0.2);
  background: linear-gradient(180deg, rgba(32, 45, 74, 0.75) 0%, rgba(18, 27, 48, 0.85) 100%);
}

.kpi-card:active {
  transform: translateY(-1px);
}

.drilldown-item-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.18s ease;
}

.drilldown-item-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateX(3px);
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.kpi-icon-badge {
  font-size: 1.15rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.8px;
  line-height: 1.1;
}

.kpi-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.kpi-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: 0.2px;
}

.kpi-pill-green {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.kpi-pill-blue {
  background: rgba(14, 165, 233, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.28);
}

.kpi-pill-purple {
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.28);
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   4. TODAY'S DIGEST WORKSPACE & CONFIGURATION
   ========================================================================== */
.digest-workspace-panel {
  background: linear-gradient(180deg, rgba(20, 28, 48, 0.7) 0%, rgba(13, 19, 34, 0.8) 100%);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.panel-headline-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.panel-main-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.panel-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Configuration Toolbar */
.analyst-config-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 14px 18px;
  background: rgba(10, 15, 26, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin: 16px 0;
}

.toolbar-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.config-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Segmented Control for Single vs Multiple */
.mode-segmented-control {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  gap: 4px;
}

.mode-segment-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.18s ease;
}

.mode-segment-btn:hover {
  color: #ffffff;
}

.mode-segment-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.segment-icon {
  font-size: 0.95rem;
}

/* Delivery Route Toggle Status Card */
.delivery-status-card {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-default);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.delivery-status-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: var(--shadow-sm);
}

.delivery-status-card.mode-safety {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
}

.delivery-status-card.mode-safety .delivery-mode-headline {
  color: #fbbf24;
}

.delivery-status-card.mode-live {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
}

.delivery-status-card.mode-live .delivery-mode-headline {
  color: #34d399;
}

.delivery-pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mode-safety .delivery-pulse-dot {
  background: var(--amber);
  box-shadow: 0 0 10px var(--amber);
}

.mode-live .delivery-pulse-dot {
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
}

.delivery-text-group {
  display: flex;
  flex-direction: column;
}

.delivery-mode-headline {
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.25;
}

.delivery-mode-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.delivery-toggle-hint {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  margin-left: 6px;
}

/* Single Analyst Selector */
.analyst-single-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.single-analyst-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.analyst-select-field {
  flex: 1;
  min-width: 280px;
}

.field-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.modern-select {
  width: 100%;
  background: rgba(10, 15, 26, 0.85);
  border: 1px solid var(--border-default);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.modern-select:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.analyst-meta-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Multiple Analyst Selector Grid */
.multi-select-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
  background: rgba(10, 15, 26, 0.7);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.multi-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.multi-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.count-badge {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.multi-quick-actions {
  display: flex;
  gap: 8px;
}

.btn-micro-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-micro-action:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.analyst-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.analyst-card-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 22, 38, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.analyst-card-item:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(20, 29, 50, 0.8);
}

.analyst-card-item.selected {
  border-color: var(--emerald);
  background: rgba(16, 185, 129, 0.08);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.15);
}

.analyst-card-item input[type="checkbox"] {
  accent-color: var(--emerald);
  width: 17px;
  height: 17px;
  cursor: pointer;
}

.analyst-avatar-badge {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.82rem;
  color: #ffffff;
  flex-shrink: 0;
}

.analyst-card-item.selected .analyst-avatar-badge {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.analyst-info-col {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.analyst-card-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: #ffffff;
}

.analyst-card-phone {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================================================
   5. Two-Column Digest Split Layout
   ========================================================================== */
.digest-split-grid {
  display: grid;
  grid-template-columns: 1.8fr 1.2fr;
  gap: 20px;
  margin-top: 8px;
}

@media (max-width: 950px) {
  .digest-split-grid {
    grid-template-columns: 1fr;
  }
}

.split-card {
  background: rgba(11, 16, 28, 0.7);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.split-card-header {
  background: rgba(16, 23, 40, 0.9);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left-group {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.88rem;
  color: #ffffff;
}

.header-badge-icon {
  font-size: 1rem;
}

.header-doc-name {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--sky);
}

.preview-count-pill {
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 10px;
  border-radius: 12px;
  color: var(--text-secondary);
}

.split-card-body {
  padding: 18px 20px;
}

.stories-preview-scroll {
  max-height: 440px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
}

/* Modern Intelligence Story Card */
.preview-story-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.preview-story-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateX(3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.story-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ticker-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(14, 165, 233, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.25);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.3px;
}

.ticker-badge.badge-filing {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}

.story-source-badge {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.story-card-title {
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.45;
  text-decoration: none;
  transition: color 0.15s ease;
}

.story-card-title:hover {
  color: var(--sky);
}

.loading-line {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  padding: 32px 16px;
}

/* Actions Column & High-Impact Buttons */
.actions-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.primary-action-container {
  width: 100%;
}

.btn-primary-dispatch {
  width: 100%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary-dispatch:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(16, 185, 129, 0.5);
  filter: brightness(1.06);
}

.btn-primary-dispatch:active {
  transform: translateY(0);
}

.btn-primary-dispatch:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary-dispatch .dispatch-icon-wrap {
  font-size: 1.6rem;
  line-height: 1;
}

.btn-primary-dispatch .dispatch-text-col {
  display: flex;
  flex-direction: column;
  text-align: left;
  flex: 1;
  margin-left: 14px;
}

.dispatch-main-label {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.dispatch-sub-label {
  font-size: 0.74rem;
  opacity: 0.85;
  margin-top: 2px;
  font-family: var(--font-mono);
}

.dispatch-arrow-wrap {
  font-size: 1.2rem;
  transition: transform 0.2s ease;
}

.btn-primary-dispatch:hover .dispatch-arrow-wrap {
  transform: translateX(4px);
}

.btn-secondary-action, .btn-master-action {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary-action {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
}

.btn-secondary-action:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-master-action {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #c7d2fe;
}

.btn-master-action:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

.btn-action-icon {
  font-size: 1rem;
}

/* Guarantee Card */
.ledger-guarantee-card {
  background: rgba(14, 165, 233, 0.05);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.guarantee-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.guarantee-shield {
  font-size: 1rem;
}

.guarantee-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #38bdf8;
}

.guarantee-text {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ==========================================================================
   6. Live Crawler Logs Window
   ========================================================================== */
.logs-stream-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.terminal-log-window {
  background: #05080e;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #94a3b8;
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-line {
  display: flex;
  gap: 10px;
  line-height: 1.4;
}

.log-ts {
  color: var(--indigo);
  font-weight: 600;
  flex-shrink: 0;
}

.log-txt {
  color: #cbd5e1;
}

/* ==========================================================================
   7. Common View Header & Tables (Watchlist, Analysts, etc.)
   ========================================================================== */
.view-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 6px;
}

.view-header-title-wrap h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.view-header-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.view-header-actions {
  display: flex;
  gap: 10px;
}

.btn-secondary-micro {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
}

.btn-secondary-micro:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Folder Tabs Bar */
/* Watchlist Controls Panel (Search & Tabs) */
.watchlist-controls-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: rgba(13, 19, 34, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  margin-bottom: 4px;
}

.watchlist-search-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.watchlist-search-wrap {
  position: relative;
  flex: 1;
  min-width: 280px;
  display: flex;
  align-items: center;
}

.search-input-icon {
  position: absolute;
  left: 14px;
  font-size: 0.95rem;
  color: var(--text-muted);
  pointer-events: none;
}

.watchlist-search-wrap input {
  width: 100%;
  background: rgba(8, 12, 22, 0.75);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 10px 38px 10px 40px;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.86rem;
  outline: none;
  transition: all 0.2s ease;
}

.watchlist-search-wrap input:focus {
  border-color: var(--indigo);
  background: rgba(10, 15, 28, 0.95);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.search-clear-btn {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.search-clear-btn:hover {
  color: #ffffff;
}

.visible-count-badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

/* Header Count Pill */
.header-count-pill {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 20px;
  letter-spacing: 0.2px;
}

/* Primary Add Button */
.btn-primary-add {
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary-add:hover {
  background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

/* Folder Tabs Navigation */
.watchlist-folder-bar {
  display: flex;
  align-items: center;
  overflow-x: auto;
}

.folder-tabs-list {
  display: flex;
  gap: 8px;
  align-items: center;
}

.folder-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.folder-tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.folder-tab-btn.active {
  background: var(--indigo);
  color: #ffffff;
  border-color: var(--indigo);
  box-shadow: var(--shadow-glow-indigo);
}

.folder-tab-count {
  font-size: 0.72rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 700;
}

/* Tables */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.terminal-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.terminal-table th {
  background: rgba(16, 23, 40, 0.8);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-default);
}

.terminal-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.terminal-table tbody tr {
  transition: background 0.15s ease;
}

.terminal-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.terminal-table tbody tr:last-child td {
  border-bottom: none;
}

/* Modern Watchlist Table & Cells */
.modern-watchlist-table th {
  background: rgba(10, 15, 28, 0.9);
}

.watchlist-row:hover {
  background: rgba(255, 255, 255, 0.025) !important;
}

/* Column 1: Asset Cell */
.asset-cell {
  display: flex;
  align-items: center;
  gap: 14px;
}

.asset-symbol-chip {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(30, 41, 59, 0.6) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: #c7d2fe;
  letter-spacing: -0.2px;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 2px;
}

.asset-symbol-chip:hover {
  border-color: var(--indigo);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(30, 41, 59, 0.8) 100%);
  transform: scale(1.05);
}

.asset-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.asset-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  transition: color 0.15s ease;
}

.asset-name:hover {
  color: #818cf8;
}

.asset-sub-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.exchange-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 1px 7px;
  border-radius: var(--radius-xs);
}

.exchange-tag strong {
  color: #e2e8f0;
  font-weight: 600;
}

.exchange-tag.bse strong {
  color: #94a3b8;
}

.aliases-hint {
  font-size: 0.7rem;
  color: var(--text-dim);
  cursor: help;
}

/* Column 2: Multi-Basket Cell */
.multi-basket-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.folder-pill-removable {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  transition: all 0.15s ease;
}

.pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.tag-remove-x {
  cursor: pointer;
  opacity: 0.6;
  font-size: 0.82rem;
  line-height: 1;
  padding: 0 1px;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.tag-remove-x:hover {
  opacity: 1;
  color: #f43f5e;
}

.btn-add-basket-trigger {
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed var(--border-default);
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-add-basket-trigger:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Column 3: Analyst Coverage */
.analyst-pill-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.analyst-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.22);
  color: #c7d2fe;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
}

.badge-unassigned {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(245, 158, 11, 0.06);
  border: 1px dashed rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.badge-unassigned:hover {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.6);
  color: #ffffff;
}

/* Column 4: Row Actions */
.row-actions-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-row-edit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
  padding: 5px 12px;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-row-edit:hover {
  background: rgba(99, 102, 241, 0.22);
  border-color: var(--indigo);
  color: #ffffff;
}

.btn-row-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(244, 63, 94, 0.06);
  border: 1px solid rgba(244, 63, 94, 0.2);
  color: #fda4af;
  width: 28px;
  height: 28px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-row-del:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: var(--rose);
  color: #ffffff;
}

/* Folder Tags */
.folder-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.3px;
}

.folder-tag-game {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.folder-tag-set {
  background: rgba(14, 165, 233, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.folder-tag-match {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.folder-tag-junior {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.folder-tag-custom {
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.btn-edit-action {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-edit-action:hover {
  background: rgba(99, 102, 241, 0.2);
  color: #ffffff;
}

.btn-cancel {
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fda4af;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-cancel:hover {
  background: rgba(244, 63, 94, 0.2);
  color: #ffffff;
}

.status-badge-ok {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
}

.status-badge-ok::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--emerald);
}

/* ==========================================================================
   8. Modals & Popovers
   ========================================================================== */
.terminal-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.terminal-modal.open {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: modalScale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(16, 23, 40, 0.7);
}

.modal-top h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
}

.modal-x {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s ease;
}

.modal-x:hover {
  color: #ffffff;
}

.modal-form {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-block label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-block input[type="text"],
.input-block input[type="tel"],
.input-block input[type="email"],
.terminal-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  outline: none;
  transition: all 0.2s ease;
}

.input-block input:focus,
.terminal-select:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-bottom {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

/* Toast Banner */
.toast-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(16, 24, 40, 0.95);
  border: 1px solid var(--emerald);
  color: #ffffff;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  font-size: 0.86rem;
  font-weight: 500;
  display: none;
  z-index: 120;
  animation: slideToast 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-banner.show {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-banner.error {
  border-color: var(--rose);
}

@keyframes slideToast {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   9. Sources Grid, Health Status, & Feed Radar
   ========================================================================== */
.source-health-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #34d399;
}

.source-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: sourcePulseDot 2s infinite ease-in-out;
}

@keyframes sourcePulseDot {
  0% { transform: scale(0.9); opacity: 0.8; box-shadow: 0 0 4px #10b981; }
  50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 12px #34d399; }
  100% { transform: scale(0.9); opacity: 0.8; box-shadow: 0 0 4px #10b981; }
}

.sources-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.sources-filter-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
}

.source-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.source-filter-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.source-filter-btn.active {
  background: var(--accent-emerald);
  color: #051b11;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

.source-filter-btn .filter-count-badge {
  font-size: 0.7rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 700;
}

.source-filter-btn.active .filter-count-badge {
  background: rgba(0, 0, 0, 0.2);
  color: #051b11;
}

.sources-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 320px;
  flex: 1;
  max-width: 480px;
}

.sources-search-wrapper .search-icon-symbol {
  position: absolute;
  left: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  pointer-events: none;
}

.sources-search-wrapper input {
  width: 100%;
  padding: 9px 36px 9px 36px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  color: #fff;
  font-size: 0.84rem;
  outline: none;
  transition: all 0.2s ease;
}

.sources-search-wrapper input:focus {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
  background: rgba(15, 23, 42, 0.95);
}

.sources-search-wrapper .clear-search-btn {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 4px;
}

.sources-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 4px;
}

.sources-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 18px;
}

/* Source Feed Card */
.source-feed-card {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.source-feed-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.source-feed-card.is-paused {
  opacity: 0.65;
  border-color: rgba(255, 255, 255, 0.05);
}

.source-feed-card.is-paused:hover {
  opacity: 0.9;
}

/* Card Header */
.source-feed-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.source-brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.source-brand-avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.source-brand-avatar.filing {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.source-brand-avatar.rss {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.2) 100%);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.source-brand-avatar.search {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(217, 119, 6, 0.2) 100%);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.source-feed-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.source-feed-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.source-feed-type-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 5px;
  width: fit-content;
}

.source-feed-type-tag.filing {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.source-feed-type-tag.rss {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.source-feed-type-tag.search {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Apple-style Switch Toggle */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 24px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: #cbd5e1;
  transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.switch-toggle input:checked + .switch-slider {
  background-color: var(--accent-emerald);
  border-color: var(--accent-emerald);
}

.switch-toggle input:checked + .switch-slider:before {
  transform: translateX(20px);
  background-color: #051b11;
}

/* Endpoint URL Bar */
.source-url-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 6px 10px;
}

.source-url-text {
  font-size: 0.73rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.source-url-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-icon-micro {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 0.85rem;
  transition: all 0.15s ease;
}

.btn-icon-micro:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* Ingestion Specs Grid */
.source-specs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.source-spec-item {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 7px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.source-spec-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
}

.source-spec-val {
  font-size: 0.76rem;
  color: #e2e8f0;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Card Footer */
.source-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.source-ping-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
}

.source-ping-badge.ok {
  color: #34d399;
}

.source-ping-badge.warn {
  color: #f59e0b;
}

.source-ping-badge.err {
  color: #ef4444;
}

.source-card-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-ping-feed {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-ping-feed:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.btn-ping-feed:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-delete-feed {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 4px 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-delete-feed:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

/* ==========================================================================
   10. Daily Digest Desk & Interactive Workstation
   ========================================================================== */
.digest-topbar-custom {
  margin-bottom: 16px;
}

.digest-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.digest-client-strip {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.digest-client-selector-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.digest-nav-arrow-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.digest-nav-arrow-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.digest-client-dropdown-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.client-avatar-micro {
  position: absolute;
  left: 10px;
  font-size: 0.95rem;
  pointer-events: none;
  z-index: 2;
}

.digest-select-modern {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(10, 15, 29, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 8px 32px 8px 34px;
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: all 0.2s ease;
  min-width: 200px;
}

.digest-select-modern:focus {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

.digest-metadata-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.digest-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 7px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #cbd5e1;
}

.digest-viewmode-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(10, 15, 29, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 3px;
}

.viewmode-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.viewmode-btn:hover {
  color: #fff;
}

.viewmode-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 700;
}

/* Document Canvas Wrapper */
.digest-canvas-wrapper {
  background: #040711;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px;
  min-height: 78vh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.6);
}

.digest-frame-loader {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 7, 17, 0.75);
  backdrop-filter: blur(4px);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #e2e8f0;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 14px;
}

.spinner-dot {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(16, 185, 129, 0.2);
  border-top-color: var(--accent-emerald);
  border-radius: 50%;
  animation: spinLoader 0.75s linear infinite;
}

@keyframes spinLoader {
  to { transform: rotate(360deg); }
}

.digest-frame-container {
  width: 100%;
  height: 78vh;
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  margin: 0 auto;
}

.digest-frame-container.mobile-mode {
  max-width: 440px;
  border: 10px solid #1e293b;
  border-radius: 36px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  height: 76vh;
}

#full-digest-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #ffffff;
}

/* ==========================================================================
   11. System Settings & Gateway Infrastructure
   ========================================================================== */
.settings-sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 18px;
}

.settings-box-panel {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-box-panel:hover {
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.settings-panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-panel-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.settings-panel-icon-wrap.green {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.2) 100%);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.settings-panel-icon-wrap.purple {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(124, 58, 237, 0.2) 100%);
  border: 1px solid rgba(139, 92, 246, 0.4);
}

.settings-panel-icon-wrap.blue {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(37, 99, 235, 0.2) 100%);
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.settings-panel-icon-wrap.amber {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(217, 119, 6, 0.2) 100%);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.settings-panel-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.settings-panel-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.settings-panel-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.setting-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.setting-row-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.setting-row-info {
  flex: 1;
  min-width: 0;
}

.setting-row-label {
  font-size: 0.86rem;
  font-weight: 600;
  color: #e2e8f0;
}

.setting-row-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.4;
}

.setting-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.setting-status-pill.ok {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.setting-status-pill.warn {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.setting-code-badge {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.35);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.setting-input-inline-wrap {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.setting-input-inline-wrap:focus-within {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

.setting-input-inline-wrap .country-prefix {
  padding: 6px 8px 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.setting-input-inline-wrap input {
  background: transparent;
  border: none;
  padding: 6px 10px;
  color: #fff;
  font-size: 0.82rem;
  outline: none;
  font-family: var(--font-mono);
  width: 140px;
}

.setting-masked-credential-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 3px 6px 3px 10px;
}

.setting-mono-input {
  background: transparent;
  border: none;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  outline: none;
  width: 160px;
}

.btn-credential-toggle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px 5px;
  font-size: 0.82rem;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.btn-credential-toggle:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.btn-micro-verify {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-micro-verify:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

/* Modal Collapsible & Checkbox Chips */
.modal-collapsible-details {
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
  margin-top: 4px;
}

.modal-collapsible-details summary {
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  user-select: none;
  transition: color 0.15s ease;
}

.modal-collapsible-details summary:hover {
  color: var(--indigo);
}

.modal-collapsible-details[open] summary {
  color: #c7d2fe;
  margin-bottom: 8px;
}

.checkbox-scroll-box {
  background: rgba(10, 15, 26, 0.6);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.checkbox-scroll-box label.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-xs);
  transition: background 0.15s ease;
}

.checkbox-scroll-box label.checkbox-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.folder-checkbox-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  transition: all 0.15s ease;
}

.folder-checkbox-tag:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Client Directory & Recipient Cards
   ========================================================================== */
.client-row:hover {
  background: rgba(255, 255, 255, 0.025) !important;
}

.client-cell {
  display: flex;
  align-items: center;
  gap: 14px;
}

.client-avatar-chip {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(30, 41, 59, 0.7) 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  color: #6ee7b7;
  letter-spacing: -0.2px;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.client-avatar-chip:hover {
  border-color: var(--emerald);
  transform: scale(1.06);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.3);
}

.client-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.client-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  transition: color 0.15s ease;
}

.client-name:hover {
  color: #34d399;
}

.client-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.client-phone-badge {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: #34d399;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 1px 7px;
  border-radius: var(--radius-xs);
  font-weight: 600;
}

.client-email-badge {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 1px 7px;
  border-radius: var(--radius-xs);
}

.client-coverage-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.client-baskets-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.client-stocks-count-badge {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
}

.client-dispatch-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dispatch-cycle-sub {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.btn-client-dispatch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  padding: 5px 12px;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-client-dispatch:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: var(--emerald);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.folder-checkbox-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.folder-checkbox-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}

.folder-checkbox-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   Macro & Sector Intelligence Desk Styles
   ========================================================================== */

.macro-benchmark-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.2s ease;
}

.macro-benchmark-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.macro-bench-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.macro-bench-val {
  font-size: 1.15rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #ffffff;
}

.macro-bench-change {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-block;
  align-self: flex-start;
}

.macro-sector-pill {
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.macro-sector-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.macro-sector-pill.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.5);
  color: #a5b4fc;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
}

.macro-story-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
}

.macro-story-card:hover {
  background: rgba(19, 28, 49, 0.6);
  border-color: var(--border-hover);
}

.macro-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.macro-authority-badge {
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
}

.macro-tier-badge {
  font-size: 0.70rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.tier-1 {
  background: rgba(244, 63, 94, 0.15);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.tier-2 {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.tier-3 {
  background: rgba(100, 116, 139, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

.macro-card-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.45;
  text-decoration: none;
}

.macro-card-title:hover {
  color: #60a5fa;
  text-decoration: underline;
}

.macro-sector-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.macro-sector-tag {
  font-size: 0.68rem;
  font-weight: 700;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  padding: 2px 7px;
  border-radius: 4px;
}

.macro-equity-box {
  background: rgba(0, 0, 0, 0.25);
  border-left: 3px solid var(--indigo);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.macro-equity-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #e2e8f0;
}

.bias-pos {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.68rem;
}

.bias-neg {
  background: rgba(244, 63, 94, 0.2);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.35);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.68rem;
}

.bias-neu {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.68rem;
}

.macro-equity-text {
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.4;
}

.macro-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
  margin-top: 2px;
}

/* =========================================================================
   Digest Edition Switcher: Morning vs Evening
   ========================================================================= */
.digest-edition-bar {
  display: flex;
  gap: 8px;
  background: rgba(15, 23, 42, 0.7);
  padding: 5px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  width: fit-content;
}

.digest-edition-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.digest-edition-btn.active {
  background: var(--accent-indigo);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.digest-edition-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}