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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #0d1117;
    color: #c9d1d9;
    min-height: 100vh;
}

a { color: #58a6ff; text-decoration: none; }
a:hover { text-decoration: underline; }

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: #161b22;
    border-bottom: 1px solid #30363d;
}

header h1 { font-size: 18px; }
header h1 a { color: #58a6ff; text-decoration: none; }

#status {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #8b949e;
}

#geyser-status.connected { color: #3fb950; }
#geyser-status.disconnected { color: #f85149; }

nav#main-nav {
    display: flex;
    gap: 2px;
    padding: 8px 24px;
    background: #161b22;
}

.tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #8b949e;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    font-size: 14px;
}

.tab.active { background: #0d1117; color: #c9d1d9; }
.tab:hover { color: #c9d1d9; }

main { padding: 16px 24px; }

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

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header-left {}

.page-header-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

.breadcrumb {
    font-size: 13px;
    color: #8b949e;
    margin-bottom: 4px;
}

.breadcrumb a { color: #8b949e; }
.breadcrumb a:hover { color: #58a6ff; }

.page-header h2 {
    color: #c9d1d9;
    font-size: 20px;
}

.page-header .subtitle {
    font-size: 13px;
    color: #8b949e;
    margin-top: 2px;
}

.search-box input {
    background: #21262d;
    border: 1px solid #30363d;
    color: #c9d1d9;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    width: 200px;
}

.search-box input::placeholder { color: #484f58; }

select {
    background: #21262d;
    border: 1px solid #30363d;
    color: #c9d1d9;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
}

/* Vote Latency Summary boxes */
.vote-latency-summary {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.latency-box {
    flex: 1;
    min-width: 120px;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    background: #161b22;
    border: 1px solid #30363d;
}

.latency-box .count {
    font-size: 28px;
    font-weight: 700;
    display: block;
    margin-bottom: 4px;
}

.latency-box .label {
    font-size: 11px;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.latency-box.min .count { color: #58a6ff; }
.latency-box.fast .count { color: #3fb950; }
.latency-box.slow .count { color: #d29922; }
.latency-box.missed .count { color: #f85149; }

/* Charts */
.chart-container {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    position: relative;
    height: 280px;
}

.chart-container h3 {
    font-size: 14px;
    color: #8b949e;
    margin-bottom: 8px;
}

.section-title {
    font-size: 14px;
    color: #8b949e;
    margin-bottom: 8px;
}

/* Controls */
.controls {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    font-size: 13px;
}

.controls input[type="number"] {
    width: 60px;
    padding: 4px;
    background: #21262d;
    border: 1px solid #30363d;
    color: #c9d1d9;
    border-radius: 4px;
}

.controls button {
    padding: 4px 12px;
    background: #21262d;
    border: 1px solid #30363d;
    color: #c9d1d9;
    border-radius: 4px;
    cursor: pointer;
}

.controls button:hover { background: #30363d; }

/* Tables */
.table-wrap {
    overflow-x: auto;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    margin-bottom: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th {
    position: sticky;
    top: 0;
    background: #161b22;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 2px solid #30363d;
    white-space: nowrap;
    font-weight: 600;
    color: #8b949e;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    z-index: 1;
}

.col-num { text-align: right; }
.col-rank { text-align: center; width: 60px; }
.col-name { min-width: 160px; }
.col-address { min-width: 200px; }

td {
    padding: 8px 12px;
    border-bottom: 1px solid #21262d;
    white-space: nowrap;
}

tr:hover { background: #161b22; }
tr.highlight { background: #1c2333; }

/* Latency colors */
.lat-1, .lat-fast { color: #3fb950; font-weight: 600; }
.lat-2, .lat-slow { color: #d29922; font-weight: 600; }
.lat-gt2 { color: #f85149; font-weight: 600; }
.lat-miss { color: #f85149; font-weight: 600; }
.lat-skip { color: #484f58; font-style: italic; }
.lat-min { color: #58a6ff; font-weight: 600; }
tr.skipped-row { opacity: 0.4; }

/* Leaderboard */
.rank-cell { text-align: center; }

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 12px;
}

.rank-1 { background: #ffd700; color: #000; }
.rank-2 { background: #c0c0c0; color: #000; }
.rank-3 { background: #cd7f32; color: #fff; }

.validator-name {
    font-weight: 600;
    color: #c9d1d9;
}

.validator-link {
    color: #58a6ff;
    cursor: pointer;
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: 12px;
}

.validator-link:hover { text-decoration: underline; }

td.num { text-align: right; font-family: 'Cascadia Code', 'Fira Code', monospace; font-size: 12px; }

/* Optimal row */
tr.optimal-row { background: #1c2333; border-bottom: 2px solid #30363d; }
tr.optimal-row td { color: #8b949e; font-style: italic; }

/* Credits coloring */
.credits-good { color: #3fb950; }
.credits-ok { color: #d29922; }
.credits-bad { color: #f85149; }

/* Responsive */
@media (max-width: 768px) {
    header { flex-direction: column; gap: 8px; }
    .vote-latency-summary { flex-direction: column; }
    .page-header { flex-direction: column; }
    .table-wrap { max-height: calc(100vh - 250px); }
}
