body {
    background-color: #f8f9fa;
    font-family: "Poppins", sans-serif;
}

.bg-odoo {
    background-color: #714B67;
    color: #fff;
}

thead.bg-odoo th {
    background-color: #714B67;
    color: #fff;
}

.btn-odoo {
    background-color: #714B67;
    color: #fff;
}

.btn-odoo:hover {
    background-color: #593852;
    color: #fff;
}

.section-title {
    font-weight: 600;
    color: #714B67;
    border-bottom: 2px solid #714B67;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
}

.table th {
    background-color: #714B67;
    color: white;
    font-weight: 500;
    text-align: left;
}

.table td {
    text-align: left;
    vertical-align: middle;
}

.modal-content {
    border-radius: 10px;
    border: none;
}

.form-section {
    background: #f5f3f7;
    padding: 10px;
    border-radius: 8px;
}

.collapse-btn {
    font-size: 14px;
    color: #714B67;
    cursor: pointer;
}

.table-container {
    max-height: 250px;
    min-height: 250px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

.modal-body {
    max-height: 500px;
    overflow-y: auto;
}

tbody tr.hidden {
    display: none !important;
}

#tablaModal thead th {
    background: #714B67;
    color: white;
    position: sticky;
    top: 0;
    z-index: 2;
}

.pasajero-row:hover {
    background-color: #e7f3ff !important;
}

.pasajero-row.table-primary {
    background-color: #cfe2ff !important;
}

.servicio-row {
    transition: all 0.2s ease;
}

.badge {
    font-size: 0.75rem;
}

.icon-check {
    color: #28a745;
    font-weight: bold;
    font-size: 12pt;
}

.icon-x {
    color: #dc3545;
    font-weight: bold;
    font-size: 12pt;
}

.no-spinner {
    -moz-appearance: textfield;
    -webkit-appearance: textfield;
    appearance: textfield;
}

.no-spinner::-webkit-outer-spin-button,
.no-spinner::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

/* ==========================================
   SELECT2 ESTILOS BASE
   ========================================== */

/* Hacer que Select2 coincida EXACTAMENTE con .form-control-sm de Bootstrap */
.select2-container--default .select2-selection--single {
    min-height: calc(1.5em + .5rem + calc(var(--bs-border-width) * 2)) !important;
    height: calc(1.5em + .5rem + calc(var(--bs-border-width) * 2)) !important;
    padding: .25rem .5rem !important;
    font-size: .875rem !important;
    border-radius: var(--bs-border-radius-sm) !important;

    /* Copiar exactamente los estilos de .form-control */
    font-weight: 400;
    line-height: 1.5;
    color: var(--bs-body-color);
    background-color: var(--bs-body-bg);
    border: var(--bs-border-width) solid var(--bs-border-color);
    appearance: none;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: calc(1.5em + .5rem) !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    color: var(--bs-body-color) !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: calc(1.5em + .5rem) !important;
    top: calc(var(--bs-border-width)) !important;
    right: calc(var(--bs-border-width)) !important;
}

/* Placeholder */
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--bs-secondary-color) !important;
}

/* Focus state - igual que .form-control:focus */
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    color: var(--bs-body-color) !important;
    background-color: var(--bs-body-bg) !important;
    border-color: #86b7fe !important;
    outline: 0 !important;
    box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25) !important;
}

/* Dropdown */
.select2-dropdown {
    border: var(--bs-border-width) solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
}

.select2-container--default .select2-results__option {
    padding: .25rem .5rem !important;
    font-size: .875rem !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--bs-primary) !important;
    color: var(--bs-white) !important;
}

/* Search box dentro del dropdown */
.select2-search--dropdown .select2-search__field {
    padding: .25rem .5rem !important;
    font-size: .875rem !important;
    border: var(--bs-border-width) solid var(--bs-border-color) !important;
    border-radius: var(--bs-border-radius-sm) !important;
}

/* Disabled state */
.select2-container--default .select2-selection--single.select2-selection--disabled {
    background-color: var(--bs-secondary-bg) !important;
    opacity: 1 !important;
}

/* Eliminar el margen extra que Select2 agrega */
.select2-container {
    width: 100% !important;
}

/* Clear button si usas allowClear */
.select2-container--default .select2-selection--single .select2-selection__clear {
    margin-right: .5rem;
    font-size: 1.2em;
    font-weight: 700;
    line-height: 1;
}

/* ==========================================
   Z-INDEX MANAGEMENT PARA MODALES
   ========================================== */

/* Z-index base para modales Bootstrap */
/* Modal backdrop: 1050 */
/* Modal: 1055 */

/* Select2 NORMAL (fuera de modales) - debe estar DEBAJO de los modales */
.select2-container {
    z-index: 1040 !important;
}

.select2-dropdown {
    z-index: 1040 !important;
}

/* Select2 DENTRO de modales Bootstrap - debe estar ENCIMA del modal */
.modal .select2-container {
    z-index: 1070 !important;
}

.modal .select2-dropdown {
    z-index: 1080 !important;
}

/* CRÍTICO: Cuando un modal de servicio está abierto, 
   ocultar los Select2 del formulario principal */
body.modal-open .select2-container:not(.modal .select2-container) {
    visibility: hidden !important;
}

/* Restaurar visibilidad cuando el modal se cierre */
body:not(.modal-open) .select2-container {
    visibility: visible !important;
}

/* Específicamente para el modal de rutas */
#modalRuta .select2-container {
    z-index: 1070 !important;
}

#modalRuta .select2-dropdown {
    z-index: 1080 !important;
}

/* Específicamente para el modal de servicios */
#modalServicio .select2-container {
    z-index: 1070 !important;
}

#modalServicio .select2-dropdown {
    z-index: 1080 !important;
}

/* Asegurar que el input de búsqueda de Select2 sea editable en modales */
.modal .select2-search__field {
    pointer-events: auto !important;
}

.modal .select2-search--dropdown {
    z-index: 1081 !important;
}

/* Asegurar que los inputs dentro del modal sean interactuables */
.modal input,
.modal select,
.modal .select2-selection {
    pointer-events: auto !important;
}

/* CRÍTICO: Asegurar que el input de búsqueda de Select2 en modales sea interactuable */
.select2-container--open .select2-search--dropdown .select2-search__field {
    pointer-events: auto !important;
    cursor: text !important;
    user-select: text !important;
    -webkit-user-select: text !important;
}