@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap');

/* Reglas Globales y Login */
body { font-family: 'Open Sans', sans-serif; background-color: #f8f9fa; margin: 0; padding: 0; color: #333; }
body.login-page { background: #f4f7f6; display: flex; justify-content: center; align-items: center; height: 100vh; padding: 15px; box-sizing: border-box; }
.login { background: white; padding: 30px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); width: 100%; max-width: 400px; box-sizing: border-box; }
.login input, .login button { width: 100%; padding: 14px; margin-bottom: 15px; box-sizing: border-box; border-radius: 4px; border: 1px solid #ccc; font-size: 15px; font-family: 'Open Sans', sans-serif; }
.login button { background: #002244; color: white; font-weight: bold; cursor: pointer; border: none; }

/* Dashboard Nav */
.navbar, .nav { background: #002244; color: white; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 5px rgba(0,0,0,0.2); flex-wrap: wrap; gap: 10px; }
.nav-links { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.nav-links a { color: #ccc; text-decoration: none; margin-right: 15px; font-weight: bold; transition: 0.3s; font-size: 14px; }
.nav-links a:hover, .nav-links a.active { color: white; border-bottom: 2px solid #28a745; padding-bottom: 5px; }
.btn-logout { color: white; font-weight: bold; background: #dc3545; padding: 8px 12px; border-radius: 4px; text-decoration: none; }
.btn-volver { background: #ffc107; color: #000 !important; text-decoration: none; padding: 6px 12px; border-radius: 4px; font-weight: bold; font-size: 0.85em; border: none; }

/* Componentes del Dashboard */
.container { max-width: 1200px; margin: 20px auto; padding: 0 15px; box-sizing: border-box; }
.card { background: white; padding: 20px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.1); margin-bottom: 20px; overflow-x: hidden; box-sizing: border-box; }
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid #dee2e6; border-radius: 4px; }
table { width: 100%; border-collapse: collapse; min-width: 600px; font-size: 0.9em; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid #dee2e6; }
th { background-color: #e9ecef; font-weight: bold; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: bold; font-size: 14px; }
.form-control { width: 100%; padding: 10px; border: 1px solid #ced4da; border-radius: 4px; box-sizing: border-box; font-family: 'Open Sans', sans-serif; }
.btn { padding: 10px 15px; border-radius: 4px; text-decoration: none; color: white; font-weight: bold; background: #28a745; border: none; cursor: pointer; display: inline-block; }
.btn-primary { background: #0056b3; color: white; border: none; padding: 10px 20px; cursor: pointer; border-radius: 4px; font-weight: bold; font-family: 'Open Sans', sans-serif; }
.btn-danger { background: #dc3545; color: white; padding: 6px 10px; border-radius: 4px; font-size: 0.85em; text-decoration: none; display: inline-block; }
.btn-warning { background: #ffc107; color: #212529; padding: 6px 10px; border-radius: 4px; font-size: 0.85em; text-decoration: none; display: inline-block; }
.btn-pdf { background: #6c757d; color: white; padding: 6px 10px; border-radius: 4px; font-size: 0.85em; text-decoration: none; display: inline-block; }
.alert { background: #d4edda; color: #155724; padding: 15px; border-radius: 4px; margin-bottom: 20px; border-left: 4px solid #28a745; }
.toggle-switch { display: flex; align-items: center; gap: 10px; background: #e9ecef; padding: 12px; border-radius: 4px; margin-bottom: 15px; }
.flex-form { display: flex; gap: 15px; flex-wrap: wrap; align-items: flex-end; }
.flex-form > div { flex: 1 1 200px; width: 100%; }
.grid-grupos { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-opciones { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; }

@media (max-width: 768px) {
    .navbar, .nav { flex-direction: column; text-align: center; }
    .nav-links { justify-content: center; }
    .flex-form, .grid-opciones, .grid-grupos { grid-template-columns: 1fr; flex-direction: column; align-items: stretch; }
    .flex-form button, .flex-form input { width: 100%; box-sizing: border-box; }
}

/* Modo Reporte PDF */
body.pdf-page { background-color: #525659; display: flex; flex-direction: column; align-items: center; }
.certificado-container { background: white; width: 21.59cm; min-height: 26cm; padding: 20px; box-sizing: border-box; position: relative; margin-bottom: 20px; box-shadow: 0 0 20px rgba(0,0,0,0.5); }
.borde-oficial { border: 2px solid #000; padding: 30px; height: 24.5cm; box-sizing: border-box; display: flex; flex-direction: column; justify-content: space-between; }
.borde-anexo { border: 2px solid #000; padding: 30px; min-height: 24.5cm; box-sizing: border-box; }
.encabezado-institucional { text-align: center; margin-bottom: 20px; line-height: 1.4; }
.encabezado-institucional h1 { margin: 0; font-size: 22px; text-transform: uppercase; font-weight: 700; color: #000; }
.encabezado-institucional h2 { margin: 5px 0 0 0; font-size: 16px; font-weight: 600; color: #333; }
.titulo-reporte { text-align: center; font-size: 18px; border-bottom: 1px solid #000; padding-bottom: 10px; margin-top: 15px; font-weight: 700; }
.info-estudiante { margin-top: 20px; font-size: 16px; line-height: 1.8; }
.resultados-box { margin-top: 25px; border: 1px solid #000; padding: 20px; background: #fafafa; text-align: center; }
.nota-final { font-size: 46px; font-weight: 700; margin: 10px 0; }
.sello { font-size: 24px; font-weight: 700; border: 3px solid; padding: 6px 15px; display: inline-block; transform: rotate(-5deg); margin-top: 15px; letter-spacing: 2px; }
.footer { text-align: center; font-size: 11px; color: #555; border-top: 1px dashed #ccc; padding-top: 10px; margin-top: 15px; }
.salto-pagina { page-break-before: always; }
.detalle-pregunta { margin-bottom: 18px; font-size: 14px; line-height: 1.5; border-bottom: 1px solid #dee2e6; padding-bottom: 15px; }
.detalle-justificacion { background: #f8f9fa; padding: 12px; border-left: 4px solid #002244; margin-top: 8px; color: #333; font-style: italic; font-size: 13.5px; }
.btn-imprimir { background: #0056b3; color: white; padding: 15px 30px; border: none; font-size: 18px; cursor: pointer; border-radius: 5px; position: fixed; top: 20px; right: 20px; font-weight: 600; z-index: 1000; }
@media print { 
    @page { size: letter portrait; margin: 1cm; } 
    body.pdf-page { background: white; padding: 0; } 
    .btn-imprimir { display: none !important; } 
    .certificado-container { margin-bottom: 0 !important; box-shadow: none !important; } 
}