:root {
    --bg-deep: #0A0B10;
    --bg-surface: #15171E;
    --accent-high: #EF4444;
    --accent-medium: #EAB308;
    --accent-low: #22C55E;
    --text-main: #FFFFFF;
    --text-muted: #8E8E93;
    --border-glass: rgba(255, 255, 255, 0.05);
    --accent-blue: #3B82F6;
}

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

body {
    background: var(--bg-deep);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

.app-header {
    background: rgba(10, 11, 16, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area h1 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fff;
}

.logo-area span {
    color: var(--text-muted);
    font-size: 0.8rem;
}

#global-alert-banner {
    background: var(--accent-low);
    color: #000;
    font-size: 0.7rem;
    padding: 0.25rem 0.75rem;
    border-radius: 2px;
    font-weight: 800;
    text-transform: uppercase;
}

#region-focus {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
}

/* ─── Navigation ─── */
.view-controls {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-glass);
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    z-index: 2000;
}

.view-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn.active {
    color: #fff;
    border-bottom: 2px solid #fff;
}

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

/* ─── Cards ─── */
.dashboard-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 8rem 1.5rem 8rem; /* Increased top padding for fixed nav */
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.5rem;
}

.cluster-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: 4px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.topic-tag {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 2px;
    margin-bottom: 0.75rem;
    display: inline-block;
}

.topic-tag.high { background: var(--accent-high); color: #fff; }
.topic-tag.medium { background: var(--accent-medium); color: #000; }
.topic-tag.low { background: var(--accent-low); color: #000; }

.card-header h3 {
    font-size: 1.25rem;
    line-height: 1.3;
}

.syn-section {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-glass);
}

.syn-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.syn-text {
    font-size: 0.9rem;
}

.source-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-decoration: none;
}

/* ─── Table ─── */
.table-container {
    background: rgba(10, 15, 20, 0.5);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-glass);
    border-radius: 4px;
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-glass);
}

.archive-nav-box {
    margin-bottom: 2rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    background: rgba(0,0,0,0.3);
    padding: 1.25rem;
    border-radius: 4px;
    border: 1px solid var(--border-glass);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
    width: 100%;
    position: relative;
}

.archive-nav-box .view-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

select#archive-jump {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    border: 1px solid var(--border-glass);
    border-radius: 4px;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 10px) center;
    padding-right: 30px !important;
}

select#archive-jump option {
    background: var(--bg-surface);
    color: var(--text-main);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-glass);
    font-size: 0.9rem;
}

td a {
    color: #fff;
    text-decoration: none;
}

/* ─── Mobile ─── */
@media (max-width: 1024px) {
    .view-controls {
        position: fixed;
        bottom: 0;
        top: auto;
        left: 0;
        width: 100%;
        background: rgba(10, 11, 16, 0.95);
        backdrop-filter: blur(20px);
        padding: 1rem;
        border-top: 1px solid var(--border-glass);
        z-index: 1000;
    }
    .view-btn.active {
        background: rgba(255, 255, 255, 0.1);
        border: none;
        border-radius: 4px;
    }
}

.loading-pulse {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-style: italic;
}

.view-panel { display: none; }
.view-panel.active { display: block; }
