/*
 * Стиль status-страницы — опирается на палитру docs/DESIGN.md:
 * sage (primary), warm-50 (фон), charcoal (текст), terra (ошибки).
 * Моноширинный акцент — как у status-page с серверным минимализмом.
 */

:root {
    --sage-500: #8FA37F;
    --sage-600: #7C8B6F;
    --sage-700: #64725A;
    --sage-50:  #F2F5EF;
    --sage-100: #E5EBE0;
    --warm-50:  #F9F7F3;
    --warm-100: #F1EDE6;
    --warm-200: #E5DFD5;
    --charcoal-500: #6B6560;
    --charcoal-700: #3E3A37;
    --charcoal-800: #2C2C2C;
    --charcoal-900: #1A1A1A;
    --terra-400: #D4926E;
    --terra-500: #C4775A;
    --terra-600: #A8614A;
    --warn-500:  #C49A5A;
    --ok-500:    #6B8F5E;

    --radius: 12px;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    color: var(--charcoal-800);
    background: var(--warm-50);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
}

.hdr {
    border-bottom: 1px solid var(--warm-200);
    background: white;
    padding: 16px 0;
}
.hdr-row { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; }
.brand { color: var(--charcoal-900); text-decoration: none; font-weight: 600; font-size: 18px; }
.brand-sub { color: var(--sage-600); font-weight: 500; margin-left: 4px; }
.nav a { color: var(--charcoal-500); text-decoration: none; margin-left: 20px; font-size: 14px; }
.nav a:hover { color: var(--sage-700); }

.main { padding: 40px 0 60px; }

.headline {
    padding: 28px 24px;
    border-radius: var(--radius);
    margin-bottom: 32px;
    background: white;
    border: 1px solid var(--warm-200);
    border-left: 4px solid var(--sage-500);
}
.headline h1 { margin: 0 0 4px; font-size: 28px; font-weight: 600; color: var(--charcoal-900); }
.headline-is-ok      { border-left-color: var(--ok-500); }
.headline-is-warn    { border-left-color: var(--warn-500); background: #FEF9EF; }
.headline-is-down    { border-left-color: var(--terra-500); background: #FEF2F0; }
.headline-is-unknown { border-left-color: var(--charcoal-500); }

.muted { color: var(--charcoal-500); font-size: 14px; }

.section-title { font-size: 20px; margin: 0 0 16px; font-weight: 500; color: var(--charcoal-900); }

.components { margin-bottom: 40px; }

.component-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.component {
    display: flex;
    gap: 14px;
    background: white;
    border: 1px solid var(--warm-200);
    border-radius: var(--radius);
    padding: 14px 18px;
    align-items: flex-start;
}
.component .dot {
    flex-shrink: 0;
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-top: 7px;
    background: var(--charcoal-500);
}
.component.is-ok .dot      { background: var(--ok-500); }
.component.is-warn .dot    { background: var(--warn-500); }
.component.is-down .dot    { background: var(--terra-500); }
.component.is-unknown .dot { background: var(--charcoal-500); }

.component-body { flex: 1; min-width: 0; }
.component-head { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.component-name { color: var(--charcoal-900); font-weight: 500; }
.component-health { color: var(--charcoal-500); font-size: 14px; }
.component.is-ok .component-health   { color: var(--ok-500); }
.component.is-warn .component-health { color: var(--warn-500); }
.component.is-down .component-health { color: var(--terra-600); }

.component-desc, .component-meta { margin: 4px 0 0; font-family: var(--mono); font-size: 12px; }
.component-desc { font-family: var(--font); font-size: 13px; }
.component-msg { color: var(--terra-600); }

.fragment-meta { margin-top: 16px; font-family: var(--mono); font-size: 12px; }

.incidents-active { margin-bottom: 32px; }
.incident-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.incident-card {
    background: white;
    border: 1px solid var(--warm-200);
    border-left: 3px solid var(--charcoal-500);
    border-radius: var(--radius);
    padding: 16px 18px;
}
.incident-card.sev-minor    { border-left-color: var(--warn-500); }
.incident-card.sev-major    { border-left-color: var(--terra-500); }
.incident-card.sev-critical { border-left-color: var(--terra-600); background: #FEF2F0; }

.incident-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.incident-title { color: var(--charcoal-900); text-decoration: none; font-weight: 500; font-size: 16px; }
.incident-title:hover { color: var(--sage-700); }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--warm-100);
    color: var(--charcoal-700);
    font-size: 12px;
    font-family: var(--mono);
}
.badge-status { background: var(--sage-100); color: var(--sage-700); }

.incident-latest { margin: 6px 0 0; font-size: 14px; }

.incident-detail { padding: 24px; background: white; border-radius: var(--radius); border: 1px solid var(--warm-200); margin-bottom: 24px; }
.incident-detail h1 { margin: 8px 0 12px; font-size: 26px; font-weight: 600; }
.badges { display: flex; gap: 8px; margin-bottom: 12px; }

.component-tag {
    font-family: var(--mono);
    background: var(--warm-100);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 4px;
}

.timeline { padding: 24px; background: white; border-radius: var(--radius); border: 1px solid var(--warm-200); }
.updates { margin: 0; padding-left: 20px; }
.update { margin-bottom: 16px; }
.update-head { display: flex; gap: 12px; align-items: baseline; }
.update p { margin: 4px 0 0; }

.explainer { margin-top: 48px; padding: 20px; border-left: 3px solid var(--sage-500); background: var(--sage-50); border-radius: 0 var(--radius) var(--radius) 0; }
.explainer h3 { margin: 0 0 8px; font-weight: 500; }
.explainer p { margin: 0 0 8px; font-size: 14px; }

.empty { padding: 40px; text-align: center; color: var(--charcoal-500); background: white; border: 1px dashed var(--warm-200); border-radius: var(--radius); }

.ftr { border-top: 1px solid var(--warm-200); padding: 20px 0; font-size: 13px; color: var(--charcoal-500); background: white; margin-top: 48px; }
.ftr .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

code { font-family: var(--mono); font-size: 13px; }
a { color: var(--sage-700); }
a:hover { color: var(--sage-600); }

@media (max-width: 640px) {
    .hdr-row { flex-direction: column; align-items: flex-start; gap: 8px; }
    .nav a { margin-left: 0; margin-right: 16px; }
    .headline h1 { font-size: 22px; }
}

/* ---- 90-day uptime timeline ---- */
.uptime { margin-top: 28px; }
.uptime-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 16px; }
.uptime-row { border: 1px solid var(--warm-200); border-radius: var(--radius); padding: 14px 16px; background: #fff; }
.uptime-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.uptime-name { font-weight: 500; color: var(--charcoal-900); }
.uptime-pct { margin-left: auto; font-family: var(--mono); font-size: 13px; }
.uptime-head .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--charcoal-500); display: inline-block; }
.uptime-head .dot.is-ok { background: var(--ok-500); }
.uptime-head .dot.is-warn { background: var(--warn-500); }
.uptime-head .dot.is-down { background: var(--terra-500); }
.uptime-head .dot.is-unknown { background: var(--charcoal-500); }
.uptime-bars { display: flex; gap: 2px; align-items: stretch; height: 30px; }
.ubar { flex: 1 1 0; min-width: 2px; border-radius: 2px; background: var(--warm-200); transition: transform .08s; }
.ubar:hover { transform: scaleY(1.12); }
.ubar.bar-ok { background: var(--ok-500); }
.ubar.bar-warn { background: var(--warn-500); }
.ubar.bar-down { background: var(--terra-500); }
.ubar.bar-none { background: var(--warm-200); }
.uptime-legend { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; }
.badge-auto { background: var(--warm-100); color: var(--charcoal-500); border: 1px solid var(--warm-200); }
