/* ============================================
   SIGEC26 - Estilos Globales
   ============================================ */

:root {
    --primary-color: #667eea;
    --primary-dark: #5a6fd6;
    --primary-light: #e8e4ff;
    --secondary-color: #764ba2;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --dark-color: #1a1a2e;
    --light-color: #f5f7fa;
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition: all 0.3s ease;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--light-color);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: var(--white);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
    color: var(--gray-800);
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
}

.btn-danger {
    background: var(--danger-color);
    color: var(--white);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    padding: 6px 10px;
    font-size: 14px;
    color: var(--primary-color);
    background: transparent;
}

.btn-icon:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 20px;
    white-space: nowrap;
}

.badge-inscripciones_abiertas { background: #d4edda; color: #155724; }
.badge-proximo_lanzamiento { background: #fff3cd; color: #856404; }
.badge-ultimos_cupos { background: #ffe5e5; color: #c41e3a; }
.badge-inscripciones_cerradas { background: #e2e3e5; color: #383d41; }
.badge-en_curso { background: #d1ecf1; color: #0c5460; }
.badge-finalizado { background: #f8f9fa; color: #6c757d; }

/* Alertas */
.alert {
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Tarjetas */
.content-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 25px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.card-header h3 {
    margin: 0;
    color: var(--gray-800);
    font-size: 16px;
}

.card-body {
    padding: 25px;
}

/* Tablas */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.data-table th {
    background: var(--gray-100);
    color: var(--gray-600);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
}

.data-table tr:hover {
    background: var(--gray-50);
}

/* Utilidades */
.text-center { text-align: center; }
.text-muted { color: var(--gray-500); }
.mb-3 { margin-bottom: 1rem; }
.mt-3 { margin-top: 1rem; }

/* ============================================
   SIGEC26 - Componentes Adicionales para Forms
   ============================================ */

/* Badges de modalidad */
.badge-modalidad-online { background: #e3f2fd; color: #1976d2; }
.badge-modalidad-presencial { background: #e8f5e9; color: #388e3c; }
.badge-modalidad-hibrido { background: #fff3e0; color: #f57c00; }

/* Badges de rol de usuario */
.badge-rol-administrador { background: #667eea; color: #fff; }
.badge-rol-ejecutivo_ventas { background: #28a745; color: #fff; }
.badge-rol-solo_lectura { background: #6c757d; color: #fff; }

/* Badges de estado de usuario */
.badge-estado-activo { background: #d4edda; color: #155724; }
.badge-estado-inactivo { background: #e2e3e5; color: #383d41; }
.badge-estado-suspendido { background: #f8d7da; color: #721c24; }

/* User cell en tablas */
.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

/* Empty state mejorado */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--gray-500);
}

.empty-state i {
    font-size: 56px;
    margin-bottom: 20px;
    display: block;
    color: var(--gray-300);
    opacity: 0.7;
}

.empty-state p {
    margin: 0 0 20px 0;
    font-size: 15px;
}

/* Detail rows para vistas de detalle */
.detail-body {
    padding: 15px 20px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--gray-500);
    font-weight: 500;
    font-size: 13px;
    flex: 0 0 40%;
}

.detail-row span:last-child {
    color: var(--gray-800);
    font-weight: 500;
    text-align: right;
    flex: 1;
}

/* Course detail grid */
.course-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

/* Precio con descuento */
.price-display {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.price-promo {
    color: var(--success-color);
    font-weight: 700;
    font-size: 18px;
}

.price-normal {
    color: var(--gray-400);
    text-decoration: line-through;
    font-size: 14px;
}

/* Logs info */
.logs-info {
    margin-top: 15px;
    padding: 12px 18px;
    background: var(--primary-light);
    border-radius: var(--border-radius);
    color: var(--primary-dark);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logs-info i {
    font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .detail-label {
        flex: auto;
        text-align: left;
    }
    
    .detail-row span:last-child {
        text-align: left;
        width: 100%;
    }
    
    .course-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .price-display {
        flex-direction: column;
        align-items: flex-start;
    }
}