  /* === EM RV Strategy Dashboard — World Monitor Terminal Aesthetic === */

  * { margin: 0; padding: 0; box-sizing: border-box; }
  body { font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', 'Consolas', Monaco, monospace; background: #0a0a0f; color: #d4d4d8; font-size: 13px; }

  /* Topbar — minimal, dark */
  .topbar { background: #111118; border-bottom: 1px solid #1e1e2a; padding: 10px 24px; display: flex; align-items: center; justify-content: space-between; }
  .topbar h1 { font-size: 16px; font-weight: 700; color: #e4e4e7; letter-spacing: -0.3px; }
  .topbar .meta { font-size: 11px; color: #71717a; font-family: inherit; }

  .layout { display: grid; grid-template-columns: 280px 1fr; }

  /* Sidebar — dark terminal */
  .sidebar { background: #111118; border-right: 1px solid #1e1e2a; overflow-y: auto; }
  .sidebar-header { padding: 10px 14px; border-bottom: 1px solid #1e1e2a; }
  .sidebar-header input { width: 100%; padding: 6px 10px; background: #0a0a0f; border: 1px solid #27272a; border-radius: 4px; color: #e4e4e7; font-size: 12px; font-family: inherit; outline: none; margin-bottom: 6px; }
  .sidebar-header input:focus { border-color: #3b82f6; box-shadow: 0 0 0 1px rgba(59,130,246,0.3); }
  .sector-filters { display: flex; gap: 3px; }
  .sector-btn { padding: 3px 8px; font-size: 10px; border: 1px solid #27272a; border-radius: 3px; background: transparent; color: #71717a; cursor: pointer; font-weight: 600; font-family: inherit; }
  .sector-btn.active { background: #1e1e2a; color: #e4e4e7; border-color: #3b82f6; }
  .sector-btn:hover { border-color: #3b82f6; }

  .issuer-list { padding: 2px 0; }
  .country-group-header { padding: 5px 14px; font-size: 10px; font-weight: 700; color: #52525b; text-transform: uppercase; letter-spacing: 0.8px; background: #0a0a0f; position: sticky; top: 0; z-index: 1; border-bottom: 1px solid #18181b; }
  .issuer-item { padding: 5px 14px 5px 20px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-size: 12px; border-left: 2px solid transparent; transition: all 0.1s; }
  .issuer-item:hover { background: #18181b; }
  .issuer-item.active { background: #172554; border-left-color: #3b82f6; }
  .issuer-item .name { font-weight: 500; color: #d4d4d8; }
  .issuer-item .ticker-label { color: #60a5fa; font-size: 10px; margin-right: 5px; }
  .issuer-item .info { color: #71717a; font-size: 10px; }
  .issuer-item .badge { font-size: 9px; padding: 1px 5px; border-radius: 2px; font-weight: 700; }
  .badge-nss { background: #172554; color: #60a5fa; }
  .badge-ns { background: #422006; color: #fbbf24; }
  .badge-sov { background: #14532d; color: #4ade80; font-size: 8px; padding: 1px 4px; border-radius: 2px; margin-left: 3px; }
  .badge-quasi { background: #422006; color: #fbbf24; font-size: 8px; padding: 1px 4px; border-radius: 2px; margin-left: 3px; }
  .badge-corp { background: #450a0a; color: #f87171; font-size: 8px; padding: 1px 4px; border-radius: 2px; margin-left: 3px; }

  /* Main content */
  .main { overflow-y: auto; padding: 16px; background: #0a0a0f; }
  .panels { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
  .panel { background: #111118; border: 1px solid #1e1e2a; border-radius: 6px; overflow: hidden; }
  .panel-full { grid-column: 1 / -1; }
  .panel-header { padding: 10px 14px; border-bottom: 1px solid #1e1e2a; display: flex; justify-content: space-between; align-items: center; }
  .panel-header h2 { font-size: 13px; font-weight: 700; color: #e4e4e7; letter-spacing: -0.2px; }
  .panel-body { padding: 14px; }

  .chart-container { height: 400px; }
  .chart-container-sm { height: 300px; width: 100%; }

  /* Stats row */
  .stats { display: flex; gap: 20px; padding: 10px 14px; background: #0a0a0f; border-bottom: 1px solid #1e1e2a; }
  .stat { text-align: center; }
  .stat-value { font-size: 20px; font-weight: 700; color: #e4e4e7; font-family: inherit; }
  .stat-label { font-size: 10px; color: #71717a; text-transform: uppercase; letter-spacing: 0.5px; }

  /* NIP tool */
  .nip-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
  .nip-form label { font-size: 11px; color: #71717a; }
  .nip-form input, .nip-form select { padding: 4px 8px; background: #0a0a0f; border: 1px solid #27272a; border-radius: 3px; color: #e4e4e7; font-size: 12px; font-family: inherit; width: 80px; }
  .nip-form button { padding: 5px 14px; background: #3b82f6; color: white; border: none; border-radius: 3px; cursor: pointer; font-size: 12px; font-family: inherit; }
  .nip-form button:hover { background: #2563eb; }
  .nip-result { margin-top: 10px; padding: 10px; background: #0a0a0f; border-radius: 4px; font-size: 12px; display: none; }

  /* Compare */
  .compare-bar { padding: 10px 14px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
  .compare-chip { padding: 2px 8px; background: #1e1e2a; border-radius: 10px; font-size: 11px; cursor: pointer; display: flex; align-items: center; gap: 4px; border: 1px solid #27272a; }
  .compare-chip .remove { color: #ef4444; font-weight: bold; }
  .compare-chip .remove:hover { color: #f87171; }

  /* Bond table — terminal style */
  .bond-table { width: 100%; font-size: 11px; border-collapse: collapse; font-family: inherit; }
  .bond-table th { text-align: left; padding: 5px 8px; border-bottom: 1px solid #27272a; color: #71717a; font-weight: 700; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
  .bond-table td { padding: 4px 8px; border-bottom: 1px solid #18181b; }
  .bond-table tr:hover { background: #18181b; }
  .bond-table .num { text-align: right; }
  .cheap { color: #4ade80; }
  .rich { color: #f87171; }

  .empty-state { text-align: center; padding: 60px 20px; color: #52525b; }
  .empty-state h3 { font-size: 15px; margin-bottom: 8px; color: #71717a; }

  /* CSV export button */
  .csv-btn { padding: 4px 10px; font-size: 10px; background: #18181b; color: #a1a1aa; border: 1px solid #27272a; border-radius: 3px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.1s; }
  .csv-btn:hover { background: #27272a; color: #e4e4e7; border-color: #3b82f6; }

  /* Tab bar — World Monitor grouped style */
  .tab-bar { background: #111118; border-bottom: 1px solid #1e1e2a; padding: 0 12px; display: flex; gap: 0; align-items: stretch; overflow-x: auto; }
  .tab-bar::-webkit-scrollbar { height: 0; }
  .tab-group { display: flex; align-items: stretch; position: relative; }
  .tab-group + .tab-group { border-left: 1px solid #1e1e2a; }
  .tab-group-label { font-size: 8px; color: #3f3f46; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700;
    position: absolute; top: 2px; left: 10px; pointer-events: none; }
  .tab-btn { padding: 12px 12px 8px; background: transparent; border: none; border-bottom: 2px solid transparent; color: #71717a; font-size: 11px; font-weight: 600; cursor: pointer; transition: all 0.1s; white-space: nowrap; font-family: inherit; }
  .tab-btn:hover { color: #d4d4d8; }
  .tab-btn.active { color: #3b82f6; border-bottom-color: #3b82f6; }
  .tab-btn.tab-alpha { color: #a78bfa; }
  .tab-btn.tab-alpha.active { color: #8b5cf6; border-bottom-color: #8b5cf6; }
  .tab-btn.tab-pulse { }
  .tab-btn.tab-a4 { }

  /* Loading */
  .conv-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 400px; color: #71717a; gap: 16px; }
  .spinner { width: 36px; height: 36px; border: 2px solid #27272a; border-top-color: #3b82f6; border-radius: 50%; animation: spin 0.8s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }

  .summary-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 12px; }
  .summary-card { background: #111118; border: 1px solid #1e1e2a; border-radius: 6px; padding: 14px; text-align: center; }
  .summary-card .card-value { font-size: 24px; font-weight: 700; color: #e4e4e7; font-family: inherit; }
  .summary-card .card-label { font-size: 9px; color: #71717a; text-transform: uppercase; letter-spacing: 0.8px; margin-top: 4px; }

  .sortable th { cursor: pointer; user-select: none; white-space: nowrap; }
  .sortable th:hover { color: #d4d4d8; }
  .sort-arrow { font-size: 9px; margin-left: 2px; color: #3b82f6; }

  .clickable-row { cursor: pointer; }
  .clickable-row:hover { background: #18181b !important; }

  .region-asia { color: #60a5fa; }
  .region-latam { color: #4ade80; }
  .region-ceemea { color: #fbbf24; }
  .region-frontier { color: #c084fc; }

  /* Regime colors */
  .regime-calm { color: #4ade80; }
  .regime-transition { color: #fbbf24; }
  .regime-stress { color: #f87171; }
  .regime-badge { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 11px; font-weight: 700; font-family: inherit; }
  .regime-badge-calm { background: #14532d; color: #4ade80; }
  .regime-badge-transition { background: #422006; color: #fbbf24; }
  .regime-badge-stress { background: #450a0a; color: #f87171; }
  .regime-badge-unknown { background: #27272a; color: #71717a; }

  /* Cluster colors */
  .cluster-0 { color: #60a5fa; }
  .cluster-1 { color: #4ade80; }
  .cluster-2 { color: #fbbf24; }
  .cluster-3 { color: #c084fc; }
  .cluster-4 { color: #f87171; }
  .cluster-5 { color: #34d399; }
  .cluster-6 { color: #fb923c; }

  .basis-wide { color: #4ade80; font-weight: 600; }
  .basis-tight { color: #f87171; font-weight: 600; }
  .basis-fair { color: #71717a; }

  /* === Map tab === */
  .map-layer-btn { padding: 4px 10px; font-size: 10px; background: #111118; color: #71717a; border: 1px solid #27272a; border-radius: 3px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.1s; }
  .map-layer-btn:hover { border-color: #3b82f6; color: #d4d4d8; }
  .map-layer-btn.active { background: #172554; color: #60a5fa; border-color: #3b82f6; }
  .tab-btn.tab-map { color: #38bdf8; }
  .tab-btn.tab-map.active { color: #0ea5e9; border-bottom-color: #0ea5e9; }

  /* Leaflet dark overrides */
  .leaflet-container { background: #050508; }
  .leaflet-control-zoom a { background: #111118 !important; color: #71717a !important; border-color: #1e1e2a !important; font-family: inherit !important; }
  .leaflet-control-zoom a:hover { background: #1e1e2a !important; color: #e4e4e7 !important; }

  .map-popup-dark .leaflet-popup-content-wrapper { background: #111118; border: 1px solid #27272a; border-radius: 6px; box-shadow: 0 8px 32px rgba(0,0,0,0.6); }
  .map-popup-dark .leaflet-popup-content { margin: 10px 12px; }
  .map-popup-dark .leaflet-popup-tip { background: #111118; border: 1px solid #27272a; }
  .map-popup-dark .leaflet-popup-close-button { color: #52525b !important; font-size: 16px !important; }
  .map-popup-dark .leaflet-popup-close-button:hover { color: #e4e4e7 !important; }

  .map-tooltip-dark { background: #0a0a0f !important; border: 1px solid #27272a !important; color: #d4d4d8 !important; border-radius: 4px !important; box-shadow: 0 4px 16px rgba(0,0,0,0.5) !important; padding: 6px 10px !important; font-family: 'SF Mono','Consolas',monospace !important; }
  .map-tooltip-dark::before { border-top-color: #27272a !important; }

  .map-country-label { background: none !important; border: none !important; box-shadow: none !important; }
  .map-country-label span { font-family: inherit; font-size: 9px; font-weight: 700; color: #a1a1aa; text-shadow: 0 0 6px #0a0a0f, 0 0 12px #0a0a0f, 0 0 3px #0a0a0f; letter-spacing: 0.3px; }

  .map-legend { background: rgba(10,10,15,0.92); backdrop-filter: blur(12px); border: 1px solid #27272a; border-radius: 6px; padding: 10px 14px; font-size: 10px; color: #d4d4d8; font-family: inherit; box-shadow: 0 4px 20px rgba(0,0,0,0.5); max-width: 200px; }
  .map-legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

  /* Stats bar */
  .map-stats-bar { display: flex; gap: 20px; padding: 10px 16px; background: #111118; border: 1px solid #1e1e2a; border-radius: 6px; margin-bottom: 8px; align-items: center; flex-wrap: wrap; }
  .map-stat { display: flex; flex-direction: column; align-items: center; gap: 1px; }
  .map-stat-value { font-size: 18px; font-weight: 700; color: #e4e4e7; }
  .map-stat-label { font-size: 8px; color: #52525b; text-transform: uppercase; letter-spacing: 0.8px; }

  /* Morning Brief trade cards */
  .mb-trade-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #1e1e2a; transition: background 0.1s; }
  .mb-trade-card:hover { background: #18181b; }
  .mb-trade-card:last-child { border-bottom: none; }
  .mb-trade-rank { font-size: 18px; font-weight: 800; color: #3b82f6; min-width: 28px; text-align: center; }
  .mb-trade-body { flex: 1; }
  .mb-trade-name { font-size: 13px; font-weight: 600; color: #e4e4e7; }
  .mb-trade-meta { font-size: 11px; color: #71717a; margin-top: 2px; }
  .mb-trade-conviction { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.5px; }
  .mb-trade-conviction.high { background: #14532d; color: #4ade80; }
  .mb-trade-conviction.medium { background: #422006; color: #fbbf24; }
  .mb-trade-conviction.low { background: #450a0a; color: #f87171; }

  /* Morning Brief alerts */
  .mb-alert-section { margin-bottom: 12px; }
  .mb-alert-section:last-child { margin-bottom: 0; }
  .mb-alert-header { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: #52525b; margin-bottom: 4px; padding-bottom: 4px; border-bottom: 1px solid #1e1e2a; }
  .mb-alert-item { display: flex; justify-content: space-between; padding: 3px 0; font-size: 12px; }
  .mb-alert-country { font-weight: 600; color: #d4d4d8; min-width: 36px; }

  /* Morning Brief tab styling */
  .tab-btn.tab-brief { color: #fbbf24; }
  .tab-btn.tab-brief.active { color: #f59e0b; border-bottom-color: #f59e0b; }
