:root {
    --bg: #0c1220;
    --card-bg: rgba(15, 23, 42, 0.78);
    --border: rgba(255, 255, 255, 0.07);
    --text: #f8fafc;
    --text-dim: #94a3b8;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.28);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.glass {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.container {
    max-width: 1580px;
    margin: 0 auto;
    padding: 40px 20px;
}

header {
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px;
}

h1 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: clamp(1.85rem, 4vw, 2.6rem);
    margin: 0;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, #fff 0%, #60a5fa 55%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-box {
    padding: 20px;
    transition: transform 0.25s var(--ease-in-out);
}

.stat-box:hover {
    transform: translateY(-3px);
    border-color: var(--accent-glow);
}

.stat-val {
    font-size: 2.1rem;
    font-weight: 800;
    display: block;
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
}

.view-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
    min-height: 820px;
}

.table-side {
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.22);
    max-height: 820px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

th {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #0c1220;
    padding: 14px 16px;
    text-align: left;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
}

th.sortable { cursor: pointer; transition: color 0.2s; }
th.sortable:hover { color: var(--accent); }

td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    overflow-wrap: break-word;
    font-size: 0.88rem;
}

tr:hover td {
    background: rgba(59, 130, 246, 0.05);
}

#map {
    border-radius: 16px;
    border: 1px solid var(--border);
    height: 820px;
    position: sticky;
    top: 36px;
}

.btn-action {
    background: #fff;
    color: #0f172a;
    padding: 9px 16px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.72rem;
    border: none;
    cursor: pointer;
    transition: 0.2s var(--ease-in-out);
}

.btn-action.primary {
    background: var(--accent);
    color: #fff;
}

.btn-action:hover {
    transform: scale(1.04);
}

.btn-action.ghost {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.leaflet-tile {
    filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(88%);
}

.pr-hud {
    font-family: ui-monospace, monospace;
    font-size: 11px;
    color: var(--text-dim);
    padding: 8px 12px;
    margin-bottom: 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.35);
}

.hub-nav-links a {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
    font-size: 0.8rem;
    margin-right: 12px;
}

.hub-nav-links a:hover {
    border-bottom: 1px solid var(--accent);
}

@media (max-width: 1024px) {
    .view-container {
        grid-template-columns: 1fr;
    }
    #map {
        height: min(40vh, 400px);
        position: relative;
        top: 0;
        order: -1;
    }
    .table-side {
        max-height: none;
    }
}
