* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; color: #1c2430; background: #f5f7fa; line-height: 1.5; }
.cabecera { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1rem; background: #012f71; color: #fff; }
.cabecera form { margin: 0; }
.enlace { background: none; border: 0; color: #fff; text-decoration: underline; font: inherit; cursor: pointer; }
.menu ul { list-style: none; margin: 0; padding: 0.5rem 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; background: #fff; border-bottom: 1px solid #d8dee8; }
.menu a { color: #00539e; text-decoration: none; font-weight: 600; }
.menu a[aria-current] { border-bottom: 2px solid #00539e; }
.proximamente { color: #7a8594; }
.contenido { max-width: 60rem; margin: 0 auto; padding: 1rem; }
.tarjeta { max-width: 26rem; margin: 1rem auto; padding: 1rem; background: #fff; border: 1px solid #d8dee8; border-radius: 0.5rem; }
.marca { color: #5c6675; margin: 0; }
.aviso { padding: 0.75rem 1rem; background: #fff4d6; border: 1px solid #e8c766; border-radius: 0.5rem; }
input, select, button, .btn { font: inherit; padding: 0.5rem 0.75rem; max-width: 100%; }
input[type=text], input[type=password], input[type=number] { width: 100%; }
button[type=submit], .btn-primary { background: #00539e; color: #fff; border: 0; border-radius: 0.4rem; cursor: pointer; }
.btn-secondary { background: #e6ebf2; border: 0; border-radius: 0.4rem; cursor: pointer; }
.float-right { float: right; }
.errorlist { color: #b00020; padding-left: 1rem; }
.tabla { width: 100%; border-collapse: collapse; background: #fff; margin: 0.5rem 0 1rem; }
.tabla th, .tabla td { text-align: left; padding: 0.4rem 0.6rem; border-bottom: 1px solid #d8dee8; vertical-align: top; }
.tabla form { margin: 0; }
.formulario fieldset { margin: 0 0 0.75rem; border: 1px solid #d8dee8; border-radius: 0.4rem; }
.qr svg { max-width: 12rem; height: auto; }
.contenido h2 { margin-top: 1.5rem; }

/* Tableros: una columna en el teléfono y tablas con scroll horizontal propio. */
.marcas, .periodo { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin: 0.5rem 0; }
.marcas a { color: #00539e; text-decoration: none; font-weight: 600; }
.marcas a[aria-current] { text-decoration: underline; }
.periodo label { display: inline-flex; align-items: center; gap: 0.35rem; }
.rango, .fuentes { color: #5c6675; }
.rejilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; }
.bloque { min-width: 0; padding: 1rem; background: #fff; border: 1px solid #d8dee8; border-radius: 0.5rem; }
.bloque h2 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.fuente { color: #5c6675; font-size: 0.85rem; font-weight: normal; margin-left: 0.5rem; }
.tabla-scroll { overflow-x: auto; }
table.tablero { width: 100%; border-collapse: collapse; }
table.tablero th, table.tablero td { padding: 0.35rem 0.5rem; border-bottom: 1px solid #e6ebf2; text-align: left; white-space: nowrap; }
table.tablero th { color: #5c6675; font-weight: 600; }
.numero { font-variant-numeric: tabular-nums; }
.flecha { font-size: 0.8rem; margin-left: 0.25rem; }
.nota-datos { display: block; margin: 0.25rem 0; color: #7a8594; font-size: 0.85rem; }
.sin-datos, .sin-datos .numero { color: #7a8594; }
.semaforo-verde { color: #0a7d32; }
.semaforo-ambar { color: #a86a00; }
.semaforo-rojo { color: #b00020; }
.semaforo-sin_meta, .semaforo-sin_datos { color: #7a8594; }
.grafica { max-width: 100%; height: auto; }

@media (max-width: 640px) {
  .rejilla { grid-template-columns: 1fr; }
  .contenido { padding: 0.5rem; }
  .bloque { padding: 0.75rem; }
  .menu ul { gap: 0.25rem 0.75rem; }
}
