/* ============================================================
   formularios.css - diseno compartido de los formularios de SST y
   Recursos Humanos (clase .pf). Las plantillas definen .pf en un
   <style> propio (en el cuerpo); por eso aqui los selectores llevan el
   prefijo "body " para ganar en especificidad y aplicar este diseno sin
   tener que tocar cada plantilla. La clase .pf solo existe en sst/ y
   rrhh/, asi que no afecta a otros modulos.
   ============================================================ */

body .pf { max-width: 1040px; margin: 0 auto; }

/* Tarjetas por seccion */
body .pf fieldset {
  border: 1px solid #e7ebf3;
  border-radius: 16px;
  padding: 26px 22px 20px;
  margin: 0 0 20px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 14px rgba(16, 24, 40, .04);
  overflow: visible;
}

/* Titulo de seccion en forma de pildora */
body .pf legend {
  float: none;
  width: auto;
  font-weight: 800;
  color: #13337e;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 7px 14px;
  margin: 0 0 2px 2px;
  background: #eef3ff;
  border: 1px solid #dbe6fb;
  border-radius: 999px;
}

/* Rejilla de campos (responsive: se apila solo en pantallas angostas) */
body .pf .row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 15px 18px;
  margin-top: 16px;
}
body .pf .field { display: flex; flex-direction: column; gap: 6px; }
body .pf .field.full { grid-column: 1 / -1; }

/* Campos tipo "casilla": en una tarjeta propia para que se lean bien */
body .pf .field.check {
  flex-direction: row;
  align-items: center;
  gap: 9px;
  background: #f7f9fc;
  border: 1px solid #e7ebf3;
  border-radius: 11px;
  padding: 10px 12px;
}

body .pf label {
  font-size: .72rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .04em;
}
body .pf .field.check label {
  text-transform: none;
  font-size: .88rem;
  color: #334155;
  font-weight: 600;
}

/* Controles */
body .pf .campo,
body .pf input,
body .pf select,
body .pf textarea {
  padding: 11px 13px;
  border: 1.5px solid #d7dde9;
  border-radius: 11px;
  font-size: .92rem;
  font-family: inherit;
  width: 100%;
  background: #fff;
  color: #1d2735;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
body .pf .field.check input,
body .pf .field.check .chk,
body .pf .chk {
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: #1a4fd6;
}
body .pf .campo:hover,
body .pf input:hover,
body .pf select:hover,
body .pf textarea:hover { border-color: #b9c4d8; }
body .pf .campo:focus,
body .pf input:focus,
body .pf select:focus,
body .pf textarea:focus {
  outline: none;
  border-color: #1a4fd6;
  box-shadow: 0 0 0 3.5px rgba(26, 79, 214, .15);
}
body .pf textarea { resize: vertical; min-height: 70px; line-height: 1.5; }

body .pf .err { color: #c0272d; font-size: .8rem; }
body .pf .help { color: #8595ad; font-size: .78rem; margin-top: 2px; }

/* Barra de acciones */
body .pf .barra { display: flex; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
body .pf .guardar {
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  background: #1a4fd6;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  font-size: .95rem;
  box-shadow: 0 3px 10px rgba(26, 79, 214, .28);
  transition: background .15s, transform .05s;
}
body .pf .guardar:hover { background: #1543b8; }
body .pf .guardar:active { transform: translateY(1px); }
body .pf .cancelar {
  padding: 12px 20px;
  border-radius: 12px;
  background: #eef1f7;
  color: #334155;
  text-decoration: none;
  font-weight: 700;
  font-size: .95rem;
}
body .pf .cancelar:hover { background: #e2e8f0; }

/* Tablas de formset (documentos, items de evaluacion, paz y salvo,
   plan de accion de investigacion). */
body .pf table.doc,
body .pf table.it,
body .pf table.acc {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: .86rem;
  margin-top: 14px;
  border: 1px solid #e7ebf3;
  border-radius: 13px;
  overflow: hidden;
}
body .pf table.doc th,
body .pf table.it th,
body .pf table.acc th {
  background: #f4f6fb;
  color: #5b6a86;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 700;
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #e7ebf3;
}
body .pf table.doc td,
body .pf table.it td,
body .pf table.acc td {
  padding: 9px 10px;
  border-bottom: 1px solid #eef1f7;
  vertical-align: top;
}
body .pf table.doc tr:last-child td,
body .pf table.it tr:last-child td,
body .pf table.acc tr:last-child td { border-bottom: none; }
body .pf table.doc .campo,
body .pf table.it .campo,
body .pf table.acc .campo { padding: 8px 9px; border-radius: 9px; }
body .pf .delcol { text-align: center; width: 60px; }

/* Caja de valoracion en vivo (matriz de peligros, GTC 45) */
body .pf .valbox {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  background: #f6f8fe;
  border: 1px solid #dbe6fb;
  border-radius: 13px;
  padding: 14px 18px;
  margin-top: 14px;
}
body .pf .valbox .cel { font-size: .82rem; color: #475569; }
body .pf .valbox .cel b { display: block; font-size: 1.25rem; color: #13337e; }
body .pf #nr_badge { color: #fff; font-weight: 800; border-radius: 9px; padding: 6px 13px; font-size: 1.05rem; }

/* Fichas de contexto (resumen del accidente/candidato) y avisos */
body .pf .ficha,
body .ficha {
  background: #f6f8fe;
  border: 1px solid #dbe6fb;
  border-radius: 13px;
  padding: 13px 16px;
  margin-bottom: 16px;
  font-size: .88rem;
}
body .aviso {
  background: #fff6e5;
  border: 1px solid #f0d9a0;
  border-radius: 13px;
  padding: 12px 16px;
  margin: 0 auto 16px;
  max-width: 1040px;
  font-size: .88rem;
  color: #8a6400;
}
