/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #f1f5f9;
    font-family: 'Inter', sans-serif;
    color: #1e293b;
    padding-top: 80px;
}

/* ===== NAVBAR ===== */
.custom-navbar {
    background: #0f172a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.custom-navbar .nav-link {
    color: #cbd5e1;
    font-weight: 500;
    margin-right: 10px;
    transition: 0.3s;
}

.custom-navbar .nav-link:hover {
    color: #38bdf8;
}

.user-badge {
    background: #1e293b;
    padding: 6px 12px;
    border-radius: 20px;
    color: #e2e8f0;
    font-size: 14px;
}

.custom-navbar .btn-logout {
    background: #ef4444;
    color: white;
    padding: 6px 10px;
    min-width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.custom-navbar .btn-logout:hover,
.custom-navbar .btn-logout:focus {
    background: #dc2626;
    color: #ffffff;
}

/* ===== DASHBOARD ===== */
.dashboard-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ===== MODULOS ===== */
.module-box {
    width: 100%;
    max-width: 1920px;
    margin: 20px auto;
    background: white;
    border-radius: 14px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: 0.3s;
}

/* HEADER */
.module-header {
    background: #0f172a !important; /* MISMO COLOR DEL NAVBAR */
    color: #ffffff;
    padding: 15px 20px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-bottom: 2px solid #38bdf8;
}


.module-header span {
    color: #f8fafc;
    /* blanco más limpio */
    font-weight: 600;
}

/* BOTONES HEADER */
.module-header .actions button {
    background: transparent;
    border: none;
    color: white;
    font-size: 16px;
    margin-left: 10px;
    cursor: pointer;
    transition: 0.2s;
}

.module-header .actions button:hover {
    color: #38bdf8;
}

/* CONTENIDO */
.module-content {
    padding: 20px;
    /*max-height: 75vh;
    overflow-y: auto;*/
    max-height: auto;
    overflow: hidden;
}

/* cuando está cerrado */
.module-box.collapsed .module-content {
    max-height: 0;
    padding: 0 20px;
    overflow: hidden;
}

/* ===== FORMULARIOS ===== */
input,
select {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 10px;
    border-radius: 8px;
    width: 100%;
    margin-top: 5px;
}

input:focus {
    outline: none;
    border-color: #38bdf8;
}

.button_A {
    display: inline-block;
    padding: 10px 18px;
    margin: 6px 4px;
    background-color: #007BFF; /* azul */
    color: #fff;
    font-weight: bold;
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

.button_A:hover {
    background-color: #0056b3; /* azul más oscuro al pasar el mouse */
}


/* ===== BOTONES ===== */
button {
    background: #0ea5e9;
    border: none;
    color: white;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
}

button:hover {
    background: #0284c7;
}

/* ===== TABLAS ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th {
    background: #0f172a;
    color: white;
    font-weight: 500;
}

th,
td {
    padding: 12px;
    text-align: left;
}

tr {
    border-bottom: 1px solid #e2e8f0;
}

tr:hover {
    background: #f1f5f9;
}

/* FONDO GENERAL */
#contenedor-unidades {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    padding: 12px;
}

/* TARJETA */
.unidad {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 12px;
    padding: 14px;
    font-size: 13px;
    color: #2c3e50;
    border: 1px solid #e6e9ef; /* 👈 clave para look serio */
    box-shadow: none; /* quitamos sombra pesada */
    transition: all 0.2s ease;
}



/* CONTENIDO */
.unidad-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

/* BOTONES */
.unidad-botones {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

/* CONSUMO */
.unidad .consumo {
    font-size: 14px;
    font-weight: 600;
    margin-top: 2px;
}


.unidad-botones > * {
    flex: 0 0 auto; /* 👈 ya no se estiran */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* BOTONES ICONO */
.unidad-botones button {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: none;
    background: #f1f3f7;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

/* ICONOS */
.unidad-botones i {
    font-size: 14px;
    color: #6b778c;
}

/* HOVER BOTONES */
.unidad-botones button:hover {
    background: #e4e8f0;
}

.unidad-botones button:hover i {
    color: #2c3e50;
}

.unidad.activa {
    border-color: #4c84ff;
    background: #f7faff;
}

.unidad.activa::before {
    background: #4c84ff;
}

.unidad-botones form {
    margin: 0;
    display: flex;
}

.unidad:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

/* TEXTO SECUNDARIO */
.unidad p {
    margin: 0;
    color: #7b8794;
    font-size: 12px;
}

/* HEADER (TÍTULO) */
.unidad strong {
    font-size: 14px;
    font-weight: 600;
    color: #1f2d3d;
    margin-bottom: 6px;
}

/* TEXTO */
.unidad .dato {
    font-size: 12px;
    margin: 2px 0;
}

/* BARRA */
.barra-contenedor {
    width: 100%;
    height: 6px;
    background: #ecf0f1;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 1px;
}

.barra {
    height: 100%;
    border-radius: 5px;
    transition: width 0.4s ease;
}

/* SIN DATOS */
.sin-datos {
    font-size: 11px;
    color: #e67e22;
}


/* ===== ALERT ===== */
.alert {
    background: #e0f2fe;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1920px) {
    .module-box {
        width: 100%;
    }
}

/* ===== LOGIN (AISLADO) ===== */

body.login-page {
    display: flex;
    justify-content: center;  /* centra horizontal */
    align-items: center;      /* centra vertical */
    height: 100vh;            /* ocupa toda la pantalla */
    padding-top: 0 !important; /* quita espacio del navbar */
    background: #f1f5f9;
}

/* Contenedor login */
.login-container {
    background: white;
    padding: 35px;
    width: 100%;
    max-width: 380px;
    border-radius: 14px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    text-align: center;
}

/* Título */
.login-container h2 {
    margin-bottom: 20px;
    font-weight: 600;
    color: #0f172a;
}

/* Inputs SOLO login */
.login-container input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

/* Botón login */
.login-container button {
    width: 100%;
    padding: 12px;
    background: #0ea5e9;
    border: none;
    color: white;
    border-radius: 8px;
    margin-top: 10px;
    cursor: pointer;
}

.login-container button:hover {
    background: #0284c7;
}

/* Error */
.login-container .error {
    color: #ef4444;
    margin-bottom: 10px;
}

/* Link */
.login-container a {
    display: block;
    margin-top: 15px;
    color: #0ea5e9;
    text-decoration: none;
}

.parpadeo {
    animation: blinkRed 1s infinite;
}

@keyframes blinkRed {
    0% { opacity: 1; }
    50% { opacity: 0.2; }
    100% { opacity: 1; }
}

.parpadeo2 {
    animation: glowGreen 1s infinite;
}

@keyframes glowGreen {
    0% {
        text-shadow: 0 0 5px rgba(40,167,69,0.5);
    }
    50% {
        text-shadow: 0 0 20px rgba(40,167,69,1);
    }
    100% {
        text-shadow: 0 0 5px rgba(40,167,69,0.5);
    }
}

.button {
    text-decoration: none !important;
    border: none;
    background: transparent;
    cursor: pointer;
}

.button:hover {
    text-decoration: none !important;
}
#contenedor-unidades > .sublinea-box {
    grid-column: 1 / -1;
}

.sublinea-box {
    width: 100%;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 18px;
    overflow: hidden;
}

.sublinea-header {
    padding: 12px 16px;
    background: #f8fafc;
    border-left: 5px solid #2563eb;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.sublinea-header span {
    font-size: 12px;
    color: #64748b;
    font-weight: 700;
}

.sublinea-content {
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    align-items: start;
}

.sublinea-content .unidad {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    box-sizing: border-box;
}

.sublinea-content .unidad-item {
    min-height: 250px;
}

.unidad-sublinea {
    width: 100%;
    margin: 8px 0 4px;
}

.unidad-sublinea select {
    width: 100%;
    height: 32px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #f8fafc;
    color: #334155;
    font-size: 12px;
    padding: 0 8px;
    outline: none;
}

.unidad-sublinea select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

/* ─── LAYOUT MONITOR ─────────────────────────────────────────────────── */
.monitor-layout {
    display: grid;
    grid-template-columns: 1fr 2fr; /* mapa 1/3 | gráficos 2/3 */
    min-height: 600px;
}

.monitor-mapa {
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
}

.monitor-mapa .map-header {
    padding: 14px 18px;
    background: #0f172a;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.monitor-mapa .map-header h2 {
    margin: 0;
    font-size: 16px;
}

.monitor-mapa .map-header p {
    margin: 4px 0 0;
    color: #cbd5e1;
    font-size: 12px;
}

#starlinkTelemetryMap {
    flex: 1;
    width: 100%;
    min-height: 500px;
    background: #e5e7eb;
}

.monitor-graficos {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* ticker más compacto dentro del panel de gráficos */
.monitor-graficos .ticker-grid {
    grid-template-columns: repeat(3, 1fr);
}

.monitor-graficos .market-layout {
    grid-template-columns: 2fr 1fr;
}

.monitor-graficos .chart-panel {
    height: 240px;
}

.monitor-graficos .chart-panel.large {
    height: 560px;
}

.monitor-graficos .chart-panel.full {
    height: 220px;
}

@media (max-width: 1100px) {
    .monitor-layout {
        grid-template-columns: 1fr;
    }

    .monitor-mapa {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }

    #starlinkTelemetryMap {
        min-height: 350px;
    }

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

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

@media (max-width: 700px) {
    .monitor-graficos .ticker-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── TABLA CON SCROLL INTERNO ───────────────────────────────────────── */
.table-wrap {
    max-height: 900px; /* ✅ ajusta la altura que necesites */
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.executive-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #111827; /* mismo color del thead */
}   

.acciones-telemetria {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.acciones-telemetria button {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 6px;
    background: #f1f5f9;
    color: #2563eb;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.acciones-telemetria button:hover {
    background: #e2e8f0;
}

.acciones-telemetria form {
    margin: 0;
    display: inline-flex;
}

.consumo-telemetria {
    min-width: 170px;
}

.telemetry-consumo-item {
    margin-bottom: 8px;
}

.telemetry-consumo-label {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 2px;
}

.telemetry-consumo-item strong {
    font-size: 12px;
    color: #0f172a;
}

.consumo-telemetria .barra-contenedor {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 3px;
}

.consumo-telemetria .barra {
    height: 100%;
    border-radius: 999px;
}

/* ─── PANEL EXPLORADOR ───────────────────────────────────────────────── */
.panel-sublineas {
    width: 220px;
    min-width: 220px;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    overflow: hidden;
}

.panel-sublineas-header {
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.panel-sublineas-header input {
    width: 100%;
    height: 36px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0 10px;
    font-size: 13px;
    background: white;
}

.panel-sublineas-lista {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
}

.sublinea-nodo {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    cursor: pointer;
    border-radius: 6px;
    margin: 2px 6px;
    transition: background 0.15s;
    font-size: 13px;
    color: #334155;
}

.sublinea-nodo:hover {
    background: #e2e8f0;
}

.sublinea-nodo.activo {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 700;
}

.nodo-icono {
    font-size: 16px;
    flex-shrink: 0;
}

.nodo-nombre {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nodo-count {
    background: #e2e8f0;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    flex-shrink: 0;
}

.sublinea-nodo.activo .nodo-count {
    background: #bfdbfe;
    color: #1d4ed8;
}

.panel-sublineas-footer {
    padding: 10px;
    border-top: 1px solid #e5e7eb;
}

.panel-sublineas-footer select {
    width: 100%;
    height: 36px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0 8px;
    font-size: 12px;
    background: white;
}

.panel-tabla {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Botones de acciones en tabla */
.acciones-telemetria {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

.acciones-telemetria button,
.acciones-telemetria form button {
    width: 30px;
    height: 30px;
    padding: 0;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #475569;
    font-size: 13px;
}

.acciones-telemetria button:hover,
.acciones-telemetria form button:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.acciones-telemetria form {
    display: inline-flex;
    margin: 0;
}

    .modal-sublinea {
        display: none;
        position: fixed;
        z-index: 9999;
        inset: 0;
        background: rgba(15, 23, 42, 0.55);
        align-items: center;
        justify-content: center;
        padding: 20px;
    }

    .modal-sublinea-content {
        width: 100%;
        max-width: 420px;
        background: #ffffff;
        border-radius: 10px;
        overflow: hidden;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    }

    .modal-sublinea-header {
        background: #0f172a;
        color: #ffffff;
        padding: 14px 16px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .modal-sublinea-header button {
        background: transparent;
        border: none;
        color: #ffffff;
        font-size: 24px;
        cursor: pointer;
        padding: 0;
    }

    .modal-sublinea-body {
        padding: 18px;
    }

    .modal-sublinea-body label {
        display: block;
        font-weight: 700;
        margin: 10px 0 6px;
        color: #334155;
    }

    .modal-sublinea-body input[type="text"] {
        width: 100%;
        height: 42px;
        border: 1px solid #cbd5e1;
        border-radius: 8px;
        padding: 0 12px;
    }

    .modal-sublinea-body input[type="color"] {
        width: 70px;
        height: 42px;
        padding: 4px;
        border: 1px solid #cbd5e1;
        border-radius: 8px;
    }

    #mensajeSublinea {
        margin-top: 12px;
        font-weight: 700;
    }

    .alertas-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
}

.alerta-item {
    border: 1px solid #e5e7eb;
    border-left: 4px solid #f59e0b;
    border-radius: 6px;
    padding: 9px 10px;
    background: #ffffff;
}

.alerta-item strong {
    display: block;
    color: #0f172a;
    font-size: 13px;
}

.alerta-item span {
    display: block;
    color: #92400e;
    font-size: 12px;
    font-weight: 700;
    margin-top: 2px;
}

.alerta-item small {
    display: block;
    color: #64748b;
    font-size: 11px;
    margin-top: 3px;
}

.alerta-empty {
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    padding: 18px;
    text-align: center;
    color: #64748b;
    background: #ffffff;
}

/*
.chart-scroll {
    width: 100%;
    height: calc(100% - 34px);
    overflow-x: auto;
    overflow-y: hidden;
}

.chart-inner {
    height: 100%;
    min-width: 900px;
}

.chart-inner canvas {
    width: 100% !important;
    height: 100% !important;
}

.alertas-card {
    height: 380px;
    overflow: hidden;
}

.alertas-card .alertas-panel {
    height: calc(100% - 38px);
    max-height: none;
    overflow-y: auto;
    padding-right: 6px;
}

.chart-panel.large {
    height: 430px;
}
    */

.chart-scroll {
    width: 100%;
    height: 350px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 12px;
}

.chart-inner {
    height: 320px;
    min-width: 1200px;
}

.chart-scroll canvas#sublineasChart {
    width: 100% !important;
    height: 320px !important;
    max-height: 320px !important;
}

.chart-panel.large {
    height: 520px;
}

.sublineas-scroll {
    width: 100%;
    height: 450px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
}

.sublineas-inner {
    width: 100%;
    min-height: 360px;
}

.sublineas-inner canvas#sublineasChart {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
}

.market-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
    gap: 12px;
    margin-bottom: 16px;
    padding: 0 18px 14px;
    align-items: stretch;
}

.chart-panel {
    min-width: 0;
}

.chart-panel.sublineas-card {
    height: 520px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sublineas-card .panel-title {
    flex: 0 0 auto;
}

.sublineas-chart-area {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
}

.sublineas-inner {
    width: 100%;
    min-height: 320px;
}

.sublineas-inner canvas#sublineasChart {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
}

.chart-panel.alertas-card {
    height: 520px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.alertas-card .panel-title {
    flex: 0 0 auto;
}

.alertas-card .alertas-panel {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    padding-right: 6px;
}

.chart-panel.full {
    grid-column: 1 / -1;
    height: 340px;
}

.chart-panel.full canvas {
    width: 100% !important;
    height: calc(100% - 34px) !important;
}

@media (max-width: 1100px) {
    .market-layout {
        grid-template-columns: 1fr;
        padding: 0 12px 14px;
    }

    .chart-panel.sublineas-card,
    .chart-panel.alertas-card {
        height: 460px;
    }
}

.market-layout {
    display: grid;
    grid-template-columns: minmax(0, 2.1fr) minmax(340px, 1fr);
    gap: 14px;
    margin-bottom: 16px;
    padding: 0 18px 14px;
    align-items: start;
}

.chart-panel {
    min-width: 0;
}

.chart-panel.sublineas-card,
.chart-panel.alertas-card {
    height: 560px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sublineas-card .panel-title,
.alertas-card .panel-title {
    flex: 0 0 auto;
    margin-bottom: 6px;
}

.sublineas-chart-area {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.sublineas-inner {
    width: 100%;
    min-height: 260px;
}

.sublineas-inner canvas#sublineasChart {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
}

.alertas-card .alertas-panel {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    padding-right: 6px;
}

.alerta-item {
    padding: 8px 10px;
}

.alerta-item strong {
    font-size: 13px;
}

.alerta-item span,
.alerta-item small {
    font-size: 11px;
}

.chart-panel.full {
    grid-column: 1 / -1;
    height: 300px;
}

.chart-panel.full canvas {
    width: 100% !important;
    height: calc(100% - 34px) !important;
}

@media (max-width: 1100px) {
    .market-layout {
        grid-template-columns: 1fr;
        padding: 0 12px 14px;
    }

    .chart-panel.sublineas-card,
    .chart-panel.alertas-card {
        height: 380px;
    }
}

.select-sublinea {
    width: 150px;
    height: 34px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #0f172a;
    padding: 0 8px;
    font-size: 12px;
    outline: none;
}

.select-sublinea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.select-sublinea.select-saving {
    background: #fff7ed;
}

.select-sublinea.select-ok {
    background: #dcfce7;
    border-color: #16a34a;
}

.select-sublinea.select-error {
    background: #fee2e2;
    border-color: #dc2626;
}

.btn-wifire {
    position: relative;
}

.wifi-badge-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wifi-badge-wrap i {
    font-size: 20px;
    color: #94a3b8;
}

.wifi-badge {
    display: none;
    position: absolute;
    top: -11px;
    right: -13px;
    min-width: 16px;
    height: 16px;
    padding: 0 2px;
    border-radius: 0;
    background: transparent;
    color: #16a34a;
    font-size: 11px;
    line-height: 16px;
    font-weight: 900;
    text-align: center;
    box-shadow: none;
}

#modalWifire.modal-app {
    align-items: center;
    justify-content: center;
    padding: 24px;
}

#modalWifire .modal-app-content {
    width: min(920px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.35);
    display: flex;
    flex-direction: column;
}

#modalWifire .modal-app-header {
    width: 100%;
    box-sizing: border-box;
    background: #0f172a;
    color: #ffffff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: 0 0 auto;
}

#modalWifire .modal-app-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    white-space: normal;
    overflow-wrap: anywhere;
}

#modalWifire .modal-app-header button {
    border: 0;
    background: #64748b;
    color: #ffffff;
    border-radius: 6px;
    padding: 8px 13px;
    font-weight: 700;
    cursor: pointer;
}

#modalWifire .modal-app-body {
    padding: 16px 18px 18px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
}

#resultadoWifire {
    color: #0f172a;
    font-size: 13px;
}

#resultadoWifire p {
    margin: 4px 0;
}

.wifire-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.wifire-summary-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    background: #f8fafc;
}

.wifire-summary-item span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.wifire-summary-item strong {
    display: block;
    margin-top: 5px;
    color: #0f172a;
    font-size: 15px;
}

.wifire-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.wifire-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
    font-size: 12px;
}

.wifire-table th {
    background: #111827;
    color: #ffffff;
    text-align: left;
    padding: 10px;
    white-space: nowrap;
}

.wifire-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #e5e7eb;
    color: #0f172a;
    vertical-align: middle;
    white-space: nowrap;
}

.wifire-table td:first-child,
.wifire-table td:nth-child(2) {
    white-space: normal;
    overflow-wrap: anywhere;
}

@media (max-width: 760px) {
    #modalWifire.modal-app {
        padding: 12px;
    }

    #modalWifire .modal-app-content {
        width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
    }

    .wifire-summary {
        grid-template-columns: 1fr 1fr;
    }
}

.alertas-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.alerta-tab {
    flex: 1;
    height: 36px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.alerta-tab span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    margin-left: 6px;
    border-radius: 999px;
    background: #e5e7eb;
    color: #0f172a;
    font-size: 12px;
}

.alerta-tab.active {
    background: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
}

.alerta-tab.active span {
    background: #ffffff;
    color: #0f172a;
}

.alerta-panel-tab {
    display: none;
}

.alerta-panel-tab.active {
    display: block;
}

.alerta-inactividad {
    border-left: 4px solid #f59e0b;
}

.alerta-consumo {
    border-left: 4px solid #2563eb;
}

.notice {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 18px;
    font-size: 14px;
    line-height: 1.45;
}

.notice p {
    margin: 0 0 8px;
}

.notice p:last-child {
    margin-bottom: 0;
}

/* ===== PLANTILLA COMPARTIDA: MENÚ ESTADÍSTICAS ===== */
.dashboard-container.stats-page {
    width: min(96vw, 1440px);
    max-width: 1440px;
    margin: 0 auto;
    padding: 18px;
    box-sizing: border-box;
    align-items: stretch;
}

.stats-page .module-box {
    width: 100%;
    margin: 20px 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    font-size: 14px;
}

.stats-page .module-header {
    min-height: 52px;
    padding: 14px 18px;
    background: #0f172a !important;
    color: #ffffff;
    border-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 800;
    cursor: pointer;
}

.stats-page .module-header > span {
    color: #ffffff;
    font-weight: 800;
}

.stats-page .module-header .actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-page .module-header .actions button {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 13px;
    line-height: 1;
}

.stats-page .module-header .actions button:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    color: #ffffff;
}

.stats-page .module-content {
    display: block;
    padding: 18px;
    background: #f8fafc;
    min-height: 160px;
}

.stats-page .stats-section {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
}

.stats-page .stats-section:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.stats-page .stats-section .executive-actions {
    margin-bottom: 14px;
}

.stats-page .period-filter,
.stats-page .access-hero,
.stats-page .admin-client-selector {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: none;
}

.stats-page .access-hero {
    padding: 16px 18px;
}

.stats-page .access-hero h2,
.stats-page .executive-actions h2 {
    margin: 0;
    color: #0f172a;
    font-size: 22px;
    font-weight: 800;
}

.stats-page .access-hero p,
.stats-page .executive-actions p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 13px;
}

.stats-page .campaign-box,
.stats-page .stripe-kpi-card,
.stats-page .stripe-chart-box,
.stats-page .summary-card,
.stats-page .ticker-card,
.stats-page .chart-panel {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: none;
}

.stats-page .campaign-box {
    padding: 14px;
    margin: 0 0 12px;
}

.stats-page .table-wrap {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    overflow-x: auto;
}

.stats-page .table-wrap table {
    margin-top: 0;
}

.stats-page .table-wrap th {
    background: #111827;
    color: #ffffff;
}

.stats-page .button,
.stats-page button.button {
    border-radius: 6px;
    font-weight: 700;
}

@media (max-width: 760px) {
    .dashboard-container.stats-page {
        width: 100%;
        padding: 12px;
    }

    .stats-page .module-content {
        padding: 12px;
    }

    .stats-page .module-header {
        padding: 12px 14px;
    }
}
.stats-client-selector {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: 0 0 16px;
    padding: 12px 16px;
    border: 1px solid #dbe3ee;
    border-radius: 9px;
    background: #fff;
}

.stats-client-selector label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: #172033;
}

.stats-client-selector select {
    min-width: 300px;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #fff;
}

.stats-client-warning {
    margin-bottom: 16px;
    padding: 12px 15px;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    background: #fffbeb;
    color: #92400e;
}

@media (max-width: 700px) {
    .stats-client-selector,
    .stats-client-selector label {
        align-items: stretch;
        flex-direction: column;
    }

    .stats-client-selector select {
        min-width: 0;
        width: 100%;
    }
}
