﻿.loader-bg {
    display: none; /* No usar !important */
    position: fixed;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    top: 0;
    left: 0;
    z-index: 99;
    display: flex;
    justify-content: center;
    align-items: center;
}
.btn btn-primary {
    padding-top: 5px !important;
    padding-bottom: 5px !important;
    padding-right: 15px !important;
    padding-left: 15px !important;
}
tr.selected {
    background-color: #e0f3ff !important;
}
.pc-item.disabled > a.pc-link {
    color: #aaa !important;
    pointer-events: none;
    cursor: not-allowed;
    opacity: 0.6;
}

.section-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 6px 0;
    font-weight: 500;
    font-size: 1.1rem;
    margin-top: 24px;
    border-bottom: 1px solid #ccc;
}

.section-toggle .toggle-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
    width: 20px;
    text-align: center;
}

.section-content {
    margin-top: 10px;
}
/* Estilos para controles de solo lectura */
.readonly-control {
    background-color: #e9ecef !important;
    opacity: 0.8;
}

    .readonly-control:focus {
        border-color: #ced4da !important;
        box-shadow: none !important;
    }

/* Para selects deshabilitados */
select.readonly-control {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: none !important;
}

/* Para checkboxes y radios deshabilitados */
input[type="checkbox"].readonly-control,
input[type="radio"].readonly-control {
    opacity: 0.6;
}
.datatable-table thead th, .table thead th {
    font-size: 0.82em !important;
}

#toolbar {
    position: sticky;
    top: 74px;
    z-index: 1020;
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 8px 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* Necesario para que position:sticky funcione dentro de .card */
.card {
    overflow: visible;
}

/* ===== Ajustes del plugin Choices.js en los combos cascada ===== */
/* Replicar el aspecto de .form-control / .form-select de Bootstrap (del template)
   para que el combo tenga el mismo alto, borde y radio que el resto de los inputs,
   y evitar que el texto largo del placeholder parta el combo en dos líneas. */
.choices {
    margin-bottom: 0;
    position: relative;
}

    /* El contenedor visible del combo = un .form-control */
.choices__inner {
    display: flex;
    align-items: center;
    min-height: calc(1.5em + 0.75rem + 2px) !important; /* alto base de .form-control */
    height: auto !important;
    padding: 0.8rem 2rem 0.8rem 0.75rem !important;
    font-size: 0.780rem !important;
    line-height: 1.5 !important;
    color: var(--bs-body-color, #212529) !important;
    background-color: #fff !important; /* evitar el gris por defecto de Choices */
    border: 1px solid var(--bs-border-color, #dbe0e5) !important;
    border-radius: var(--bs-border-radius, 0.375rem) !important;
    overflow: hidden;
}

    /* Estado deshabilitado sí debe verse gris */
    .choices.is-disabled .choices__inner {
        background-color: #e9ecef !important;
        cursor: not-allowed;
    }


    /* Estado enfocado = igual que :focus de .form-control */
    .choices.is-focused .choices__inner,
    .choices.is-open .choices__inner {
        border-color: var(--bs-primary, #4680ff);
        box-shadow: 0 0 0 0.2rem rgba(70, 128, 255, 0.15);
    }

    /* Esquinas inferiores rectas cuando el desplegable está abierto */
    .choices.is-open .choices__inner {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    /* Texto de la opción seleccionada / placeholder: una sola línea con elipsis */
    .choices__inner .choices__list--single {
        padding: 0 !important;
        margin: 0;
        display: flex;
        align-items: center;
        width: 100%;
    }


        .choices__inner .choices__list--single .choices__item {
            font-size: 0.780rem;
            line-height: 1.5;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 100%;
        }

/* Opciones del desplegable también en tamaño acorde */
.choices__list--dropdown .choices__item,
.choices__list[aria-expanded] .choices__item {
    font-size: 0.780rem !important;
    line-height: 1.5 !important;
    padding: 0.35rem 0.75rem !important;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Campo de búsqueda dentro del desplegable, acorde al tema */
.choices__list--dropdown .choices__input,
.choices__list[aria-expanded] .choices__input {
    font-size: 0.780rem !important;
    padding: 0.375rem 0.75rem !important;
}


/* El desplegable de Choices debe quedar por encima del #toolbar sticky (z-index:1020)
   y de otros controles. Al abrirse, Choices agrega .is-open al contenedor. */
.choices.is-open {
    z-index: 1040;
}

.choices__list--dropdown,
.choices__list[aria-expanded] {
    z-index: 1040;
}


