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

body {
    font-family: system-ui, -apple-system, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    min-height: 100vh;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #1e293b;
    border-bottom: 1px solid #334155;
}

.header h1 {
    font-size: 1.25rem;
    font-weight: 600;
}

.controls {
    display: flex;
    gap: 0.5rem;
}

.btn {
    padding: 0.5rem 1rem;
    background: #3b82f6;
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
}

.btn:hover { background: #2563eb; }
.btn:disabled { background: #475569; cursor: not-allowed; }
.btn.danger { background: #dc2626; }
.btn.danger:hover { background: #b91c1c; }

.content {
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

section {
    margin-bottom: 1.5rem;
}

section h2 {
    font-size: 1rem;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 1rem;
}

/* Config */
.config-section {
    background: #1e293b;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #334155;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.config-item label {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 0.25rem;
}

.config-item input[type="number"],
.config-item input[type="text"] {
    width: 100%;
    padding: 0.5rem;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 4px;
    color: #e2e8f0;
    font-size: 0.875rem;
}

.config-item input[type="range"] {
    width: 100%;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: #1e293b;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #334155;
    text-align: center;
}

.stat-label {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

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

.stat-card.success .stat-value { color: #4ade80; }
.stat-card.warning .stat-value { color: #fbbf24; }
.stat-card.error .stat-value { color: #f87171; }

/* Timeline */
.timeline-section {
    background: #1e293b;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #334155;
}

.timeline {
    display: flex;
    gap: 2px;
    height: 40px;
    overflow: hidden;
}

.timeline-bar {
    width: 4px;
    border-radius: 2px;
}

.timeline-bar.fresh { background: #4ade80; }
.timeline-bar.stale { background: #fbbf24; }
.timeline-bar.pending { background: #3b82f6; }
.timeline-bar.error { background: #f87171; }

/* Events */
.events-section {
    background: #1e293b;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #334155;
}

.events-list {
    max-height: 300px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.75rem;
}

.event-item {
    padding: 0.25rem 0;
    border-bottom: 1px solid #334155;
    display: flex;
    gap: 1rem;
}

.event-time { color: #64748b; }
.event-id { color: #94a3b8; }
.event-status { font-weight: 500; }
.event-status.fresh { color: #4ade80; }
.event-status.stale { color: #fbbf24; }
.event-status.pending { color: #3b82f6; }
.event-status.error { color: #f87171; }
.event-latency { color: #64748b; }
