:root {
    --primary-color: #003876;
    --primary-dark: #002855;
    --primary-light: #004a9e;
    --secondary-color: #003876;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --border-color: #dee2e6;
    --institutional-blue: #003876;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

html {
    font-size: 13px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 14px;
    }
}

body {
    margin: 0;
    background: #ffffff;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
}

main {
    padding-top: 1rem;
}

/* Navbar Institucional */
.bg-gradient-primary {
    background: var(--institutional-blue) !important;
    box-shadow: var(--shadow-md);
    border-bottom: 3px solid var(--primary-light);
}

.navbar-brand img {
    filter: brightness(0) invert(1); /* Hace el logo blanco para que se vea en el navbar azul */
    transition: opacity 0.3s ease;
}

.navbar-brand:hover img {
    opacity: 0.9;
}

.navbar-brand {
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.navbar-brand:hover {
    transform: scale(1.02);
}

.nav-link {
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border-radius: 6px;
    margin: 0 2px;
    padding: 6px 12px !important;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Cards Institucionales */
.card-modern {
    background: white;
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card-modern:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.card-header-modern {
     color: var(--institutional-blue);
    padding: 0.75rem 1rem;
    border: none;
    font-weight: 600;
    font-size: 0.9rem;
 }

/* Botones Institucionales */
.btn-modern {
    border-radius: 15px;
    padding: 6px 16px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    border: none;
}

.btn-modern:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 8px 20px;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--institutional-blue);
    color: white;
    border: 1px solid var(--primary-dark);
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
    border-color: var(--primary-dark);
}

.btn-success {
    background: var(--success-color);
    color: white;
    border: 1px solid #218838;
}

.btn-success:hover {
    background: #218838;
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    border: 1px solid #c82333;
}

.btn-danger:hover {
    background: #c82333;
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: #212529;
    border: 1px solid #e0a800;
}

.btn-warning:hover {
    background: #e0a800;
    color: #212529;
}

.btn-info {
    background: var(--info-color);
    color: white;
    border: 1px solid #138496;
}

.btn-info:hover {
    background: #138496;
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: 1px solid #5a6268;
}

.btn-secondary:hover {
    background: #5a6268;
    color: white;
}

/* Tablas Institucionales */
.table-modern {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.table-modern thead {
/*    background: var(--institutional-blue);*/
    color: white;
    border-bottom: 3px solid var(--primary-light);
}

.table-modern thead th {
    border: none;
    padding: 0.6rem 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.3px;
}

.table-modern tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.table-modern tbody tr:hover {
    background-color: #e7f1ff;
    border-left: 2px solid var(--institutional-blue);
}

.table-modern tbody td {
    padding: 0.6rem 0.75rem;
    vertical-align: middle;
    font-size: 0.875rem;
}

/* Badges Institucionales */
.badge {
    padding: 4px 8px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.7rem;
    border: 1px solid transparent;
}

.bg-success {
    background: var(--success-color) !important;
    border-color: #218838 !important;
}

.bg-danger {
    background: var(--danger-color) !important;
    border-color: #c82333 !important;
}

.bg-warning {
    background: var(--warning-color) !important;
    border-color: #e0a800 !important;
    color: #212529 !important;
}

.bg-primary {
    background: var(--institutional-blue) !important;
    border-color: var(--primary-dark) !important;
}

.bg-secondary {
    background: #6c757d !important;
    border-color: #5a6268 !important;
}

/* Formularios Institucionales */
.form-control {
    border-radius: 4px;
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--institutional-blue);
    box-shadow: 0 0 0 0.2rem rgba(0, 56, 118, 0.25);
    outline: none;
}

.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--dark-color);
    margin-bottom: 6px;
}

.form-select {
    border-radius: 4px;
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.form-select:focus {
    border-color: var(--institutional-blue);
    box-shadow: 0 0 0 0.2rem rgba(0, 56, 118, 0.25);
    outline: none;
}

/* Alertas Institucionales */
.alert {
    border-radius: 4px;
    border-left: 3px solid;
    box-shadow: var(--shadow-sm);
    padding: 0.75rem 1rem;
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left-color: var(--success-color);
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left-color: var(--danger-color);
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left-color: var(--warning-color);
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: var(--info-color);
}

/* Footer Institucional */
.footer-modern {
    background: var(--institutional-blue);
    color: white;
    padding: 1rem 0;
    margin-top: auto;
    box-shadow: 0 -4px 6px -1px rgb(0 0 0 / 0.1);
    border-top: 2px solid var(--primary-light);
    font-size: 0.85rem;
}

.footer-modern a {
    color: #b3d4fc;
    transition: color 0.3s ease;
}

.footer-modern a:hover {
    color: white;
}

/* Página de Inicio */
.hero-section {
    background: var(--institutional-blue);
    border-radius: 6px;
    padding: 2rem 1.5rem;
    color: white;
    text-align: center;
    box-shadow: var(--shadow-md);
    margin: 1.5rem 0;
    border: 1px solid var(--primary-light);
}

.hero-section h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-section p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    opacity: 0.95;
}

/* Cards de Acción */
.action-card {
    background: white;
    border-radius: 6px;
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    height: 100%;
}

.action-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--institutional-blue);
    transform: translateY(-2px);
}

.action-card i {
    font-size: 2rem;
    color: var(--institutional-blue);
    margin-bottom: 0.75rem;
}

.action-card h3 {
    color: var(--institutional-blue);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.action-card p {
    color: #6c757d;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Estadísticas */
.stats-card {
    background: white;
    border-radius: 6px;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    border-left: 3px solid var(--primary-color);
}

.stats-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--institutional-blue);
    margin: 0;
}

.stats-card p {
    color: #6b7280;
    font-size: 0.85rem;
    margin: 0.5rem 0 0 0;
    font-weight: 600;
}

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

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Espaciado Compacto */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 0.75rem;
}

h1 {
    font-size: 1.75rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.1rem;
}

h5 {
    font-size: 1rem;
}

.card-body {
    padding: 1rem;
}

.card-header {
    padding: 0.75rem 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 1.5rem;
    }
    
    .hero-section p {
        font-size: 0.9rem;
    }
    
    .action-card {
        margin-bottom: 1rem;
    }
    
    html {
        font-size: 13px;
    }
}

/* Focus States */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 56, 118, 0.25);
}

/* Scrollbar Moderno */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--institutional-blue);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Estilos para Filtros de Tabla */
.card-header-modern .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.card-header-modern .form-control,
.card-header-modern .form-select {
    border-radius: 4px;
    border: 1px solid gray;
    background: rgba(255, 255, 255, 0.95);
    padding: 5px 10px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

    .card-header-modern .form-control:focus,
    .card-header-modern .form-select:focus {
        border-color: gray;
        background: white;
        box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.3);
        outline: none;
    }

.card-header-modern .btn-light {
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 4px 10px;
    transition: all 0.3s ease;
}

.card-header-modern .btn-light:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Filtros por Columna */
.filter-column {
    border-radius: 4px;
    border: 1px solid var(--border-color);
    padding: 3px 6px;
    font-size: 0.7rem;
    transition: all 0.2s ease;
    background: white;
}

.filter-column:focus {
    border-color: var(--institutional-blue);
    box-shadow: 0 0 0 0.15rem rgba(0, 56, 118, 0.25);
    outline: none;
}

.table-modern thead th {
    position: relative;
}

.table-modern thead th .filter-column {
    width: 100%;
    margin-top: 8px;
}

/* Contador de Resultados */
#resultadosContador {
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
}

#resultadosContador strong {
    font-size: 0.95rem;
    margin: 0 4px;
}

/* Mensaje Sin Resultados */
#noResults {
    padding: 3rem 1rem;
}

#noResults i {
    opacity: 0.5;
}

/* Animación para filas */
.table-modern tbody tr {
    transition: all 0.2s ease;
}

.table-modern tbody tr:not(:visible) {
    display: none !important;
}
