/* Custom CSS */

/* Global: No rounded buttons — all .btn variants must have square corners */
.btn,
.btn-sm,
.btn-lg,
[class*="btn-"] {
    border-radius: 0 !important;
}


/* Fix alert warning text visibility */
[data-bs-theme="light"] .alert-warning,
[data-bs-theme="light"] .alert-warning p,
[data-bs-theme="light"] .alert-warning span,
[data-bs-theme="light"] .alert-warning strong,
[data-bs-theme="light"] .alert-warning .form-text,
[data-bs-theme="light"] .alert-warning h1,
[data-bs-theme="light"] .alert-warning h2,
[data-bs-theme="light"] .alert-warning h3,
[data-bs-theme="light"] .alert-warning h4,
[data-bs-theme="light"] .alert-warning h5,
[data-bs-theme="light"] .alert-warning h6 {
    color: #000 !important;
}

[data-bs-theme="dark"] .alert-warning,
[data-bs-theme="dark"] .alert-warning p,
[data-bs-theme="dark"] .alert-warning span,
[data-bs-theme="dark"] .alert-warning strong,
[data-bs-theme="dark"] .alert-warning .form-text,
[data-bs-theme="dark"] .alert-warning h1,
[data-bs-theme="dark"] .alert-warning h2,
[data-bs-theme="dark"] .alert-warning h3,
[data-bs-theme="dark"] .alert-warning h4,
[data-bs-theme="dark"] .alert-warning h5,
[data-bs-theme="dark"] .alert-warning h6 {
    color: #ffda6a !important;
}

/* Fix badge bg-secondary contrast - Make it look like bg-dark as requested */
.badge.bg-secondary {
    color: #fff !important;
    background-color: #212529 !important;
    /* Bootstrap dark color */
}

/* Tabs Standardization: Inactive Black, Active Blue */
.nav-tabs .nav-link {
    color: #000000;
    /* Black for inactive tabs */
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
    color: var(--bs-primary, #0d6efd) !important;
    /* Blue for active tab */
    font-weight: bold;
}

.nav-tabs .nav-link:hover {
    color: var(--bs-primary, #0d6efd);
    border-color: #e9ecef #e9ecef #dee2e6;
}

/* Fix Select2 text overlapping with the clear button 'x' */
.select2-selection__rendered {
    padding-right: 25px !important; 
}

/* Animation for blinking elements */
@keyframes blinker {
    50% { opacity: 0; }
}
.blink {
    animation: blinker 1s linear infinite;
}

/* Estandarización visual de desplegables en todo el ERP: flecha siempre visible y eliminación de checks de validación */
.form-select.is-valid,
.was-validated .form-select:valid,
.form-select.is-valid:not([multiple]):not([size]),
.form-select.is-valid:not([multiple])[size="1"],
.was-validated .form-select:valid:not([multiple]):not([size]),
.was-validated .form-select:valid:not([multiple])[size="1"] {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    padding-right: 2.25rem !important;
    border-color: #ced4da !important;
}

.form-select-sm.is-valid,
.was-validated .form-select-sm:valid,
.form-select-sm.is-valid:not([multiple]):not([size]),
.form-select-sm.is-valid:not([multiple])[size="1"],
.was-validated .form-select-sm:valid:not([multiple]):not([size]),
.was-validated .form-select-sm:valid:not([multiple])[size="1"] {
    padding-right: 1.75rem !important;
}

/* Evitar borde verde invasivo en Select2 validado */
.is-valid + .select2-container--bootstrap-5 .select2-selection,
.was-validated select:valid + .select2-container--bootstrap-5 .select2-selection {
    border-color: #ced4da !important;
}

/* Garantizar siempre la flecha estándar en todos los desplegables Select2 individuales (Bootstrap 5) */
.select2-container--bootstrap-5 .select2-selection--single {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 16px 12px !important;
    padding-right: 2.25rem !important;
}

/* Adaptación para selects compactos o dentro de tablas */
.form-select-sm ~ .select2-container--bootstrap-5 .select2-selection--single,
select.select2-sm + .select2-container--bootstrap-5 .select2-selection--single,
.select2-container--bootstrap-5 .select2--small.select2-selection--single,
table .select2-container--bootstrap-5 .select2-selection--single {
    background-position: right 0.5rem center !important;
    padding-right: 1.75rem !important;
}

/* ==========================================================================
   REGLA GENERAL: Estandarización Compacta de Select2 en toda la herramienta
   ========================================================================== */

/* 1. Contenedor cerrado individual (altura compacta estándar igual a form-control-sm) */
.select2-container--bootstrap-5 .select2-selection--single {
    height: 28px !important;
    min-height: 28px !important;
    padding: 0 8px !important;
    padding-right: 1.75rem !important;
    font-size: 0.8125rem !important;
    border-radius: 4px !important;
    border: 1px solid #ced4da !important;
    display: flex !important;
    align-items: center !important;
    background-position: right 0.5rem center !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    line-height: 26px !important;
    padding-left: 0 !important;
    padding-right: 20px !important;
    font-size: 0.8125rem !important;
    color: #495057 !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__clear {
    right: 1.25rem !important;
}

/* 2. Contenedor cerrado múltiple (etiquetas) */
.select2-container--bootstrap-5 .select2-selection--multiple {
    min-height: 28px !important;
    padding: 1px 4px !important;
    font-size: 0.8125rem !important;
    border-radius: 4px !important;
    border: 1px solid #ced4da !important;
    display: flex !important;
    align-items: center !important;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice {
    font-size: 0.75rem !important;
    padding: 1px 6px !important;
    margin: 1px 2px !important;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-search__field {
    font-size: 0.8125rem !important;
    margin: 0 !important;
    height: 22px !important;
}

/* 3. Desplegable flotante y buscador interno con búsqueda en TODO el ERP */
.select2-container--bootstrap-5 .select2-dropdown .select2-search,
.select2-dropdown .select2-search {
    padding: 4px 6px !important;
}

.select2-container--bootstrap-5 .select2-dropdown .select2-search .select2-search__field,
.select2-dropdown .select2-search .select2-search__field,
.select2-search--dropdown .select2-search__field {
    height: 28px !important;
    min-height: 28px !important;
    padding: 2px 8px !important;
    font-size: 0.8125rem !important;
    border-radius: 4px !important;
    border: 1px solid #ced4da !important;
    box-sizing: border-box !important;
}

.select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option,
.select2-dropdown .select2-results__options .select2-results__option {
    padding: 4px 8px !important;
    font-size: 0.8125rem !important;
    line-height: 1.4 !important;
}


