/* Estilos adicionales para XCRUD */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    
    /* Fuente principal */
    --font-family-primary: 'Smooch Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Aplicar Smooch Sans como fuente principal */
* {
    font-family: var(--font-family-primary);
}

body {
    font-family: var(--font-family-primary);
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: 0.01em;
}

/* Estilos específicos para diferentes elementos */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-primary);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.navbar-brand {
    font-family: var(--font-family-primary);
    font-weight: 700;
    letter-spacing: 0.05em;
}

.btn {
    font-family: var(--font-family-primary);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.form-control, .form-select {
    font-family: var(--font-family-primary);
    font-weight: 400;
}

.table {
    font-family: var(--font-family-primary);
    font-weight: 400;
    letter-spacing: 0.01em;
    font-size: 1.1rem; /* Reducido de 1.3rem para mejor balance */
}

.table th {
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 0.9rem; /* Ligeramente más grande para encabezados */
}

.table td {
    font-weight: 400;
    letter-spacing: 0.01em;
    vertical-align: middle; /* Mejor alineación vertical */
}

.card-header {
    font-family: var(--font-family-primary);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.toast-header {
    font-family: var(--font-family-primary);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.alert {
    font-family: var(--font-family-primary);
    font-weight: 400;
}

/* Mejoras específicas para Smooch Sans */

/* Navbar con mejor tipografía */
.navbar-brand {
    font-family: var(--font-family-primary);
    font-weight: 700;
    letter-spacing: 0.05em;
    font-size: 1.3rem;
}

/* Títulos de sección más elegantes */
.card-header h5 {
    font-weight: 600;
    letter-spacing: 0.03em;
    margin-bottom: 0;
}

/* Botones con mejor legibilidad */
.btn {
    font-family: var(--font-family-primary);
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: none;
}

.btn-sm {
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* Formularios con mejor jerarquía visual - OPTIMIZADO */
.form-label {
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    font-family: var(--font-family-primary);
    font-weight: 400;
    letter-spacing: 0.01em;
    font-size: 1.1rem; /* Reducido de 1.5rem para mejor usabilidad */
    padding: 0.75rem 1rem; /* Padding más generoso para compensar */
}

.form-control::placeholder {
    font-weight: 300;
    font-style: italic;
    letter-spacing: 0.01em;
    opacity: 0.7; /* Mejor contraste */
}

/* Tablas con mejor legibilidad - OPTIMIZADO */
.table {
    font-family: var(--font-family-primary);
    font-weight: 400;
    letter-spacing: 0.01em;
    font-size: 1.1rem; /* Reducido de 1.3rem para mejor balance */
}

.table th {
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 0.9rem; /* Ligeramente más grande para encabezados */
}

.table td {
    font-weight: 400;
    letter-spacing: 0.01em;
    vertical-align: middle; /* Mejor alineación vertical */
}

/* Toasts con tipografía mejorada */
.toast-header {
    font-family: var(--font-family-primary);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.toast-body {
    font-family: var(--font-family-primary);
    font-weight: 400;
    letter-spacing: 0.01em;
    line-height: 1.5;
}

/* Elementos de información */
.db-info h5 {
    font-weight: 700;
    letter-spacing: 0.03em;
}

.db-info p {
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* Badges y elementos pequeños */
.badge {
    font-family: var(--font-family-primary);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.small, small {
    font-family: var(--font-family-primary);
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* Elementos de navegación */
.nav-link {
    font-family: var(--font-family-primary);
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Modales con mejor jerarquía */
.modal-title {
    font-family: var(--font-family-primary);
    font-weight: 600;
    letter-spacing: 0.03em;
}

.modal-body {
    font-family: var(--font-family-primary);
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* Elementos de búsqueda */
.search-container .form-label {
    font-weight: 600;
    letter-spacing: 0.02em;
}

#searchResults {
    font-family: var(--font-family-primary);
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* Resaltado de búsqueda */
.search-highlight {
    font-family: var(--font-family-primary);
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* Mensajes de estado */
.text-muted {
    font-family: var(--font-family-primary);
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* Loading y spinners */
.loading p {
    font-family: var(--font-family-primary);
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Clases de utilidad para tipografía */
.text-display {
    font-weight: 700;
    letter-spacing: 0.03em;
}

.text-heading {
    font-weight: 600;
    letter-spacing: 0.02em;
}

.text-body {
    font-weight: 400;
    letter-spacing: 0.01em;
}

.text-caption {
    font-weight: 300;
    letter-spacing: 0.01em;
    font-size: 0.9rem;
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Clases de utilidad */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

.pulse {
    animation: pulse 2s infinite;
}

/* Mejoras para el área de upload */
.upload-area {
    border: 2px dashed #ccc;
    border-radius: 15px;
    padding: 50px 20px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.2);
}

/* Mejoras para las tarjetas de tabla */
.table-card {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.table-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.table-card .card-body {
    padding: 1.5rem;
}

.table-card .fa {
    transition: all 0.3s ease;
}

.table-card:hover .fa {
    transform: scale(1.2);
    color: var(--primary-color) !important;
}

/* Mejoras para la información de la base de datos */
.db-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.db-info h5 {
    margin-bottom: 15px;
    font-weight: 600;
}

.db-info .fa {
    margin-right: 8px;
}

/* Mejoras para la tabla de datos */
/* Contenedor de tabla con overflow controlado */
.table-container {
    max-height: 600px;
    overflow-y: auto;
    overflow-x: hidden; /* Evitar scroll horizontal */
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Tabla responsiva */
.table {
    margin-bottom: 0;
    width: 100%; /* Asegurar que la tabla use todo el ancho disponible */
}

.table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    border: none;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* SOLUCIÓN: Efectos hover sin desbordamiento */
.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.1) !important;
    /* REMOVIDO: transform: scale(1.01); - Causaba scroll horizontal */
    transition: all 0.2s ease;
    box-shadow: inset 0 0 10px rgba(0, 123, 255, 0.2); /* Sombra interna en su lugar */
}

/* Mejoras para botones de acción */
.record-actions {
    white-space: nowrap;
}

.record-actions .btn {
    margin: 0 2px;
    padding: 0.375rem 0.5rem;
    transition: all 0.2s ease;
}

.record-actions .btn:hover {
    transform: scale(1.1);
}

/* Mejoras para modales */
.modal-content {
    border: none;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 15px 15px 0 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    color: white;
}

.modal-header .btn-close {
    filter: invert(1);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0 0 15px 15px;
    background-color: #f8f9fa;
}

/* Mejoras para formularios */
.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    transform: translateY(-1px);
}

/* Mejoras para alertas */
.alert {
    border: none;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-out;
}

/* Loading indicator mejorado */
.loading {
    text-align: center;
    padding: 3rem;
}

.loading .spinner-border {
    width: 3rem;
    height: 3rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mejoras responsivas */
@media (max-width: 768px) {
    .upload-area {
        padding: 30px 15px;
    }
    
    .db-info {
        padding: 20px 15px;
    }
    
    .modal-dialog {
        margin: 1rem;
    }
    
    .table-container {
        max-height: 400px;
    }
    
    .record-actions .btn {
        padding: 0.25rem 0.4rem;
        font-size: 0.8rem;
    }
    
    .table {
        font-size: 0.9rem; /* Más pequeño en móviles */
    }
    
    .form-control, .form-select {
        font-size: 1rem; /* Tamaño estándar en móviles */
    }
}

/* Prevención de overflow horizontal global */
.container-fluid {
    overflow-x: hidden; /* Evitar scroll horizontal en el contenedor principal */
}

/* Tabla responsiva mejorada */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Scroll suave en móviles */
}

/* Asegurar que las animaciones no causen overflow */
.table tbody tr,
.table tbody tr:hover,
.table-success,
.table-danger,
.table-info {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Efectos de hover para navegación */
.navbar-nav .nav-link:hover {
    transform: translateY(-2px);
    transition: all 0.2s ease;
}

.btn-outline-light:hover {
    transform: scale(1.05);
    transition: all 0.2s ease;
}

/* Mejoras para estados de carga */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Scrollbar personalizado */
.table-container::-webkit-scrollbar {
    width: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Mejoras para el sistema de búsqueda */
.search-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-container .form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.search-container .form-select,
.search-container .form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.search-container .form-select:focus,
.search-container .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    transform: translateY(-1px);
}

.search-results-info {
    font-size: 0.9rem;
    padding: 0.5rem;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.8);
}

.search-highlight {
    background-color: #fff3cd;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-weight: bold;
}

/* Mejoras para botones de búsqueda */
.btn-group .btn {
    transition: all 0.2s ease;
}

.btn-group .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Animación para resultados de búsqueda */
@keyframes searchResult {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-result-row {
    animation: searchResult 0.3s ease-out;
}

/* Indicador de búsqueda activa */
.search-active {
    border-left: 4px solid var(--primary-color);
    background-color: rgba(0, 123, 255, 0.05);
}

/* === ANIMACIONES PARA OPERACIONES CRUD - CORREGIDAS === */

/* Animación para fila actualizada - SIN OVERFLOW */
.table-success {
    background-color: #d1e7dd !important;
    transition: background-color 0.3s ease;
    animation: updateFlash 0.6s ease-out;
}

@keyframes updateFlash {
    0% {
        background-color: #198754;
        box-shadow: inset 0 0 15px rgba(25, 135, 84, 0.5);
    }
    50% {
        background-color: #d1e7dd;
        box-shadow: inset 0 0 10px rgba(25, 135, 84, 0.3);
    }
    100% {
        background-color: #d1e7dd;
        box-shadow: none;
    }
}

/* Animación para fila que será eliminada - SIN OVERFLOW */
.table-danger {
    background-color: #f8d7da !important;
    transition: all 0.5s ease;
    animation: deleteFlash 0.8s ease-out;
}

@keyframes deleteFlash {
    0% {
        background-color: #dc3545;
        box-shadow: inset 0 0 15px rgba(220, 53, 69, 0.5);
    }
    25% {
        background-color: #f8d7da;
        box-shadow: inset 0 0 10px rgba(220, 53, 69, 0.3);
    }
    50% {
        background-color: #dc3545;
        box-shadow: inset 0 0 15px rgba(220, 53, 69, 0.5);
    }
    75% {
        background-color: #f8d7da;
        box-shadow: inset 0 0 10px rgba(220, 53, 69, 0.3);
    }
    100% {
        background-color: #f8d7da;
        box-shadow: none;
    }
}

/* Animación para nueva fila agregada - SIN OVERFLOW */
.table-info {
    background-color: #cff4fc !important;
    transition: background-color 0.3s ease;
    animation: addFlash 0.8s ease-out;
}

@keyframes addFlash {
    0% {
        background-color: #0dcaf0;
        opacity: 0;
        box-shadow: inset 0 0 15px rgba(13, 202, 240, 0.5);
    }
    50% {
        background-color: #cff4fc;
        opacity: 0.8;
        box-shadow: inset 0 0 10px rgba(13, 202, 240, 0.3);
    }
    100% {
        background-color: #cff4fc;
        opacity: 1;
        box-shadow: none;
    }
}

/* Efectos hover mejorados para filas */
.table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.1) !important;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Pulse effect para botones de acción */
.record-actions .btn {
    transition: all 0.2s ease;
}

.record-actions .btn:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.record-actions .btn:active {
    transform: scale(1.05);
    transition: all 0.1s ease;
}

/* Efectos de carga para botones */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    color: #fff;
}

/* Animación de slide para alertas */
.alert {
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === MEJORAS PARA FORMULARIOS DE EDICIÓN ===*/

/* Etiquetas para campos NULL */
.badge.bg-secondary {
    font-size: 0.65em;
    padding: 0.25em 0.5em;
}

/* Placeholder mejorado para campos NULL */
.form-control:placeholder-shown {
    font-style: italic;
}

/* Indicadores visuales para campos numéricos */
.form-text {
    font-size: 0.8em;
    margin-top: 0.25rem;
}

.form-text .fa-info-circle {
    color: #6c757d;
    margin-right: 0.25rem;
}

/* Resaltado para campos con valor 0 */
.form-control[value="0"] {
    background-color: #f8f9fa;
    border-left: 3px solid #28a745;
}

/* Estilos para campos con valores especiales */
.special-value-indicator {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 0.8em;
    pointer-events: none;
}

/* Mejoras para labels de formulario */
.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.form-label .badge {
    margin-left: auto;
}

/* Estilos específicos para diferentes tipos de datos */
.field-integer .form-control {
    text-align: right;
    font-family: 'Courier New', monospace;
}

.field-text .form-control {
    font-family: inherit;
}

/* Indicador visual para campos requeridos */
.required-field .form-label::after {
    content: ' *';
    color: #dc3545;
    font-weight: bold;
}

/* Animación para campos actualizados */
.field-updated {
    animation: fieldUpdate 0.6s ease-out;
}

@keyframes fieldUpdate {
    0% {
        background-color: #d1e7dd;
        transform: scale(1.02);
    }
    100% {
        background-color: transparent;
        transform: scale(1);
    }
}

/* Efectos de hover para mejor UX */
.form-control:hover:not(:focus) {
    border-color: #86b7fe;
    transition: border-color 0.15s ease-in-out;
}

/* Estilos para campos de solo lectura o deshabilitados */
.form-control:disabled,
.form-control[readonly] {
    background-color: #f8f9fa;
    opacity: 0.8;
}

/* Efectos de hover para navegación */
.navbar-nav .nav-link:hover {
    transform: translateY(-2px);
    transition: all 0.2s ease;
}

.btn-outline-light:hover {
    transform: scale(1.05);
    transition: all 0.2s ease;
}

/* Mejoras para estados de carga */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Scrollbar personalizado */
.table-container::-webkit-scrollbar {
    width: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Mejoras para el sistema de búsqueda */
.search-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-container .form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.search-container .form-select,
.search-container .form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.search-container .form-select:focus,
.search-container .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    transform: translateY(-1px);
}

.search-results-info {
    font-size: 0.9rem;
    padding: 0.5rem;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.8);
}

.search-highlight {
    background-color: #fff3cd;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-weight: bold;
}

/* Mejoras para botones de búsqueda */
.btn-group .btn {
    transition: all 0.2s ease;
}

.btn-group .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Animación para resultados de búsqueda */
@keyframes searchResult {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-result-row {
    animation: searchResult 0.3s ease-out;
}

/* Indicador de búsqueda activa */
.search-active {
    border-left: 4px solid var(--primary-color);
    background-color: rgba(0, 123, 255, 0.05);
}

/* === ANIMACIONES PARA OPERACIONES CRUD - CORREGIDAS === */

/* Animación para fila actualizada - SIN OVERFLOW */
.table-success {
    background-color: #d1e7dd !important;
    transition: background-color 0.3s ease;
    animation: updateFlash 0.6s ease-out;
}

@keyframes updateFlash {
    0% {
        background-color: #198754;
        box-shadow: inset 0 0 15px rgba(25, 135, 84, 0.5);
    }
    50% {
        background-color: #d1e7dd;
        box-shadow: inset 0 0 10px rgba(25, 135, 84, 0.3);
    }
    100% {
        background-color: #d1e7dd;
        box-shadow: none;
    }
}

/* Animación para fila que será eliminada - SIN OVERFLOW */
.table-danger {
    background-color: #f8d7da !important;
    transition: all 0.5s ease;
    animation: deleteFlash 0.8s ease-out;
}

@keyframes deleteFlash {
    0% {
        background-color: #dc3545;
        box-shadow: inset 0 0 15px rgba(220, 53, 69, 0.5);
    }
    25% {
        background-color: #f8d7da;
        box-shadow: inset 0 0 10px rgba(220, 53, 69, 0.3);
    }
    50% {
        background-color: #dc3545;
        box-shadow: inset 0 0 15px rgba(220, 53, 69, 0.5);
    }
    75% {
        background-color: #f8d7da;
        box-shadow: inset 0 0 10px rgba(220, 53, 69, 0.3);
    }
    100% {
        background-color: #f8d7da;
        box-shadow: none;
    }
}

/* Animación para nueva fila agregada - SIN OVERFLOW */
.table-info {
    background-color: #cff4fc !important;
    transition: background-color 0.3s ease;
    animation: addFlash 0.8s ease-out;
}

@keyframes addFlash {
    0% {
        background-color: #0dcaf0;
        opacity: 0;
        box-shadow: inset 0 0 15px rgba(13, 202, 240, 0.5);
    }
    50% {
        background-color: #cff4fc;
        opacity: 0.8;
        box-shadow: inset 0 0 10px rgba(13, 202, 240, 0.3);
    }
    100% {
        background-color: #cff4fc;
        opacity: 1;
        box-shadow: none;
    }
}

/* Efectos hover mejorados para filas */
.table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.1) !important;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Pulse effect para botones de acción */
.record-actions .btn {
    transition: all 0.2s ease;
}

.record-actions .btn:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.record-actions .btn:active {
    transform: scale(1.05);
    transition: all 0.1s ease;
}

/* Efectos de carga para botones */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    color: #fff;
}

/* Animación de slide para alertas */
.alert {
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === MEJORAS PARA FORMULARIOS DE EDICIÓN ===*/

/* Etiquetas para campos NULL */
.badge.bg-secondary {
    font-size: 0.65em;
    padding: 0.25em 0.5em;
}

/* Placeholder mejorado para campos NULL */
.form-control:placeholder-shown {
    font-style: italic;
}

/* Indicadores visuales para campos numéricos */
.form-text {
    font-size: 0.8em;
    margin-top: 0.25rem;
}

.form-text .fa-info-circle {
    color: #6c757d;
    margin-right: 0.25rem;
}

/* Resaltado para campos con valor 0 */
.form-control[value="0"] {
    background-color: #f8f9fa;
    border-left: 3px solid #28a745;
}

/* Estilos para campos con valores especiales */
.special-value-indicator {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 0.8em;
    pointer-events: none;
}

/* Mejoras para labels de formulario */
.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.form-label .badge {
    margin-left: auto;
}

/* Estilos específicos para diferentes tipos de datos */
.field-integer .form-control {
    text-align: right;
    font-family: 'Courier New', monospace;
}

.field-text .form-control {
    font-family: inherit;
}

/* Indicador visual para campos requeridos */
.required-field .form-label::after {
    content: ' *';
    color: #dc3545;
    font-weight: bold;
}

/* Animación para campos actualizados */
.field-updated {
    animation: fieldUpdate 0.6s ease-out;
}

@keyframes fieldUpdate {
    0% {
        background-color: #d1e7dd;
        transform: scale(1.02);
    }
    100% {
        background-color: transparent;
        transform: scale(1);
    }
}

/* Efectos de hover para mejor UX */
.form-control:hover:not(:focus) {
    border-color: #86b7fe;
    transition: border-color 0.15s ease-in-out;
}

/* Estilos para campos de solo lectura o deshabilitados */
.form-control:disabled,
.form-control[readonly] {
    background-color: #f8f9fa;
    opacity: 0.8;
}