/* undo.systems */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: #0B0E14;
    color: #C9D1D9;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.5;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(28,34,48,0.3) 40px),
        repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(28,34,48,0.3) 40px);
}

/* Typography */
.section-heading {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 20px;
    color: #C9D1D9;
    margin-bottom: 1.25rem;
}

.mono {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
}

/* Hero Section */
.hero {
    padding: 3rem 2rem 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.hero-inner {
    background: #141821;
    padding: 2rem;
    border-radius: 4px;
    border: 1px solid #1C2230;
}

.hero-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.status-row {
    display: flex;
    gap: 0.5rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot.green {
    background: #3FB950;
    box-shadow: 0 0 8px rgba(63,185,80,0.4);
}

.status-dot.yellow {
    background: #D29922;
    box-shadow: 0 0 8px rgba(210,153,34,0.4);
}

.status-dot.red {
    background: #F85149;
    box-shadow: 0 0 8px rgba(248,81,73,0.4);
}

.uptime-counter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.uptime-label {
    font-size: 0.75rem;
    color: #8B949E;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.uptime-value {
    font-size: 1rem;
    color: #3FB950;
}

.status-label {
    font-size: 0.8rem;
    color: #8B949E;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hero-title {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: 1.5rem;
    color: #3FB950;
    margin-bottom: 0.5rem;
}

.uptime-detail {
    font-size: 0.85rem;
    color: #8B949E;
    margin-bottom: 1.25rem;
}

/* Hero Metrics */
.hero-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.metric-card {
    background: #0B0E14;
    border: 1px solid #1C2230;
    border-radius: 4px;
    padding: 0.75rem;
    text-align: center;
}

.metric-value {
    display: block;
    font-size: 1.1rem;
    color: #C9D1D9;
    margin-bottom: 0.25rem;
}

.metric-label {
    display: block;
    font-size: 0.7rem;
    color: #8B949E;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Emergency Button + Confirmation Guard */
.hero-actions {
    position: relative;
}

.emergency-btn {
    background: #F85149;
    color: #FFFFFF;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.65rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(248,81,73,0.3);
    animation: pulse-red 2s ease-in-out infinite;
    transition: background 0.2s;
}

.emergency-btn:hover {
    background: #da3b34;
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 20px rgba(248,81,73,0.3); }
    50% { box-shadow: 0 0 30px rgba(248,81,73,0.5); }
}

.confirm-guard {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(248,81,73,0.08);
    border: 1px solid rgba(248,81,73,0.3);
    border-radius: 4px;
}

.confirm-guard.active {
    display: block;
    animation: fadeSlideIn 0.3s ease forwards;
}

.confirm-text {
    font-size: 0.85rem;
    color: #F85149;
    margin-bottom: 0.75rem;
}

.confirm-actions {
    display: flex;
    gap: 0.75rem;
}

.confirm-yes {
    background: #F85149;
    color: #FFFFFF;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.confirm-yes:hover {
    background: #da3b34;
}

.confirm-cancel {
    background: transparent;
    color: #8B949E;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.5rem 1.25rem;
    border: 1px solid #1C2230;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.confirm-cancel:hover {
    border-color: #8B949E;
    color: #C9D1D9;
}

/* Timeline Section */
.timeline {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

.event-log {
    margin-bottom: 1.5rem;
}

.event {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-left: 2px solid #1C2230;
    padding-left: 1rem;
    margin-left: 4px;
    transition: background 0.2s;
}

.event:hover {
    background: rgba(28,34,48,0.3);
}

.event[data-status="yellow"] {
    border-left-color: #D29922;
}

.event[data-status="red"] {
    border-left-color: #F85149;
}

.event-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.3rem;
}

.event-dot.green {
    background: #3FB950;
    box-shadow: 0 0 6px rgba(63,185,80,0.3);
}

.event-dot.yellow {
    background: #D29922;
    box-shadow: 0 0 6px rgba(210,153,34,0.3);
}

.event-dot.red {
    background: #F85149;
    box-shadow: 0 0 6px rgba(248,81,73,0.3);
}

.event-content {
    flex: 1;
}

.event-time {
    font-size: 0.75rem;
    color: #8B949E;
}

.event-text {
    font-size: 0.85rem;
    color: #C9D1D9;
    margin-top: 0.15rem;
}

.event-tag {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    margin-top: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tag-success {
    color: #3FB950;
    background: rgba(63,185,80,0.1);
    border: 1px solid rgba(63,185,80,0.2);
}

.tag-warning {
    color: #D29922;
    background: rgba(210,153,34,0.1);
    border: 1px solid rgba(210,153,34,0.2);
}

.tag-critical {
    color: #F85149;
    background: rgba(248,81,73,0.1);
    border: 1px solid rgba(248,81,73,0.2);
}

/* Recovery Slider */
.recovery-slider {
    background: #141821;
    padding: 1.25rem;
    border-radius: 4px;
    border: 1px solid #1C2230;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.slider-label {
    font-size: 0.85rem;
    color: #8B949E;
}

.slider-timestamp {
    font-size: 0.75rem;
    color: #3FB950;
}

.slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #1C2230;
    outline: none;
    border-radius: 2px;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3FB950;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(63,185,80,0.4);
}

.slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3FB950;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 8px rgba(63,185,80,0.4);
}

.slider-range {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #8B949E;
}

.snapshot-count {
    font-size: 0.7rem;
    color: #8B949E;
}

/* Dashboard Grid */
.dashboard {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-areas:
        "api auth cache"
        "db cdn queue";
    gap: 1rem;
}

.system-panel {
    background: #141821;
    border: 1px solid #1C2230;
    border-radius: 4px;
    padding: 1rem;
    transition: border-color 0.2s;
}

.system-panel:hover {
    border-color: #3FB950;
}

.system-panel:nth-child(1) { grid-area: api; }
.system-panel:nth-child(2) { grid-area: auth; }
.system-panel:nth-child(3) { grid-area: cache; }
.system-panel:nth-child(4) { grid-area: db; }
.system-panel:nth-child(5) { grid-area: cdn; }
.system-panel:nth-child(6) { grid-area: queue; }

.panel-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.panel-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #C9D1D9;
}

.panel-metrics {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.panel-metric {
    text-align: center;
    flex: 1;
}

.panel-metric-val {
    display: block;
    font-size: 0.9rem;
    color: #C9D1D9;
}

.panel-metric-label {
    display: block;
    font-size: 0.6rem;
    color: #8B949E;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.panel-version {
    font-size: 0.7rem;
    color: #8B949E;
    text-align: right;
}

/* Analysis Section */
.analysis {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

.blast-panel {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-bottom: 1.5rem;
    background: #141821;
    padding: 1.5rem;
    border-radius: 4px;
    border: 1px solid #1C2230;
}

.blast-viz {
    flex-shrink: 0;
}

.blast-details {
    flex: 1;
}

.blast-heading {
    font-size: 0.9rem;
    font-weight: 600;
    color: #C9D1D9;
    margin-bottom: 0.75rem;
}

.blast-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid #1C2230;
}

.blast-row:last-child {
    border-bottom: none;
}

.blast-label {
    font-size: 0.85rem;
    color: #8B949E;
}

.blast-val {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    font-weight: 500;
}

.blast-val.red { color: #F85149; }
.blast-val.yellow { color: #D29922; }
.blast-val.green { color: #3FB950; }

/* Diff Panel */
.diff-panel {
    background: #141821;
    padding: 1.25rem;
    border-radius: 4px;
    border: 1px solid #1C2230;
}

.diff-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.diff-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #C9D1D9;
}

.diff-badge {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    font-weight: 500;
    color: #D29922;
    background: rgba(210,153,34,0.1);
    border: 1px solid rgba(210,153,34,0.25);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    text-transform: uppercase;
}

.diff-block {
    font-size: 0.8rem;
    border-radius: 3px;
    overflow: hidden;
}

.diff-line {
    padding: 0.3rem 0.75rem;
    border-left: 3px solid transparent;
}

.diff-context {
    color: #8B949E;
    background: transparent;
    border-left-color: #1C2230;
}

.diff-remove {
    background: rgba(248,81,73,0.08);
    color: #F85149;
    border-left-color: #F85149;
}

.diff-add {
    background: rgba(63,185,80,0.08);
    color: #3FB950;
    border-left-color: #3FB950;
}

/* Audit Section */
.audit {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

.audit-panel {
    background: #141821;
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid #1C2230;
    margin-bottom: 1.5rem;
}

.audit-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid #1C2230;
    font-size: 0.8rem;
    transition: background 0.2s;
}

.audit-row:last-child {
    border-bottom: none;
}

.audit-row:hover {
    background: rgba(28,34,48,0.3);
}

.audit-time {
    color: #8B949E;
    min-width: 130px;
}

.audit-action {
    color: #D29922;
    min-width: 80px;
}

.audit-snapshot {
    color: #3FB950;
}

.audit-detail {
    flex: 1;
    color: #C9D1D9;
}

.audit-lock {
    font-size: 12px;
    opacity: 0.6;
}

/* SLA Panel */
.sla-panel {
    background: #141821;
    border: 1px solid #1C2230;
    border-radius: 4px;
    padding: 1.25rem;
}

.sla-heading {
    font-size: 0.9rem;
    font-weight: 600;
    color: #C9D1D9;
    margin-bottom: 1rem;
}

.sla-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.sla-item {
    text-align: center;
}

.sla-value {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.sla-value.green { color: #3FB950; }
.sla-value.yellow { color: #D29922; }
.sla-value.red { color: #F85149; }

.sla-label {
    display: block;
    font-size: 0.65rem;
    color: #8B949E;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Footer */
.footer {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
}

.flink {
    font-size: 0.8rem;
    color: #8B949E;
    text-decoration: none;
    transition: color 0.2s;
}

.flink:hover {
    color: #C9D1D9;
}

.footer-copy {
    font-size: 0.7rem;
    color: #8B949E;
}

/* Animations */
@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-areas:
            "api auth"
            "cache db"
            "cdn queue";
    }

    .sla-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .blast-panel {
        flex-direction: column;
    }

    .hero-metrics {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "api"
            "auth"
            "cache"
            "db"
            "cdn"
            "queue";
    }

    .sla-grid {
        grid-template-columns: 1fr 1fr;
    }

    .hero-top-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}
