/* ============================================
   Estilos globales para paneles de GridView
   Diseño unificado del sistema de becas
   ============================================ */

/* Panel principal */
.panel-primary {
    border: none !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    border-radius: 8px;
}

/* Encabezado del panel (barra con título e ícono) */
.panel-heading {
    background: linear-gradient(135deg, #17355B 0%, #1e4a7a 100%) !important;
    border: none !important;
    border-radius: 8px 8px 0 0 !important;
    padding: 12px 15px !important;
}
.panel-heading h3,
.panel-heading .panel-title {
    margin: 0;
    font-weight: 600;
    color: #fff;
}
.panel-heading .glyphicon,
.panel-heading i.glyphicon {
    margin-right: 6px;
}

/* Cuerpo del panel */
.panel-body {
    border-radius: 0 0 8px 8px;
}

/* Footer del panel */
.panel-footer {
    border-radius: 0 0 8px 8px !important;
    background: #f8f9fa !important;
    border-top: 1px solid #e9ecef !important;
}

/* ============================================
   Botones de toolbar del GridView
   ============================================ */

/* Normalizar TODOS los botones del toolbar a la misma altura */
.kv-grid-toolbar .btn {
    padding: 7px 12px;
    font-size: 13px;
    border-radius: 6px;
    vertical-align: middle;
    line-height: 1.5;
}

/* Botón crear (acción principal) */
.btn-crear {
    background: linear-gradient(135deg, #17355B 0%, #1e4a7a 100%);
    border: none;
    color: #fff;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(23,53,91,0.30);
    margin-right: 4px;
}
.btn-crear:hover {
    background: linear-gradient(135deg, #1e4a7a 0%, #17355B 100%);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(23,53,91,0.40);
}
.btn-crear:focus {
    color: #fff;
    outline: none;
}

/* Botón reset / secundario */
.btn-reset {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    color: #17355B;
    font-weight: 600;
    transition: all 0.2s ease;
    margin-right: 4px;
}
.btn-reset:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    color: #17355B;
    transform: translateY(-1px);
}
.btn-reset:focus {
    color: #17355B;
    outline: none;
}

/* Botones default del toolbar (toggleData, export, etc.) */
.kv-grid-toolbar .btn-default {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    color: #17355B;
    font-weight: 600;
    transition: all 0.2s ease;
    margin-right: 4px;
}
.kv-grid-toolbar .btn-default:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    color: #17355B;
    transform: translateY(-1px);
}
.kv-grid-toolbar .btn-default:focus {
    color: #17355B;
    outline: none;
}

/* ============================================
   Botones de modal (Cerrar, Guardar, Editar)
   ============================================ */

/* Botón Cerrar */
.btn-modal-cerrar {
    background-color: #F0F0F0;
    color: #384152;
    border: none;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.2s ease;
}
.btn-modal-cerrar:hover {
    background-color: #e2e2e2;
    color: #384152;
}
.btn-modal-cerrar:focus {
    outline: none;
    color: #384152;
}

/* Botón Guardar (submit) */
.btn-modal-guardar {
    background: linear-gradient(135deg, #17355B 0%, #1e4a7a 100%);
    color: #fff;
    border: none;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(23,53,91,0.35);
}
.btn-modal-guardar:hover {
    background: linear-gradient(135deg, #1e4a7a 0%, #17355B 100%);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(23,53,91,0.45);
}
.btn-modal-guardar:focus {
    outline: none;
    color: #fff;
}

/* Botón Editar (link modal-remote) */
.btn-modal-editar {
    background: linear-gradient(135deg, #17355B 0%, #1e4a7a 100%);
    color: #fff;
    border: none;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(23,53,91,0.35);
}
.btn-modal-editar:hover {
    background: linear-gradient(135deg, #1e4a7a 0%, #17355B 100%);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(23,53,91,0.45);
    text-decoration: none;
}
.btn-modal-editar:focus {
    outline: none;
    color: #fff;
    text-decoration: none;
}

/* ============================================
   Campos de solo lectura (view)
   ============================================ */

/* Campo de formulario deshabilitado visualmente */
.form-control-readonly {
    background-color: #eee;
    cursor: not-allowed;
}

/* Último grupo de formulario sin margen inferior */
.form-group-last {
    margin-bottom: 0;
}

/* ============================================
   Íconos de estado
   ============================================ */

/* Ícono de éxito (verde) */
.icon-success {
    color: #70ad47;
}

/* Ícono de error (rojo) */
.icon-error {
    color: #d9534f;
}

/* ============================================
   Tablas y listas de validación (modales)
   ============================================ */

/* Tabla de validación en modales */
.table-validacion {
    margin-bottom: 10px;
    background: #fff;
}

/* Celda de encabezado de validación */
.table-validacion > tbody > tr > th,
.th-validacion-label {
    width: 32%;
    background: #F5F7FA;
    color: #17355B;
}

/* Lista de validación - estilos base mejorados */
.list-group-validacion {
    margin-bottom: 0;
    border-radius: 0;
}

/* Ítems de lista de validación - ahora se definen en la sección de Novedades */

/* ============================================
   Alertas de contrato (modales generar contrato)
   ============================================ */

/* Contenedor de error de contrato */
.alert-contrato-error {
    background-color: #FDF2F2;
    border-left: 6px solid #d9534f;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 14px;
    color: #d9534f;
}

/* Contenedor del detalle de errores */
.error-details-box {
    white-space: pre-wrap;
    background: #FFF;
    border: 1px solid #EEE;
    border-radius: 10px;
    padding: 10px 12px;
    margin-top: 10px;
    color: #333;
}

/* Cada línea de error individual */
.error-list-item {
    padding: 4px 0;
}

/* Alerta de confirmación de contrato */
.alert-contrato-confirmar {
    background-color: #F9FAFB;
    border-left: 6px solid #17355B;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 14px;
    color: #17355B;
}

/* Tabla resumen de contrato */
.table-resumen-contrato {
    margin-bottom: 0;
}
.table-resumen-contrato > tbody > tr > td:first-child {
    width: 120px;
}

/* Texto con color primario oscuro */
.text-primary-dark {
    color: #17355B;
}

/* Caja de resumen de datos */
.resumen-datos-box {
    background: #F9FAFB;
    padding: 12px;
    border-radius: 10px;
}

/* Utilidades de espaciado */
.mt-xs {
    margin-top: 4px;
}
.mb-xs {
    margin-bottom: 8px;
}
.mt-sm {
    margin-top: 8px;
}
.mt-md {
    margin-top: 12px;
}
.mt-lg {
    margin-top: 14px;
}

/* Alerta de éxito (pago registrado) */
.alert-pago-exito {
    background-color: #d4edda;
    border-left: 6px solid #28a745;
    border-radius: 10px;
    padding: 12px 16px;
    color: #155724;
}

/* Alerta de éxito (contrato generado) */
.alert-contrato-exito {
    background-color: #F9FAFB;
    border-left: 6px solid #5cb85c;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 14px;
    color: #155724;
}

/* ============================================
   Novedades (header y detalle) - Estilo mejorado
   ============================================ */

/* Contenedor general de novedades */
.novedades-contenido {
    margin-top: 16px;
}

/* Contenedor principal de novedades (alerta roja) */
.novedades-header {
    background-color: #FDF2F2;
    border-left: 6px solid #dc3545;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
    color: #9F1D1D;
}

.novedades-header strong {
    font-size: 16px;
    display: inline;
    margin-bottom: 6px;
}

.novedades-header .mt-xs {
    font-size: 14px;
    color: #666;
    margin-top: 4px;
}

/* Contenedor de novedades en OK (sin bloqueo) */
.novedades-header-ok {
    background-color: #d4edda;
    border-left: 6px solid #28a745;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
    color: #155724;
}

.novedades-header-ok strong {
    font-size: 16px;
    display: inline;
    margin-bottom: 6px;
}

/* Resumen de información del estudiante - Estilo Expediente */
.novedades-resumen-estudiante {
    background: linear-gradient(135deg, #17355B 0%, #234773 100%);
    color: #fff;
    padding: 20px 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    box-shadow: 0 4px 15px rgba(23, 53, 91, 0.3);
}

.novedades-resumen-estudiante .info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
}

.novedades-resumen-estudiante .info-label {
    font-size: 11px;
    text-transform: uppercase;
    opacity: 0.85;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.novedades-resumen-estudiante .info-label .glyphicon {
    font-size: 10px;
    opacity: 0.7;
}

.novedades-resumen-estudiante .info-value {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

/* Título de sección de novedades */
.novedades-seccion-titulo {
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    background-color: #17355B;
    padding: 12px 16px;
    border-radius: 10px 10px 0 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.novedades-seccion-titulo .glyphicon {
    font-size: 14px;
}

/* Sección individual de novedades */
.novedades-seccion {
    margin-bottom: 16px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
    border: 1px solid #E5EAF0;
}

/* Body de la sección */
.novedades-seccion-body {
    padding: 0;
}

/* Tabla dentro de sección de novedades */
.novedades-seccion .table-validacion {
    margin-bottom: 0;
    background: #fff;
    border: none;
}

.novedades-seccion .table-validacion > tbody > tr > th,
.novedades-seccion .table-validacion > tbody > tr > td {
    padding: 12px 16px;
    border-color: #F0F0F0;
    vertical-align: middle;
    border-left: none;
    border-right: none;
}

.novedades-seccion .table-validacion > tbody > tr:first-child > th,
.novedades-seccion .table-validacion > tbody > tr:first-child > td {
    border-top: none;
}

.novedades-seccion .table-validacion > tbody > tr:last-child > th,
.novedades-seccion .table-validacion > tbody > tr:last-child > td {
    border-bottom: none;
}

.novedades-seccion .th-validacion-label {
    width: 160px;
    font-weight: 600;
    color: #17355B;
    background: #F8F9FB !important;
    font-size: 13px;
}

.novedades-seccion .table-validacion > tbody > tr > td {
    color: #384152;
    font-size: 14px;
    font-weight: 500;
}

/* Lista de validación mejorada */
.list-group-validacion {
    margin-bottom: 0;
    border-radius: 0;
    padding: 0;
}

.list-group-validacion .list-group-item {
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding: 12px 16px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.list-group-validacion .list-group-item:first-child {
    border-top: 1px solid #F0F0F0;
}

.list-group-validacion .list-group-item:last-child {
    border-bottom: none;
}

/* Íconos en items de lista */
.list-group-validacion .list-group-item::before {
    font-family: 'Glyphicons Halflings', sans-serif;
    font-size: 12px;
    flex-shrink: 0;
}

/* Ítems de lista de validación con estilos mejorados */
.list-group-item-validacion-danger {
    background: #FDF2F2;
    color: #9F1D1D;
    border-color: #F5C2C7 !important;
}

.list-group-item-validacion-danger::before {
    content: '\e014'; /* glyphicon-remove */
    color: #dc3545;
}

.list-group-item-validacion-warning {
    background: #FFF8E6;
    color: #8A5A00;
    border-color: #F2D08A !important;
}

.list-group-item-validacion-warning::before {
    content: '\e101'; /* glyphicon-alert */
    color: #ffc107;
}

.list-group-item-validacion-muted {
    background: #F0FFF4;
    color: #276749;
    border-color: #C6F6D5 !important;
}

.list-group-item-validacion-muted::before {
    content: '\e013'; /* glyphicon-ok */
    color: #28a745;
}

.list-group-item-validacion-info {
    background: #F5F7FA;
    color: #384152;
    border-color: #E5EAF0 !important;
}

.list-group-item-validacion-info::before {
    content: '\e086'; /* glyphicon-info-sign */
    color: #17355B;
}

/* Badge de alerta en novedades */
.novedades-badge-alerta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #dc3545;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.novedades-badge-ok {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #28a745;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

/* Pagos pendientes destacados */
.novedades-pagos-pendientes {
    background: #FFF8E6;
    border: 2px dashed #ffc107;
    border-radius: 12px;
    padding: 16px 20px;
    margin-top: 8px;
}

.novedades-pagos-pendientes .titulo {
    font-weight: 700;
    color: #8A5A00;
    font-size: 15px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.novedades-pagos-pendientes .titulo .glyphicon {
    font-size: 16px;
    color: #ffc107;
}

.novedades-pagos-pendientes .pago-item {
    background: #fff;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    border: 1px solid #F2D08A;
}

.novedades-pagos-pendientes .pago-item:last-child {
    margin-bottom: 0;
}

.novedades-pagos-pendientes .pago-orden {
    font-weight: 600;
    color: #384152;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.novedades-pagos-pendientes .pago-orden .glyphicon {
    color: #8A5A00;
}

.novedades-pagos-pendientes .pago-valor {
    font-weight: 700;
    color: #dc3545;
    font-size: 16px;
    background: #FDF2F2;
    padding: 6px 12px;
    border-radius: 6px;
}

