:root {
    --bg: #0f0f14;
    --bg-card: #1a1a24;
    --bg-elevated: #22222e;
    --border: rgba(255,255,255,0.07);
    --text: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --green: #22c55e;
    --green-bg: rgba(34,197,94,0.12);
    --green-border: rgba(34,197,94,0.25);
    --amber: #f59e0b;
    --amber-bg: rgba(245,158,11,0.12);
    --amber-border: rgba(245,158,11,0.25);
    --red: #ef4444;
    --red-bg: rgba(239,68,68,0.12);
    --red-border: rgba(239,68,68,0.25);
    --blue: #3b82f6;
    --blue-bg: rgba(59,130,246,0.12);
    --blue-border: rgba(59,130,246,0.25);
    --radius: 12px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.app {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 16px 64px;
}

.hidden { display: none !important; }

/* Header */
.header { margin-bottom: 24px; }
.brand {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: -0.3px;
}

/* Status Banner */
.status-banner {
    padding: 24px 28px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 32px;
    transition: all 0.4s ease;
}
.status-banner.status-operational {
    background: linear-gradient(135deg, rgba(34,197,94,0.15), rgba(34,197,94,0.05));
    border: 1px solid var(--green-border);
}
.status-banner.status-degraded {
    background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(245,158,11,0.05));
    border: 1px solid var(--amber-border);
}
.status-banner.status-major_outage {
    background: linear-gradient(135deg, rgba(239,68,68,0.15), rgba(239,68,68,0.05));
    border: 1px solid var(--red-border);
}
.status-banner.status-maintenance {
    background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(59,130,246,0.05));
    border: 1px solid var(--blue-border);
}
.banner-icon { font-size: 24px; }
.banner-text { font-size: 18px; font-weight: 600; }

/* Active Incident */
.active-incident {
    background: var(--bg-card);
    border: 1px solid var(--red-border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 32px;
}
.incident-active-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--red);
    margin-bottom: 4px;
}
.incident-active-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.incident-active-services {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}
.service-tag {
    background: var(--bg-elevated);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Sections */
.section { margin-bottom: 36px; }
.section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 16px;
}

/* Services List */
.services-list {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.service-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    transition: background 0.2s;
}
.service-row:hover { background: var(--bg-elevated); }
.service-row + .service-row { border-top: 1px solid var(--border); }
.service-name { font-size: 14px; font-weight: 500; }
.service-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.status-dot.operational { background: var(--green); }
.status-dot.degraded { background: var(--amber); }
.status-dot.major_outage { background: var(--red); }
.status-dot.maintenance { background: var(--blue); }
.status-text.operational { color: var(--green); }
.status-text.degraded { color: var(--amber); }
.status-text.major_outage { color: var(--red); }
.status-text.maintenance { color: var(--blue); }
.service-note {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Uptime bars */
.uptime-row {
    margin-bottom: 20px;
}
.uptime-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}
.uptime-name { font-size: 13px; font-weight: 500; }
.uptime-pct { font-size: 13px; color: var(--green); font-weight: 500; }
.uptime-bars {
    display: flex;
    gap: 1px;
    height: 28px;
    border-radius: 4px;
    overflow: hidden;
}
.uptime-bar {
    flex: 1;
    min-width: 2px;
    position: relative;
    cursor: pointer;
    transition: opacity 0.15s;
}
.uptime-bar:hover { opacity: 0.7; }
.uptime-bar.operational { background: var(--green); }
.uptime-bar.degraded { background: var(--amber); }
.uptime-bar.outage { background: var(--red); }
.uptime-bar.maintenance { background: var(--blue); }
.uptime-bar.unknown { background: rgba(255,255,255,0.06); }
.uptime-bar[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    color: var(--text);
    z-index: 10;
    pointer-events: none;
}
.uptime-legend {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
}

/* Incidents */
.incident-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 12px;
}
.incident-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    cursor: pointer;
}
.incident-title { font-size: 15px; font-weight: 600; }
.incident-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}
.incident-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;
}
.incident-badge.resolved { background: var(--green-bg); color: var(--green); }
.incident-badge.active { background: var(--red-bg); color: var(--red); }
.incident-data-safe {
    margin-top: 8px;
    font-size: 13px;
    color: var(--green);
}
.incident-timeline {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.incident-timeline.collapsed { display: none; }
.timeline-item {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    position: relative;
}
.timeline-item + .timeline-item { border-top: 1px solid rgba(255,255,255,0.03); }
.timeline-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}
.timeline-dot.investigating { background: var(--red); }
.timeline-dot.identified { background: var(--amber); }
.timeline-dot.monitoring { background: var(--blue); }
.timeline-dot.resolved { background: var(--green); }
.timeline-time { font-size: 12px; color: var(--text-muted); }
.timeline-msg { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

.no-incidents { color: var(--text-muted); font-size: 14px; font-style: italic; }

/* Maintenance */
.maintenance-card {
    background: var(--bg-card);
    border: 1px solid var(--blue-border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 12px;
}
.maintenance-title { font-size: 14px; font-weight: 600; color: var(--blue); }
.maintenance-meta { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* Skeleton */
.service-skeleton {
    height: 48px;
    background: rgba(255,255,255,0.04);
    animation: pulse-skeleton 1.5s infinite;
}
.service-skeleton + .service-skeleton { border-top: 1px solid var(--border); }
@keyframes pulse-skeleton { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

/* Footer */
.footer {
    text-align: center;
    padding-top: 32px;
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}
.footer-sep { opacity: 0.3; }
.footer-link { color: var(--blue); text-decoration: none; }
.footer-link:hover { text-decoration: underline; }

@media (max-width: 480px) {
    .app { padding: 20px 12px 48px; }
    .status-banner { padding: 18px 20px; }
    .banner-text { font-size: 16px; }
}
