:root {
    --bg-deep: #030508;
    --bg-panel: #0b101a;
    --bg-card: #151b2b;
    --primary: #F0B90B;
    /* Gold */
    --accent: #00f3ff;
    /* Cyan */
    --danger: #ff0055;
    --success: #0ecb81;
    --text-main: #f0f4f8;
    --text-muted: #8b9bb4;
    --border: #1e2636;
    --glow-primary: 0 0 15px rgba(240, 185, 11, 0.2);
    --glow-accent: 0 0 15px rgba(0, 243, 255, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-main);
    font-family: 'Space Grotesk', -apple-system, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* HEADER */
header {
    height: 70px;
    background: rgba(11, 16, 26, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
    text-decoration: none;
}

.brand svg {
    width: 32px;
    height: 32px;
    fill: var(--primary);
    filter: drop-shadow(0 0 5px rgba(240, 185, 11, 0.5));
}

.nav-status {
    display: flex;
    gap: 20px;
    font-size: 13px;
    font-family: 'IBM Plex Mono', monospace;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse 2s infinite;
}

/* NAV BUTTONS */
.nav-btn {
    text-decoration: none;
    color: var(--text-sec);
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-btn:hover {
    color: var(--primary);
    background: rgba(240, 185, 11, 0.1);
    border-color: rgba(240, 185, 11, 0.3);
    box-shadow: 0 0 10px rgba(240, 185, 11, 0.1);
}

/* GRID LAYOUT */
.dashboard {
    display: grid;
    grid-template-columns: 350px 1fr 300px;
    /* Sidebar | Map/Main | Stats */
    grid-template-rows: 110px 1fr 220px;
    /* KPI | Map | Console */
    gap: 10px;
    padding: 10px;
    height: calc(100vh - 70px);
}

/* PANELS */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.panel-head {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
}

/* KPI CARDS */
.kpi-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.kpi-card {
    background: linear-gradient(135deg, var(--bg-panel) 0%, var(--bg-card) 100%);
    padding: 20px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.kpi-val {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
    font-family: 'IBM Plex Mono', monospace;
    margin-top: 5px;
}

.kpi-label {
    font-size: 12px;
    color: var(--text-muted);
}

.kpi-chart {
    height: 40px;
    width: 100%;
    margin-top: 10px;
    opacity: 0.5;
}

/* BLOCK FEED */
.feed-container {
    overflow-y: auto;
    flex: 1;
    padding-right: 5px;
}

.block-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    animation: slideIn 0.3s ease-out;
}

.block-row:hover {
    background: var(--bg-card);
}

.block-height {
    color: var(--accent);
    font-weight: 600;
}

.block-data {
    color: var(--text-muted);
}

.block-hash {
    color: var(--text-muted);
    opacity: 0.6;
    font-size: 10px;
}

/* MAP VISUALIZER */
.map-panel {
    grid-column: 2;
    grid-row: 2;
    background: #0b101a;
    position: relative;
}

/* Simplified "Map" style using geometric nodes */
.node {
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    position: absolute;
    transition: all 1s;
}

.connection {
    position: absolute;
    height: 1px;
    background: rgba(0, 243, 255, 0.1);
    transform-origin: 0 0;
}

/* AI CONSENSUS */
.consensus-panel {
    grid-column: 3;
    grid-row: 2;
}

.vote-circle {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: conic-gradient(var(--success) 0% 0%, var(--bg-card) 0% 100%);
    margin: 5px auto;
    position: relative;
    box-shadow: 0 0 30px rgba(14, 203, 129, 0.1);
}

.vote-inner {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    background: var(--bg-panel);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.confidence-val {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
}

/* TERMINAL */
.terminal-panel {
    background: #05080c;
    border: 1px solid var(--border);
}

.log-content {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--success);
    line-height: 1.6;
    overflow-y: hidden;
    height: 100%;
    text-shadow: 0 0 5px rgba(14, 203, 129, 0.3);
}

/* SCROLLBAR */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

/* MOBILE */
@media (max-width: 1000px) {
    .dashboard {
        display: flex;
        flex-direction: column;
        height: auto;
    }

    .kpi-grid {
        grid-template-columns: 1fr 1fr;
    }

    .panel {
        min-height: 300px;
    }

    .nav-status {
        display: none;
    }
}