:root {
    --bg-body: #f5f7fb;
    --bg-card: #ffffff;
    --border-soft: #e1e5f0;
    --text-main: #111827;
    --text-muted: #6b7280;
    --accent: #22c55e;
    --accent-soft: #dcfce7;
    --accent-warn: #facc15;
    --accent-warn-soft: #fef9c3;
    --accent-bad: #f97373;
    --accent-bad-soft: #fee2e2;
    --radius-lg: 18px;
    --radius-xl: 24px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    height: 28px;
}

.status-label {
    font-size: 14px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: #f9fafb;
    color: var(--text-muted);
}

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

.btn-outline {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: #f9fafb;
    font-size: 13px;
    color: var(--text-main);
    cursor: pointer;
}

.btn-outline:hover {
    background: #eef2ff;
}

.main {
    max-width: 780px;
    margin: 0 auto 40px;
    padding: 0 16px 40px;
    width: 100%;
}

.hero {
    margin-top: 4px;
    border-radius: var(--radius-xl);
    padding: 22px 24px;
    background: linear-gradient(135deg, #e0f2fe, #e9d5ff);
    border: 1px solid rgba(148, 163, 184, .25);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hero-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
}

.pill-icon {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.pill-ok {
    background: var(--accent-soft);
    color: #16a34a;
    border: 1px solid #4ade80;
}

.pill-warn {
    background: var(--accent-warn-soft);
    color: #b45309;
    border: 1px solid #fbbf24;
}

.pill-bad {
    background: var(--accent-bad-soft);
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

.hero-sub {
    font-size: 14px;
    color: var(--text-muted);
}

.hero-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.cards-row {
    margin-top: 24px;
    display: grid;
    grid-template-columns: minmax(0, 1.6fr);
    gap: 20px;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    padding: 18px 20px 20px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
}

.card-title {
    font-size: 17px;
    font-weight: 600;
}

.card-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.uptime-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 12px;
}

.uptime-main {
    font-size: 14px;
    color: var(--text-muted);
}

.uptime-value {
    font-size: 30px;
    font-weight: 700;
}

.uptime-label {
    font-size: 13px;
    color: var(--text-muted);
}

.component-count {
    font-size: 13px;
    color: var(--text-muted);
}

.bars-wrapper {
    margin-top: 8px;
}

.bars-row {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.day-bar {
    width: 10px;
    height: 22px;
    border-radius: 4px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background: #e5e7eb;
}

.day-ok {
    background: #4ade80;
    border-color: #22c55e;
}

.day-degraded {
    background: #facc15;
    border-color: #eab308;
}

.day-outage {
    background: #f97373;
    border-color: #ef4444;
}

.legend {
    margin-top: 10px;
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.legend-ok { background: #4ade80; }
.legend-degraded { background: #facc15; }
.legend-outage { background: #f97373; }

@media (max-width: 640px) {
    .header-bar {
        padding: 14px 16px;
    }
    .hero {
        padding: 18px 16px;
    }
    .card {
        padding: 16px;
    }
}

/* ---------------- History (incident list) ---------------- */

.history-section {
    margin-top: 32px;
}

.history-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.history-title {
    font-size: 16px;
    font-weight: 600;
}

.history-list {
    margin-top: 8px;
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid var(--border-soft);
    padding: 4px 20px 12px;
}

.history-month-label {
    text-transform: lowercase;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 14px;
    margin-bottom: 6px;
}

.history-row {
    display: flex;
    gap: 16px;
    padding: 10px 0;
    border-top: 1px solid #e5e7eb;
}

.history-row:first-of-type {
    border-top: none;
}

.history-date {
    width: 40px;
    text-align: center;
    padding-top: 2px;
}

.history-date-day {
    font-size: 15px;
    font-weight: 600;
}

.history-date-dow {
    font-size: 11px;
    text-transform: lowercase;
    color: var(--text-muted);
}

.history-item {
    flex: 1;
    display: flex;
    gap: 10px;
}

.history-bar {
    width: 3px;
    border-radius: 999px;
    margin-top: 4px;
    margin-bottom: 4px;
}

.history-bar-ok {
    background: #4ade80;
}

.history-bar-warn {
    background: #facc15;
}

.history-bar-critical {
    background: #f97373;
}

.history-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.history-title-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.history-item-title {
    font-size: 14px;
    font-weight: 600;
}

.history-item-time {
    font-size: 11px;
    color: var(--text-muted);
}

.history-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.history-component {
    font-weight: 500;
    color: #4b5563;
}

.history-duration {
    color: #4b5563;
    font-weight: 500;
}

@media (max-width: 640px) {
    .history-list {
        padding: 4px 14px 10px;
    }
    .history-row {
        gap: 10px;
    }
    .history-date {
        width: 32px;
    }
}
