* {
    box-sizing: border-box;
}

:root {
    --bg: #f5f7fa;
    --surface: #ffffff;
    --sidebar: #111827;
    --sidebar-muted: #94a3b8;
    --text: #1f2937;
    --muted: #64748b;
    --border: #e2e8f0;
    --primary: #1e293b;
    --success: #22c55e;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background: var(--bg);
    color: var(--text);
}

.layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
}

.sidebar {
    min-height: 100vh;
    padding: 28px 20px;
    background: var(--sidebar);
    color: white;

    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;

    display: grid;
    place-items: center;

    background: white;
    color: var(--sidebar);

    font-weight: 800;
}

.brand-name {
    font-size: 18px;
    font-weight: 700;
}

.brand-subtitle {
    margin-top: 2px;
    color: var(--sidebar-muted);
    font-size: 12px;
}

.navigation {
    display: flex;
    flex-direction: column;
    gap: 6px;

    margin-top: 42px;
}

.nav-item {
    padding: 11px 13px;
    border-radius: 8px;

    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-weight: 600;
}

.nav-item.disabled {
    opacity: 0.45;
}

.sidebar-footer {
    margin-top: auto;

    display: flex;
    align-items: center;
    gap: 8px;

    color: var(--sidebar-muted);
    font-size: 13px;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--success);
}

.main-content {
    min-width: 0;
    padding: 34px 42px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.topbar h1 {
    margin: 0;
    font-size: 27px;
}

.topbar p {
    margin: 6px 0 0;
    color: var(--muted);
}

.mode-badge {
    padding: 7px 11px;

    border: 1px solid var(--border);
    border-radius: 999px;

    background: var(--surface);

    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.query-panel {
    margin-top: 32px;
    padding: 30px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 14px;
}

.query-header h2 {
    margin: 0;
    font-size: 21px;
}

.query-header p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.query-box {
    display: flex;
    gap: 12px;

    margin-top: 24px;
}

.query-box input {
    flex: 1;
    min-width: 0;

    padding: 15px 17px;

    border: 1px solid #cbd5e1;
    border-radius: 9px;

    background: #f8fafc;

    font-size: 15px;
}

.query-box button {
    padding: 0 24px;

    border: 0;
    border-radius: 9px;

    background: var(--primary);
    color: white;

    font-weight: 600;
}

.query-box input:disabled,
.query-box button:disabled {
    opacity: 0.6;
}

.query-examples {
    margin-top: 17px;

    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    color: var(--muted);
    font-size: 12px;
}

.query-examples span {
    padding: 5px 9px;

    border: 1px solid var(--border);
    border-radius: 999px;

    background: #f8fafc;
}

.diagnostic-placeholder {
    margin-top: 22px;
    padding: 30px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 14px;
}

.placeholder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.placeholder-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.placeholder-header h2 {
    margin: 6px 0;
    font-size: 21px;
}

.placeholder-header p {
    margin: 0;
    color: var(--muted);
}

.health-placeholder {
    min-width: 72px;
    height: 42px;

    display: grid;
    place-items: center;

    border: 1px solid var(--border);
    border-radius: 9px;

    color: var(--muted);
    font-weight: 700;
}

.cards-grid {
    margin-top: 28px;

    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.info-card {
    padding: 20px;

    border: 1px solid var(--border);
    border-radius: 11px;

    background: #fafbfc;
}

.info-card h3 {
    margin: 0 0 18px;
    font-size: 15px;
}

.info-card dl {
    margin: 0;
}

.info-card dl > div {
    padding: 8px 0;

    display: flex;
    justify-content: space-between;
    gap: 18px;

    border-bottom: 1px solid #edf0f3;
}

.info-card dl > div:last-child {
    border-bottom: 0;
}

.info-card dt {
    color: var(--muted);
    font-size: 13px;
}

.info-card dd {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
}

.page-footer {
    padding: 30px 0 10px;

    color: #94a3b8;
    text-align: center;
    font-size: 12px;
}

@media (max-width: 900px) {

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

    .sidebar {
        min-height: auto;
    }

    .navigation {
        display: none;
    }

    .sidebar-footer {
        margin-top: 20px;
    }

    .main-content {
        padding: 24px 18px;
    }

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

    .query-box {
        flex-direction: column;
    }

    .query-box button {
        min-height: 48px;
    }
}


/* Login */

.login-page {
    min-height: 100vh;
    background: #f1f5f9;
}

.login-container {
    min-height: 100vh;

    display: grid;
    place-items: center;

    padding: 24px;
}

.login-card {
    width: min(440px, 100%);

    overflow: hidden;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 16px;

    box-shadow:
        0 20px 45px rgba(15, 23, 42, 0.08);
}

.login-brand {
    padding: 24px;

    display: flex;
    align-items: center;
    gap: 12px;

    background: var(--sidebar);
    color: white;
}

.login-brand .brand-mark {
    flex: 0 0 auto;
}

.login-brand-name {
    color: white;
}

.login-brand-subtitle {
    margin-top: 3px;

    color: #94a3b8;
    font-size: 12px;
}

.login-content {
    padding: 30px;
}

.login-content h1 {
    margin: 0;
    font-size: 24px;
}

.login-content > p {
    margin: 8px 0 24px;

    color: var(--muted);
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.login-form label {
    margin-top: 7px;

    color: #475569;
    font-size: 13px;
    font-weight: 600;
}

.login-form input {
    width: 100%;

    padding: 13px 14px;

    border: 1px solid #cbd5e1;
    border-radius: 8px;

    background: white;
    color: var(--text);

    font-size: 15px;
}

.login-form input:focus {
    outline: 2px solid rgba(30, 41, 59, 0.12);
    border-color: #64748b;
}

.login-form button {
    min-height: 46px;

    margin-top: 14px;

    border: 0;
    border-radius: 8px;

    background: var(--primary);
    color: white;

    font-weight: 600;
    cursor: pointer;
}

.login-error {
    margin-bottom: 17px;
    padding: 11px 13px;

    border: 1px solid #fecaca;
    border-radius: 8px;

    background: #fef2f2;
    color: #991b1b;

    font-size: 13px;
}

.login-footer {
    padding: 15px 24px;

    border-top: 1px solid var(--border);

    color: #94a3b8;
    text-align: center;
    font-size: 11px;
}


/* Sesión */

.sidebar-footer-stack {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.session-user {
    padding-top: 10px;

    border-top: 1px solid rgba(255, 255, 255, 0.08);

    color: #cbd5e1;
    font-size: 12px;
}

.logout-form {
    margin: 0;
}

.logout-form button {
    width: 100%;
    padding: 9px 11px;

    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 7px;

    background: transparent;
    color: #cbd5e1;

    text-align: left;
    font-size: 12px;

    cursor: pointer;
}

.logout-form button:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}


/* ==========================================================
   RedOps Visual Polish v1
   ========================================================== */

:root {
    --accent: #2563eb;
    --accent-soft: #eff6ff;
    --accent-border: #bfdbfe;
    --surface-hover: #f8fafc;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.07);
}

body {
    background:
        linear-gradient(
            180deg,
            #f8fafc 0%,
            #f4f6f9 100%
        );
}

.sidebar {
    background:
        linear-gradient(
            180deg,
            #111827 0%,
            #0f172a 100%
        );

    box-shadow:
        8px 0 30px rgba(15, 23, 42, 0.08);
}

.brand-mark {
    background:
        linear-gradient(
            135deg,
            #ffffff,
            #e2e8f0
        );

    box-shadow:
        0 5px 16px rgba(0, 0, 0, 0.18);
}

.navigation {
    gap: 8px;
}

.nav-item {
    position: relative;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.11);

    box-shadow:
        inset 3px 0 0 var(--accent);
}

.nav-item:not(.disabled):hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateX(2px);
}

.main-content {
    max-width: 1600px;
}

.topbar {
    padding-bottom: 6px;
}

.topbar h1 {
    font-size: 29px;
    letter-spacing: -0.02em;
}

.mode-badge {
    background: #f8fafc;
    border-color: #cbd5e1;

    box-shadow: var(--shadow-sm);
}

.query-panel {
    position: relative;
    overflow: hidden;

    border-color: #dbe3ec;

    box-shadow: var(--shadow-md);
}

.query-panel::before {
    content: "";

    position: absolute;
    top: 0;
    left: 0;
    right: 0;

    height: 3px;

    background:
        linear-gradient(
            90deg,
            var(--accent),
            #60a5fa
        );
}

.query-header h2 {
    letter-spacing: -0.01em;
}

.query-box input {
    background: #ffffff;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.query-box input:focus {
    outline: none;

    border-color: #93c5fd;

    box-shadow:
        0 0 0 4px rgba(37, 99, 235, 0.10);
}

.query-box button {
    min-width: 120px;

    background:
        linear-gradient(
            135deg,
            #1e293b,
            #0f172a
        );

    box-shadow:
        0 5px 14px rgba(15, 23, 42, 0.15);

    cursor: pointer;

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        opacity 0.15s ease;
}

.query-box button:not(:disabled):hover {
    transform: translateY(-1px);

    box-shadow:
        0 8px 18px rgba(15, 23, 42, 0.20);
}

.query-box button:not(:disabled):active {
    transform: translateY(0);
}

.query-examples span {
    background: #ffffff;

    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}

.diagnostic-placeholder {
    border-color: #dbe3ec;

    box-shadow: var(--shadow-md);
}

.placeholder-label {
    color: var(--accent);
}

.health-placeholder {
    min-width: 96px;

    background: #f8fafc;

    box-shadow: var(--shadow-sm);

    letter-spacing: 0.03em;
}

.cards-grid {
    gap: 18px;
}

.info-card {
    position: relative;

    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            #fafbfc 100%
        );

    border-color: #e2e8f0;

    box-shadow: var(--shadow-sm);

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.info-card:hover {
    transform: translateY(-2px);

    border-color: #cbd5e1;

    box-shadow:
        0 8px 22px rgba(15, 23, 42, 0.07);
}

.info-card h3 {
    padding-bottom: 12px;

    border-bottom: 1px solid #edf0f3;

    font-size: 14px;
    letter-spacing: 0.01em;
}

.info-card dd {
    color: #0f172a;
}

.page-footer {
    opacity: 0.8;
}


/* Login visual polish */

.login-page {
    background:
        radial-gradient(
            circle at top,
            #e8eef7 0%,
            #f1f5f9 42%,
            #f8fafc 100%
        );
}

.login-card {
    border-color: #dbe3ec;

    box-shadow:
        0 28px 70px rgba(15, 23, 42, 0.13);
}

.login-brand {
    background:
        linear-gradient(
            135deg,
            #111827,
            #1e293b
        );
}

.login-form button {
    background:
        linear-gradient(
            135deg,
            #1e293b,
            #0f172a
        );

    box-shadow:
        0 6px 16px rgba(15, 23, 42, 0.17);

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.login-form button:hover {
    transform: translateY(-1px);

    box-shadow:
        0 9px 20px rgba(15, 23, 42, 0.21);
}


/* Estados de salud */

.health-placeholder {
    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.health-healthy {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;

    box-shadow:
        0 0 0 3px rgba(16, 185, 129, 0.08);
}

.health-warning {
    background: #fffbeb;
    color: #b45309;
    border-color: #fde68a;

    box-shadow:
        0 0 0 3px rgba(245, 158, 11, 0.08);
}

.health-critical {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;

    box-shadow:
        0 0 0 3px rgba(239, 68, 68, 0.08);
}

.health-neutral {
    background: #f8fafc;
    color: #64748b;
    border-color: #e2e8f0;
}


/* ==========================================================
   Identidad corporativa USACH
   Naranjo institucional: #EA7600
   ========================================================== */

:root {
    --accent: #EA7600;
    --accent-soft: #FDF1E5;
    --accent-border: #F3AD66;
}

.nav-item.active {
    box-shadow:
        inset 3px 0 0 #EA7600;
}

.query-panel::before {
    background:
        linear-gradient(
            90deg,
            #EA7600,
            #F1A04D
        );
}

.placeholder-label {
    color: #EA7600;
}

.query-box input:focus {
    border-color: #ED8318;

    box-shadow:
        0 0 0 4px rgba(234, 118, 0, 0.14);
}

.query-box button {
    background:
        linear-gradient(
            135deg,
            #EA7600,
            #D96800
        );

    box-shadow:
        0 5px 14px rgba(234, 118, 0, 0.22);
}

.query-box button:not(:disabled):hover {
    box-shadow:
        0 8px 20px rgba(234, 118, 0, 0.30);
}

.login-form button {
    background:
        linear-gradient(
            135deg,
            #EA7600,
            #D96800
        );

    box-shadow:
        0 6px 16px rgba(234, 118, 0, 0.22);
}

.login-form button:hover {
    box-shadow:
        0 9px 22px rgba(234, 118, 0, 0.30);
}


/* ==========================================================
   Diagnóstico NOC - jerarquía visual por función
   ========================================================== */

.info-card-device,
.info-card-connectivity,
.info-card-telemetry {
    overflow: hidden;
}

.info-card-device::before,
.info-card-connectivity::before,
.info-card-telemetry::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
}

.info-card-device h3,
.info-card-connectivity h3,
.info-card-telemetry h3 {
    margin-top: 2px;
}

.info-card-device {
    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            #fffaf5 100%
        );
}

.info-card-device dd {
    font-size: 14px;
    font-weight: 700;
}

.info-card-connectivity dl > div,
.info-card-telemetry dl > div {
    min-height: 35px;
    align-items: center;
}

.info-card-telemetry dd {
    font-variant-numeric: tabular-nums;
}

.info-card-telemetry dt {
    white-space: nowrap;
}

@media (min-width: 901px) {

    .cards-grid {
        grid-template-columns:
            minmax(220px, 0.85fr)
            minmax(280px, 1fr)
            minmax(340px, 1.35fr);
    }

}



/* ==========================================================
   Acceso externo Telnet / SSH desde IP de gestión
   ========================================================== */

.management-access {
    position: relative;
}

.management-ip-button {
    padding: 4px 7px;

    display: inline-flex;
    align-items: center;
    gap: 6px;

    border: 1px solid transparent;
    border-radius: 6px;

    background: transparent;

    color: #0f172a;
    font: inherit;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.management-ip-button:not(:disabled):hover {
    background: var(--accent-soft);
    border-color: var(--accent-border);
    color: var(--accent);
}

.management-ip-button:disabled {
    cursor: default;
    color: #64748b;
}

.management-ip-arrow {
    color: var(--accent);
    font-size: 11px;
}

.management-access-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 20;

    min-width: 130px;
    padding: 6px;

    background: #ffffff;

    border: 1px solid #dbe3ec;
    border-radius: 8px;

    box-shadow:
        0 10px 28px rgba(15, 23, 42, 0.14);
}

.management-access-menu[hidden] {
    display: none;
}

.management-access-menu a {
    padding: 8px 10px;

    display: block;

    border-radius: 6px;

    color: #0f172a;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.management-access-menu a:hover {
    background: var(--accent-soft);
    color: var(--accent);
}



/* ==========================================================
   RedOps NOC - identidad visual sidebar y cabecera
   ========================================================== */

.sidebar {
    background:
        linear-gradient(
            180deg,
            #0f172a 0%,
            #111827 55%,
            #0b1220 100%
        );

    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.brand {
    padding-bottom: 22px;

    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
    background: var(--accent);

    color: #ffffff;

    box-shadow:
        0 6px 18px rgba(234, 118, 0, 0.26);
}

.brand-name {
    color: #ffffff;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.brand-subtitle {
    color: #94a3b8;
}

.nav-item {
    position: relative;

    transition:
        background 0.16s ease,
        color 0.16s ease,
        border-color 0.16s ease;
}

.nav-item.active {
    background:
        linear-gradient(
            90deg,
            rgba(234, 118, 0, 0.18),
            rgba(234, 118, 0, 0.06)
        );

    border-color: rgba(234, 118, 0, 0.30);

    color: #ffffff;
}

.nav-item.active::before {
    content: "";

    position: absolute;
    left: -1px;
    top: 8px;
    bottom: 8px;

    width: 3px;

    border-radius: 0 3px 3px 0;

    background: var(--accent);
}

.nav-item.disabled {
    color: #64748b;
}

.system-status {
    color: #cbd5e1;
}

.session-user {
    color: #ffffff;
    font-weight: 600;
}

.topbar {
    padding-bottom: 18px;

    border-bottom: 1px solid #e2e8f0;
}

.topbar h1 {
    color: #0f172a;

    font-size: 26px;
    letter-spacing: -0.025em;
}

.topbar p {
    color: #64748b;
}

.mode-badge {
    border: 1px solid var(--accent-border);

    background: var(--accent-soft);

    color: #b45309;

    font-weight: 700;
    letter-spacing: 0.06em;

    box-shadow:
        0 2px 8px rgba(234, 118, 0, 0.08);
}



/* ==========================================================
   RedOps NOC - panel principal de consulta
   ========================================================== */

.query-panel {
    position: relative;
    overflow: hidden;

    border: 1px solid #dbe3ec;

    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            #fbfcfe 100%
        );

    box-shadow:
        0 10px 30px rgba(15, 23, 42, 0.06);
}

.query-panel::before {
    content: "";

    position: absolute;
    top: 0;
    left: 0;
    right: 0;

    height: 3px;

    background: var(--accent);
}

.query-header h2 {
    color: #0f172a;

    font-size: 18px;
    letter-spacing: -0.015em;
}

.query-header p {
    max-width: 720px;

    color: #64748b;
    line-height: 1.55;
}

.query-box {
    padding: 6px;

    border: 1px solid #cbd5e1;
    border-radius: 11px;

    background: #ffffff;

    box-shadow:
        inset 0 1px 2px rgba(15, 23, 42, 0.03),
        0 4px 14px rgba(15, 23, 42, 0.04);

    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.query-box:focus-within {
    border-color: var(--accent);

    box-shadow:
        0 0 0 3px rgba(234, 118, 0, 0.10),
        0 6px 18px rgba(15, 23, 42, 0.05);
}

.query-box input {
    border: 0;
    outline: 0;

    background: transparent;

    color: #0f172a;
}

.query-box input::placeholder {
    color: #94a3b8;
}

.query-box button {
    border-radius: 8px;

    background:
        linear-gradient(
            135deg,
            #EA7600,
            #d96b00
        );

    color: #ffffff;

    box-shadow:
        0 5px 14px rgba(234, 118, 0, 0.22);
}

.query-box button:not(:disabled):hover {
    box-shadow:
        0 8px 20px rgba(234, 118, 0, 0.28);
}

.query-examples {
    margin-top: 14px;
}

.query-examples span {
    border-color: #e2e8f0;

    color: #475569;

    cursor: default;
}



/* ==========================================================
   Estados visuales de puerto admin/oper
   ========================================================== */

.port-status {
    padding: 3px 8px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 52px;

    border: 1px solid;
    border-radius: 999px;

    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.port-status-up {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.port-status-down {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.port-status-neutral {
    background: #f8fafc;
    color: #64748b;
    border-color: #e2e8f0;
}



/* ==========================================================
   Barras visuales de utilización de interfaz
   ========================================================== */

.info-card-telemetry .telemetry-utilization {
    align-items: flex-start;
}

.telemetry-utilization dd {
    min-width: 145px;
}

.utilization-value {
    margin-bottom: 6px;

    text-align: right;

    font-variant-numeric: tabular-nums;
}

.utilization-track {
    width: 145px;
    height: 6px;

    overflow: hidden;

    border-radius: 999px;

    background: #e2e8f0;
}

.utilization-bar {
    display: block;

    width: 0;
    height: 100%;

    border-radius: inherit;

    background: var(--accent);

    transition: width 0.35s ease;
}



/* ==========================================================
   Razones del diagnóstico de salud
   ========================================================== */

.health-reasons {
    margin-top: 14px;
    padding: 12px 14px;

    border: 1px solid #e2e8f0;
    border-radius: 9px;

    background: #f8fafc;

    color: #475569;
    font-size: 13px;
    line-height: 1.5;
}

.health-reasons[hidden] {
    display: none;
}

.health-reasons-title {
    margin-bottom: 6px;

    color: #0f172a;
    font-weight: 700;
}

.health-reasons ul {
    margin: 0;
    padding-left: 18px;
}

.health-reasons li + li {
    margin-top: 4px;
}



/* ==========================================================
   Estado de vigencia de muestra CRC
   ========================================================== */

.crc-freshness {
    margin-left: 7px;
    padding: 2px 6px;

    display: inline-flex;
    align-items: center;

    border: 1px solid;
    border-radius: 999px;

    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.crc-freshness-current {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.crc-freshness-stale {
    background: #fffbeb;
    color: #b45309;
    border-color: #fde68a;
}

.crc-freshness-neutral {
    background: #f8fafc;
    color: #64748b;
    border-color: #e2e8f0;
}



/* ==========================================================
   Subsecciones de identidad endpoint / dispositivo
   ========================================================== */

.identity-section-label {
    margin: 2px 0 8px;

    color: var(--accent);

    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.identity-section-switch {
    margin-top: 18px;
    padding-top: 14px;

    border-top: 1px solid #e2e8f0;
}

.info-card-device dl + .identity-section-label {
    margin-top: 18px;
}



/* ==========================================================
   Trazabilidad técnica ARP / FDB
   ========================================================== */

.diagnostic-trace {
    margin-top: 18px;

    border: 1px solid #e2e8f0;
    border-radius: 10px;

    background: #f8fafc;
}

.diagnostic-trace summary {
    padding: 13px 16px;

    cursor: pointer;

    color: #475569;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;

    user-select: none;
}

.diagnostic-trace[open] summary {
    border-bottom: 1px solid #e2e8f0;

    color: var(--accent);
}

.diagnostic-trace-grid {
    padding: 15px 16px;

    display: grid;
    grid-template-columns:
        repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.diagnostic-trace-grid > div {
    min-width: 0;
}

.diagnostic-trace-grid span {
    margin-bottom: 4px;

    display: block;

    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.diagnostic-trace-grid strong {
    display: block;

    overflow-wrap: anywhere;

    color: #0f172a;
    font-size: 12px;
    font-weight: 600;
}

@media (max-width: 1100px) {

    .diagnostic-trace-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 600px) {

    .diagnostic-trace-grid {
        grid-template-columns: 1fr;
    }

}



/* ==========================================================
   Corrección menú Telnet / SSH
   Permitir que el desplegable salga de la tarjeta
   ========================================================== */

.info-card-device {
    overflow: visible;
    z-index: 10;
}

.management-access-menu {
    z-index: 100;
}



/* ==========================================================
   Metadatos de procesamiento de consulta
   ========================================================== */

.query-processing {
    margin-top: 18px;

    border: 1px solid #e2e8f0;
    border-radius: 10px;

    background: #ffffff;
}

.query-processing summary {
    padding: 13px 16px;

    cursor: pointer;

    color: #475569;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;

    user-select: none;
}

.query-processing[open] summary {
    border-bottom: 1px solid #e2e8f0;

    color: var(--accent);
}

.query-processing-grid {
    padding: 15px 16px;

    display: grid;
    grid-template-columns:
        repeat(6, minmax(0, 1fr));
    gap: 14px;
}

.query-processing-grid > div {
    min-width: 0;
}

.query-processing-grid span {
    margin-bottom: 4px;

    display: block;

    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.query-processing-grid strong {
    display: block;

    overflow-wrap: anywhere;

    color: #0f172a;
    font-size: 12px;
    font-weight: 600;

    font-variant-numeric: tabular-nums;
}

@media (max-width: 1100px) {

    .query-processing-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

}

@media (max-width: 650px) {

    .query-processing-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}



/* ==========================================================
   Vista NOC de dispositivos caídos
   ========================================================== */

.cards-grid[hidden],
.diagnostic-trace[hidden],
.down-devices-panel[hidden] {
    display: none;
}

.down-devices-panel {
    margin-top: 28px;

    overflow: hidden;

    border: 1px solid #e2e8f0;
    border-radius: 11px;

    background: #ffffff;

    box-shadow: var(--shadow-sm);
}

.down-devices-header {
    padding: 16px 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    border-bottom: 1px solid #e2e8f0;

    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            #fafbfc 100%
        );
}

.down-devices-label {
    color: var(--accent);

    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.down-devices-header h3 {
    margin: 4px 0 0;

    color: #0f172a;
    font-size: 16px;
}

.down-devices-count {
    min-width: 40px;
    height: 34px;
    padding: 0 10px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #fecaca;
    border-radius: 999px;

    background: #fef2f2;

    color: #b91c1c;

    font-size: 13px;
    font-weight: 800;

    font-variant-numeric: tabular-nums;
}

.down-devices-table-wrap {
    overflow-x: auto;
}

.down-devices-table {
    width: 100%;
    min-width: 850px;

    border-collapse: collapse;
}

.down-devices-table th,
.down-devices-table td {
    padding: 12px 14px;

    border-bottom: 1px solid #edf0f3;

    text-align: left;
    vertical-align: middle;
}

.down-devices-table th {
    background: #f8fafc;

    color: #64748b;

    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.down-devices-table td {
    color: #334155;

    font-size: 12px;

    font-variant-numeric: tabular-nums;
}

.down-devices-table tbody tr:last-child td {
    border-bottom: 0;
}

.down-devices-table tbody tr:hover {
    background: #fffaf5;
}

.down-devices-table td strong {
    color: #0f172a;
    font-weight: 700;
}

.device-down-status {
    padding: 3px 7px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #fecaca;
    border-radius: 999px;

    background: #fef2f2;

    color: #b91c1c;

    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
}



/* ==========================================================
   Acciones rápidas del panel de consulta
   ========================================================== */

.query-examples .query-example-action {
    padding: 5px 9px;

    border: 1px solid #e2e8f0;
    border-radius: 999px;

    background: #ffffff;

    color: #475569;
    font: inherit;
    font-size: 12px;

    cursor: pointer;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.query-examples .query-example-action:hover {
    border-color: var(--accent-border);

    background: var(--accent-soft);

    color: var(--accent);
}

