/* ========================================================
   ESTILOS INSTITUCIONALES - SISTEMA DE SUSTENTACIÓN Y RÚBRICA
   EESPP CHIMBOTE - UNIDAD DE INVESTIGACIÓN
   ======================================================== */

:root {
  /* Paleta oficial extraída del escudo institucional EESPPCH */
  --primary: #1E3A6D;          /* Azul marino / Real del borde y letras EESPPCH */
  --primary-dark: #122547;     /* Azul profundo */
  --primary-light: #2A5395;    /* Azul medio */
  --gold-accent: #F5D033;      /* Amarillo dorado del escudo y sol */
  --gold-light: #FEF9E7;       /* Crema dorada suave */
  --tree-green: #529F44;       /* Verde pedagógico del árbol del saber */
  --tree-light: #EBF7E7;       /* Verde suave */
  --ocean-blue: #5B9AD5;       /* Azul olas marinas de Chimbote */
  
  --bg-main: #F4F7FC;          /* Fondo suave */
  --card-bg: #FFFFFF;
  --text-main: #1A2840;
  --text-muted: #5C6E87;
  --border: #CCD8EC;
  --border-dark: #8FA6C8;
  
  /* Badges y Programas */
  --fid-color: #1E3A6D;
  --fid-bg: #E8F0FC;
  --ppd-color: #6D28D9;
  --ppd-bg: #EDE9FE;

  /* Niveles de desempeño */
  --lvl-exc-bg: #1D559E;
  --lvl-mb-bg: #2E8B57;
  --lvl-b-bg: #C6881A;
  --lvl-reg-bg: #C95D22;
  --lvl-def-bg: #B72727;

  /* Resumen columnas */
  --inv1-color: #D97706;
  --inv1-bg: #FEF3C7;
  --inv2-color: #059669;
  --inv2-bg: #D1FAE5;
  --inv3-color: #2563EB;
  --inv3-bg: #DBEAFE;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.45;
  padding: 14px 10px;
}

.container {
  max-width: 1440px;
  margin: 0 auto;
  background: var(--card-bg);
  padding: 24px 28px;
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
}

/* ========================================================
   NAVEGACIÓN SUPERIOR ENTRE MÓDULOS
   ======================================================== */
.app-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: linear-gradient(135deg, #1E3A6D 0%, #122547 100%);
  border-bottom: 3px solid var(--gold-accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: 6px;
  margin-bottom: 20px;
  box-shadow: 0 4px 10px rgba(30, 58, 109, 0.15);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-mini-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25));
}

.brand-badge {
  background: var(--gold-accent);
  color: #122547;
  font-size: 11px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.brand-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.nav-right-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-session-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid #10b981;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 11.5px;
  color: #a7f3d0;
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 6px #10b981;
}

.btn-logout {
  background: transparent;
  border: none;
  color: #fca5a5;
  font-size: 10.5px;
  text-decoration: underline;
  cursor: pointer;
  margin-left: 4px;
}

.btn-logout:hover {
  color: #fee2e2;
}

.nav-tabs {
  display: flex;
  gap: 6px;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.tab-btn.active {
  background: #ffffff;
  color: #0f2d42;
  font-weight: 700;
}

/* Paneles de vista */
.view-panel {
  display: none;
}
.view-panel.active {
  display: block;
}

/* ========================================================
   MODAL DE ACCESO A ADMINISTRACIÓN
   ======================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.modal-card {
  background: #ffffff;
  border-radius: 8px;
  width: 100%;
  max-width: 420px;
  padding: 24px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border);
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 12px;
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 800;
  color: #0f2d42;
}

.btn-close-modal {
  background: none;
  border: none;
  font-size: 18px;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
}

.btn-close-modal:hover {
  color: #0f172a;
}

/* ========================================================
   PORTAL DE ACCESO DEL JURADO (LOGIN CON CLAVE ÚNICA)
   ======================================================== */
.jury-login-card {
  max-width: 540px;
  margin: 30px auto;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px 36px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.login-logo-circle {
  width: 92px;
  height: 92px;
  background: #FFFDF0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
  border: 3px solid var(--gold-accent);
  box-shadow: 0 6px 16px rgba(245, 208, 51, 0.3);
}

.login-logo-img {
  width: 78px;
  height: 78px;
  object-fit: contain;
}

.jury-login-header h2 {
  font-size: 18px;
  font-weight: 800;
  color: #0f2d42;
  margin-bottom: 6px;
}

.jury-login-header p {
  font-size: 12.5px;
  color: #64748b;
  margin-bottom: 22px;
  line-height: 1.4;
}

.jury-login-form {
  text-align: left;
}

.input-key-code {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 16px !important;
  font-weight: 800 !important;
  letter-spacing: 1.5px;
  text-align: center;
  text-transform: uppercase;
  color: #0f2d42 !important;
  background: #f8fafc !important;
  border: 2px solid #94a3b8 !important;
}

.input-key-code:focus {
  border-color: #0284c7 !important;
  background: #ffffff !important;
}

.field-help {
  display: block;
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
}

.btn-block {
  width: 100%;
  justify-content: center;
  margin-top: 14px;
}

.btn-lg {
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 700;
}

.alert-error {
  background: #fee2e2;
  border: 1px solid #f87171;
  color: #991b1b;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  margin-bottom: 12px;
}

.jury-login-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
  font-size: 11.5px;
  color: #64748b;
}

/* ========================================================
   ÁREA DE ADMINISTRACIÓN
   ======================================================== */
.admin-header-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: linear-gradient(135deg, #1b4965 0%, #0f2d42 100%);
  color: #ffffff;
  padding: 16px 22px;
  border-radius: 6px;
  margin-bottom: 20px;
}

.admin-title h2 { font-size: 17px; font-weight: 800; margin-bottom: 4px; }
.admin-title p { font-size: 11.5px; opacity: 0.85; }

.admin-quick-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-pill {
  background: rgba(255, 255, 255, 0.15);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-pill strong { font-size: 13.5px; font-weight: 800; }
.stat-pill.fid-stat { border: 1px solid #60a5fa; background: rgba(37, 99, 235, 0.25); }
.stat-pill.ppd-stat { border: 1px solid #c084fc; background: rgba(124, 58, 237, 0.25); }

/* ========================================================
   SUB-PESTAÑAS DE ADMINISTRACIÓN
   ======================================================== */
.admin-subtabs-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 4px;
}

.subtab-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 700;
  color: #475569;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.subtab-btn:hover {
  background: #e2e8f0;
  color: #0f2d42;
}

.subtab-btn.active {
  background: #0f2d42;
  color: #ffffff;
  border-color: #0f2d42;
}

.subtab-content {
  display: none;
}

.subtab-content.active {
  display: block;
}

.select-dropdown {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 7px 10px;
  font-size: 12px;
  width: 100%;
}

.card-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.card-title-bar {
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
}

.card-title-bar h3 {
  font-size: 13px;
  font-weight: 700;
  color: #0f2d42;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-card form { padding: 16px 20px; }

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 10px;
}

.form-group.span-2 { grid-column: span 2; }

.form-group label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 3px;
}

.form-group .req { color: #dc2626; }

.form-group input, .form-group select {
  width: 100%;
  padding: 6px 9px;
  font-size: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  outline: none;
  background: #fff;
  transition: border-color 0.15s;
}

.form-group input:focus, .form-group select:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.select-highlight {
  font-weight: 700;
  background: #f0fdf4 !important;
  color: #166534 !important;
}

.sub-form-block {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.sub-form-block h4 {
  font-size: 11px;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.form-actions-bar {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

/* Tabla de administración */
.list-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.list-controls-bar h3 { font-size: 13.5px; font-weight: 800; color: #0f2d42; }

.search-filter-box { display: flex; gap: 8px; }
.search-filter-box input {
  padding: 5px 10px;
  font-size: 11.5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  width: 240px;
}

.search-filter-box select {
  padding: 5px 8px;
  font-size: 11.5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  font-weight: 600;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.admin-table th {
  background: #0f2d42;
  color: #fff;
  padding: 7px 8px;
  text-align: left;
  font-weight: 700;
  font-size: 10.5px;
  text-transform: uppercase;
}

.admin-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.admin-table tr:hover td { background: #f8fafc; }

.cell-key-box {
  background: #f8fafc;
  border: 1px dashed #0284c7;
  padding: 4px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-weight: 700;
  font-size: 11.5px;
  color: #0369a1;
  display: inline-block;
  margin-bottom: 4px;
}

.btn-copy-link, .btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  margin-right: 2px;
}

.btn-copy-link:hover { background: #f1f5f9; border-color: #0284c7; color: #0284c7; }
.btn-whatsapp { border-color: #86efac; color: #15803d; }
.btn-whatsapp:hover { background: #f0fdf4; }

.badge-tipo {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 8px;
}

.badge-tipo.badge-fid { background: var(--fid-bg); color: var(--fid-color); border: 1px solid #93c5fd; }
.badge-tipo.badge-ppd { background: var(--ppd-bg); color: var(--ppd-color); border: 1px solid #c4b5fd; }

.badge-status {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 8px;
}

.badge-status.st-pendiente { background: #fef3c7; color: #92400e; }
.badge-status.st-evaluando { background: #e0f2fe; color: #0369a1; }
.badge-status.st-evaluada { background: #d1fae5; color: #065f46; }

.tbl-actions { display: flex; gap: 4px; }
.btn-sm {
  padding: 3px 6px;
  font-size: 10.5px;
  font-weight: 600;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.btn-sm-eval { background: #0284c7; color: #fff; }
.btn-sm-eval:hover { background: #0369a1; }
.btn-sm-edit { background: #e2e8f0; color: #334155; }
.btn-sm-edit:hover { background: #cbd5e1; }
.btn-sm-del { background: #fee2e2; color: #dc2626; }
.btn-sm-del:hover { background: #fca5a5; }

/* ========================================================
   BARRA DE ACCIÓN SUPERIOR DE LA RÚBRICA
   ======================================================== */
.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: #f1f5f9;
  padding: 8px 14px;
  border-radius: 6px;
  margin-bottom: 18px;
  border: 1px solid #e2e8f0;
}

.thesis-assigned-tag {
  font-size: 12px;
  font-weight: 700;
  color: #0f2d42;
  background: #e2e8f0;
  padding: 3px 8px;
  border-radius: 4px;
}

.time-schedule-tag {
  font-size: 11px;
  font-weight: 700;
  color: #15803d;
  background: #dcfce7;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid #86efac;
}

.action-info { display: flex; align-items: center; gap: 8px; }
.badge-vps {
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 10px;
}

.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: #059669; color: #fff; }
.btn-success:hover { background: #047857; }
.btn-secondary { background: #475569; color: #fff; }
.btn-secondary:hover { background: #334155; }
.btn-outline { background: transparent; color: #334155; border-color: #cbd5e1; }
.btn-outline:hover { background: #f8fafc; }
.btn-outline-danger { background: transparent; color: #dc2626; border-color: #fca5a5; }
.btn-outline-danger:hover { background: #fef2f2; border-color: #dc2626; }

/* ========================================================
   ENCABEZADO INSTITUCIONAL
   ======================================================== */
.institutional-header {
  display: grid;
  grid-template-columns: 280px 1fr 210px;
  align-items: center;
  gap: 14px;
  border-bottom: 3px solid var(--primary);
  padding: 12px 18px;
  margin-bottom: 18px;
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFD 100%);
  border-radius: 8px;
  border-left: 5px solid var(--gold-accent);
  box-shadow: 0 2px 8px rgba(30, 58, 109, 0.06);
}

.logo-box { display: flex; align-items: center; gap: 12px; }
.header-logo-img {
  width: 66px;
  height: 66px;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(30, 58, 109, 0.2));
}
.inst-text h2 { font-size: 12px; font-weight: 800; color: var(--primary); line-height: 1.2; }
.inst-text small { font-size: 9px; color: var(--text-muted); }

.rubric-main-title { text-align: center; }
.rubric-main-title h1 {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.2px;
  line-height: 1.35;
  margin-bottom: 4px;
}

.prog-badge-container { display: flex; justify-content: center; gap: 8px; }
.program-tag {
  display: inline-block;
  background: var(--fid-bg);
  color: var(--fid-color);
  border: 1px solid #93c5fd;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
}

.clave-tag-display {
  display: inline-block;
  background: #f8fafc;
  color: #0f2d42;
  border: 1px dashed #94a3b8;
  font-family: monospace;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.logo-right { justify-content: flex-end; }
.inst-unit { display: flex; align-items: center; gap: 6px; }
.unit-title { font-size: 11px; font-weight: 800; color: var(--primary); text-align: right; line-height: 1.2; }

/* ========================================================
   METADATOS Y FORMULARIO
   ======================================================== */
.meta-section { margin-bottom: 18px; }
.meta-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.meta-table td { border: 1px solid var(--border-dark); padding: 4px 7px; vertical-align: middle; }
.meta-table .lbl { background: #f1f5f9; font-weight: 700; color: #334155; width: 150px; }
.meta-table .val input {
  width: 100%;
  border: 1px solid transparent;
  padding: 3px 5px;
  font-size: 11px;
  border-radius: 3px;
  outline: none;
  background: #fff;
}

.meta-table .val input:focus { border-color: var(--secondary); background: #f8fafc; }
.input-readonly { background: #f8fafc !important; color: #1e293b; cursor: default; }
.investigators-header-row td.lbl { background: #e2e8f0; }

/* ========================================================
   TABLAS DE RÚBRICA Y RESUMEN
   ======================================================== */
.section-title-bar {
  background: linear-gradient(90deg, #1E3A6D 0%, #2A5395 100%);
  color: #fff;
  padding: 6px 12px;
  border-radius: 4px 4px 0 0;
  margin-top: 14px;
  border-left: 4px solid var(--gold-accent);
}

.section-title-bar h2 { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.3px; }
.table-responsive { width: 100%; overflow-x: auto; margin-bottom: 18px; }
.rubric-table, .summary-table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.rubric-table th, .rubric-table td, .summary-table th, .summary-table td {
  border: 1px solid #94a3b8;
  padding: 4px 4px;
  vertical-align: middle;
}

.rubric-table thead th { background: #1E3A6D; color: #ffffff; font-size: 10.5px; font-weight: 700; text-align: center; }
.sub-headers th { font-size: 9px; }
.sub-headers .range { font-size: 8px; font-weight: 500; opacity: 0.9; }

.th-criterio { width: 12%; }
.th-desc { width: 17%; }
.lvl-col { width: 10.5%; }
.eval-inv-th { width: 6%; }

.lvl-exc { background: #1D559E !important; }
.lvl-mb { background: #2E8B57 !important; }
.lvl-b { background: #C6881A !important; }
.lvl-reg { background: #C95D22 !important; }
.lvl-def { background: #B72727 !important; }

.crit-name-cell { font-weight: 700; color: #0f2d42; background: #f8fafc; }
.crit-desc-cell { font-size: 9.5px; color: #334155; text-align: justify; line-height: 1.25; }
.lvl-desc-cell {
  font-size: 9px;
  color: #1e293b;
  text-align: justify;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.15s;
}

.lvl-desc-cell:hover { background-color: #f1f5f9; }
.eval-input-cell { text-align: center; background: #fff; padding: 2px; }
.score-input {
  width: 42px;
  padding: 4px 2px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  outline: none;
  transition: all 0.15s;
}

.score-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(27, 73, 101, 0.2); }
.score-input.invalid-score { border-color: #ef4444; background: #fee2e2; }

/* Tabla Resumen Ponderada */
.summary-bar { background: #0f2d42; }
.th-expositores { background: #1e293b; color: #fff; font-size: 11px; text-align: center; }
.th-inv-hdr { font-size: 11px; font-weight: 800; text-align: center; }
.inv-hdr-1 { background: #fef3c7; color: #92400e; }
.inv-hdr-2 { background: #d1fae5; color: #065f46; }
.inv-hdr-3 { background: #dbeafe; color: #1e40af; }

.summary-sub-row th { background: #f1f5f9; color: #334155; font-size: 10px; font-weight: 700; text-align: center; }
.col-crit-name { width: 34%; text-align: left !important; }
.col-peso { width: 8%; text-align: center; }
.col-puntaje { width: 8%; text-align: center; }
.col-calif { width: 10%; text-align: center; }

.summary-crit-lbl { font-weight: 600; color: #1e293b; font-size: 10px; }
.summary-peso-val, .summary-score-val { text-align: center; font-weight: 600; font-size: 11px; }
.summary-calif-val { text-align: center; font-weight: 700; font-size: 11px; color: #0f172a; }
.cell-inv1-val { background: #fffbeb; }
.cell-inv2-val { background: #f0fdf4; }
.cell-inv3-val { background: #eff6ff; }

/* Totales */
.footer-total-row td { font-weight: 800; font-size: 12px; padding: 6px 4px; }
.lbl-total-ponderado { text-align: center; background: #f8fafc; }
.val-peso-total { text-align: center; background: #e2e8f0; }
.lbl-prom { text-align: center; background: #f1f5f9; text-transform: uppercase; }
.val-prom { text-align: center; font-size: 13.5px; }

.prom-box-1 { background: #f59e0b !important; color: #ffffff; }
.prom-box-2 { background: #10b981 !important; color: #ffffff; }
.prom-box-3 { background: #2563eb !important; color: #ffffff; }

.footer-condicion-row td { padding: 6px 4px; font-weight: 800; text-align: center; font-size: 11px; }
.lbl-condicion { text-align: right; background: #f8fafc; }
.val-condicion { font-size: 11px; letter-spacing: 0.5px; }
.cond-aprobado { color: #047857; background: #ecfdf5; }
.cond-desaprobado { color: #b91c1c; background: #fef2f2; }

/* Observaciones y firmas */
.signatures-section { margin-top: 18px; }
.observations-box { margin-bottom: 20px; }
.observations-box label { display: block; font-size: 10.5px; font-weight: 700; margin-bottom: 4px; color: #334155; }
.observations-box textarea {
  width: 100%;
  border: 1px solid var(--border-dark);
  border-radius: 4px;
  padding: 5px;
  font-size: 11px;
  font-family: inherit;
  outline: none;
  resize: vertical;
}

.signature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 32px;
  padding-bottom: 12px;
}

.sign-card { text-align: center; }
.sign-line { border-bottom: 1.5px solid #000; width: 80%; margin: 0 auto 5px auto; }
.sign-name { font-size: 10.5px; font-weight: 700; color: #0f172a; }
.sign-role { font-size: 9px; color: #64748b; }
.doc-footer { text-align: center; margin-top: 18px; font-size: 10px; color: #94a3b8; border-top: 1px solid #e2e8f0; padding-top: 8px; }

/* ========================================================
   REGLAS PARA IMPRESIÓN Y PDF (@media print)
   ======================================================== */
@media print {
  body { background: #fff; padding: 0; font-size: 8.5pt; }
  .container { max-width: 100%; box-shadow: none; border: none; padding: 0; margin: 0; }
  .no-print, .no-print-section { display: none !important; }
  #viewRubric { display: block !important; }
  .institutional-header { margin-bottom: 4px; padding-bottom: 4px; }
  .meta-table td { padding: 2px 3px; font-size: 8pt; }
  .meta-table input { border: none !important; background: transparent !important; padding: 0 !important; font-size: 8pt; }
  .rubric-table, .summary-table { font-size: 7pt; }
  .rubric-table th, .rubric-table td, .summary-table th, .summary-table td { padding: 2px 2px; }
  .crit-desc-cell, .lvl-desc-cell { font-size: 6.5pt; line-height: 1.1; }
  .score-input { border: none !important; background: transparent !important; font-size: 8.5pt; }
  .signature-grid { margin-top: 30px; page-break-inside: avoid; }
  .summary-section { page-break-inside: avoid; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}

@media (max-width: 900px) {
  .institutional-header { grid-template-columns: 1fr; text-align: center; }
  .logo-box { justify-content: center; }
  .unit-title { text-align: center; }
  .signature-grid { grid-template-columns: 1fr; gap: 16px; }
  .form-grid-3 { grid-template-columns: 1fr; }
  .form-group.span-2 { grid-column: span 1; }
  .app-nav { flex-direction: column; align-items: stretch; gap: 10px; }
  .nav-right-controls { justify-content: space-between; }
}
