/* =========================
   BASE GLOBAL SI360
========================= */

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: #060c18;
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
    overflow-x: hidden;
}

/* =========================
   HEADER SI360
========================= */

.header-si360 {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #001f3f;
    border-bottom: 2px solid #ffb300;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.brand-text strong {
    font-family: 'Orbitron', sans-serif;
    color: #ffb300;
    font-size: 15px;
    text-transform: uppercase;
}

.menu-toggle {
    display: none;
    font-size: 22px;
    color: #ffb300;
    cursor: pointer;
}

/* =========================
   MENÚ SI360
========================= */

.nav-si360 {
    display: block;
}

.menu-si360 {
    display: flex;
    align-items: center;
    gap: 14px;
}

.menu-si360 a {
    text-decoration: none;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s ease;
}

.menu-si360 a:hover {
    background: rgba(255,179,0,0.15);
}

.menu-si360 i {
    font-size: 13px;
    color: #ffb300;
}

.menu-divider {
    width: 1px;
    height: 22px;
    background: rgba(255,255,255,0.15);
}

.menu-title {
    color: #ffb300;
    font-weight: 900;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.menu-logout {
    color: #ffb300;
}

/* =========================
   TICKER SI360
========================= */

.flash-container {
    background: #000000;
    display: flex;
    align-items: center;
    border-bottom: 2px solid #ce1126;
}

.flash-label {
    background: #ffb300;
    color: #000000;
    padding: 8px 15px;
    font-weight: 900;
    font-size: 11px;
    text-transform: uppercase;
    white-space: nowrap;
}

.flash-track {
    overflow: hidden;
    flex: 1;
}

.flash-text {
    display: inline-block;
    padding-left: 100%;
    white-space: nowrap;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 13px;
    color: #00ff00;
    text-shadow: 0 0 8px rgba(0,255,0,0.6);
    animation: scroll 28s linear infinite;
}

@keyframes scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-100%); }
}

/* =========================
   RESPONSIVE HEADER + TICKER
========================= */

@media (max-width: 768px) {

    .menu-toggle {
        display: block;
    }

    .nav-si360 {
        display: none;
        background: #001f3f;
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    .nav-si360.active {
        display: block;
    }

    .menu-si360 {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 10px;
    }

    .menu-si360 a {
        justify-content: center;
        font-size: 11px;
        border: 1px solid rgba(255,179,0,0.25);
        background: rgba(255,255,255,0.05);
    }

    .menu-divider {
        width: 100%;
        height: 1px;
    }

    .menu-title {
        padding: 8px 10px;
        background: rgba(255,179,0,0.08);
        border-radius: 6px;
    }

    .flash-container {
        flex-direction: column;
        align-items: stretch;
    }

    .flash-label {
        text-align: center;
    }

    .flash-text {
        padding: 10px;
        animation-duration: 36s;
    }
}

/* =========================
   TARJETAS MONITOR TERRITORIAL
========================= */

.estado-sistema,
.monitor-territorial,
.system-status,
.cards-monitor {
    color: #0a192f;
}

.estado-sistema > div,
.monitor-territorial > div,
.system-status > div,
.cards-monitor > div {
    background: #f5f7fa;
    color: #0a192f;
    border-radius: 14px;
}

.estado-sistema *,
.monitor-territorial *,
.system-status *,
.cards-monitor * {
    color: #0a192f !important;
}

.estado-sistema i,
.monitor-territorial i,
.system-status i,
.cards-monitor i {
    color: #00bcd4 !important;
    font-size: 20px;
}

.border-green { border-bottom: 4px solid #2ecc71; }
.border-blue  { border-bottom: 4px solid #2980b9; }
.border-red   { border-bottom: 4px solid #e74c3c; }
.border-yellow{ border-bottom: 4px solid #f1c40f; }

/* =========================
   FORMULARIO DIAGNÓSTICO
========================= */

#contacto-diagnostico > div {
    width: 100%;
    max-width: 850px;
    margin: 0 auto;
    padding: 45px;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    border: 1px solid #eef2f6;
    box-sizing: border-box;
}

#contacto-diagnostico form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

#contacto-diagnostico form > div {
    width: 100%;
}

#contacto-diagnostico input,
#contacto-diagnostico select,
#contacto-diagnostico textarea {
    width: 100%;
    box-sizing: border-box;
}

#contacto-diagnostico button {
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 768px) {

    #contacto-diagnostico > div {
        max-width: 94%;
        padding: 18px 12px;
    }

    #contacto-diagnostico form {
        grid-template-columns: 1fr;
    }

    html, body {
        overflow-x: hidden !important;
    }
}

/* =========================
   BLINDAJE PANEL VIEJO
========================= */

/* SOLO afecta páginas que cargan header_private.php */
body.panel-old {
    background: #060c18;
    color: #ffffff;
    font-family: Arial, sans-serif;
}

/* Header viejo */
body.panel-old .header,
body.panel-old .menu,
body.panel-old .logo {
    all: unset;
}

/* Contenedor */
body.panel-old .contenedor {
    max-width: 900px;
    margin: 50px auto;
    background: #0f172a;
    padding: 30px 35px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

/* Título */
body.panel-old h1 {
    text-align: center;
    margin-bottom: 25px;
    color: #00f2ff;
}

/* Labels */
body.panel-old label {
    display: block;
    margin-top: 18px;
    margin-bottom: 6px;
    font-weight: 700;
    color: #ffb300;
}

/* Inputs */
body.panel-old input,
body.panel-old textarea,
body.panel-old select {
    width: 100% !important;
    padding: 12px 14px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    background: #020617 !important;
    color: #ffffff !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
}

/* Botón */
body.panel-old button {
    margin-top: 25px;
    width: 100%;
    background: #00f2ff;
    color: #000000;
    border: none;
    padding: 14px 18px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
}

body.panel-old button:hover {
    background: #22d3ee;
}

/* ==================================================
   ANALISIS CONTEXTUAL – MODULO PUBLICO
================================================== */

.contenedor-analisis {
    max-width: 1200px;
    margin: 50px auto;
    padding: 0 22px;
    color: #00345c;
}

.analisis-title {
    font-size: 28px;
    font-weight: 900;
    color: #00345c;
    margin-bottom: 14px;
}

.analisis-intro {
    font-size: 15px;
    line-height: 1.6;
    color: #00345c;
    margin-bottom: 10px;
    max-width: 880px;
}

.bloque-analisis {
    margin: 28px 0 36px;
    background: #0f172a;
    border-radius: 14px;
    padding: 22px 26px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.45);
}

.bloque-analisis h3 {
    color: #00345c;
    margin-bottom: 12px;
    font-size: 18px;
}

.bloque-analisis ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bloque-analisis li {
    padding: 6px 0;
    font-size: 14px;
    color: #00345c;
}

.analisis-subtitle {
    font-size: 20px;
    color: #00345c;
    margin-bottom: 18px;
    font-weight: 800;
}

/* =====================
   GRID DE TARJETAS
===================== */

.grid-contexto {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}

/* =====================
   TARJETA CONTEXTUAL
===================== */

.card-contexto {
    background: #0b1220;
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: 0 14px 30px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-contexto:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(0,0,0,0.6);
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.card-categoria {
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* =====================
   RIESGO VISUAL
===================== */

.card-riesgo {
    font-size: 12px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 999px;
    text-transform: uppercase;
}

.riesgo-alto {
    background: rgba(239,68,68,0.18);
    color: #ef4444;
}

.riesgo-medio {
    background: rgba(251,191,36,0.18);
    color: #fbbf24;
}

.riesgo-bajo {
    background: rgba(34,197,94,0.18);
    color: #22c55e;
}

/* =====================
   CONTENIDO TARJETA
===================== */

.card-titulo {
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    margin: 8px 0 10px;
    line-height: 1.4;
}

.card-resumen {
    font-size: 14px;
    line-height: 1.6;
    color: #cbd5e1;
    margin-bottom: 14px;
}

.card-fecha {
    font-size: 12px;
    color: #94a3b8;
}

/* =====================
   ESTADO SIN CONTENIDO
===================== */

.sin-contenido {
    margin-top: 20px;
    padding: 22px 26px;
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    color: #cbd5e1;
    font-size: 14px;
}

/* =====================
   RESPONSIVE
===================== */

@media (max-width: 768px) {

    .contenedor-analisis {
        margin: 30px auto;
        padding: 0 18px;
    }

    .analisis-title {
        font-size: 22px;
    }

    .analisis-subtitle {
        font-size: 18px;
    }

    .bloque-analisis {
        padding: 18px 20px;
    }

    .grid-contexto {
        gap: 16px;
    }
}
