/* Variables de colores */
:root {
    --primary-color: #4a90e2;
    --secondary-color: #7b68ee;
    --success-color: #5cb85c;
    --danger-color: #d9534f;
    --warning-color: #f0ad4e;
    --info-color: #5bc0de;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #5cb85c 0%, #4cae4c 100%);
}

/* Estilos generales */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

/* Navbar mejorada */
.navbar-custom {
    background: var(--gradient-primary);
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    padding: 1rem 0;
    border-bottom: 3px solid rgba(255,255,255,0.1);
}

.navbar-brand {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.5rem;
    color: white !important;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.navbar-brand:hover {
    transform: translateY(-2px);
}

.navbar-brand img {
    height: 40px;
    margin-right: 12px;
    border-radius: 8px;
    background: white;
    padding: 5px;
}

.navbar-nav .nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    margin: 0 10px;
    padding: 8px 16px !important;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

.navbar-nav .nav-link.active {
    background: rgba(255,255,255,0.3);
    color: white !important;
}

/* Header principal */
.header-main {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.header-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.15" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,138.7C960,139,1056,117,1152,96C1248,75,1344,53,1392,42.7L1440,32L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
}

.header-content {
    position: relative;
    z-index: 2;
    padding: 0.5rem 0;
}

.header-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

/* Cards mejorados */
.card-custom {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    margin-top: 1rem;
}

.card-custom:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.card-header-custom {
    background: var(--gradient-secondary);
    color: white;
    padding: 1.5rem;
    border: none;
    font-weight: 600;
    font-size: 1.2rem;
}

.card-body-custom {
    padding: 2rem;
}

/* Tabla mejorada */
.table-custom {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.table-custom thead {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.table-custom thead th {
    border: none;
    padding: 0.5rem 1rem;
    font-weight: 600;
    color: var(--dark-color);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

.table-custom tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid #f1f3f4;
}

.table-custom tbody tr:nth-child(even) {
    background-color: #f8f9fa !important;
}

.table-custom tbody tr:nth-child(odd) {
    background-color: #ffffff !important;
}

.table-custom tbody tr:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%) !important;
    transform: scale(1.01);
}

.table-custom tbody td {
    padding: 0.5rem 1rem;
    vertical-align: middle;
    border: none;
    font-size: 0.9rem;
    background-color: transparent !important;
}

/* Forzar colores de fila */
.table-custom tbody tr:nth-child(even) td {
    background-color: #f8f9fa !important;
}

.table-custom tbody tr:nth-child(odd) td {
    background-color: #ffffff !important;
}

/* Badges mejorados */
.badge-custom {
    padding: 0.35rem 0.75rem;
    border-radius: 15px;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-folio {
    background: var(--gradient-primary);
    color: white;
}

.badge-sexo-m {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.badge-sexo-f {
    background: linear-gradient(135deg, #ff69b4 0%, #ff1493 100%);
    color: white;
}

/* Contenedor principal */
.main-container {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

/* Botones mejorados */
.btn-custom {
    border-radius: 20px;
    padding: 0.4rem 1.2rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 0.8rem;
}

.btn-primary-custom {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-action-custom {
    background: linear-gradient(135deg, #4a90e2 0%, #357ab8 100%);
    border: 1px solid #357ab8;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(74, 158, 232, 0.2);
    border-radius: 6px;
    font-size: 0.875rem;
}

.btn-action-custom:hover {
    background: linear-gradient(135deg, #357ab8 0%, #2c7a7b 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(74, 158, 232, 0.3);
    color: white;
}

.btn-action-custom:focus {
    box-shadow: 0 0 0 0 3px rgba(74, 158, 232, 0.2);
    color: white;
}

.btn-edit-custom {
    background: linear-gradient(135deg, #28a745 0%, #1e6a09 100%);
    border: 1px solid #1e6a09;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
    border-radius: 6px;
    font-size: 0.875rem;
}

.btn-edit-custom:hover {
    background: linear-gradient(135deg, #1e6a09 0%, #28a745 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
    color: white;
}

.btn-edit-custom:focus {
    box-shadow: 0 0 0 0 3px rgba(40, 167, 69, 0.2);
    color: white;
}

.btn-history-custom {
    background: linear-gradient(135deg, #17a2b8 0%, #138236 100%);
    border: 1px solid #138236;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(23, 136, 118, 0.2);
    border-radius: 6px;
    font-size: 0.875rem;
}

.btn-history-custom:hover {
    background: linear-gradient(135deg, #138236 0%, #17a2b8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(23, 136, 118, 0.3);
    color: white;
}

.btn-history-custom:focus {
    box-shadow: 0 0 0 0 3px rgba(23, 136, 118, 0.2);
    color: white;
}

.btn-delete-custom {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border: 1px solid #c82333;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
    border-radius: 6px;
    font-size: 0.875rem;
}

.btn-delete-custom:hover {
    background: linear-gradient(135deg, #c82333 0%, #dc3545 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
    color: white;
}

.btn-delete-custom:focus {
    box-shadow: 0 0 0 0 3px rgba(220, 53, 69, 0.2);
    color: white;
}

.btn-action-custom:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(74, 158, 232, 0.2);
}

.btn-edit-custom:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(40, 167, 69, 0.2);
}

.btn-history-custom:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(23, 136, 118, 0.2);
}

.btn-delete-custom:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(220, 53, 69, 0.2);
}

/* Modal mejorado */
.modal-content-custom {
    border: none;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header-custom {
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 15px 15px 0 0;
    padding: 1.5rem;
}

.modal-title-custom {
    font-weight: 600;
    font-size: 1.3rem;
}

.form-control-custom {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control-custom:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.25);
}

.form-label-custom {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* Stats cards */
.stats-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 1rem;
}

.stats-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.stats-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stats-label {
    color: #6c757d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .header-title {
        font-size: 2rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .table-custom {
        font-size: 0.85rem;
    }
    
    .btn-action-custom {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
}

/* Loading spinner */
.spinner-custom {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Estilos adicionales para forzar colores de tabla */
.table tbody tr:nth-child(even) {
    background-color: #f8f9fa !important;
}

.table tbody tr:nth-child(odd) {
    background-color: #ffffff !important;
}

.table tbody tr:nth-child(even) td {
    background-color: #f8f9fa !important;
}

.table tbody tr:nth-child(odd) td {
    background-color: #ffffff !important;
}
