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

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-tertiary: #6e7681;
    --accent-green: #3fb950;
    --accent-yellow: #d29922;
    --accent-orange: #db6d28;
    --accent-blue: #58a6ff;
    --accent-purple: #a371f7;
    --accent-red: #f85149;
    --border-color: #30363d;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
}

.stat-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.stat-card.large {
    grid-column: span 1;
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.15), rgba(88, 166, 255, 0.05));
    border-color: var(--accent-blue);
}

.stat-icon {
    font-size: 1.75rem;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-card.large .stat-value {
    color: var(--accent-blue);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* Panel */
.panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.panel-header h2 {
    font-size: 1rem;
    font-weight: 600;
}

.panel-header select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.375rem 0.5rem;
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-icon:hover {
    color: var(--accent-blue);
    background: rgba(88, 166, 255, 0.1);
}

/* Leaderboard */
.leaderboard-list {
    max-height: 400px;
    overflow-y: auto;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.leaderboard-item:hover {
    background: var(--bg-tertiary);
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.rank {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    margin-right: 1rem;
    border-radius: 50%;
    background: var(--bg-tertiary);
}

.rank.gold { background: linear-gradient(135deg, #ffd700, #ffb700); color: #000; }
.rank.silver { background: linear-gradient(135deg, #c0c0c0, #a0a0a0); color: #000; }
.rank.bronze { background: linear-gradient(135deg, #cd7f32, #a0522d); color: #fff; }

.agent-info {
    flex: 1;
}

.agent-name {
    font-weight: 500;
}

.agent-stats {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.agent-score {
    font-weight: 600;
    color: var(--accent-yellow);
}

/* Activity Feed */
.activity-feed {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

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

.activity-text strong {
    color: var(--accent-blue);
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

/* Ships List */
.ships-list {
    max-height: 400px;
    overflow-y: auto;
}

.ship-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.ship-item:hover {
    background: var(--bg-tertiary);
}

.ship-item:last-child {
    border-bottom: none;
}

.ship-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.ship-item-title {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-weight: 500;
}

.status-badge.verified {
    background: rgba(63, 185, 80, 0.2);
    color: var(--accent-green);
}

.status-badge.pending {
    background: rgba(210, 153, 34, 0.2);
    color: var(--accent-yellow);
}

.ship-item-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.ship-item-author {
    color: var(--text-tertiary);
}

/* Funnel Chart */
.funnel-chart {
    padding: 1.5rem;
}

.funnel-stage {
    margin-bottom: 1rem;
}

.funnel-stage:last-child {
    margin-bottom: 0;
}

.funnel-bar {
    height: 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    transition: width 0.5s ease;
}

.funnel-bar.submitted {
    background: linear-gradient(90deg, var(--accent-blue), rgba(88, 166, 255, 0.7));
}

.funnel-bar.attested {
    background: linear-gradient(90deg, var(--accent-yellow), rgba(210, 153, 34, 0.7));
}

.funnel-bar.verified {
    background: linear-gradient(90deg, var(--accent-green), rgba(63, 185, 80, 0.7));
}

.funnel-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.375rem;
}

/* Loading */
.loading-inline {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
}

/* Footer */
footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

footer a {
    color: var(--accent-blue);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .stat-card.large {
        grid-column: span 3;
    }

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

@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }

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

    .stat-card.large {
        grid-column: span 2;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }
}
