/* =========================================================
 * Estilos modernos compartidos (modern.css)
 * Componentes: headers, filtros, info-box, gráficos, tablas,
 * modales, mapas y helpers generales.
 * ======================================================= */

/* ---------- Helpers generales ---------- */
.fondo {
    background-repeat: no-repeat, repeat;
    height: 40vh;
    background-size: cover;
    background-position: center;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    color: black;
    margin-bottom: 4px;
}
.select2-container--default .select2-selection--single .select2-selection__choice {
    color: black;
    margin-bottom: 4px;
}
.select2-container--default .select2-selection--single {
    padding-bottom: 27px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100%;
}

/* DataTables generales */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_processing,
.dataTables_wrapper .dataTables_paginate {
    color: #d0cece;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #d0cece !important;
}

.button-size {
    font-size: 16px;
}

/* Tablas auxiliares de Highcharts */
.highcharts-figure,
.highcharts-data-table table {
    min-width: 360px;
    max-width: 800px;
    margin: 1em auto;
}

.highcharts-data-table table {
    font-family: Verdana, sans-serif;
    border-collapse: collapse;
    border: 1px solid #EBEBEB;
    margin: 10px auto;
    text-align: center;
    width: 100%;
    max-width: 500px;
    border-radius: 8px;
    overflow: hidden;
}
.highcharts-data-table caption {
    padding: 1em 0;
    font-size: 1.2em;
    color: #555;
}
.highcharts-data-table th {
    font-weight: 600;
    padding: 0.5em;
}
.highcharts-data-table td,
.highcharts-data-table th,
.highcharts-data-table caption {
    padding: 0.5em;
}
.highcharts-data-table thead tr,
.highcharts-data-table tr:nth-child(even) {
    background: #f8f8f8;
}
.highcharts-data-table tr:hover {
    background: #f1f7ff;
}

/* =========================================================
 * Vistas modernas: home, búsqueda y medidores inteligentes
 * ======================================================= */

/* ---------- Header de la vista ---------- */
.vista-inteligente .content-header,
.vista-busqueda .content-header,
.vista-home .content-header {
    background: linear-gradient(135deg, #0c4da2 0%, #0d6efd 40%, #4dabf7 100%);
    border-left: 5px solid #ffc107;
    border-radius: 0 12px 12px 0;
    box-shadow: 0 4px 20px rgba(13, 110, 253, 0.3);
    transition: box-shadow 0.35s ease, transform 0.2s ease;
    padding: 1rem 1.5rem;
}
.vista-inteligente .content-header:hover,
.vista-busqueda .content-header:hover,
.vista-home .content-header:hover {
    box-shadow: 0 8px 28px rgba(13, 110, 253, 0.4);
}
.vista-inteligente .content-header h1,
.vista-busqueda .content-header h1,
.vista-home .content-header h1 {
    color: #fff !important;
    font-weight: 700;
    font-size: 1.6rem;
    letter-spacing: -0.02em;
}

/* Badge y header específico para vista inteligente */
.vista-inteligente .badge-inteligente {
    background: linear-gradient(135deg, #ffc107, #ffb300);
    color: #1a1a1a;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.4em 0.75em;
    border-radius: 20px;
    vertical-align: middle;
    margin-left: 10px;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.4);
}
.vista-inteligente .header-inteligente-notice,
.vista-busqueda .header-inteligente-notice,
.vista-home .header-inteligente-notice {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    color: #fff;
    margin-top: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.vista-inteligente .btn-ir-busqueda-medidor,
.vista-busqueda .btn-ir-busqueda-medidor,
.vista-home .btn-ir-busqueda-medidor {
    background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
    color: #0d6efd;
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 0.5rem 1.25rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.vista-inteligente .btn-ir-busqueda-medidor:hover,
.vista-busqueda .btn-ir-busqueda-medidor:hover,
.vista-home .btn-ir-busqueda-medidor:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    color: #0a58ca;
    background: #fff;
    border-color: #fff;
}

/* ---------- Bloque de filtros (accordion) ---------- */
.vista-inteligente #accordionExample,
.vista-busqueda #accordionExample,
.vista-home #accordionExample {
    margin-top: 1.75rem;
}

.vista-inteligente #accordionExample > .card,
.vista-busqueda #accordionExample > .card,
.vista-home #accordionExample > .card {
    border: none;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    border-top: 4px solid #0d6efd;
    overflow: hidden;
}
.vista-inteligente #accordionExample > .card:hover,
.vista-busqueda #accordionExample > .card:hover,
.vista-home #accordionExample > .card:hover {
    box-shadow: 0 8px 30px rgba(13, 110, 253, 0.12);
}

.vista-inteligente #accordionExample .card-body,
.vista-busqueda #accordionExample .card-body,
.vista-home #accordionExample .card-body {
    padding: 1.5rem 1.25rem !important;
}

.vista-inteligente #accordionExample .bm_filtros,
.vista-busqueda #accordionExample .bm_filtros {
    margin-bottom: 1.25rem;
}
.vista-inteligente #accordionExample .row-filtros-alert,
.vista-busqueda #accordionExample .row-filtros-alert {
    margin-top: 1rem;
    margin-bottom: 1rem;
}
.vista-inteligente #accordionExample .row-filtros-btn,
.vista-busqueda #accordionExample .row-filtros-btn {
    margin-top: 0.5rem;
}

/* Ocultar tipo módulo y módulo solo en vista inteligente */
.vista-inteligente .bm_filtros .filtro-tipo-modulo,
.vista-inteligente .bm_filtros .filtro-modulo {
    display: none !important;
}

.vista-inteligente #div-cards,
.vista-busqueda #div-cards,
.vista-home #div-cards {
    margin-top: 2rem;
}

/* Cards primarias con borde superior azul */
.vista-inteligente .card-primary.card-outline,
.vista-busqueda .card-primary.card-outline,
.vista-home .card-primary.card-outline {
    border-top: 4px solid #0d6efd;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease;
}
.vista-inteligente .card-primary.card-outline:hover,
.vista-busqueda .card-primary.card-outline:hover,
.vista-home .card-primary.card-outline:hover {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
}

/* Botón principal de acción (Aplicar filtros, etc.) */
.vista-inteligente .btn-success,
.vista-busqueda .btn-success,
.vista-home .btn-success {
    background: linear-gradient(135deg, #20c997 0%, #198754 100%);
    border: none;
    border-radius: 10px;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    box-shadow: 0 4px 14px rgba(25, 135, 84, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.vista-inteligente .btn-success:hover,
.vista-busqueda .btn-success:hover,
.vista-home .btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(25, 135, 84, 0.45);
}

/* ---------- Info-box ---------- */
.vista-inteligente .info-box,
.vista-busqueda .info-box,
.vista-home .info-box {
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}
.vista-inteligente .info-box:hover,
.vista-busqueda .info-box:hover,
.vista-home .info-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

/* Fondo degradado oscuro para tarjetas de datos de medidor */
.vista-inteligente #div-cards .info-box,
.vista-busqueda #div-cards .info-box {
    background: linear-gradient(0deg, #33363b 0%, #282e35 100%);
}
.vista-inteligente #div-cards .info-box:hover,
.vista-busqueda #div-cards .info-box:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Títulos y valores en blanco en datos de medidor */
.vista-inteligente #div-cards .info-box-content > span.info-box-text,
.vista-inteligente #div-cards .info-box-content .info-box-number,
.vista-inteligente #div-cards .info-box-content label.info-box-text,
.vista-busqueda #div-cards .info-box-content > span.info-box-text,
.vista-busqueda #div-cards .info-box-content .info-box-number,
.vista-busqueda #div-cards .info-box-content label.info-box-text {
    color: #fff !important;
}

.vista-inteligente #div-cards .info-box-content > span.info-box-text,
.vista-busqueda #div-cards .info-box-content > span.info-box-text {
    font-weight: 700;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 0.25rem;
}

.vista-inteligente #div-cards .info-box-content .info-box-number,
.vista-inteligente #div-cards .info-box-content label.info-box-text,
.vista-busqueda #div-cards .info-box-content .info-box-number,
.vista-busqueda #div-cards .info-box-content label.info-box-text {
    font-weight: 800;
    font-size: 1.05rem;
    display: block;
}

/* Sin datos cargados: valores en blanco suave */
.vista-inteligente #div-cards .info-box-content .info-box-number:empty,
.vista-inteligente #div-cards .info-box-content label.info-box-text:empty,
.vista-busqueda #div-cards .info-box-content .info-box-number:empty,
.vista-busqueda #div-cards .info-box-content label.info-box-text:empty {
    color: rgba(255, 255, 255, 0.75) !important;
    font-weight: 600;
    font-size: 0.95rem;
}

.vista-inteligente #div-cards .info-box-content a,
.vista-busqueda #div-cards .info-box-content a {
    color: #ffc107 !important;
    text-decoration: underline;
}
.vista-inteligente #div-cards .info-box-content a:hover,
.vista-busqueda #div-cards .info-box-content a:hover {
    color: #ffda6a !important;
}

/* Estados del medidor (ONLINE/OFFLINE) */
.vista-inteligente #div-cards .info-box-content #estado.text-success,
.vista-busqueda #div-cards .info-box-content #estado.text-success {
    color: #198754 !important;
}
.vista-inteligente #div-cards .info-box-content #estado.text-danger,
.vista-busqueda #div-cards .info-box-content #estado.text-danger {
    color: #dc3545 !important;
}

/* Estado del relé (CONECTADO/DESCONECTADO) */
.vista-inteligente #div-cards .info-box-content #estado_remoto.text-success,
.vista-busqueda #div-cards .info-box-content #estado_remoto.text-success {
    color: #198754 !important;
}
.vista-inteligente #div-cards .info-box-content #estado_remoto.text-success .estado-rele-icon,
.vista-busqueda #div-cards .info-box-content #estado_remoto.text-success .estado-rele-icon {
    color: #198754 !important;
    margin-right: 6px;
}
.vista-inteligente #div-cards .info-box-content #estado_remoto.text-danger,
.vista-busqueda #div-cards .info-box-content #estado_remoto.text-danger {
    color: #dc3545 !important;
}
.vista-inteligente #div-cards .info-box-content #estado_remoto.text-danger .estado-rele-icon,
.vista-busqueda #div-cards .info-box-content #estado_remoto.text-danger .estado-rele-icon {
    color: #dc3545 !important;
    margin-right: 6px;
}

/* ---------- Gráficos ---------- */
.vista-inteligente .highcharts-figure,
.vista-busqueda .highcharts-figure,
.vista-home .highcharts-figure {
    min-height: 320px;
    padding: 1rem;
    border-radius: 12px;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.vista-inteligente .card-body .nav-tabs .nav-link,
.vista-busqueda .card-body .nav-tabs .nav-link,
.vista-home .card-body .nav-tabs .nav-link {
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
}
.vista-inteligente .card-body .nav-tabs .nav-link.active,
.vista-busqueda .card-body .nav-tabs .nav-link.active,
.vista-home .card-body .nav-tabs .nav-link.active {
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    color: #fff;
    border-color: transparent;
}

/* ---------- Mapas ---------- */
.vista-inteligente .mapaContainer,
.vista-busqueda .mapaContainer {
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.08);
    height: 420px;
    background: linear-gradient(90deg, #454d55 0%, #5c5c5c 12%, #b5b6b6 50%, #5c5c5c 88%, #454d55 100%);
    display: flex;
    align-content: center;
    justify-content: center;
    align-items: center;
    width: 100%;
}
.vista-inteligente .mapaContainer #map,
.vista-busqueda .mapaContainer #map {
    border-radius: 14px;
    height: 100%;
    width: 80%;
}

/* ---------- Alertas e información ---------- */
.vista-inteligente .alert.alert-warning,
.vista-busqueda .alert.alert-warning {
    border-radius: 12px;
    border: 1px solid #eab308;
    background: linear-gradient(135deg, #fef08a 0%, #fde047 35%, #facc15 100%);
    color: #713f12;
    font-weight: 600;
    box-shadow: 0 2px 12px rgba(250, 204, 21, 0.35);
    padding: 0.85rem 1.25rem;
}

/* ---------- Botón volver arriba ---------- */
.vista-inteligente #back-to-top,
.vista-busqueda #back-to-top,
.vista-home #back-to-top {
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.vista-inteligente #back-to-top:hover,
.vista-busqueda #back-to-top:hover,
.vista-home #back-to-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* ---------- Animaciones de entrada ---------- */
.vista-inteligente .content-header,
.vista-inteligente #accordionExample .card,
.vista-inteligente #div-cards,
.vista-busqueda .content-header,
.vista-busqueda #accordionExample .card,
.vista-busqueda #div-cards,
.vista-home .content-header,
.vista-home #accordionExample .card,
.vista-home #div-cards {
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Modales modernos compartidos ---------- */
/* Modal de carga */
#modalCargando .modal-dialog {
    max-width: 340px;
}
#modalCargando .modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: modalCargandoFade 0.35s ease;
    overflow: hidden;
    border-top: 4px solid #0d6efd;
}
@keyframes modalCargandoFade {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
#modalCargando .modal-body {
    padding: 2rem 2.5rem !important;
    text-align: center;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}
#modalCargando .spinner-inteligente {
    width: 56px;
    height: 56px;
    border: 4px solid #e2e8f0;
    border-top-color: #0d6efd;
    border-right-color: #4dabf7;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1.25rem;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
#modalCargando .cargando-titulo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.35rem;
    margin-top: 1rem;
}
#modalCargando .cargando-subtitulo {
    font-size: 0.9rem;
    color: #64748b;
}

/* Modal de confirmación de cambio de estado remoto (aplicado a ambas vistas) */
#modalCambioEstadoRemoto .modal-dialog {
    max-width: 500px;
}
#modalCambioEstadoRemoto .modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: modalCargandoFade 0.35s ease;
    overflow: hidden;
    border-top: 4px solid #dc3545;
}
#modalCambioEstadoRemoto .modal-header {
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    border-bottom: 1px solid #e2e8f0;
    padding: 1.25rem 1.5rem;
}
#modalCambioEstadoRemoto .modal-header .modal-title {
    font-weight: 700;
    color: #1e293b;
    font-size: 1.1rem;
}
#modalCambioEstadoRemoto .modal-body {
    padding: 2rem 1.5rem !important;
    text-align: center;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}
#modalCambioEstadoRemoto .modal-body .modal-title {
    font-weight: 700;
    color: #334155;
}
#modalCambioEstadoRemoto .modal-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 1rem 1.5rem;
    border-radius: 0 0 16px 16px;
}

/* =========================================================
 * Modales modernos - busqueda_medidor, monitoreo, gis, busqueda_medidor_inteligente
 * ======================================================= */
.modal-modern .modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    border-top: 4px solid #2d3238;
    animation: modalCargandoFade 0.3s ease;
}
.modal-modern .modal-header {
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 1.25rem 1rem 1.5rem;
    align-items: center;
}
.modal-modern .modal-header .modal-title {
    font-weight: 700;
    color: #1e293b;
    font-size: 1.15rem;
    margin: 0;
}
.modal-modern .modal-header .close,
.modal-modern .modal-header button.close {
    margin: 0 0 0 auto;
    padding: 0.25rem 0.5rem;
    font-size: 1.5rem;
    line-height: 1.2;
    color: #64748b;
    opacity: 0.9;
    border: none;
    background: transparent;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}
.modal-modern .modal-header .close:hover,
.modal-modern .modal-header button.close:hover {
    color: #1e293b;
    background: rgba(0, 0, 0, 0.06);
    opacity: 1;
}
.modal-modern .modal-header .close:focus,
.modal-modern .modal-header button.close:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}
.modal-modern .modal-body {
    padding: 1.25rem 1.5rem !important;
    background: #fff;
    color: #1e293b;
}
.modal-modern .modal-body .modal-title,
.modal-modern .modal-body p,
.modal-modern .modal-body label,
.modal-modern .modal-body h4,
.modal-modern .modal-body h5,
.modal-modern .modal-body td,
.modal-modern .modal-body th {
    color: #1e293b !important;
}
.modal-modern .modal-body .form-control,
.modal-modern .modal-body input,
.modal-modern .modal-body select,
.modal-modern .modal-body textarea {
    color: #1e293b;
    background-color: #fff;
}
.modal-modern .modal-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 1rem 1.5rem;
    border-radius: 0 0 16px 16px;
}
.modal-modern .modal-footer .btn-secondary {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
}
/* Modal de error: borde superior rojo */
#modalError.modal-modern .modal-content {
    border-top-color: #dc3545;
}
/* Modal cambio estado remoto ya tiene sus estilos; asegurar clase */
#modalCambioEstadoRemoto.modal-modern .modal-content {
    border-top-color: #dc3545;
}

/* =========================================================
 * Nav-bar moderno - escala de grises (más oscuro que el body)
 * Ancho completo de pantalla (anula sidebar de AdminLTE)
 * ======================================================= */
body .wrapper > .navbar-modern.main-header.navbar,
body.sidebar-mini .navbar-modern.main-header.navbar,
body.sidebar-collapse .navbar-modern.main-header.navbar {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    left: 0 !important;
    right: 0 !important;
    box-sizing: border-box;
}
.navbar-modern.main-header.navbar {
    margin-left: 0;
    background: linear-gradient(135deg, #1e2226 0%, #252a30 35%, #2d3238 70%, #383e45 100%) !important;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    padding: 0.35rem 1rem;
    min-height: 57px;
}
.navbar-modern .nav-link,
.navbar-modern .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.92) !important;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 8px;
    padding: 0.5rem 0.75rem !important;
    transition: background 0.2s ease, color 0.2s ease;
}
.navbar-modern .nav-link:hover,
.navbar-modern .navbar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff !important;
}
.navbar-modern .dropdown-menu {
    background: linear-gradient(180deg, #252a30 0%, #2d3238 50%, #383e45 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    padding: 0.5rem 0;
    margin-top: 0.35rem;
}
.navbar-modern .dropdown-menu .dropdown-item,
.navbar-modern .dropdown-menu .nav-link {
    color: rgba(255, 255, 255, 0.95) !important;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}
.navbar-modern .dropdown-menu .dropdown-item:hover,
.navbar-modern .dropdown-menu .nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff !important;
}
.navbar-modern .dropdown-toggle::after {
    border-top-color: rgba(255, 255, 255, 0.9);
}
.navbar-modern .navbar-nav.ml-auto .nav-link {
    color: rgba(255, 255, 255, 0.92) !important;
}

/* Toggler responsive (hamburger) - visible y alineado con el tema */
.navbar-modern .navbar-toggler-modern {
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    color: rgba(255, 255, 255, 0.95) !important;
}
.navbar-modern .navbar-toggler-modern:hover,
.navbar-modern .navbar-toggler-modern:focus {
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff !important;
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
}
.navbar-modern .navbar-toggler-modern i {
    font-size: 1.2rem;
}

/* Menú colapsado (sidebar) en móvil/tablet */
@media (max-width: 991.98px) {
    .navbar-modern .navbar-collapse {
        background: linear-gradient(180deg, #252a30 0%, #1e2226 100%);
        border-radius: 0 0 12px 12px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
        margin: 0.5rem -1rem -0.35rem -1rem;
        padding: 1rem 1rem 1.25rem;
        border: 1px solid rgba(255, 255, 255, 0.06);
        border-top: none;
    }
    .navbar-modern .navbar-collapse .navbar-nav {
        flex-direction: column;
    }
    .navbar-modern .navbar-collapse .nav-item {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }
    .navbar-modern .navbar-collapse .nav-item:last-child {
        border-bottom: none;
    }
    .navbar-modern .navbar-collapse .nav-link {
        padding: 0.75rem 1rem !important;
        display: block;
    }
    .navbar-modern .navbar-collapse .dropdown-menu {
        position: static !important;
        float: none;
        width: 100%;
        margin: 0.25rem 0 0.5rem 0;
        box-shadow: none;
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 8px;
    }
    .navbar-modern .navbar-collapse .dropdown-item,
    .navbar-modern .navbar-collapse .dropdown-menu .nav-link {
        padding: 0.5rem 1rem 0.5rem 2rem !important;
    }
    .navbar-modern .navbar-collapse .ml-auto {
        margin-left: 0 !important;
        margin-top: 0.5rem;
        padding-top: 0.75rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* =========================================================
 * Footer moderno - escala de grises (más oscuro que el body)
 * ======================================================= */
.main-footer.modern-footer {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    background: linear-gradient(135deg, #1e2226 0%, #252a30 40%, #2d3238 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    padding: 1rem 1.5rem;
    font-size: 0.9rem;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.2);
}
.main-footer.modern-footer strong {
    color: #fff;
}
.main-footer.modern-footer a {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
}
.main-footer.modern-footer a:hover {
    color: #fff;
    text-decoration: underline;
}

/* =========================================================
 * Vista GIS (geolocalización) - mismos estilos que monitoreo/búsqueda
 * ======================================================= */
.vista-gis .content-header {
    background: linear-gradient(135deg, #0c4da2 0%, #0d6efd 40%, #4dabf7 100%);
    border-left: 5px solid #ffc107;
    border-radius: 0 12px 12px 0;
    box-shadow: 0 4px 20px rgba(13, 110, 253, 0.3);
    transition: box-shadow 0.35s ease;
    padding: 1rem 1.5rem;
}
.vista-gis .content-header h1 {
    color: #fff !important;
    font-weight: 700;
    font-size: 1.6rem;
    letter-spacing: -0.02em;
}
.vista-gis .header-gis-notice {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    color: #fff;
    margin-top: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.vista-gis .topFiltros {
    margin-top: 1.75rem;
}
.vista-gis .filtroGis.info-box,
.vista-gis .botones-tags.info-box {
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-top: 4px solid #0d6efd;
}
.vista-gis .filtroGis.info-box:hover,
.vista-gis .botones-tags.info-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}
.vista-gis .btn-success {
    background: linear-gradient(135deg, #20c997 0%, #198754 100%);
    border: none;
    border-radius: 10px;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    box-shadow: 0 4px 14px rgba(25, 135, 84, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.vista-gis .btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(25, 135, 84, 0.45);
}

/* Botón ONLINE en GIS: mantiene comportamiento original (relleno/outline) */
.vista-gis #online.btn-success {
    background-image: none !important;
    background-color: #28a745 !important;
    border: 1px solid #28a745 !important;
    border-radius: .25rem !important;
    color: #fff !important;
    box-shadow: none !important;
}
.vista-gis #online.btn-success.active {
    background-image: none !important;
    background-color: #28a745 !important;
    border: 1px solid #28a745 !important;
    border-radius: .25rem !important;
    color: #fff !important;
}
.vista-gis #online.btn-success.outline,
.vista-gis #online.btn-success.outline:hover,
.vista-gis #online.btn-success.outline:focus {
    background-image: none !important;
    background-color: transparent !important;
    border: 1px solid #28a745 !important;
    border-radius: .25rem !important;
    color: #28a745 !important;
    box-shadow: none !important;
}
.vista-gis .tablaGateways .card {
    border: none;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border-top: 4px solid #0d6efd;
    overflow: hidden;
}
.vista-gis #map {
    min-height: 420px;
    height: 100%;
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.08);
}
.vista-gis .content-header,
.vista-gis .topFiltros,
.vista-gis .tablaGateways .card {
    animation: fadeInUp 0.5s ease;
}

/* ---------- Búsqueda Medidor Inteligente: cards homogéneas ---------- */
.vista-inteligente #div-cards,
.vista-busqueda #div-cards,
.vista-home #div-cards {
    margin-bottom: 2rem;
}
.cards-medidor-inteligente {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    max-width: 100%;
}
.cards-medidor-inteligente .d-flex.justify-content-center {
    margin-left: -0.25rem;
    margin-right: -0.25rem;
}
.cards-medidor-inteligente .row {
    margin-bottom: 1rem;
}
.cards-medidor-inteligente .row:last-child {
    margin-bottom: 0;
}
.cards-medidor-inteligente .row > [class^="col-"] {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
}
.cards-medidor-inteligente .info-box {
    min-height: 5rem;
    display: flex;
    align-items: stretch;
    margin-bottom: 0;
    padding: 0;
}
.cards-medidor-inteligente .info-box-content {
    padding: 0.4rem 0.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}
.cards-medidor-inteligente .info-box-text {
    margin-bottom: 0.15rem;
    line-height: 1.25;
    font-size: 0.875rem;
}
.cards-medidor-inteligente .info-box-number {
    line-height: 1.3;
    margin-bottom: 0;
}
.cards-medidor-inteligente .info-box-content label.info-box-text {
    margin-bottom: 0;
}
/* Energía activa: menos espacio entre líneas */
.cards-medidor-inteligente .energia-activa-detalle {
    line-height: 1.2;
    margin-top: 0.15rem;
    margin-bottom: 0;
    font-size: 0.9rem;
}
.cards-medidor-inteligente .energia-activa-detalle + * {
    margin-top: 0;
}
.cards-medidor-inteligente .info-box-content .mb-0 {
    margin-bottom: 0 !important;
}

/* ---------- Home / Tablero de Monitoreo (dashboard) ---------- */
.vista-home .btn-dashboard-module {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1.25rem 0.75rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    color: #334155;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.vista-home .btn-dashboard-module:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(13, 110, 253, 0.2);
    border-color: #0d6efd;
    background: linear-gradient(135deg, #fff 0%, #eff6ff 100%);
    color: #0d6efd;
    text-decoration: none;
}
.vista-home .btn-dashboard-module img {
    max-height: 48px;
    object-fit: contain;
}
.vista-home .btn-dashboard-module .label-btn-home {
    color: inherit;
    font-size: 0.9rem;
    margin: 0;
}

/* Home con video de fondo */
.home-video {
    min-height: 100vh;
}
.home-video-header {
    position: relative;
    background-color: #000;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
}
.home-video-header video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: 0;
    transform: translate(-50%, -50%);
}
.home-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.75), rgba(15, 23, 42, 0.25));
    mix-blend-mode: multiply;
    z-index: 1;
}
.home-video-header .container {
    position: relative;
    z-index: 2;
}
.home-video-logo {
    max-width: 140px;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.6));
}
.home-video-modules {
    max-width: 960px;
}
.home-video .btn-dashboard-module {
    background: rgba(15, 23, 42, 0.7);
    border-color: rgba(148, 163, 184, 0.7);
    color: #e2e8f0;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
}
.home-video .btn-dashboard-module:hover {
    background: rgba(15, 23, 42, 0.9);
    border-color: #0d6efd;
    color: #e5f0ff;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.8);
}

