* { box-sizing: border-box; }

body {
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  margin: 0;
  background: #f4f5f7;
  color: #1c1c1e;
}

.login-box {
  max-width: 380px;
  margin: 10vh auto;
  background: #fff;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.login-box h1 { margin-bottom: 0.25rem; font-size: 1.4rem; }
.subtitulo { color: #6b7280; font-size: 0.9rem; margin-top: 0; }

form label { display: block; margin-top: 1rem; font-size: 0.85rem; color: #374151; }
form input {
  width: 100%;
  padding: 0.55rem;
  margin-top: 0.25rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.95rem;
}

/* Los checkboxes NUNCA deben heredar el width:100% de arriba — es la causa
   raíz de que las casillas de "No aplica" y las de 6.1 se vieran corridas. */
input[type="checkbox"] {
  width: auto;
  min-width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
  accent-color: #7c2d12;
}

button {
  margin-top: 1.5rem;
  width: 100%;
  padding: 0.6rem;
  background: #7c2d12;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
}
button:hover { opacity: 0.9; }

.error { color: #b91c1c; font-size: 0.85rem; }
.ayuda { font-size: 0.8rem; color: #9ca3af; margin-top: 1.5rem; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.link-button {
  background: none;
  border: none;
  color: #6b7280;
  width: auto;
  margin: 0;
  cursor: pointer;
  font-size: 0.85rem;
}

.contenido { max-width: 700px; margin: 2rem auto; padding: 0 1.5rem; }
.nota { color: #6b7280; font-size: 0.9rem; }
.ok { color: #15803d; background: #f0fdf4; padding: 0.6rem 0.9rem; border-radius: 6px; font-size: 0.9rem; }

.lista-secciones { list-style: none; padding: 0; }
.lista-secciones li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}
.lista-secciones li.completa { border-color: #86efac; background: #f0fdf4; }
.lista-secciones a { text-decoration: none; color: #1c1c1e; font-size: 0.95rem; }
.lista-secciones .avance { font-size: 0.8rem; color: #9ca3af; }

.paso-indicador { font-size: 0.8rem; color: #9ca3af; margin-bottom: 0; }

.campo-caja {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1.1rem;
  margin-bottom: 1rem;
}
.campo-caja-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.campo-caja label { font-size: 0.9rem; font-weight: 600; display: block; margin-bottom: 2px; }
.ayuda-campo {
  font-size: 0.8rem;
  color: #6b7280;
  margin: 2px 0 10px;
  font-style: italic;
  padding-left: 8px;
  border-left: 2px solid #e5e7eb;
}

.campo-contenido, .caja-justificacion textarea {
  width: 100%;
  min-height: 70px;
  padding: 0.55rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
}

.toggle-no-aplica {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 4px 10px 4px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.toggle-no-aplica label {
  display: inline;
  font-size: 0.78rem;
  font-weight: 400;
  color: #6b7280;
  margin: 0;
}

.caja-justificacion { margin-top: 8px; }
.caja-justificacion label { font-size: 0.8rem; color: #b91c1c; display: block; margin-bottom: 4px; }

.caja-fuente { margin-top: 12px; border-top: 1px dashed #e5e7eb; padding-top: 10px; }
.caja-fuente > label { font-size: 0.8rem; color: #374151; font-weight: 500; }
.caja-fuente-obligatoria {
  border-top: none;
  margin-top: 12px;
  padding: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
}
.aviso-fuente { font-size: 0.78rem; color: #92400e; margin: 2px 0 8px; font-weight: 500; }
.fila-fuente { display: flex; gap: 8px; margin-top: 6px; }
.fila-fuente select, .fila-fuente input {
  flex: 1;
  padding: 0.45rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.85rem;
  width: auto;
}

.paso-flujo { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.paso-num { font-size: 0.85rem; color: #9ca3af; width: 20px; flex-shrink: 0; }
.paso-flujo input { flex: 1; padding: 0.45rem; border: 1px solid #d1d5db; border-radius: 6px; font-size: 0.85rem; width: auto; }

.lista-checklist { display: flex; flex-direction: column; gap: 2px; }
.fila-checklist {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
}
.fila-checklist:hover { background: #f9fafb; }
.fila-checklist input[type="checkbox"] { margin-top: 2px; }
.fila-checklist label {
  display: inline;
  font-size: 0.88rem;
  font-weight: 400;
  color: #1c1c1e;
  margin: 0;
  line-height: 1.4;
}

.caja-intro {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
  color: #1e40af;
}
.caja-intro p { margin: 0 0 8px; }
.caja-intro .link-button { color: #1e40af; font-size: 0.78rem; padding: 0; }

.grupo-repetible {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.25rem;
  background: #fafafa;
}
.grupo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.grupo-numero { font-size: 0.85rem; font-weight: 600; color: #7c2d12; text-transform: uppercase; letter-spacing: 0.02em; }
.grupo-header .link-button { color: #b91c1c; font-size: 0.78rem; }

.campo-select {
  width: 100%;
  padding: 0.55rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
}

.actividad-fija {
  background: #f3f4f6;
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  color: #374151;
  margin: 0;
}

.opciones-si-no { display: flex; gap: 12px; margin-top: 10px; }
.opcion-radio {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.88rem;
  cursor: pointer;
}
.opcion-radio input { width: auto; margin: 0; }

.acciones-form { display: flex; justify-content: space-between; align-items: center; margin-top: 1.5rem; }
.acciones-form button { width: auto; padding: 0.6rem 1.5rem; }

.secundario {
  background: none;
  border: 1px solid #d1d5db;
  color: #374151;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.85rem;
  cursor: pointer;
}

.caja-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: #b91c1c;
}
.caja-error ul { margin: 4px 0 0; padding-left: 1.1rem; }

.contenido-ancho { max-width: 950px; }

.tabla-admin { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
.tabla-admin th, .tabla-admin td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.88rem;
}
.tabla-admin th { color: #6b7280; font-weight: 500; font-size: 0.8rem; }
.col-area { color: #6b7280; }
.col-acciones a { color: #7c2d12; text-decoration: none; font-size: 0.85rem; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
}
.badge-sin_iniciar { background: #f3f4f6; color: #6b7280; }
.badge-en_captura { background: #e0e7ff; color: #4338ca; }
.badge-enviado { background: #fef3c7; color: #92400e; }
.badge-observado { background: #fee2e2; color: #b91c1c; }
.badge-validado { background: #dcfce7; color: #15803d; }

.documento-texto {
  width: 100%;
  min-height: 420px;
  font-family: "SF Mono", Consolas, monospace;
  font-size: 0.82rem;
  padding: 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  white-space: pre;
}

.caja-observar { margin-top: 1.5rem; }
.form-observar textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.6rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.88rem;
  margin: 6px 0 10px;
}
.boton-observar { background: #b91c1c; width: auto; padding: 0.55rem 1.2rem; }
.form-validar { margin-top: 0.8rem; }
.form-validar button { background: #15803d; width: auto; padding: 0.55rem 1.2rem; }

.caja-diagrama {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1rem;
  overflow-x: auto;
}
.caja-diagrama svg { display: block; }

.caja-recordatorio {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  margin-bottom: 10px;
}
.recordatorio-titulo { font-size: 0.78rem; color: #92400e; font-weight: 600; margin: 0 0 4px; }
.recordatorio-texto {
  font-family: inherit;
  font-size: 0.85rem;
  color: #78350f;
  white-space: pre-wrap;
  margin: 0;
}
.recordatorio-vacio { font-size: 0.8rem; color: #92400e; font-style: italic; margin: 0; }
