/**
 * Tema oscuro para páginas públicas de estado (/p/<slug>).
 * Se carga solo cuando body tiene .status-public-page--dark (valor public_theme en BD).
 */

body.status-public-page--dark.status-public-page,
body.status-public-page--dark .status-public-shell .content-body {
    background: #0b0f14 !important;
    color: #e2e8f0;
}

body.status-public-page--dark .container-fluid h1,
body.status-public-page--dark section h1 {
    color: #f8fafc !important;
}

body.status-public-page--dark .text-danger {
    color: #fca5a5 !important;
}

body.status-public-page--dark .text-muted {
    color: #94a3b8 !important;
}

body.status-public-page--dark .lead {
    color: #cbd5e1 !important;
}

/* Pie: franja de características */
body.status-public-page--dark .status-public-footer-features {
    background: #0f1419;
    border-top-color: #1e293b;
}

body.status-public-page--dark .status-public-footer-feature {
    background: #131a24;
    border-color: #243042;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

body.status-public-page--dark .status-public-footer-feature h3 {
    color: #f1f5f9 !important;
}

body.status-public-page--dark .status-public-footer-feature p {
    color: #94a3b8 !important;
}

body.status-public-page--dark .status-public-footer-feature-icon--transparency {
    background: rgba(59, 130, 246, 0.22);
    border-color: rgba(96, 165, 250, 0.35);
    color: #93c5fd;
}

body.status-public-page--dark .status-public-footer-feature-icon--history {
    background: rgba(14, 165, 233, 0.22);
    border-color: rgba(56, 189, 248, 0.35);
    color: #7dd3fc;
}

body.status-public-page--dark .status-public-footer-feature-icon--alerts {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(74, 222, 128, 0.35);
    color: #86efac;
}

body.status-public-page--dark .status-public-footer-feature-icon--precision {
    background: rgba(139, 92, 246, 0.22);
    border-color: rgba(167, 139, 250, 0.35);
    color: #c4b5fd;
}

/* Barra superior: icono de página y subtítulo */
body.status-public-page--dark .status-public-nav-page-icon {
    background: linear-gradient(180deg, #132a22 0%, #0f1f18 100%);
    border-color: rgba(34, 197, 94, 0.35);
    color: #4ade80;
}

body.status-public-page--dark .status-header-subtitle {
    color: #94a3b8 !important;
}

body.status-public-page--dark .status-section-title {
    color: #f1f5f9 !important;
}

body.status-public-page--dark .status-kpi-reliability-downtime30 {
    color: #94a3b8 !important;
    border-top-color: rgba(148, 163, 184, 0.35) !important;
}

body.status-public-page--dark .status-kpi-reliability-downtime30 strong {
    color: #f8fafc !important;
}

/* Tarjeta estado general */
body.status-public-page--dark .status-general-card {
    background: #131a24;
    border-color: #243042;
    box-shadow: 0 4px 22px rgba(0, 0, 0, 0.45);
}

body.status-public-page--dark .status-general-card h3 {
    color: #f8fafc !important;
}

body.status-public-page--dark .status-general-card p {
    color: #94a3b8 !important;
}

body.status-public-page--dark .status-general-card--manual {
    border-top-color: #fb7185;
    background: linear-gradient(180deg, #131a24 0%, #2a1218 100%);
}

body.status-public-page--dark .status-general-card--outage {
    border-top-color: #f87171;
    background: linear-gradient(180deg, #131a24 0%, #281515 100%);
}

body.status-public-page--dark .status-general-card--degraded {
    border-top-color: #fb923c;
    background: linear-gradient(180deg, #131a24 0%, #2a1810 100%);
}

body.status-public-page--dark .status-general-card--maintenance_all,
body.status-public-page--dark .status-general-card--maintenance_partial {
    border-top-color: #38bdf8;
    background: linear-gradient(180deg, #131a24 0%, #0f1f2a 100%);
}

body.status-public-page--dark .status-general-card--operational_w_maint {
    border-top-color: #fbbf24;
    background: linear-gradient(180deg, #131a24 0%, #241f12 100%);
}

body.status-public-page--dark .status-general-card--operational_ok {
    border-top-color: #4ade80;
    background: linear-gradient(180deg, #131a24 0%, #0f2218 100%);
}

body.status-public-page--dark .status-general-card--mixed {
    border-top-color: #94a3b8;
    background: linear-gradient(180deg, #131a24 0%, #1a1f28 100%);
}

body.status-public-page--dark .status-general-card-icon--manual {
    background: linear-gradient(145deg, #4c1d24 0%, #3f1720 100%);
    color: #fda4af;
    border-color: rgba(251, 113, 133, 0.5);
    box-shadow: 0 0 0 5px rgba(244, 63, 94, 0.12), 0 6px 14px rgba(0, 0, 0, 0.4);
}

body.status-public-page--dark .status-general-card-icon--outage {
    background: linear-gradient(145deg, #450a0a 0%, #3f1515 100%);
    color: #fca5a5;
    border-color: rgba(248, 113, 113, 0.5);
    box-shadow: 0 0 0 5px rgba(248, 113, 113, 0.1), 0 6px 14px rgba(0, 0, 0, 0.4);
}

body.status-public-page--dark .status-general-card-icon--degraded {
    background: linear-gradient(145deg, #431407 0%, #3a1a0d 100%);
    color: #fdba74;
    border-color: rgba(251, 146, 60, 0.5);
    box-shadow: 0 0 0 5px rgba(251, 146, 60, 0.1), 0 6px 14px rgba(0, 0, 0, 0.35);
}

body.status-public-page--dark .status-general-card-icon--maintenance_all,
body.status-public-page--dark .status-general-card-icon--maintenance_partial {
    background: linear-gradient(145deg, #0c4a6e 0%, #0a3a54 100%);
    color: #7dd3fc;
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: 0 0 0 5px rgba(14, 165, 233, 0.12), 0 6px 14px rgba(0, 0, 0, 0.35);
}

body.status-public-page--dark .status-general-card-icon--operational_w_maint {
    background: linear-gradient(145deg, #422006 0%, #361a08 100%);
    color: #fcd34d;
    border-color: rgba(251, 191, 36, 0.45);
    box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.1), 0 6px 14px rgba(0, 0, 0, 0.35);
}

body.status-public-page--dark .status-general-card-icon--operational_ok {
    background: linear-gradient(145deg, #14532d 0%, #0f3d22 100%);
    color: #86efac;
    border-color: rgba(74, 222, 128, 0.5);
    box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.12), 0 6px 16px rgba(0, 0, 0, 0.35);
}

body.status-public-page--dark .status-general-card-icon--mixed {
    background: linear-gradient(145deg, #1e293b 0%, #151b26 100%);
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.45);
    box-shadow: 0 0 0 5px rgba(100, 116, 139, 0.1), 0 4px 12px rgba(0, 0, 0, 0.35);
}

/* Tarjetas de monitor */
body.status-public-page--dark .status-monitor-card {
    background: #131a24;
    border-color: #243042;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

body.status-public-page--dark .status-monitor-title {
    color: #f1f5f9 !important;
}

body.status-public-page--dark .status-monitor-meta {
    color: #94a3b8 !important;
}

body.status-public-page--dark .status-monitor-type-icon {
    background: linear-gradient(180deg, #1a2332 0%, #141c28 100%);
    border-color: #2d3a4d;
    color: #94a3b8;
}

body.status-public-page--dark .status-uptime-pill {
    background: #1e293b !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

body.status-public-page--dark .monitor-status-chip.is-up {
    color: #86efac;
    background-color: rgba(22, 163, 74, 0.2);
    border-color: rgba(74, 222, 128, 0.4);
}

body.status-public-page--dark .monitor-status-chip.is-down {
    color: #fca5a5;
    background-color: rgba(185, 28, 28, 0.25);
    border-color: rgba(248, 113, 113, 0.45);
}

body.status-public-page--dark .monitor-status-chip.is-unknown {
    color: #cbd5e1;
    background-color: rgba(51, 65, 85, 0.65);
    border-color: rgba(100, 116, 139, 0.85);
}

body.status-public-page--dark .monitor-status-chip.is-degraded {
    color: #fcd34d;
    background-color: rgba(180, 83, 9, 0.28);
    border-color: rgba(251, 191, 36, 0.45);
}

body.status-public-page--dark .monitor-status-chip.is-maintenance {
    color: #7dd3fc;
    background-color: rgba(3, 105, 161, 0.35);
    border-color: rgba(56, 189, 248, 0.5);
}

/* Incidentes manuales */
body.status-public-page--dark .status-incident-card {
    background: #131a24;
    border-color: #243042;
    color: #e2e8f0;
}

body.status-public-page--dark .status-incident-badge.open {
    background: rgba(185, 28, 28, 0.35);
    color: #fecaca;
}

body.status-public-page--dark .status-incident-badge.monitoring {
    background: rgba(180, 83, 9, 0.35);
    color: #fed7aa;
}

body.status-public-page--dark .status-incident-badge.resolved {
    background: rgba(22, 101, 52, 0.35);
    color: #bbf7d0;
}

/* KPIs y franjas */
body.status-public-page--dark .status-kpi-section-head-title {
    color: #f8fafc !important;
}

body.status-public-page--dark .status-kpi-section-head-hint {
    color: #94a3b8 !important;
}

body.status-public-page--dark .status-strip-panel {
    background: #131a24 !important;
    border-color: #243042 !important;
}

body.status-public-page--dark .status-unified-strip-head {
    color: #f1f5f9 !important;
}

body.status-public-page--dark .status-unified-strip-desc {
    color: #94a3b8 !important;
}

body.status-public-page--dark .status-unified-strip {
    background: #0f1419 !important;
    border-color: #1e293b !important;
}

body.status-public-page--dark .status-unified-bar-axis {
    color: #94a3b8 !important;
}

body.status-public-page--dark .status-legend-text {
    color: #94a3b8 !important;
}

body.status-public-page--dark .status-group-heading {
    color: #cbd5e1 !important;
    border-bottom-color: #243042 !important;
}

body.status-public-page--dark .status-kpi-tile {
    background: #131a24 !important;
    border-color: #243042 !important;
}

/* Cabecera y pie de cada KPI: en el tema claro son gris muy claro; en oscuro unificamos fondo oscuro y texto legible. */
body.status-public-page--dark .status-kpi-tile-label {
    background: #1a2332 !important;
    color: #e2e8f0 !important;
    border-bottom-color: #334155 !important;
}

body.status-public-page--dark .status-kpi-tile-body {
    color: #f8fafc !important;
    background: transparent !important;
}

body.status-public-page--dark .status-kpi-tile-foot {
    background: #1a2332 !important;
    color: #cbd5e1 !important;
    border-top-color: #334155 !important;
}

body.status-public-page--dark .status-kpi-tile-foot .text-muted {
    color: #94a3b8 !important;
}

body.status-public-page--dark .status-donut-wrap {
    background: radial-gradient(circle at 30% 25%, #1e293b 0%, #131a24 100%) !important;
    border-color: #243042 !important;
}

body.status-public-page--dark .status-donut {
    background: #334155 !important;
}

body.status-public-page--dark .status-donut.has-data {
    background: conic-gradient(#22c55e 0turn calc(var(--up-ratio, 0) * 1turn), #7f1d1d 0) !important;
}

body.status-public-page--dark .status-kpi-big {
    color: #f8fafc !important;
}

body.status-public-page--dark .status-kpi-big-muted {
    color: #94a3b8 !important;
}

body.status-public-page--dark .status-kpi-incident-badge {
    color: #e2e8f0 !important;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.28) 0%, rgba(30, 58, 138, 0.35) 100%) !important;
    border-color: rgba(96, 165, 250, 0.35) !important;
}

body.status-public-page--dark .status-semi-gauge-inner {
    background: conic-gradient(
        from 0deg at 50% 50%,
        #334155 0deg 90deg,
        var(--gauge-accent, #ea580c) 90deg calc(90deg + var(--avail-pct, 0) * 1.8deg),
        #334155 calc(90deg + var(--avail-pct, 0) * 1.8deg) 270deg,
        #334155 270deg 360deg
    ) !important;
}

body.status-public-page--dark .status-monitor-kpi-wrap {
    border-top-color: #243042 !important;
    background: transparent !important;
}

body.status-public-page--dark .status-public-history-toolbar {
    background: #131a24 !important;
    border-color: #243042 !important;
}

body.status-public-page--dark .status-public-history-toolbar-label {
    color: #f1f5f9 !important;
}

body.status-public-page--dark .status-public-history-seg {
    background: #0f1419 !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

body.status-public-page--dark .status-public-history-seg:hover {
    border-color: #475569 !important;
    color: #f8fafc !important;
}

body.status-public-page--dark .status-public-history-seg.is-selected {
    background: rgba(22, 163, 74, 0.22) !important;
    border-color: #22c55e !important;
    color: #bbf7d0 !important;
}

/* Fiabilidad MTBF / MTTR: mismos acentos que en claro, adaptados a fondo oscuro. */
body.status-public-page--dark .status-kpi-key-stat {
    border-left-width: 4px;
}

body.status-public-page--dark .status-kpi-key-stat--mtbf {
    border-left-color: #22c55e !important;
    border-color: rgba(34, 197, 94, 0.38) !important;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.26) 0%, rgba(22, 163, 74, 0.1) 42%, rgba(15, 23, 42, 0.65) 100%) !important;
}

body.status-public-page--dark .status-kpi-key-stat--mttr {
    border-left-color: #f59e0b !important;
    border-color: rgba(245, 158, 11, 0.42) !important;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.24) 0%, rgba(217, 119, 6, 0.12) 42%, rgba(15, 23, 42, 0.65) 100%) !important;
}

body.status-public-page--dark .status-kpi-key-stat--mtbf .status-kpi-key-stat-label {
    color: #86efac !important;
}

body.status-public-page--dark .status-kpi-key-stat--mttr .status-kpi-key-stat-label {
    color: #fdba74 !important;
}

body.status-public-page--dark .status-kpi-key-stat--mtbf .status-kpi-key-stat-hint {
    color: #bbf7d0 !important;
}

body.status-public-page--dark .status-kpi-key-stat--mttr .status-kpi-key-stat-hint {
    color: #fde68a !important;
}

body.status-public-page--dark .status-kpi-key-stat--mtbf .status-kpi-key-stat-value {
    color: #f0fdf4 !important;
}

body.status-public-page--dark .status-kpi-key-stat--mttr .status-kpi-key-stat-value {
    color: #fffbeb !important;
}

body.status-public-page--dark .status-kpi-tile-foot strong:nth-of-type(1) {
    color: #86efac !important;
}

body.status-public-page--dark .status-kpi-tile-foot strong:nth-of-type(2) {
    color: #fdba74 !important;
}
