/* ============================================================
   ESTILOS BASE (GLOBAL)
   ============================================================ */

a:link,
a:visited,
a:hover,
a:active {
    text-decoration: none !important;
}

.rounded,
.bootstrap-tagsinput,
.bootstrap-tagsinput>.badge {
    border-radius: 8px !important;
}

.rounded-start,
.bootstrap-tagsinput,
.bootstrap-tagsinput>.badge {
    border-top-left-radius: 8px !important;
    border-bottom-left-radius: 8px !important;
}

.rounded-end,
.bootstrap-tagsinput,
.bootstrap-tagsinput>.badge {
    border-top-right-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
}

.rounded-top,
.bootstrap-tagsinput,
.bootstrap-tagsinput>.badge {
    border-top-left-radius: 8px !important;
    border-top-right-radius: 8px !important;
}

.rounded-bottom,
.bootstrap-tagsinput,
.bootstrap-tagsinput>.badge {
    border-bottom-left-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
}

.backgroundImage {
    width: 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
    z-index: 1;
}

/* ============================================================
   SWITCHES GLOBALES
   ============================================================ */

.form-check-input:not(.switch-grande):not(#estatusSwitch) {
    width: 1.2em !important;
    height: 1.2em !important;
}

.form-check-input:active,
.form-check-input:focus,
.btn {
    outline: 0 !important;
    box-shadow: none !important;
}

/* ============================================================
   TABLAS GLOBALES
   ============================================================ */

.list-group-item {
    border: 0px !important;
}

th.sortable {
    cursor: pointer;
    user-select: none;
}

th.sortable .sort-icon {
    margin-left: 6px;
    font-size: 0.8rem;
    opacity: 0.5;
}

th.sortable.asc .sort-icon::after {
    content: "▲";
}

th.sortable.desc .sort-icon::after {
    content: "▼";
}

/* ============================================================
   ETIQUETAS PREMIUM (GLOBAL)
   ============================================================ */

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 8px;
    line-height: 1.2;
    transition: all 0.2s ease-in-out;
}

.status-abierto {
    background-color: #e8f8f2 !important;
    color: #059669 !important;
    border: 1px solid #10b981 !important;
}

.status-cerrado {
    background-color: #fde8e8 !important;
    color: #e11d48 !important;
    border: 1px solid #ef4444 !important;
}

.is-invalid {
    border: 2px solid #dc3545 !important;
    background-color: #ffe6e6 !important;
}

.icon-admin {
    width: 40px;
    height: 40px;
    object-fit: contain;
    vertical-align: middle;
    /* 🔥 clave para centrar */
    margin-right: 8px;
}


/* ============================================================
   AJUSTES SOLO PARA MÓVIL — PLANTILLA listado-header
   ============================================================ */
@media (max-width: 576px) {

    /* Alineación correcta del select */
    .listado-row {
        align-items: flex-start !important;
    }

    /* Separación entre select y botones */
    .listado-row select {
        margin-bottom: 12px !important;
    }

    /* Botones PDF/Excel lado a lado */
    .listado-btn-wrapper {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .btn-pdf,
    .btn-excel {
        width: 45% !important;
        font-size: 0.8rem !important;
        padding: 6px 0 !important;
        text-align: center !important;
    }

    /* Columnas del select y botones ocupan 100% en móvil */
    .listado-row>.col-3,
    .listado-row>.col-9 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    /* Ancho visual ideal del card en móvil (85%) */
    .col-6.mx-auto {
        width: 85% !important;
        max-width: 85% !important;
    }
}

/* ============================================================
   ESTADOS VISUALES DE FORMULARIOS (OPACIDAD E INICIALIZACIÓN)
   ============================================================ */
.form-uninitialized-state {
    position: relative;
    opacity: 0.55 !important;
    transition: opacity 0.3s ease, filter 0.3s ease;
    pointer-events: none !important;
    filter: grayscale(15%);
    user-select: none;
}

.form-uninitialized-state input,
.form-uninitialized-state select,
.form-uninitialized-state button,
.form-uninitialized-state .select2-container {
    pointer-events: none !important;
}

.form-ready-state {
    position: relative;
    opacity: 1 !important;
    transition: opacity 0.3s ease, filter 0.3s ease;
    pointer-events: auto !important;
    filter: none !important;
}

.form-uninitialized-notice {
    background-color: #e8f4fd;
    border: 1px solid #b6e0fe;
    color: #084298;
    border-radius: 8px;
    font-size: 0.88rem;
}

/* Modal / Loader de Inicialización de Módulos Ultraligero */
.module-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(2px);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.25s ease;
}

.module-loader-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.module-loader-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #0d6efd;
    border-radius: 50%;
    animation: moduleSpin 0.6s linear infinite;
}

@keyframes moduleSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ============================================================
   ANCHO PREMIUM (95% PANTALLA) MODALES DE BÚSQUEDA (COMO EN APPPOSDEMO)
   ============================================================ */
.modal[id^="modalSearch"] .modal-dialog {
    max-width: 95vw !important;
    width: 95% !important;
}

@media (max-width: 575.98px) {
    .modal[id^="modalSearch"] .modal-dialog.modal-fullscreen-sm-down {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
    }
}

.modal[id^="modalSearch"] tbody button i,
.modal[id^="modalSearch"] tbody .btn i,
.modal[id^="modalSearch"] tbody a i {
    pointer-events: none;
}

/* ============================================================
   ESTILOS LOGIN (LOGO Y TÍTULO CENTRADOS)
   ============================================================ */
.login-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border-radius: 50%;
    padding: 4px;
    background-color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.login-title {
    font-weight: 700;
    font-size: 1.35rem;
    color: #212529;
    margin-top: 12px;
    margin-bottom: 0;
    letter-spacing: -0.2px;
}

/* ============================================================
   ESTILOS SIDEBAR (LOGO Y TÍTULO CENTRADOS)
   ============================================================ */
.sidebar-logo {
    width: 55px;
    height: 55px;
    object-fit: contain;
    display: block;
    margin: 0 auto 8px auto;
    border-radius: 50%;
    padding: 3px;
    background-color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.sidebar-title {
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.25;
    color: #212529;
    margin: 0;
    text-align: center;
    display: block;
    word-break: break-word;
    padding: 0 10px;
}

#sidebar-wrapper.collapsed .sidebar-heading {
    min-width: 0 !important;
    padding: 8px 0 !important;
}

#sidebar-wrapper.collapsed .sidebar-logo {
    width: 42px;
    height: 42px;
    margin: 0 auto;
}

.icon-admin {
    max-height: 50px;
    max-width: 50px;
    object-fit: contain;
    margin-right: 10px;
    vertical-align: middle;
}