/* ============================================
   CartOS Status Page
   Sora + Plus Jakarta Sans, CartOS blue palette
   ============================================ */

/* ── Status Banner ─────────────────────────── */

.status-banner {
    padding: 100px 24px 48px;
    text-align: center;
    transition: background 0.5s ease;
}

.status-banner-operational  { background: #16a34a; }
.status-banner-degraded     { background: #d97706; }
.status-banner-partial_outage { background: #ea580c; }
.status-banner-major_outage { background: #dc2626; }
.status-banner-maintenance  { background: #3b82f6; }

.status-banner-inner {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.status-banner-icon {
    width: 56px;
    height: 56px;
    color: rgba(255, 255, 255, 0.9);
}

.status-banner h1 {
    font-family: 'Sora', sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    color: #fff;
    margin: 0;
    letter-spacing: -0.02em;
}

/* ── Container ─────────────────────────────── */

.status-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}

/* ── Sections ──────────────────────────────── */

.status-section {
    margin-bottom: 48px;
}

.section-heading {
    font-family: 'Sora', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-heading svg { color: #64748b; }

/* ── Legend ─────────────────────────────────── */

.components-section {
    margin-bottom: 56px;
}

.status-legend {
    display: flex;
    justify-content: flex-end;
    gap: 24px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    color: #64748b;
}

.legend-indicator {
    width: 14px;
    height: 14px;
    border-radius: 4px;
}

.indicator-operational  { background: #16a34a; }
.indicator-degraded     { background: #f59e0b; }
.indicator-partial,
.indicator-partial_outage { background: #f97316; }
.indicator-major,
.indicator-major_outage   { background: #dc2626; }
.indicator-maintenance    { background: #3b82f6; }

/* ── Component List ────────────────────────── */

.component-list {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.component-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 28px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
}

.component-row:last-child { border-bottom: none; }
.component-row:hover { background: #fafbfc; }

/* The colored status indicator — prominent square with icon */
.component-indicator {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.component-indicator svg {
    width: 18px;
    height: 18px;
    color: #fff;
}

.component-indicator.indicator-operational  { background: #16a34a; }
.component-indicator.indicator-degraded     { background: #f59e0b; }
.component-indicator.indicator-partial_outage { background: #f97316; }
.component-indicator.indicator-major_outage { background: #dc2626; }
.component-indicator.indicator-maintenance  { background: #3b82f6; }

.component-name {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    flex: 1;
}

.component-status-label {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-text-operational     { color: #16a34a; }
.status-text-degraded        { color: #d97706; }
.status-text-partial_outage  { color: #ea580c; }
.status-text-major_outage    { color: #dc2626; }
.status-text-maintenance     { color: #2563eb; }

/* ── Incident Cards ────────────────────────── */

.incident-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 12px;
}

.incident-card.active-incident {
    border-left: 4px solid #f59e0b;
}

.incident-card.maintenance-card {
    border-left: 4px solid #3b82f6;
    background: #f8faff;
}

.incident-card.resolved-incident {
    border-color: #f1f5f9;
}

.incident-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.incident-header h3 {
    font-family: 'Sora', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    line-height: 1.4;
}

.incident-badge {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    flex-shrink: 0;
}

.badge-none         { background: #f1f5f9; color: #64748b; }
.badge-minor        { background: #fefce8; color: #ca8a04; }
.badge-major        { background: #fff7ed; color: #ea580c; }
.badge-critical     { background: #fef2f2; color: #dc2626; }
.badge-resolved     { background: #f0fdf4; color: #16a34a; }
.badge-maintenance  { background: #eff6ff; color: #2563eb; }

.badge-investigating { background: #fefce8; color: #ca8a04; }
.badge-identified    { background: #fff7ed; color: #ea580c; }
.badge-monitoring    { background: #eff6ff; color: #2563eb; }

.incident-meta {
    display: flex;
    gap: 16px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.82rem;
    color: #64748b;
    flex-wrap: wrap;
}

.incident-meta .affected { color: #94a3b8; }

/* ── Incident Timeline ─────────────────────── */

.incident-timeline {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.timeline-entry {
    display: flex;
    gap: 14px;
    padding: 10px 0;
    position: relative;
}

.timeline-entry:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 26px;
    bottom: -2px;
    width: 2px;
    background: #e2e8f0;
}

.timeline-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 3px;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #e2e8f0;
}

.status-dot-investigating { background: #f59e0b; box-shadow: 0 0 0 2px #fde68a; }
.status-dot-identified    { background: #f97316; box-shadow: 0 0 0 2px #fed7aa; }
.status-dot-monitoring    { background: #3b82f6; box-shadow: 0 0 0 2px #bfdbfe; }
.status-dot-resolved      { background: #16a34a; box-shadow: 0 0 0 2px #bbf7d0; }
.status-dot-update        { background: #8b5cf6; box-shadow: 0 0 0 2px #ddd6fe; }
.status-dot-scheduled     { background: #3b82f6; box-shadow: 0 0 0 2px #bfdbfe; }
.status-dot-completed     { background: #16a34a; box-shadow: 0 0 0 2px #bbf7d0; }

.timeline-content { flex: 1; min-width: 0; }

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

.timeline-status {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e293b;
}

.timeline-time {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.75rem;
    color: #94a3b8;
    white-space: nowrap;
}

.timeline-content p {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.65;
    margin: 0;
}

/* ── Date Groups ───────────────────────────── */

.incident-date-group {
    margin-bottom: 28px;
}

.incident-date {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: #64748b;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.no-incidents {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.95rem;
    color: #94a3b8;
    text-align: center;
    padding: 40px 0;
}

/* ── Footer ────────────────────────────────── */

.status-footer {
    text-align: center;
    padding: 32px 0;
    border-top: 1px solid #e2e8f0;
}

.status-footer p {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.82rem;
    color: #94a3b8;
    margin: 4px 0;
}

.status-footer a { color: #2563eb; text-decoration: none; font-weight: 500; }
.status-footer a:hover { text-decoration: underline; }

/* ── Admin Styles ──────────────────────────── */

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

.admin-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.admin-status-header h1 {
    font-family: 'Sora', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.admin-nav-links {
    display: flex;
    gap: 8px;
}

.admin-nav-link {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: #475569;
    border: 1px solid #e2e8f0;
    transition: all 0.15s ease;
}

.admin-nav-link:hover { background: #f1f5f9; }
.admin-nav-link.active { background: #2563eb; color: #fff; border-color: #2563eb; }

.status-admin-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 24px;
}

.status-admin-card h2 {
    font-family: 'Sora', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 16px;
}

.component-admin-row {
    display: grid;
    grid-template-columns: 1fr 200px 60px;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.component-admin-name {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    color: #1e293b;
}

.status-select {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.82rem;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    width: 100%;
}

.status-select:focus { outline: none; border-color: #3584e4; box-shadow: 0 0 0 3px rgba(53,132,228,0.12); }

.btn-sm-save {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-sm-save:hover { background: #1d4ed8; }

.incident-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.incident-form label {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
    display: block;
}

.incident-form input,
.incident-form select,
.incident-form textarea {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.92rem;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

.incident-form input:focus,
.incident-form select:focus,
.incident-form textarea:focus {
    outline: none;
    border-color: #3584e4;
    box-shadow: 0 0 0 3px rgba(53,132,228,0.12);
}

.incident-form textarea { resize: vertical; min-height: 80px; }

.form-row-inline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] { width: auto; }

.btn-primary-status {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 10px;
    border: none;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-start;
}

.btn-primary-status:hover { background: #1d4ed8; }

.flash-success-status {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 12px 20px;
    border-radius: 10px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.88rem;
    margin-bottom: 20px;
}

.admin-incident-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-incident-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: #f8fafc;
    border-radius: 10px;
    gap: 12px;
}

.admin-incident-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1e293b;
}

.admin-incident-meta {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.75rem;
    color: #94a3b8;
}

.admin-incident-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.admin-incident-actions a {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    color: #475569;
    transition: all 0.15s ease;
}

.admin-incident-actions a:hover { background: #f1f5f9; }

/* Auth pages */
.status-auth-container {
    max-width: 440px;
    margin: 80px auto;
    padding: 0 24px;
}

.status-auth-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 40px;
}

.status-auth-card h1 {
    font-family: 'Sora', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 24px;
    text-align: center;
}

/* ── Responsive ────────────────────────────── */

@media (max-width: 640px) {
    .status-banner { padding: 80px 20px 36px; }
    .status-banner-icon { width: 40px; height: 40px; }
    .status-banner h1 { font-size: 1.5rem; }

    .component-row {
        padding: 16px 18px;
        gap: 12px;
    }

    .component-indicator {
        width: 28px;
        height: 28px;
        border-radius: 6px;
    }

    .component-indicator svg { width: 15px; height: 15px; }

    .component-name { font-size: 0.88rem; }

    .component-status-label { font-size: 0.75rem; }

    .incident-header { flex-direction: column; }

    .status-legend { gap: 12px; }

    .timeline-header { flex-direction: column; align-items: flex-start; gap: 2px; }

    .component-admin-row { grid-template-columns: 1fr; gap: 8px; }
    .form-row-inline { grid-template-columns: 1fr; }

    .admin-status-header { flex-direction: column; gap: 12px; align-items: flex-start; }
    .admin-nav-links { flex-wrap: wrap; }

    .admin-incident-item { flex-direction: column; align-items: flex-start; }
}
