/* ============================================
   ESTILOS GLOBALES DEL SISTEMA
   ============================================ */

/* --- Variables Globales --- */
:root {
    --primary-color: #002855;
    --primary-hover: #003d7a;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-bg: #f0f2f5;
    --card-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    --border-radius: 10px;
    --transition-speed: 0.3s;
}

/* --- Reset y Base --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light-bg);
    color: #333;
    line-height: 1.6;
}

/* --- Scrollbar Personalizada --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

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

/* --- Tarjetas y Contenedores --- */
.card-custom {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed);
}

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

/* --- Tablas Mejoradas --- */
.table-custom {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.table-custom thead th {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 15px 20px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table-custom tbody td {
    padding: 12px 20px;
    vertical-align: middle;
    border-bottom: 1px solid #e9ecef;
}

.table-custom tbody tr:hover {
    background: rgba(0, 40, 85, 0.03);
}

.table-custom tbody tr:last-child td {
    border-bottom: none;
}

/* --- Badges Personalizados --- */
.badge-custom {
    padding: 6px 15px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.8rem;
}

.badge-active {
    background: #d4edda;
    color: #155724;
}

.badge-inactive {
    background: #f8d7da;
    color: #721c24;
}

.badge-pending {
    background: #fff3cd;
    color: #856404;
}

/* --- Botones Personalizados --- */
.btn-custom-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: all var(--transition-speed);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-custom-primary:hover {
    background: var(--primary-hover);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 40, 85, 0.3);
}

.btn-custom-danger {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: all var(--transition-speed);
}

.btn-custom-danger:hover {
    background: #c82333;
    color: white;
    transform: translateY(-2px);
}

.btn-custom-success {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: all var(--transition-speed);
}

.btn-custom-success:hover {
    background: #218838;
    color: white;
    transform: translateY(-2px);
}

/* --- Campos de Formulario --- */
.form-control-custom {
    border-radius: var(--border-radius);
    border: 2px solid #e0e0e0;
    padding: 12px 15px;
    transition: all var(--transition-speed);
    width: 100%;
}

.form-control-custom:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 40, 85, 0.25);
    outline: none;
}

.form-control-custom.error {
    border-color: var(--danger-color);
}

.form-control-custom.success {
    border-color: var(--success-color);
}

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

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

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

.slide-in {
    animation: slideIn 0.3s ease forwards;
}

/* --- Estados de Carga --- */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 40, 85, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 0.8s ease infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- Notificaciones Toast --- */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast-custom {
    background: white;
    padding: 15px 25px;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease forwards;
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid var(--primary-color);
}

.toast-custom.success {
    border-left-color: var(--success-color);
}

.toast-custom.error {
    border-left-color: var(--danger-color);
}

.toast-custom.warning {
    border-left-color: var(--warning-color);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* --- Medidor de Fuerza de Contraseña --- */
.password-strength-bar {
    height: 4px;
    border-radius: 2px;
    margin-top: 8px;
    transition: all 0.3s ease;
    background: #e0e0e0;
}

.password-strength-bar.weak {
    width: 33%;
    background: var(--danger-color);
}

.password-strength-bar.medium {
    width: 66%;
    background: var(--warning-color);
}

.password-strength-bar.strong {
    width: 100%;
    background: var(--success-color);
}

.password-strength-text {
    font-size: 0.8rem;
    margin-top: 4px;
}

.password-strength-text.weak {
    color: var(--danger-color);
}

.password-strength-text.medium {
    color: var(--warning-color);
}

.password-strength-text.strong {
    color: var(--success-color);
}

/* --- Avatar --- */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    background: var(--primary-color);
}

.avatar-sm {
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
}

.avatar-lg {
    width: 60px;
    height: 60px;
    font-size: 1.8rem;
}

/* --- Filtros y Búsqueda --- */
.filter-badge {
    background: #e9ecef;
    color: #333;
    padding: 6px 15px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.filter-badge .remove {
    cursor: pointer;
    color: var(--danger-color);
    font-weight: bold;
}

.filter-badge .remove:hover {
    color: #c82333;
}

/* --- Estados Vacíos --- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 4rem;
    color: #ccc;
    margin-bottom: 20px;
}

.empty-state h5 {
    color: #666;
    margin-bottom: 10px;
}

.empty-state p {
    color: #999;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .table-custom {
        font-size: 0.85rem;
    }
    
    .table-custom thead th,
    .table-custom tbody td {
        padding: 10px 12px;
    }
    
    .card-custom {
        padding: 15px;
    }
    
    .toast-container {
        left: 20px;
        right: 20px;
    }
    
    .toast-custom {
        min-width: auto;
        width: 100%;
    }
}

/* --- Utilidades --- */
.text-primary-custom {
    color: var(--primary-color);
}

.bg-primary-custom {
    background: var(--primary-color);
}

.border-primary-custom {
    border-color: var(--primary-color);
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}

.cursor-pointer {
    cursor: pointer;
}

.text-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}