/* ══════════════════════════════════════════════════════════════
   FinanceOS — Pages CSS (Map, Equity, Intel Views)
   ══════════════════════════════════════════════════════════════ */

/* ─── Navigation Bar ─── */
#terminal-nav {
    height: 30px;
    background: linear-gradient(180deg, #0d0d0d 0%, #080808 100%);
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--sp-5);
}

.nav-tabs {
    display: flex;
    gap: 1px;
}

.nav-tab {
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    padding: 4px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    transition: all var(--transition-fast);
    position: relative;
}

.nav-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-tab.active {
    color: var(--orange);
    border-color: var(--border-accent);
    border-bottom: 2px solid var(--orange);
    background: var(--bg-panel);
}

.nav-icon {
    font-size: 10px;
}

.nav-key {
    font-size: 8px;
    color: var(--text-muted);
    background: var(--bg-highlight);
    padding: 0 3px;
    border-radius: 1px;
    border: 1px solid var(--border-primary);
}

.nav-breadcrumb {
    font-size: 9px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* ─── View System ─── */
.terminal-view {
    display: none;
    height: calc(100vh - var(--header-h) - 30px - var(--ticker-h) - var(--cmd-h));
    overflow: hidden;
}

.terminal-view.active {
    display: block;
}

#view-terminal .terminal-view.active,
.terminal-view.active #terminal-grid {
    height: 100%;
}

/* Update terminal grid height for new nav bar */
#terminal-grid {
    height: 100%;
}

/* ══════════════════════════════════════════════════════════════
   MAP VIEW
   ══════════════════════════════════════════════════════════════ */
#view-map {
    position: relative;
}

#view-map.active {
    display: flex;
}

#map-container {
    flex: 1;
    height: 100%;
    background: #000;
    z-index: 1;
}

/* Leaflet overrides for dark theme */
.leaflet-container {
    background: #000 !important;
    font-family: var(--font-mono) !important;
}

.leaflet-control-zoom a {
    background: var(--bg-panel) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-accent) !important;
}

.leaflet-control-zoom a:hover {
    background: var(--bg-hover) !important;
    color: var(--orange) !important;
}

.leaflet-popup-content-wrapper {
    background: rgba(10, 10, 10, 0.95) !important;
    border: 1px solid var(--border-accent) !important;
    border-radius: 2px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6) !important;
}

.leaflet-popup-tip {
    background: rgba(10, 10, 10, 0.95) !important;
    border: 1px solid var(--border-accent) !important;
}

.leaflet-popup-close-button {
    color: var(--text-muted) !important;
}

.leaflet-popup-close-button:hover {
    color: var(--orange) !important;
}

/* Map popup styled */
.map-popup {
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    min-width: 200px;
}

.map-popup-tag {
    display: inline-block;
    font-size: 8px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 1px;
    color: #000;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.map-popup-title {
    font-size: var(--fs-lg);
    font-weight: 700;
    color: var(--white);
    margin-bottom: 4px;
}

.map-popup-body {
    font-size: var(--fs-xs);
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Custom markers */
.custom-marker {
    background: transparent !important;
    border: none !important;
}

.marker-military-base {
    color: #ff3b3b;
    font-size: 14px;
    text-shadow: 0 0 6px rgba(255, 59, 59, 0.6);
    animation: marker-pulse 2s ease-in-out infinite;
}

.marker-port {
    color: #00d26a;
    font-size: 12px;
    text-shadow: 0 0 4px rgba(0, 210, 106, 0.4);
}

.marker-oil {
    color: #ff8c00;
    font-size: 11px;
    text-shadow: 0 0 4px rgba(255, 140, 0, 0.4);
}

.marker-choke {
    color: #ffd700;
    font-size: 14px;
    text-shadow: 0 0 6px rgba(255, 215, 0, 0.5);
    animation: marker-pulse 3s ease-in-out infinite;
}

.marker-vessel {
    font-size: 10px;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

.marker-flight {
    font-size: 10px;
    opacity: 0.8;
}

@keyframes marker-pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.15);
    }
}

/* Map Sidebar */
.map-sidebar {
    width: 280px;
    background: var(--bg-panel);
    border-left: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 10;
}

.map-sidebar-header {
    padding: var(--sp-3);
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    background: var(--bg-panel-header);
}

.map-sidebar-header h2 {
    font-family: var(--font-sans);
    font-size: var(--fs-sm);
    color: var(--text-accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.map-info-panel {
    padding: var(--sp-3);
    border-bottom: 1px solid var(--border-primary);
}

.info-summary .info-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    font-size: var(--fs-xs);
}

.info-label {
    color: var(--text-muted);
}

.info-value {
    color: var(--text-primary);
    font-weight: 500;
}

.map-stats {
    padding: var(--sp-3);
    border-bottom: 1px solid var(--border-primary);
}

.map-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-2);
}

.map-stat-item {
    text-align: center;
    padding: var(--sp-2);
    background: var(--bg-highlight);
    border-radius: 2px;
}

.map-stat-value {
    font-size: var(--fs-xl);
    font-weight: 700;
    display: block;
}

.map-stat-label {
    font-size: 8px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.map-feed {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.feed-header {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-accent);
    padding: var(--sp-3);
    border-bottom: 1px solid var(--border-primary);
    letter-spacing: 1px;
}

.feed-item {
    padding: var(--sp-2) var(--sp-3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    font-size: var(--fs-xs);
    display: flex;
    gap: var(--sp-2);
    line-height: 1.3;
}

.feed-time {
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 55px;
}

.feed-text {
    color: var(--text-secondary);
}

.feed-system .feed-text {
    color: var(--cyan);
}

.feed-military .feed-text {
    color: var(--red);
}

.feed-alert .feed-text {
    color: var(--red);
    font-weight: 600;
}

.feed-oil .feed-text {
    color: var(--orange);
}

.feed-energy .feed-text {
    color: var(--orange);
}

.feed-shipping .feed-text {
    color: var(--blue);
}

/* Layer Controls */
.map-layer-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(10, 10, 10, 0.92);
    border: 1px solid var(--border-accent);
    border-radius: 2px;
    padding: var(--sp-2);
    z-index: 1000;
    min-width: 170px;
}

.layer-controls-header {
    padding: 2px var(--sp-2) 4px;
    border-bottom: 1px solid var(--border-primary);
    margin-bottom: 4px;
}

.layer-toggle {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 2px var(--sp-2);
    cursor: pointer;
    font-size: var(--fs-xs);
    transition: background var(--transition-fast);
}

.layer-toggle:hover {
    background: var(--bg-hover);
}

.layer-toggle input[type="checkbox"] {
    width: 10px;
    height: 10px;
    accent-color: var(--orange);
}

.layer-icon {
    width: 14px;
    text-align: center;
    font-size: 10px;
}

.layer-label {
    color: var(--text-secondary);
}

/* Map Legend */
.map-legend {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(10, 10, 10, 0.88);
    border: 1px solid var(--border-accent);
    border-radius: 2px;
    padding: var(--sp-2) var(--sp-3);
    z-index: 1000;
}

.legend-items {
    display: flex;
    gap: var(--sp-4);
    font-size: 9px;
    color: var(--text-secondary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 3px;
}

.legend-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

/* ══════════════════════════════════════════════════════════════
   EQUITY VIEW
   ══════════════════════════════════════════════════════════════ */
#view-equity.active {
    display: block;
    overflow-y: auto;
}

#equity-container {
    height: 100%;
    overflow-y: auto;
}

.equity-search-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: var(--sp-7);
}

.equity-search-box {
    max-width: 700px;
    width: 100%;
}

.equity-search-header {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-6);
}

.equity-search-header h1 {
    font-family: var(--font-sans);
    font-size: var(--fs-2xl);
    color: var(--text-accent);
    font-weight: 700;
}

.equity-search-input-row {
    display: flex;
    gap: var(--sp-2);
    margin-bottom: var(--sp-5);
}

.equity-search-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-accent);
    color: var(--white);
    font-family: var(--font-mono);
    font-size: var(--fs-lg);
    padding: var(--sp-4) var(--sp-5);
    outline: none;
    border-radius: 2px;
    transition: border-color var(--transition-fast);
}

.equity-search-input:focus {
    border-color: var(--orange);
    box-shadow: var(--glow-orange);
}

.equity-search-btn {
    background: var(--orange);
    color: #000;
    border: none;
    font-family: var(--font-mono);
    font-size: var(--fs-md);
    font-weight: 700;
    padding: var(--sp-4) var(--sp-6);
    cursor: pointer;
    border-radius: 2px;
    transition: all var(--transition-fast);
    letter-spacing: 1px;
}

.equity-search-btn:hover {
    background: #e07800;
}

.equity-available {
    display: flex;
    gap: var(--sp-2);
    flex-wrap: wrap;
    align-items: center;
}

.equity-ticker-chip {
    background: var(--bg-highlight);
    border: 1px solid var(--border-accent);
    color: var(--cyan);
    font-size: var(--fs-xs);
    padding: 2px 8px;
    cursor: pointer;
    border-radius: 2px;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.equity-ticker-chip:hover {
    background: var(--orange);
    color: #000;
    border-color: var(--orange);
}

.equity-not-found {
    margin-bottom: var(--sp-5);
    padding: var(--sp-4);
    border: 1px solid var(--red);
    border-radius: 2px;
    background: var(--red-bg);
}

/* Company Profile */
.equity-profile {
    padding: var(--sp-5);
    max-width: 1400px;
    margin: 0 auto;
}

.equity-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: var(--sp-5);
    border-bottom: 1px solid var(--border-accent);
    margin-bottom: var(--sp-5);
}

.equity-back {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    cursor: pointer;
    margin-bottom: var(--sp-2);
    transition: color var(--transition-fast);
}

.equity-back:hover {
    color: var(--orange);
}

.equity-title-row {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.equity-company-name {
    font-family: var(--font-sans);
    font-size: var(--fs-2xl);
    font-weight: 700;
    color: var(--white);
}

.equity-symbol {
    font-size: var(--fs-lg);
    color: var(--cyan);
    font-weight: 600;
}

.equity-subtitle {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    margin-top: var(--sp-1);
}

.equity-price {
    font-size: var(--fs-3xl);
    font-weight: 700;
    color: var(--white);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.equity-price-change {
    font-size: var(--fs-lg);
    font-weight: 500;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Sections */
.equity-section {
    margin-bottom: var(--sp-6);
}

.equity-section-title {
    font-family: var(--font-sans);
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--text-accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: var(--sp-2);
    border-bottom: 1px solid var(--border-accent);
    margin-bottom: var(--sp-4);
}

/* Metrics Grid */
.equity-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-2);
}

.metric-card {
    background: var(--bg-highlight);
    border: 1px solid var(--border-primary);
    padding: var(--sp-3);
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.metric-label {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: var(--fs-lg);
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* Description */
.equity-description {
    background: var(--bg-highlight);
    border: 1px solid var(--border-primary);
    padding: var(--sp-4);
    border-radius: 2px;
}

.equity-desc-meta {
    display: flex;
    gap: var(--sp-5);
    margin-bottom: var(--sp-3);
    font-size: var(--fs-sm);
    color: var(--text-muted);
    flex-wrap: wrap;
}

.equity-desc-meta strong {
    color: var(--text-primary);
}

.equity-description p {
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Supply Chain */
.supply-chain-container {
    display: flex;
    gap: var(--sp-4);
    align-items: stretch;
}

.supply-chain-column {
    flex: 1;
}

.supply-chain-label {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-accent);
    letter-spacing: 1px;
    margin-bottom: var(--sp-3);
    text-align: center;
}

.supply-chain-card {
    background: var(--bg-highlight);
    border: 1px solid var(--border-primary);
    padding: var(--sp-2) var(--sp-3);
    margin-bottom: 3px;
    border-radius: 2px;
    transition: border-color var(--transition-fast);
}

.supply-chain-card:hover {
    border-color: var(--border-focus);
}

.supplier-card {
    border-left: 2px solid var(--blue);
}

.customer-card {
    border-left: 2px solid var(--green);
}

.sc-name {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.sc-role {
    font-size: 9px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.sc-bar-container {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.sc-bar {
    height: 3px;
    border-radius: 1px;
    transition: width 0.5s ease;
}

.sc-pct {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
}

.supply-chain-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    gap: var(--sp-3);
}

.supply-chain-arrows {
    color: var(--text-muted);
    font-size: 10px;
    letter-spacing: 4px;
    animation: arrow-flow 2s linear infinite;
}

@keyframes arrow-flow {
    0% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.3;
    }
}

.supply-chain-company-badge {
    background: var(--orange);
    color: #000;
    padding: var(--sp-3) var(--sp-4);
    border-radius: 3px;
    text-align: center;
    box-shadow: var(--glow-orange);
}

.sc-company-symbol {
    font-size: var(--fs-xl);
    font-weight: 800;
    letter-spacing: 2px;
}

.sc-company-name {
    font-size: 8px;
    margin-top: 2px;
}

/* Financials Table */
.financials-table-container {
    overflow-x: auto;
}

.financials-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
}

.financials-table th {
    background: var(--bg-panel-header);
    color: var(--text-muted);
    font-weight: 600;
    padding: var(--sp-2) var(--sp-3);
    text-align: right;
    border-bottom: 1px solid var(--border-accent);
    font-size: 10px;
    text-transform: uppercase;
}

.financials-table th:first-child {
    text-align: left;
}

.financials-table td {
    padding: var(--sp-2) var(--sp-3);
    text-align: right;
    font-variant-numeric: tabular-nums;
    border-bottom: 1px solid var(--border-primary);
}

.financials-table td:first-child {
    text-align: left;
}

/* Peers */
.equity-peers {
    display: flex;
    gap: var(--sp-2);
    flex-wrap: wrap;
}

.equity-peer-chip {
    background: var(--bg-highlight);
    border: 1px solid var(--border-accent);
    color: var(--cyan);
    font-size: var(--fs-sm);
    padding: var(--sp-2) var(--sp-4);
    cursor: pointer;
    border-radius: 2px;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.equity-peer-chip:hover {
    background: var(--cyan);
    color: #000;
}

/* ══════════════════════════════════════════════════════════════
   INTEL / WEBCAM VIEW
   ══════════════════════════════════════════════════════════════ */
#view-intel.active {
    display: block;
    overflow-y: auto;
}

#intel-container {
    height: 100%;
}

.intel-page {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.intel-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-3) var(--sp-5);
    background: var(--bg-panel-header);
    border-bottom: 1px solid var(--border-primary);
    gap: var(--sp-4);
}

.intel-header-left {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.intel-header-left h2 {
    font-family: var(--font-sans);
    font-size: var(--fs-sm);
    color: var(--text-accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.intel-category-filters {
    display: flex;
    gap: 1px;
}

.intel-cat-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border-accent);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 9px;
    padding: 2px 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.intel-cat-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.intel-cat-btn.active {
    background: var(--orange);
    border-color: var(--orange);
    color: #000;
    font-weight: 600;
}

.intel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1px;
    background: var(--border-primary);
    flex: 1;
    overflow-y: auto;
}

.intel-feed-card {
    background: var(--bg-panel);
    display: flex;
    flex-direction: column;
}

.intel-feed-header {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
    background: var(--bg-panel-header);
    border-bottom: 1px solid var(--border-primary);
}

.intel-feed-status {
    display: flex;
    align-items: center;
    gap: 3px;
    color: var(--green);
    font-size: 9px;
}

.intel-feed-name {
    flex: 1;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--text-primary);
}

.intel-expand-btn {
    background: none;
    border: 1px solid var(--border-accent);
    color: var(--text-muted);
    font-size: 9px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 1px;
}

.intel-expand-btn:hover {
    border-color: var(--orange);
    color: var(--orange);
}

.intel-feed-viewport {
    aspect-ratio: 16/9;
    background: #050505;
    position: relative;
    overflow: hidden;
}

.intel-feed-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    gap: var(--sp-2);
    background: linear-gradient(135deg, #0a0a0a 0%, #111 50%, #0a0a0a 100%);
    transition: background var(--transition-normal);
}

.intel-feed-placeholder:hover {
    background: linear-gradient(135deg, #111 0%, #1a1a1a 50%, #111 100%);
}

.feed-play-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--orange);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--orange);
    font-size: 16px;
    transition: all var(--transition-fast);
}

.intel-feed-placeholder:hover .feed-play-btn {
    background: var(--orange);
    color: #000;
    box-shadow: var(--glow-orange);
}

.feed-location {
    font-size: var(--fs-sm);
    color: var(--text-primary);
    font-weight: 500;
}

.feed-category {
    font-size: 9px;
    color: var(--cyan);
    letter-spacing: 1px;
}

.intel-feed-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.intel-feed-footer {
    display: flex;
    justify-content: space-between;
    padding: var(--sp-1) var(--sp-3);
    border-top: 1px solid var(--border-primary);
}

/* Expanded overlay */
.intel-expanded-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.intel-expanded-content {
    width: 90%;
    max-width: 1200px;
    background: var(--bg-panel);
    border: 1px solid var(--border-accent);
    border-radius: 3px;
}

.intel-expanded-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--sp-3) var(--sp-5);
    border-bottom: 1px solid var(--border-primary);
    color: var(--text-accent);
    font-weight: 600;
}

.intel-close-btn {
    background: var(--red);
    color: #fff;
    border: none;
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    padding: var(--sp-2) var(--sp-4);
    cursor: pointer;
    border-radius: 2px;
}

.intel-expanded-viewport {
    aspect-ratio: 16/9;
    background: #000;
}

.intel-feed-iframe.expanded {
    width: 100%;
    height: 100%;
}

/* ══════════════════════════════════════════════════════════════
   MACRO VIEW
   ══════════════════════════════════════════════════════════════ */
#view-macro.active {
    display: block;
    overflow-y: auto;
}

#macro-container {
    height: 100%;
    overflow-y: auto;
}

.macro-dashboard {
    padding: var(--sp-5);
    max-width: 1400px;
    margin: 0 auto;
}

.macro-header {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding-bottom: var(--sp-4);
    border-bottom: 1px solid var(--border-accent);
    margin-bottom: var(--sp-5);
}

.macro-header h1 {
    font-family: var(--font-sans);
    font-size: var(--fs-2xl);
    color: var(--white);
    font-weight: 700;
}

.macro-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-4);
}

.macro-card {
    background: var(--bg-highlight);
    border: 1px solid var(--border-primary);
    border-radius: 3px;
    padding: var(--sp-4);
    transition: border-color var(--transition-fast);
}

.macro-card:hover {
    border-color: var(--border-accent);
}

.macro-card.span-2 {
    grid-column: span 2;
}

.macro-card-header {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: var(--cyan);
    letter-spacing: 1px;
    text-transform: uppercase;
    padding-bottom: var(--sp-3);
    border-bottom: 1px solid var(--border-primary);
    margin-bottom: var(--sp-3);
}

.macro-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-2) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    gap: var(--sp-3);
}

.macro-stat:last-child {
    border-bottom: none;
}

.m-label {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    min-width: 120px;
}

.m-value {
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    text-align: right;
    flex: 1;
}

.m-change {
    font-size: var(--fs-xs);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    min-width: 55px;
    text-align: right;
    color: var(--text-muted);
}

.m-change.positive {
    color: var(--green);
}

.m-change.negative {
    color: var(--red);
}

.macro-divider {
    height: 1px;
    background: var(--border-primary);
    margin: var(--sp-3) 0;
}

.macro-footer-note {
    font-size: 10px;
    color: var(--text-muted);
    padding-top: var(--sp-2);
}

/* Inflation Gauge */
.macro-gauge-container {
    margin-top: var(--sp-3);
    padding-top: var(--sp-3);
    border-top: 1px solid var(--border-primary);
}

.macro-gauge-label {
    font-size: 9px;
    color: var(--text-muted);
    margin-bottom: var(--sp-2);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.macro-gauge-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    position: relative;
    overflow: visible;
}

.macro-gauge-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
    box-shadow: 0 0 8px rgba(0, 210, 106, 0.3);
}

.macro-gauge-target {
    position: absolute;
    top: -3px;
    width: 2px;
    height: 12px;
    background: var(--orange);
    box-shadow: 0 0 4px rgba(255, 140, 0, 0.5);
}

/* Yield Curve */
.yield-curve-display {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-primary);
    border-radius: 2px;
    padding: var(--sp-2);
}

/* Economic Calendar Table */
.eco-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
}

.eco-table th {
    font-size: 9px;
    color: var(--text-muted);
    font-weight: 600;
    padding: var(--sp-2) var(--sp-3);
    text-align: left;
    border-bottom: 1px solid var(--border-accent);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.eco-table td {
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--fs-xs);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-variant-numeric: tabular-nums;
}

/* ══════════════════════════════════════════════════════════════
   OSINT VIEW
   ══════════════════════════════════════════════════════════════ */
#view-osint.active {
    display: block;
    overflow-y: auto;
}

#osint-container {
    height: 100%;
    overflow-y: auto;
}

.osint-dashboard {
    padding: var(--sp-5);
    max-width: 1400px;
    margin: 0 auto;
}

.osint-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-4);
}

.osint-card {
    position: relative;
}

.osint-search {
    display: flex;
    gap: var(--sp-2);
    margin-bottom: var(--sp-3);
}

.osint-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-accent);
    color: var(--white);
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    padding: var(--sp-2) var(--sp-3);
    outline: none;
    border-radius: 2px;
    transition: border-color var(--transition-fast);
}

.osint-input:focus {
    border-color: var(--orange);
    box-shadow: var(--glow-orange);
}

.osint-btn {
    background: var(--orange);
    color: #000;
    border: none;
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    font-weight: 700;
    padding: var(--sp-2) var(--sp-4);
    cursor: pointer;
    border-radius: 2px;
    letter-spacing: 1px;
    transition: all var(--transition-fast);
}

.osint-btn:hover {
    background: #e07800;
}

.osint-result {
    padding: var(--sp-2) 0;
}

.osint-result .macro-stat {
    padding: var(--sp-1) 0;
}

.threat-feed-container::-webkit-scrollbar {
    width: 4px;
}

.threat-feed-container::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.threat-feed-container::-webkit-scrollbar-thumb {
    background: var(--border-accent);
    border-radius: 2px;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
    .equity-metrics-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .supply-chain-container {
        flex-direction: column;
    }

    .supply-chain-center {
        flex-direction: row;
        min-width: auto;
    }

    .supply-chain-arrows {
        transform: rotate(90deg);
    }

    .macro-grid {
        grid-template-columns: 1fr;
    }

    .macro-card.span-2 {
        grid-column: span 1;
    }

    .osint-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .map-sidebar {
        width: 220px;
    }

    .equity-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ══════════════════════════════════════════════════════════════
   LIVE TICKER WEBSOCKET ANIMATIONS
   ══════════════════════════════════════════════════════════════ */
.live-up {
    background-color: rgba(0, 210, 106, 0.15) !important;
    transition: background-color 0s;
}

.live-down {
    background-color: rgba(255, 59, 59, 0.15) !important;
    transition: background-color 0s;
}

.ticker-item {
    transition: background-color 0.5s ease-out;
}

/* ══════════════════════════════════════════════════════════════
   GEOPOLITICAL INTELLIGENCE WINDOW
   ══════════════════════════════════════════════════════════════ */

.geo-intel-window {
    position: absolute;
    z-index: 2000;
    width: 320px;
    max-height: 520px;
    background: rgba(10, 10, 12, 0.96);
    border: 1px solid #333;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 1px rgba(255, 140, 0, 0.3);
    font-family: var(--font-mono);
    overflow: hidden;
    backdrop-filter: blur(12px);
    animation: geoWindowIn 0.3s ease;
}

.geo-intel-window.minimized {
    max-height: 38px;
}

@keyframes geoWindowIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(8px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes marker-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.geo-window-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.12), rgba(255, 140, 0, 0.04));
    border-bottom: 1px solid #333;
    cursor: move;
    user-select: none;
}

.geo-window-title {
    display: flex;
    align-items: center;
    gap: 6px;
}

.geo-flag {
    font-size: 14px;
}

.geo-country-name {
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1px;
}

.geo-country-code {
    font-size: 8px;
    color: #888;
    background: #1a1a1a;
    padding: 1px 4px;
    border-radius: 2px;
}

.geo-window-controls {
    display: flex;
    gap: 4px;
}

.geo-window-controls button {
    background: none;
    border: 1px solid #444;
    color: #888;
    font-size: 10px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.15s;
}

.geo-window-controls button:hover {
    color: #fff;
    border-color: #ff8c00;
}

.geo-close:hover {
    color: #ff3b3b !important;
    border-color: #ff3b3b !important;
}

.geo-risk-badge {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 10px;
    margin: 0;
}

/* Tabs */
.geo-tabs {
    display: flex;
    border-bottom: 1px solid #333;
}

.geo-tab {
    flex: 1;
    background: none;
    border: none;
    color: #666;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 5px 0;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}

.geo-tab:hover {
    color: #aaa;
}

.geo-tab.active {
    color: #ff8c00;
    border-bottom-color: #ff8c00;
}

/* Tab Content */
.geo-tab-content {
    display: none;
    padding: 8px 10px;
    overflow-y: auto;
    max-height: 380px;
}

.geo-tab-content.active {
    display: block;
}

.geo-tab-content::-webkit-scrollbar {
    width: 3px;
}

.geo-tab-content::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 2px;
}

.geo-section-header {
    font-size: 8px;
    color: #ff8c00;
    letter-spacing: 1px;
    font-weight: 700;
    margin: 6px 0 4px 0;
}

.geo-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
    font-size: 9px;
}

.geo-label {
    color: #888;
}

.geo-value {
    color: #ccc;
    text-align: right;
    max-width: 55%;
}

.geo-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin: 4px 0;
}

/* Parliament Bar */
.geo-parliament {
    margin: 4px 0;
}

.geo-parl-bar {
    display: flex;
    height: 12px;
    border-radius: 2px;
    overflow: hidden;
    background: #111;
}

.geo-parl-fill {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 7px;
    font-weight: 700;
    color: #000;
}

.geo-parl-fill.ruling {
    background: #ff8c00;
}

.geo-parl-fill.opposition {
    background: #4da6ff;
}

.geo-parl-legend {
    display: flex;
    justify-content: space-between;
    font-size: 7px;
    margin-top: 2px;
}

/* Alignment Spectrum */
.geo-alignment {
    margin: 4px 0 8px 0;
}

.geo-align-labels {
    display: flex;
    justify-content: space-between;
    font-size: 7px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.geo-align-bar {
    position: relative;
    height: 8px;
    border-radius: 4px;
    margin-top: 2px;
    background: linear-gradient(90deg, #ff3b3b 0%, #ff8c00 25%, #555 50%, #4da6ff 75%, #0084ff 100%);
}

.geo-align-marker {
    position: absolute;
    top: -3px;
    width: 4px;
    height: 14px;
    background: #fff;
    border-radius: 2px;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.7);
    transform: translateX(-50%);
}

/* Tags */
.geo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin: 4px 0;
}

.geo-alliance-tag {
    font-size: 7px;
    padding: 1px 5px;
    border: 1px solid #555;
    color: #ccc;
    border-radius: 2px;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.geo-ally-tag {
    font-size: 7px;
    padding: 1px 5px;
    border: 1px solid #00d26a40;
    color: #00d26a;
    border-radius: 2px;
}

.geo-adversary-tag {
    font-size: 7px;
    padding: 1px 5px;
    border: 1px solid #ff3b3b40;
    color: #ff3b3b;
    border-radius: 2px;
}

.geo-resource-tag {
    font-size: 7px;
    padding: 1px 5px;
    border: 1px solid #ff8c0040;
    color: #ff8c00;
    border-radius: 2px;
}

/* UN Voting */
.geo-un-votes {
    margin: 4px 0;
}

.geo-un-row {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 8px;
    color: #888;
    margin: 2px 0;
}

.geo-un-row>span:first-child {
    width: 40px;
}

.geo-un-row>span:last-child {
    width: 28px;
    text-align: right;
}

.geo-un-bar {
    flex: 1;
    height: 5px;
    background: #1a1a1a;
    border-radius: 3px;
    overflow: hidden;
}

.geo-un-bar>div {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s;
}

/* Trade bars */
.geo-trade-row {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 8px;
    color: #ccc;
    margin: 2px 0;
}

.geo-trade-name {
    width: 70px;
    color: #888;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.geo-trade-pct {
    width: 24px;
    text-align: right;
}

.geo-trade-bar {
    flex: 1;
    height: 4px;
    background: #1a1a1a;
    border-radius: 2px;
    overflow: hidden;
}

.geo-trade-bar>div {
    height: 100%;
    border-radius: 2px;
}

/* Risk Grid */
.geo-risk-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: 4px 0;
}

.geo-risk-card {
    text-align: center;
    padding: 6px;
    background: #0d0d0d;
    border: 1px solid #222;
    border-radius: 3px;
}

.geo-risk-score {
    font-size: 16px;
    font-weight: 800;
}

.geo-risk-label {
    font-size: 7px;
    color: #666;
    letter-spacing: 1px;
    margin-top: 2px;
}

.geo-risk-sub {
    font-size: 7px;
    color: #444;
}

/* Democracy Index Bar */
.geo-democracy-bar {
    height: 8px;
    background: #1a1a1a;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 4px;
}

.geo-demo-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}