/**
 * Estilos específicos para el dashboard administrativo
 * Siguiendo el manual de estilo FMC
 */

/* === DASHBOARD PRINCIPAL === */
.admin-dashboard {
    background: var(--fmc-bg-secondary);
    min-height: calc(100vh - 200px);
}

.dashboard-header {
    background: var(--fmc-bg-primary);
    padding: var(--fmc-spacing-lg);
    margin-bottom: var(--fmc-spacing-lg);
    border-bottom: 1px solid var(--fmc-border-color);
    text-align: left;
}

.dashboard-header h1 {
    color: var(--fmc-primary);
    margin-bottom: var(--fmc-spacing-xs);
    font-weight: 600;
    font-size: var(--fmc-font-size-2xl);
}

.dashboard-header .subtitle {
    color: var(--fmc-text-secondary);
    font-size: var(--fmc-font-size-base);
    font-weight: 400;
    margin: 0;
}

/* === GRID DE ESTADÍSTICAS === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--fmc-spacing-lg);
    margin-bottom: var(--fmc-spacing-2xl);
}

.stat-card {
    background: var(--fmc-bg-primary);
    border-radius: var(--fmc-radius-md);
    padding: var(--fmc-spacing-xl);
    box-shadow: var(--fmc-shadow);
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border-left: 4px solid var(--fmc-primary);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(30, 58, 138, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--fmc-shadow-lg);
    border-left-color: var(--fmc-secondary);
}

.stat-card:nth-child(2) {
    border-left-color: var(--fmc-success);
}

.stat-card:nth-child(2):hover {
    border-left-color: var(--fmc-success);
}

.stat-card:nth-child(3) {
    border-left-color: var(--fmc-info);
}

.stat-card:nth-child(3):hover {
    border-left-color: var(--fmc-info);
}

.stat-card:nth-child(4) {
    border-left-color: var(--fmc-warning);
}

.stat-card:nth-child(4):hover {
    border-left-color: var(--fmc-warning);
}

.stat-icon {
    font-size: 2.5rem;
    margin-right: var(--fmc-spacing-lg);
    width: 60px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.stat-card:nth-child(1) .stat-icon {
    color: var(--fmc-primary);
}

.stat-card:nth-child(2) .stat-icon {
    color: var(--fmc-success);
}

.stat-card:nth-child(3) .stat-icon {
    color: var(--fmc-info);
}

.stat-card:nth-child(4) .stat-icon {
    color: var(--fmc-warning);
}

.stat-content {
    position: relative;
    z-index: 2;
}

.stat-content h3 {
    font-size: 2.5rem;
    margin: 0;
    color: var(--fmc-text-primary);
    font-weight: 700;
    line-height: 1;
}

.stat-content p {
    margin: var(--fmc-spacing-xs) 0 0 0;
    color: var(--fmc-text-secondary);
    font-weight: 500;
    font-size: var(--fmc-font-size-sm);
}

/* === ACCIONES RÁPIDAS === */
.quick-actions {
    margin-bottom: var(--fmc-spacing-2xl);
}

.quick-actions h2 {
    color: var(--fmc-text-primary);
    margin-bottom: var(--fmc-spacing-lg);
    font-size: var(--fmc-font-size-2xl);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--fmc-spacing-sm);
}

.quick-actions h2::before {
    content: '';
    width: 4px;
    height: 2rem;
    background: linear-gradient(135deg, var(--fmc-primary) 0%, var(--fmc-secondary) 100%);
    border-radius: var(--fmc-radius);
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--fmc-spacing-md);
}

.action-card {
    background: var(--fmc-bg-primary);
    border-radius: var(--fmc-radius-md);
    padding: var(--fmc-spacing-xl);
    text-align: center;
    text-decoration: none;
    color: var(--fmc-text-primary);
    box-shadow: var(--fmc-shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--fmc-border-color);
    position: relative;
    overflow: hidden;
}

.action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(30, 58, 138, 0.05), transparent);
    transition: left 0.5s ease;
}

.action-card:hover::before {
    left: 100%;
}

.action-card:hover {
    transform: translateY(-4px);
    color: var(--fmc-primary);
    text-decoration: none;
    box-shadow: var(--fmc-shadow-lg);
    border-color: var(--fmc-primary);
}

.action-card i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: var(--fmc-spacing-md);
    color: var(--fmc-primary);
    position: relative;
    z-index: 2;
}

.action-card span {
    font-weight: 500;
    font-size: var(--fmc-font-size-base);
    position: relative;
    z-index: 2;
}

/* === SECCIONES RECIENTES === */
.recent-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--fmc-spacing-xl);
}

.recent-users, .recent-mutuas {
    background: var(--fmc-bg-primary);
    border-radius: var(--fmc-radius-md);
    box-shadow: var(--fmc-shadow);
    overflow: hidden;
}

.recent-users h2, .recent-mutuas h2 {
    color: var(--fmc-text-primary);
    margin: 0;
    padding: var(--fmc-spacing-xl) var(--fmc-spacing-xl) var(--fmc-spacing-lg);
    border-bottom: 2px solid var(--fmc-border-light);
    font-size: var(--fmc-font-size-xl);
    font-weight: 600;
    background: var(--fmc-bg-secondary);
    display: flex;
    align-items: center;
    gap: var(--fmc-spacing-sm);
}

.recent-users h2::before {
    content: '\f0c0';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--fmc-primary);
}

.recent-mutuas h2::before {
    content: '\f1ad';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--fmc-info);
}

/* === TABLAS MEJORADAS === */
.table-container {
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.data-table th,
.data-table td {
    padding: var(--fmc-spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--fmc-border-light);
}

.data-table th {
    background-color: var(--fmc-bg-secondary);
    font-weight: 600;
    color: var(--fmc-text-primary);
    position: sticky;
    top: 0;
    font-size: var(--fmc-font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
}

.data-table tbody tr {
    transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
    background-color: var(--fmc-bg-secondary);
}

.table-footer {
    text-align: center;
    padding: var(--fmc-spacing-lg);
    background: var(--fmc-bg-secondary);
    border-top: 1px solid var(--fmc-border-light);
}

/* === BADGES MEJORADOS === */
.role-badge, .status-badge {
    padding: var(--fmc-spacing-xs) var(--fmc-spacing-sm);
    border-radius: var(--fmc-radius);
    font-size: var(--fmc-font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: var(--fmc-spacing-xs);
}

.role-admin {
    background-color: var(--fmc-danger);
    color: var(--fmc-text-light);
}

.role-usuario {
    background-color: var(--fmc-primary);
    color: var(--fmc-text-light);
}

.status-active {
    background-color: var(--fmc-success);
    color: var(--fmc-text-light);
}

.status-inactive {
    background-color: var(--fmc-text-secondary);
    color: var(--fmc-text-light);
}

/* === ESTADOS ESPECIALES === */
.no-data {
    text-align: center;
    color: var(--fmc-text-muted);
    font-style: italic;
    padding: var(--fmc-spacing-2xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--fmc-spacing-md);
}

.no-data::before {
    content: '\f05a';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 2rem;
    color: var(--fmc-text-muted);
}

.user-assigned {
    color: var(--fmc-success);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--fmc-spacing-xs);
}

.user-assigned::before {
    content: '\f007';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

.no-user {
    color: var(--fmc-warning);
    font-style: italic;
    display: flex;
    align-items: center;
    gap: var(--fmc-spacing-xs);
}

.no-user::before {
    content: '\f071';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

/* === HEADER ESTILO ADMIN === */
.fmc-header.admin-style {
    background: var(--fmc-bg-primary);
    border-bottom: 2px solid var(--fmc-primary);
    box-shadow: var(--fmc-shadow);
}

.fmc-header.admin-style .header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--fmc-spacing-md) 0;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: var(--fmc-spacing-lg);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--fmc-spacing-sm);
    padding: var(--fmc-spacing-sm) var(--fmc-spacing-md);
    color: var(--fmc-text-primary);
    text-decoration: none;
    border-radius: var(--fmc-radius);
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(44, 90, 160, 0.1), transparent);
    transition: left 0.5s ease;
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover {
    color: var(--fmc-primary);
    background-color: var(--fmc-bg-secondary);
    text-decoration: none;
    transform: translateY(-2px);
}

.nav-link.active {
    color: var(--fmc-primary);
    background-color: var(--fmc-bg-secondary);
    border: 1px solid var(--fmc-primary);
    box-shadow: 0 2px 4px rgba(44, 90, 160, 0.1);
}

.nav-link i {
    font-size: var(--fmc-font-size-base);
    width: 16px;
    text-align: center;
}

/* === RESPONSIVE NAVIGATION === */
@media (max-width: 991.98px) {
    .fmc-header.admin-style .header-content {
        flex-direction: column;
        gap: var(--fmc-spacing-md);
    }
    
    .main-nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: var(--fmc-spacing-sm);
    }
    
    .nav-link {
        font-size: var(--fmc-font-size-sm);
        padding: var(--fmc-spacing-xs) var(--fmc-spacing-sm);
    }
}

@media (max-width: 767.98px) {
    .main-nav {
        grid-template-columns: repeat(3, 1fr);
        display: grid;
        gap: var(--fmc-spacing-xs);
        width: 100%;
    }
    
    .nav-link {
        justify-content: center;
        text-align: center;
        font-size: var(--fmc-font-size-xs);
        padding: var(--fmc-spacing-xs);
    }
    
    .nav-link i {
        font-size: var(--fmc-font-size-sm);
    }
}

@media (max-width: 575.98px) {
    .main-nav {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .main-nav {
        grid-template-columns: 1fr;
    }
}

/* === RESPONSIVE === */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .actions-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 991.98px) {
    .admin-dashboard {
        padding: var(--fmc-spacing-lg);
    }
    
    .recent-section {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767.98px) {
    .dashboard-header {
        padding: var(--fmc-spacing-xl);
    }
    
    .dashboard-header h1 {
        font-size: var(--fmc-font-size-2xl);
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        margin-right: 0;
        margin-bottom: var(--fmc-spacing-md);
    }
}

@media (max-width: 575.98px) {
    .admin-dashboard {
        padding: var(--fmc-spacing-md);
    }
    
    .dashboard-header {
        padding: var(--fmc-spacing-lg);
    }
    
    .recent-users h2, .recent-mutuas h2 {
        padding: var(--fmc-spacing-lg);
        font-size: var(--fmc-font-size-lg);
    }
    
    .data-table th,
    .data-table td {
        padding: var(--fmc-spacing-sm);
        font-size: var(--fmc-font-size-sm);
    }
}

/* === ANIMACIONES === */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card {
    animation: slideInUp 0.6s ease-out;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

.action-card {
    animation: slideInUp 0.6s ease-out;
}

.action-card:nth-child(1) { animation-delay: 0.5s; }
.action-card:nth-child(2) { animation-delay: 0.6s; }
.action-card:nth-child(3) { animation-delay: 0.7s; }
.action-card:nth-child(4) { animation-delay: 0.8s; }
.action-card:nth-child(5) { animation-delay: 0.9s; }

/* === ACCESIBILIDAD === */
@media (prefers-reduced-motion: reduce) {
    .stat-card,
    .action-card {
        animation: none;
    }
    
    .stat-card:hover,
    .action-card:hover {
        transform: none;
    }
    
    .action-card::before {
        display: none;
    }
}