:root {
  --azul: #1f4e78;
  --fondo: #f5f6f8;
  --borde: #d7dbe0;
  --ok: #1e7a3c;
  --warn: #9a6b00;
  --error: #a52020;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, system-ui, sans-serif;
  background: var(--fondo);
  color: #1c2430;
}

.cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.8rem 1.4rem;
  background: var(--azul);
  color: #fff;
}

.cabecera h1 { font-size: 1.1rem; margin: 0; }
.cabecera a { color: #fff; text-decoration: none; }
.cabecera nav a { margin-left: 1rem; opacity: 0.9; }
.cabecera nav a:hover { opacity: 1; text-decoration: underline; }

main { padding: 1.4rem; max-width: 1400px; margin: 0 auto; }

h2 { margin-top: 0; }

.tarjeta {
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.2rem;
}

fieldset { border: 1px solid var(--borde); border-radius: 6px; margin: 1rem 0; }
legend { padding: 0 0.4rem; font-weight: 600; }
.opcion { display: block; margin: 0.35rem 0; }

.fila { display: flex; gap: 1.5rem; flex-wrap: wrap; }

label { display: block; margin: 0.6rem 0; font-weight: 600; }
input[type="number"], input[type="file"], input[type="text"], select {
  font: inherit;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--borde);
  border-radius: 5px;
  background: #fff;
}
input[type="number"] { width: 7rem; }

button, .boton {
  font: inherit;
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--azul);
  background: var(--azul);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .boton:hover { filter: brightness(1.1); }
.boton.secundario { background: #6b7684; border-color: #6b7684; }
.acciones-fila { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: center; }

.acciones { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1rem; }

.tabla-scroll { overflow: auto; max-height: 70vh; border: 1px solid var(--borde); border-radius: 6px; }

table { border-collapse: collapse; width: 100%; background: #fff; font-size: 0.85rem; }
th, td { border-bottom: 1px solid var(--borde); padding: 0.25rem 0.35rem; text-align: center; white-space: nowrap; }
thead th { position: sticky; top: 0; background: var(--azul); color: #fff; z-index: 1; }
tbody tr:nth-child(even) { background: #fafbfc; }
td input { width: 8.5rem; text-align: center; }

.rangos { list-style: none; display: flex; gap: 1rem; flex-wrap: wrap; padding: 0; margin: 0.5rem 0; }
.rangos li { padding: 0.3rem 0.6rem; border-radius: 999px; background: #eef1f5; }
.rangos .bien { background: #e3f5e8; color: var(--ok); }
.rangos .regular { background: #fdf3d8; color: var(--warn); }
.rangos .mal { background: #fbe4e4; color: var(--error); }

.nota { color: #5a6472; font-size: 0.9rem; }

.aviso { padding: 0.6rem 0.9rem; border-radius: 6px; margin-bottom: 1rem; }
.aviso.ok { background: #e3f5e8; color: var(--ok); }
.aviso.error { background: #fbe4e4; color: var(--error); }

.pie { text-align: center; color: #7a8391; font-size: 0.8rem; padding: 1rem; }
