/* ==========================================================================
   1. CONTROL DE COLORES GLOBALES Y CONTENEDORES OSCUROS
   ========================================================================== */

/* Forzar blanco en contenedores base, menús y pies de página */
body, 
html, 
.wrapper, 
main, 
footer, 
.footer,
.card-custom,
.card {
    color: #ffffff !important;
}

.main-content {
    background: transparent !important;
}

/* Forzar blanco absoluto en elementos genéricos y clases mutadas de Bootstrap */
.text-muted, 
.text-white-50, 
.text-light-50,
p, 
small {
    color: #ffffff !important;
}

/* ==========================================================================
   2. BARRA LATERAL (SIDEBAR) - NAVEGACIÓN
   ========================================================================== */

/* Sidebar general */
.sidebar {
    z-index: 3000 !important;
}

.sidebar-overlay {
    z-index: 2990 !important;
}

.offcanvas {
    z-index: 3000 !important;
}

.offcanvas-backdrop {
    z-index: 2990 !important;
}

.sidebar-panel {
    background: #080c16 !important;
    border-right: 1px solid rgba(56, 189, 248, 0.12) !important;
    box-shadow: 12px 0 30px rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.app-header {
    position: relative;
    z-index: 2000;
    overflow: visible !important;
    background: #0b101d !important;
    border: 1px solid rgba(56, 189, 248, 0.18) !important;
    border-radius: 14px !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 8px 24px rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.app-header .dropdown {
    position: relative;
    z-index: 2001;
}

.app-header .dropdown-menu {
    z-index: 2002 !important;
}

/* Todos los modales comparten centrado, capa y estructura visual responsiva */
.modal.show {
    z-index: 4000 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0.75rem !important;
    overflow-x: hidden;
    overflow-y: auto;
}

.modal-backdrop.show {
    z-index: 3990 !important;
}

/* SweetAlert2 siempre al frente de modales, backdrop, sidebar y cualquier capa */
.swal2-container {
    z-index: 999999 !important;
}
.swal2-container.swal2-backdrop-show,
.swal2-container.swal2-noanimation {
    z-index: 999999 !important;
}
.swal2-popup {
    z-index: 1000000 !important;
}

/* Modal Dialog & Content: limitados a la altura visible del viewport (100dvh) */
.modal .modal-dialog,
.modal.show .modal-dialog {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-height: calc(100vh - 1.5rem);
    max-height: calc(100dvh - 1.5rem);
    margin: auto !important;
    min-height: 0;
}

.modal .modal-content,
.modal.show .modal-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: calc(100vh - 1.5rem);
    max-height: calc(100dvh - 1.5rem);
    min-height: 0;
    overflow: hidden;
    background: rgba(16, 20, 28, 0.98) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 18px !important;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.5) !important;
}

/* Si el modal contiene un <form>, convertir el form en contenedor flex vertical */
.modal-content > form,
.modal.show .modal-content > form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    width: 100%;
    overflow: hidden;
}

/* Header y Footer siempre fijos y visibles en pantalla */
.modal-content .modal-header,
.modal.show .modal-header,
.modal-content .modal-footer,
.modal.show .modal-footer {
    flex: 0 0 auto;
}

/* El cuerpo del modal es la única sección con scroll interno */
.modal-content .modal-body,
.modal.show .modal-body,
.modal-content > form > .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Adaptación universal de modales para móviles y pantallas reducidas */
@media (max-width: 767.98px) {
    .modal.show {
        padding: 0.35rem !important;
    }

    .modal .modal-dialog,
    .modal.show .modal-dialog {
        max-height: calc(100dvh - 0.7rem);
        margin: 0.35rem auto !important;
    }

    .modal .modal-content,
    .modal.show .modal-content {
        max-height: calc(100dvh - 0.7rem);
        border-radius: 14px !important;
    }

    .modal-content .modal-header {
        padding: 0.75rem 0.85rem !important;
    }

    .modal-content .modal-body {
        padding: 0.85rem !important;
    }

    .modal-content .modal-footer {
        padding: 0.65rem 0.85rem !important;
        gap: 0.5rem;
    }

    /* Prevenir auto-zoom molesto en iOS al tocar campos del formulario */
    .modal-content input,
    .modal-content select,
    .modal-content textarea,
    .modal-content .form-control,
    .modal-content .form-select {
        font-size: 16px !important;
    }
}

@media (max-width: 767.98px) {
    .auth-container {
        min-height: 100dvh !important;
        padding: 1rem 0.75rem !important;
    }

    .auth-card {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 18px !important;
    }

    .auth-card .card-body {
        padding: 1.25rem 1rem !important;
    }

    .auth-brand {
        min-height: 90px;
        padding: 0.5rem;
        margin-bottom: 0.75rem !important;
        border-radius: 14px;
    }

    .auth-brand img {
        max-height: 68px;
    }

    .auth-card .nav-tabs {
        margin-bottom: 1.25rem !important;
    }

    .auth-card .nav-tabs .nav-link {
        padding: 0.55rem 0.3rem;
        font-size: 0.82rem;
        white-space: nowrap;
    }

    .auth-card .form-control,
    .auth-card .form-select,
    .auth-card .btn {
        min-height: 44px;
    }

    .auth-card .input-group .btn {
        width: auto !important;
        min-width: 48px;
        margin-bottom: 0 !important;
    }

    .auth-card .row > .col-6 {
        flex: 0 0 100%;
        width: 100%;
    }

    .auth-card .row.g-3 {
        row-gap: 0 !important;
    }

    .calendar-modal-host > .d-flex.justify-content-between {
        display: grid !important;
        grid-template-columns: auto 1fr auto;
        align-items: center !important;
        gap: 0.5rem !important;
    }

    .calendar-modal-host > .d-flex.justify-content-between > div:first-child {
        display: contents;
    }

    .calendar-modal-host > .d-flex.justify-content-between > div:first-child > a:first-child {
        grid-column: 1;
    }

    .calendar-modal-host > .d-flex.justify-content-between > div:first-child > span {
        grid-column: 2;
        margin: 0 !important;
        white-space: nowrap;
        text-align: center;
    }

    .calendar-modal-host > .d-flex.justify-content-between > div:first-child > a:last-child {
        grid-column: 3;
    }

    .calendar-modal-host > .d-flex.justify-content-between > div:last-child {
        grid-column: 1 / -1;
        justify-self: end;
    }

    .calendar-modal-host > .d-flex.justify-content-between .btn {
        width: auto !important;
        margin-bottom: 0 !important;
        padding: 0.45rem 0.35rem !important;
        font-size: 0.76rem;
        white-space: nowrap;
    }

    .calendar-modal-host > .d-flex.justify-content-between > div:first-child > span {
        font-size: 0.86rem;
    }

    .calendar-modal-host .table-responsive {
        overflow-x: hidden;
    }

    .calendar-modal-host > .row,
    .calendar-modal-host > .row > .col-12,
    .calendar-modal-host .table-responsive {
        min-width: 0;
    }

    .calendar-modal-host .table-responsive > .calendar-table {
        width: 100% !important;
        min-width: 0 !important;
        table-layout: fixed;
        font-size: 0.72rem;
    }

    .calendar-modal-host .calendar-table th,
    .calendar-modal-host .calendar-table td {
        width: 14.2857%;
        padding: 0.35rem 0.2rem;
        overflow: hidden;
    }

    .calendar-modal-host .calendar-table td {
        height: 60px;
        max-height: 60px;
        min-height: 60px;
    }

    .calendar-modal-host .calendar-day-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 0;
    }

    .calendar-modal-host .calendar-day-num {
        font-family: var(--st-font-mono, monospace);
        font-weight: 700;
        font-size: 0.85rem;
        white-space: nowrap;
        line-height: 1;
    }

    .calendar-modal-host .day-summary-badge {
        position: static;
        padding: 0.15rem 0.35rem;
        font-size: 0.65rem;
        font-weight: 700;
        line-height: 1;
        border-radius: 9999px;
        background: rgba(14, 165, 233, 0.25) !important;
        border: 1px solid #38bdf8 !important;
        color: #38bdf8 !important;
    }

    .calendar-modal-host .calendar-cell-content {
        display: none !important;
    }

    .app-header.d-flex.justify-content-between {
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.5rem !important;
        padding: 0.65rem 0.75rem !important;
    }

    .app-header > div:first-child {
        min-width: 0;
        flex: 1 1 auto;
        gap: 0.5rem !important;
    }

    .app-header > div:first-child > .btn {
        flex: 0 0 42px;
        width: 42px !important;
        min-width: 42px;
        margin-bottom: 0 !important;
        padding-left: 0.35rem;
        padding-right: 0.35rem;
    }

    .app-header-title {
        min-width: 0;
        margin: 0 !important;
        font-size: 1.05rem !important;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .app-header > .dropdown {
        flex: 0 0 auto;
        margin-left: 0 !important;
    }

    .app-header > .dropdown > .app-user-button {
        width: auto !important;
        min-width: 0;
        margin-bottom: 0 !important;
        padding: 0.25rem 0.45rem !important;
    }
}

.app-header-title {
    letter-spacing: 0.3px;
}

.app-user-button {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 999px !important;
    padding: 0.35rem 0.75rem !important;
}

.app-user-button:hover,
.app-user-button:focus {
    background: rgba(13, 110, 253, 0.18) !important;
    border-color: rgba(13, 110, 253, 0.55) !important;
}

.app-avatar {
    width: 38px;
    height: 38px;
    background: linear-gradient(180deg, #0d6efd, #0a57d5);
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(13, 110, 253, 0.35);
}

.dropdown-menu-dark {
    background: rgba(12, 15, 22, 0.97) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.dropdown-menu-dark .dropdown-item {
    color: #ffffff !important;
}

.dropdown-menu-dark .dropdown-item:hover,
.dropdown-menu-dark .dropdown-item:focus {
    background: rgba(13, 110, 253, 0.18) !important;
    color: #ffffff !important;
}

.sidebar-brand {
    width: 100%;
    padding: 0.25rem 0.4rem;
}

.sidebar-logo {
    max-height: 56px !important;
    width: auto;
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.35));
}

.sidebar-toggle {
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    background: rgba(255, 255, 255, 0.04) !important;
    color: #ffffff !important;
}

.sidebar-toggle:hover {
    background: rgba(13, 110, 253, 0.18) !important;
    border-color: rgba(13, 110, 253, 0.55) !important;
}

/* Enlaces inactivos */
.nav-pills .nav-link {
    color: #94a3b8 !important;
    border-radius: 10px !important;
    padding: 0.7rem 0.95rem !important;
    margin-bottom: 0.35rem !important;
    transition: all 0.2s ease !important;
    border-left: 3px solid transparent !important;
}

/* Enlace activo (Cian tecnológico con indicador lateral) */
.nav-pills .nav-link.active {
    color: #38bdf8 !important;
    background: rgba(56, 189, 248, 0.12) !important;
    border-left: 3px solid #38bdf8 !important;
    box-shadow: inset 0 0 14px rgba(56, 189, 248, 0.1) !important;
    font-weight: 600 !important;
}

/* Efecto Hover sutil sobre las opciones */
.nav-pills .nav-link:not(.active):hover {
    background: rgba(56, 189, 248, 0.06) !important;
    color: #ffffff !important;
    border-left-color: rgba(56, 189, 248, 0.4) !important;
    transform: translateX(3px);
}

.sidebar-nav {
    gap: 0.15rem;
}

.sidebar-section-title {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.4);
    margin: 0.85rem 0 0.35rem 0.6rem;
    font-family: var(--st-font-mono, 'JetBrains Mono', monospace);
}

.sidebar-scrollable::-webkit-scrollbar {
    width: 4px;
}
.sidebar-scrollable::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.2);
    border-radius: 4px;
}
.sidebar-scrollable::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 189, 248, 0.5);
}

.badge-pulse-live {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #10b981;
    font-family: var(--st-font-mono, 'JetBrains Mono', monospace);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sidebar-panel.collapsed .sidebar-brand {
    justify-content: center !important;
}

/* ==========================================================================
   3. COMPONENTES DE FORMULARIOS Y VENTANAS MODALES
   ========================================================================== */

/* Asegurar opacidad y texto claro en la estructura del modal */
.modal-content,
.modal-content h5,
.modal-content .modal-title,
.modal-content label,
.modal-content .form-label,
.modal-content .form-text {
    color: #ffffff !important;
}

/* Forzar texto blanco en casillas de entrada, selectores y áreas de texto */
.modal-content .form-control,
.modal-content .form-select,
.modal-content textarea,
.modal-content input {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.1) !important; /* Da un fondo estilizado a los inputs */
}

/* Color del texto de sugerencia (Placeholder) */
.modal-content .form-control::placeholder,
.modal-content input::placeholder {
    color: #cbd5e1 !important;
    opacity: 1 !important;
}

/* Botón secundario/Cancelar dentro de modales */
.modal-footer .btn-outline-secondary,
.modal-footer .btn-secondary,
.modal-footer .btn-outline-secondary * {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

/* Invertir el botón "X" de cierre de Bootstrap para que se renderice en blanco */
.modal-content .btn-close {
    filter: invert(1) !important;
}

#dayModal .modal-dialog {
    pointer-events: auto;
}

.card.card-custom.calendar-modal-host {
    backdrop-filter: none !important;
}

/* Transiciones suaves para el calendario y sus modales */
.modal.fade {
    transition: opacity 220ms ease;
}

.modal.fade .modal-dialog {
    transform: translateY(-18px) scale(0.98);
    transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.modal.fade.show .modal-dialog {
    transform: translateY(0) scale(1);
}

.modal-backdrop.fade {
    transition: opacity 220ms ease;
}

.day-summary-badge,
.calendar-day-link,
.calendar-table td {
    transition: background-color 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.day-summary-badge:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.24);
}

.calendar-day-link:hover {
    color: #ffffff !important;
}

@media (prefers-reduced-motion: reduce) {
    .modal.fade,
    .modal.fade .modal-dialog,
    .modal-backdrop.fade,
    .day-summary-badge,
    .calendar-day-link,
    .calendar-table td {
        transition: none !important;
    }
}

.antenas-page {
    min-width: 0;
}

.antenas-page .antenas-search-input {
    width: min(25%, 260px);
}

.antenas-page .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 767.98px) {
    .antenas-page .antenas-heading {
        align-items: stretch !important;
        flex-direction: column;
        gap: 1rem;
    }

    .antenas-page .antenas-heading h2 {
        font-size: 1.35rem;
    }

    .antenas-page .antenas-heading .btn,
    .antenas-page .antenas-filters .input-group,
    .antenas-page .antenas-search-input {
        width: 100%;
    }

    .antenas-page .antenas-filters {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 0.6rem !important;
    }



    .antenas-page .antenas-form-dialog {
        max-width: none;
        max-height: calc(100dvh - 0.7rem);
    }

    .antenas-page .antenas-form-dialog .modal-content {
        max-height: calc(100dvh - 0.7rem);
    }

    .antenas-page .modal-footer {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .antenas-page .modal-footer .btn {
        min-height: 2.75rem;
        margin: 0;
    }
}


/* Evitar que los asteriscos de campos obligatorios se vuelvan blancos */
.text-danger,
.modal-content .text-danger {
    color: #ff4d4d !important; /* Rojo vivo para modo oscuro */
}

/* ==========================================================================
   4. EXCEPCIONES CRÍTICAS (ZONAS CON FONDO CLARO)
   ========================================================================== */

/* REGLA UNIVERSAL DE ALTO CONTRASTE: TEXTO NEGRO EN FONDOS CLAROS Y BADGES */
.table-light, 
.table-light th, 
.table-light td, 
.table-light *,
.bg-light, 
.bg-white,
.bg-secondary-subtle,
.bg-light-subtle,
.bg-warning-subtle,
.bg-info-subtle,
.bg-success-subtle,
.badge.bg-light,
.badge.bg-white,
.badge.bg-secondary-subtle,
.badge.bg-light-subtle,
.badge.bg-warning,
.badge.bg-warning-subtle,
.badge.bg-info,
.badge.bg-info-subtle,
.badge.bg-success,
.badge.bg-success-subtle,
.badge-light,
.btn-light,
.table-warning,
.table-warning td,
.table-warning th,
.table-warning *,
.text-dark {
    color: #111827 !important;
}

.badge.bg-warning,
.badge.bg-warning-subtle,
.badge.bg-info,
.badge.bg-info-subtle,
.badge.bg-secondary-subtle,
.badge.bg-light,
.badge.bg-white {
    color: #0f172a !important;
    font-weight: 700 !important;
}

.badge.bg-secondary-subtle *,
.badge.bg-light *,
.badge.bg-white *,
.badge.bg-warning * {
    color: #0f172a !important;
}

/* Calendar summary and small tweaks */
.summary-list .summary-item:hover { background: rgba(255,255,255,0.03); }
.calendar-table td { vertical-align: top; height:160px; max-height:160px; overflow:hidden; }

/* Las tablas conservan sus columnas y se desplazan horizontalmente en móvil. */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive > .table {
    min-width: 640px;
}

.table-responsive > .calendar-table {
    min-width: 760px;
    table-layout: fixed;
}

.dataTables_wrapper,
.dataTables_scroll,
.dataTables_scrollHead,
.dataTables_scrollBody {
    width: 100%;
}

.dataTables_scrollBody {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

.dataTables_scrollHeadInner,
.dataTables_scrollHeadInner > table,
.dataTables_scrollBody > table {
    min-width: 640px;
}

.table-responsive th,
.table-responsive td {
    vertical-align: middle;
    overflow-wrap: break-word;
    word-break: normal;
}

.payment-history-table {
    min-width: 680px !important;
}

.payment-history-table td[data-label="Cliente"],
.payment-history-table th:nth-child(2) {
    min-width: 130px;
    white-space: nowrap;
}

.payment-history-table td[data-label="Antena"] {
    min-width: 140px;
}

@media (max-width: 576px) {
    .table-responsive > .table {
        font-size: 0.82rem;
    }

    .table-responsive th,
    .table-responsive td {
        padding: 0.55rem 0.45rem;
    }

    .table-responsive .btn {
        width: auto !important;
        margin-bottom: 0.2rem;
        white-space: nowrap !important;
    }

    .table-responsive .btn i {
        margin-right: 0 !important;
    }
}
.calendar-cell-content { max-height:110px; overflow-y:auto; padding-right:6px; }
.calendar-table td .calendar-day-link { display:block; color:inherit }

.list-group-item .badge { font-size: 0.85rem; }

.calendar-table {
    border-color: rgba(56, 189, 248, 0.15) !important;
}

.calendar-table-head th {
    background: #080c16 !important;
    color: var(--st-cyan, #38bdf8) !important;
    font-family: var(--st-font-mono, monospace);
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    border-bottom: 2px solid rgba(56, 189, 248, 0.25) !important;
    padding: 0.5rem 0.2rem;
}

.calendar-table td {
    vertical-align: top;
    height: 110px;
    max-height: 110px;
    overflow: hidden;
    background: #0b1120;
    border-color: rgba(255, 255, 255, 0.07) !important;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.calendar-table td.calendar-empty-cell {
    background: rgba(3, 7, 18, 0.6) !important;
}

.calendar-table td.calendar-has-payments {
    background: rgba(14, 165, 233, 0.08) !important;
    border-color: rgba(56, 189, 248, 0.25) !important;
    cursor: pointer;
}

.calendar-table td.calendar-has-payments:hover {
    background: rgba(14, 165, 233, 0.18) !important;
    border-color: rgba(56, 189, 248, 0.55) !important;
}

.calendar-table td.calendar-day-today {
    box-shadow: inset 0 0 0 2px #38bdf8, 0 0 12px rgba(56, 189, 248, 0.25) !important;
}

.calendar-table td.calendar-day-today .calendar-day-num {
    color: #38bdf8 !important;
    font-weight: 800;
}

.calendar-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 3px;
}

.calendar-day-num {
    font-family: var(--st-font-mono, monospace);
    font-weight: 700;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1;
    white-space: nowrap;
}

.day-summary-badge {
    padding: 0.15rem 0.45rem;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    border-radius: 9999px;
    background: rgba(14, 165, 233, 0.2) !important;
    color: #38bdf8 !important;
    border: 1px solid rgba(56, 189, 248, 0.5) !important;
}

.calendar-event-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 1px 4px;
    margin-bottom: 2px;
    font-size: 0.7rem;
    transition: background 0.15s ease;
}

.calendar-event-pill:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.3);
}

/* ==========================================================================
   5. UNIFICACIÓN VISUAL GLOBAL - AZUL, NEGRO Y GRIS
   ========================================================================== */

.card-custom,
.card,
.modal-content,
.auth-card {
    background: #0d121f !important;
    border: 1px solid rgba(56, 189, 248, 0.16) !important;
    border-radius: 14px !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 8px 24px rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.main-content {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}

.sidebar-panel {
    background: #080c16 !important;
    border-right: 1px solid rgba(56, 189, 248, 0.12) !important;
    box-shadow: 12px 0 30px rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.card-header,
.modal-header,
.modal-footer {
    border-color: rgba(255, 255, 255, 0.12) !important;
}

.btn,
.form-control,
.form-select,
.form-check-input,
.input-group-text {
    border-radius: 12px !important;
}

.form-control,
.form-select,
textarea,
input,
select {
    background: #080d18 !important;
    color: #f8fafc !important;
    border: 1px solid rgba(56, 189, 248, 0.2) !important;
    border-radius: 10px !important;
}

.form-control:focus,
.form-select:focus,
textarea:focus,
input:focus,
select:focus {
    border-color: #38bdf8 !important;
    background: #0a1120 !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25), 0 0 12px rgba(56, 189, 248, 0.15) !important;
    color: #ffffff !important;
}

#payment_antennas .payment-antenna-option {
    padding: 0.55rem 0.65rem 0.55rem 2rem;
    border-radius: 8px;
    cursor: pointer;
}

#payment_antennas .payment-antenna-option:hover,
#payment_antennas .payment-antenna-option.payment-antenna-selected {
    background: rgba(13, 110, 253, 0.28);
}

#payment_antennas .payment-antenna:checked {
    background-color: #0d6efd !important;
    border-color: #8ec5ff !important;
}

.form-control::placeholder,
.form-select::placeholder,
textarea::placeholder {
    color: rgba(255, 255, 255, 0.55) !important;
}

.form-control:focus,
.form-select:focus,
textarea:focus,
input:focus,
select:focus {
    border-color: rgba(13, 110, 253, 0.9) !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25) !important;
}

.btn-primary {
    background: linear-gradient(180deg, #0d6efd, #0a57d5) !important;
    border-color: #0d6efd !important;
    color: #ffffff !important;
    box-shadow: 0 10px 24px rgba(13, 110, 253, 0.35) !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(180deg, #0b63ea, #0846b6) !important;
    border-color: #0b63ea !important;
}

.btn-outline-secondary,
.btn-secondary {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.22) !important;
    background: rgba(255, 255, 255, 0.04) !important;
}

.btn-success {
    background: linear-gradient(180deg, #0b5ed7, #0a46a3) !important;
    border-color: #0b5ed7 !important;
    color: #ffffff !important;
}

.btn-whatsapp {
    background: linear-gradient(180deg, #25d366, #128c7e) !important;
    border-color: #25d366 !important;
    color: #ffffff !important;
}

.btn-whatsapp:hover,
.btn-whatsapp:focus {
    background: linear-gradient(180deg, #20ba5a, #0e7064) !important;
    border-color: #20ba5a !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4) !important;
}

.table-dark,
.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(11, 14, 20, 0.88) !important;
    color: #ffffff !important;
}

.table-light {
    background-color: rgba(222, 228, 235, 0.92) !important;
    color: #111827 !important;
}

.table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.12) !important;
}

.table-responsive {
    border-radius: 14px;
    overflow: hidden;
}

.badge {
    border-radius: 999px !important;
}

/* ========================================================
   VISTA DE TABLA TRANSFORMADA EN GRILLA/CARDS PARA MÓVILES (UNIVERSAL)
   Aplica a: Antenas, Pagos, Clientes, Cuentas, Usuarios, Base de Datos
   ======================================================== */
@media (min-width: 768px) {
    .action-btn-text {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    .antenas-page,
    .payments-page,
    .clients-page,
    .accounts-page,
    .users-page,
    .database-page {
        min-width: 0 !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }

    .antenas-page .antenas-heading,
    .payments-page .payments-heading {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.85rem !important;
    }

    .antenas-page .antenas-heading h2,
    .payments-page .payments-heading h3 {
        font-size: 1.35rem !important;
    }

    .antenas-page .antenas-heading .btn,
    .payments-page .payments-heading .btn {
        width: 100% !important;
        min-height: 2.75rem;
    }

    .antenas-page .antenas-filters {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.6rem !important;
        width: 100% !important;
    }

    .antenas-page .antenas-filters .input-group,
    .antenas-page .antenas-filters .antenas-search-input {
        width: 100% !important;
    }

    .mobile-table-hint {
        display: none !important;
    }

    .antenas-card,
    .clients-card,
    .accounts-card,
    .users-card,
    .database-card,
    .payments-panel {
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    /* Ocultar barra de búsqueda duplicada de DataTables ya que existe la personalizada */
    .dataTables_filter {
        display: none !important;
    }

    .dataTables_length {
        margin-bottom: 0.75rem !important;
    }

    .dataTables_wrapper,
    .dataTables_scroll,
    .dataTables_scrollBody,
    .table-responsive {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: visible !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .dataTables_scrollHead {
        display: none !important;
    }

    .table-mobile-cards,
    .antenas-page table,
    .antenas-page .table,
    .table-responsive > .table-mobile-cards,
    table.dataTable.table-mobile-cards {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        margin: 0 !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
        background: transparent !important;
        display: block !important;
    }

    /* Ocultar la cabecera thead tradicional */
    .table-mobile-cards thead,
    .antenas-page table thead,
    .antenas-page .table thead {
        display: none !important;
    }

    /* El tbody pasa a ser una grilla vertical */
    .table-mobile-cards tbody,
    .antenas-page table tbody,
    .antenas-page .table tbody {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.85rem !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Ocultar celdas vacías innecesarias en móviles */
    .table-mobile-cards tbody tr td.empty-mobile-cell,
    .antenas-page table tbody tr td.empty-mobile-cell {
        display: none !important;
    }

    /* Cada fila (tr) es una tarjeta completa estilo app móvil */
    .table-mobile-cards tbody tr,
    .antenas-page table tbody tr,
    .antenas-page .table tbody tr {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        box-sizing: border-box !important;
        background: #0d121f !important;
        border: 1px solid rgba(56, 189, 248, 0.2) !important;
        border-radius: 14px !important;
        padding: 0.85rem 1rem !important;
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        transition: transform 0.15s ease, border-color 0.15s ease !important;
        position: relative !important;
        overflow: hidden !important;
        margin-bottom: 0 !important;
    }

    /* Resplandor láser superior en cada tarjeta */
    .table-mobile-cards tbody tr::before,
    .antenas-page table tbody tr::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 2px;
        background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.6), transparent);
        pointer-events: none;
    }

    .table-mobile-cards tbody tr:hover,
    .antenas-page table tbody tr:hover,
    .antenas-page .table tbody tr:hover {
        border-color: rgba(56, 189, 248, 0.5) !important;
    }

    /* Anular columna fija sticky para que no tape contenido */
    .table-sticky-col th:first-child,
    .table-sticky-col td:first-child,
    .table-mobile-cards tbody tr td:first-child,
    .antenas-page .table tbody tr td:first-child {
        position: static !important;
        left: auto !important;
        background: transparent !important;
        background-color: transparent !important;
        box-shadow: none !important;
        border-right: none !important;
    }

    /* Cada celda (td) es un renglón clave-valor compacto */
    .table-mobile-cards tbody tr td,
    .antenas-page table tbody tr td,
    .antenas-page .table tbody tr td {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        box-sizing: border-box !important;
        padding: 0.35rem 0 !important;
        border: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
        background: transparent !important;
        text-align: right !important;
        font-size: 0.85rem !important;
        min-height: auto !important;
        white-space: normal !important;
        position: static !important;
    }

    /* Etiqueta descriptiva (data-label) en la izquierda */
    .table-mobile-cards tbody tr td::before,
    .antenas-page table tbody tr td::before,
    .antenas-page .table tbody tr td::before {
        content: attr(data-label);
        font-weight: 600 !important;
        color: #94a3b8 !important;
        font-size: 0.68rem !important;
        text-transform: uppercase !important;
        letter-spacing: 0.04em !important;
        text-align: left !important;
        margin-right: 0.65rem !important;
        flex-shrink: 0 !important;
    }

    /* El contenido/valor en la derecha de la celda */
    .table-mobile-cards .td-value,
    .antenas-page .td-value,
    .td-value,
    .table-mobile-cards tbody tr td > *:not(::before),
    .antenas-page table tbody tr td > *:not(::before),
    .antenas-page .table tbody tr td > *:not(::before) {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        text-align: right !important;
        color: #f1f5f9 !important;
        font-size: 0.85rem !important;
        max-width: 75% !important;
        white-space: normal !important;
        word-break: break-word !important;
        gap: 0.25rem !important;
    }

    /* Cabecera destacada de la tarjeta: Asignada a, Cliente, Titular */
    .table-mobile-cards tbody tr td:first-child,
    .table-mobile-cards tbody tr td[data-label="Asignada a"],
    .antenas-page .table tbody tr td[data-label="Asignada a"],
    .table-mobile-cards tbody tr td[data-label="Cliente"],
    .table-mobile-cards tbody tr td[data-label="Titular"] {
        padding-top: 0 !important;
        padding-bottom: 0.55rem !important;
        border-bottom: 1px solid rgba(56, 189, 248, 0.25) !important;
        margin-bottom: 0.35rem !important;
    }

    .table-mobile-cards tbody tr td[data-label="Asignada a"]::before,
    .table-mobile-cards tbody tr td[data-label="Cliente"]::before,
    .table-mobile-cards tbody tr td[data-label="Titular"]::before {
        font-size: 0.65rem !important;
        color: #64748b !important;
    }

    .table-mobile-cards tbody tr td[data-label="Asignada a"] .td-value,
    .antenas-page .table tbody tr td[data-label="Asignada a"] .td-value,
    .table-mobile-cards tbody tr td[data-label="Cliente"] .td-value,
    .table-mobile-cards tbody tr td[data-label="Titular"] .td-value {
        font-size: 1.02rem !important;
        font-weight: 700 !important;
        color: #38bdf8 !important;
    }

    /* Etiquetas de código compacto (Serial, Kit, Cédula, Teléfono) */
    .table-mobile-cards tbody tr td code,
    .antenas-page .table tbody tr td code {
        font-size: 0.80rem !important;
        color: #38bdf8 !important;
        font-weight: 600 !important;
        background: rgba(15, 23, 42, 0.8) !important;
        border: 1px solid rgba(56, 189, 248, 0.25) !important;
        padding: 0.15rem 0.45rem !important;
        border-radius: 6px !important;
        letter-spacing: normal !important;
        max-width: 100% !important;
        white-space: nowrap !important;
        display: inline-block !important;
    }

    /* Botón copiar en tarjetas móviles */
    .table-mobile-cards .btn-copy,
    .antenas-page .btn-copy {
        font-size: 0.85rem !important;
        color: #94a3b8 !important;
        padding: 0.1rem 0.25rem !important;
        line-height: 1 !important;
        border: none !important;
        background: transparent !important;
    }

    .table-mobile-cards .btn-copy:hover,
    .antenas-page .btn-copy:hover {
        color: #38bdf8 !important;
    }

    /* Renglón de Acciones al final de la tarjeta */
    .table-mobile-cards tbody tr td[data-label="Acciones"],
    .antenas-page .table tbody tr td[data-label="Acciones"],
    .table-mobile-cards tbody tr td[data-label="Acción"] {
        border-bottom: none !important;
        border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
        padding-top: 0.75rem !important;
        padding-bottom: 0 !important;
        justify-content: stretch !important;
        margin-top: 0.35rem !important;
    }

    .table-mobile-cards tbody tr td[data-label="Acciones"]::before,
    .antenas-page .table tbody tr td[data-label="Acciones"]::before,
    .table-mobile-cards tbody tr td[data-label="Acción"]::before {
        display: none !important;
    }

    .table-mobile-cards tbody tr td[data-label="Acciones"] .d-inline-flex,
    .antenas-page .table tbody tr td[data-label="Acciones"] .d-inline-flex,
    .table-mobile-cards tbody tr td[data-label="Acción"] .d-inline-flex {
        width: 100% !important;
        max-width: 100% !important;
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)) !important;
        gap: 0.45rem !important;
    }

    .table-mobile-cards tbody tr td[data-label="Acciones"] .d-inline-flex > *,
    .antenas-page .table tbody tr td[data-label="Acciones"] .d-inline-flex > *,
    .table-mobile-cards tbody tr td[data-label="Acción"] .d-inline-flex > * {
        width: 100% !important;
        min-width: 0 !important;
        padding: 0.42rem 0.5rem !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 0.80rem !important;
        font-weight: 600 !important;
        border-radius: 8px !important;
        min-height: 2.1rem !important;
    }

    .action-btn-text,
    .antenas-page .action-btn-text {
        display: inline !important;
    }

    /* Fila vacía cuando no hay datos */
    .table-mobile-cards tbody tr td.dataTables_empty,
    .antenas-page .table tbody tr td.dataTables_empty {
        display: block !important;
        text-align: center !important;
        border-bottom: none !important;
        padding: 2.5rem 1rem !important;
        width: 100% !important;
    }

    .table-mobile-cards tbody tr td.dataTables_empty::before,
    .antenas-page .table tbody tr td.dataTables_empty::before {
        display: none !important;
    }

    /* Paginación y resumen de DataTables en móviles */
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: center !important;
        margin-top: 1rem !important;
        float: none !important;
    }

    .dataTables_wrapper .dataTables_paginate .pagination {
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 0.25rem !important;
    }
}

/* Pagos: mantiene el contenido usable en pantallas estrechas. */
.payments-page {
    min-width: 0;
}

.payments-page .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.payments-page .payments-search-input {
    width: min(25%, 260px);
}

.payments-page .payments-date-filters {
    gap: 0.5rem;
}

@media (max-width: 767.98px) {
    .payments-page .payments-heading {
        align-items: stretch !important;
        flex-direction: column;
        gap: 1rem;
    }

    .payments-page .payments-heading h3 {
        font-size: 1.35rem;
    }

    .payments-page .payments-heading p {
        font-size: 0.9rem;
    }

    .payments-page .payments-heading .btn {
        width: 100%;
    }

    .payments-page .payments-filters {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 0.6rem !important;
    }

    .payments-page .payments-filters .input-group,
    .payments-page .payments-search-input,
    .payments-page .payments-date-filters {
        width: 100%;
    }

    .payments-page .payments-date-filters {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
    }

    .payments-page .payments-date-filters label {
        margin: 0 !important;
        align-self: end;
    }

    .payments-page .payments-date-filters input {
        width: 100%;
        margin: 0 !important;
    }

    .payments-page .payments-date-filters button,
    .payments-page .payments-date-filters a {
        width: 100%;
        margin: 0 !important;
    }

    .payments-page .payments-date-filters button {
        grid-column: 1;
    }

    .payments-page .payments-date-filters a {
        grid-column: 2;
        grid-row: 3;
    }

    .payments-page .payments-panel {
        padding: 0.75rem !important;
    }

    .payments-page .payments-panel h5 {
        font-size: 1rem;
    }

    .payments-page .table-responsive {
        margin: 0 -0.25rem;
    }

    .payments-page .table-responsive > .table:not(.table-mobile-cards) {
        min-width: 620px;
    }

    .payments-page .modal-dialog {
        margin: 0.5rem;
    }

    .payments-page .payments-form-dialog,
    .payments-page .payments-review-dialog {
        max-width: none;
        max-height: calc(100dvh - 0.7rem);
    }

    .payments-page .payments-form-dialog .modal-content,
    .payments-page .payments-review-dialog .modal-content {
        max-height: calc(100dvh - 0.7rem);
    }

    .payments-page #payment_antennas {
        max-height: 28dvh !important;
    }

    .payments-page #payment_select_all {
        white-space: nowrap;
    }

    .payments-page .payments-form-dialog .modal-footer {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .payments-page .payments-review-dialog .modal-footer {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .payments-page .payments-review-dialog .modal-footer #review_payment_btn_receipt {
        width: 100%;
    }

    .payments-page .payments-review-dialog .modal-footer .d-flex {
        width: 100%;
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .payments-page .modal-footer .btn {
        margin: 0;
        min-height: 2.5rem;
    }
}

/* Limitadores de altura para comprobantes de pago e iframe de vista previa */
#review_payment_receipt {
    height: 320px;
    max-height: 40vh;
}

@media (max-width: 767.98px) {
    #review_payment_receipt {
        height: 220px;
        max-height: 30vh;
    }
}

#pdfPreviewModal .modal-dialog {
    max-height: calc(100vh - 1.5rem);
    max-height: calc(100dvh - 1.5rem);
    height: calc(100vh - 1.5rem);
    height: calc(100dvh - 1.5rem);
}

#pdfPreviewModal .modal-content,
.pdf-preview-content {
    height: 100% !important;
    max-height: calc(100vh - 1.5rem) !important;
    max-height: calc(100dvh - 1.5rem) !important;
    display: flex !important;
    flex-direction: column !important;
}

#pdfPreviewModal .modal-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

#pdfPreviewModal .modal-footer {
    flex: 0 0 auto !important;
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (max-width: 420px) {
    .payments-page .payments-date-filters {
        grid-template-columns: 1fr;
    }

    .payments-page .payments-date-filters label,
    .payments-page .payments-date-filters button,
    .payments-page .payments-date-filters a {
        grid-column: 1;
        grid-row: auto;
    }

    .payments-page .payments-date-filters label:not(:first-of-type) {
        margin-top: 0.25rem !important;
    }
}

.modal-content .btn-close {
    filter: invert(1) !important;
}

body,
html,
.wrapper,
main,
footer,
.footer,
.card-custom,
.card,
.table,
.table td,
.table th,
label,
small,
span,
.text-muted,
.text-white-50,
.text-light-50,
.sidebar a,
.sidebar span,
.sidebar i,
.nav-link {
    color: #ffffff !important;
}

/* Movimiento consistente para la interfaz completa */
.btn,
.nav-link,
.dropdown-item,
.sidebar-toggle,
.app-user-button,
.card-custom,
.auth-card,
.alert,
.dropdown-menu,
.offcanvas,
.form-control,
.form-select,
textarea,
input,
select {
    transition: transform 180ms ease, color 180ms ease, background-color 180ms ease,
        border-color 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.btn:hover,
.sidebar-toggle:hover,
.app-user-button:hover {
    transform: translateY(-1px);
}

.btn:active,
.sidebar-toggle:active,
.app-user-button:active {
    transform: translateY(0);
}

.card-custom:not(.calendar-modal-host):hover,
.auth-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34) !important;
}

.form-control:focus,
.form-select:focus,
textarea:focus,
input:focus,
select:focus {
    transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
    .btn,
    .nav-link,
    .dropdown-item,
    .sidebar-toggle,
    .app-user-button,
    .card-custom,
    .auth-card,
    .alert,
    .dropdown-menu,
    .offcanvas,
    .form-control,
    .form-select,
    textarea,
    input,
    select {
        transition: none !important;
    }

    .btn:hover,
    .sidebar-toggle:hover,
    .app-user-button:hover,
    .card-custom:not(.calendar-modal-host):hover,
    .auth-card:hover,
    .form-control:focus,
    .form-select:focus,
    textarea:focus,
    input:focus,
    select:focus {
        transform: none !important;
    }
}

/* Command Palette (Ctrl+K) Styles */
#commandPaletteResults .list-group-item {
    transition: background-color 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
}
#commandPaletteResults .list-group-item:hover,
#commandPaletteResults .list-group-item.active {
    background: rgba(14, 165, 233, 0.15) !important;
    border-color: rgba(56, 189, 248, 0.4) !important;
}
#commandPaletteResults .list-group-item.active .badge {
    border-color: var(--st-cyan) !important;
    color: var(--st-cyan) !important;
}