/* Kit Checa tu Jornada horas — estilos
   Pensado para personas mayores: letra grande, alto contraste (7:1), botones de 48 px o más,
   sin animaciones. Todo en rem para respetar la letra grande del teléfono. */

/* Tipografía: para usar Atkinson Hyperlegible, copia los .woff2 a /fonts y quita los comentarios.
@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('../fonts/AtkinsonHyperlegible-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('../fonts/AtkinsonHyperlegible-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
*/

:root {
  --letra: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --texto: #1b1b1b;
  --texto-suave: #3b3b3b;
  --fondo: #ffffff;
  --fondo-suave: #f2f4f7;
  --borde: #6b6b6b;
  --primario: #0b3d91;
  --primario-oscuro: #072a66;
  --primario-claro: #e6edf8;
  --ok: #0a5a2a;
  --ok-fondo: #e4f4ea;
  --aviso: #6e3b00;
  --aviso-fondo: #fff1dc;
  --error: #9a1418;
  --error-fondo: #fde8e8;
  --foco: #ffbf00;
  --radio: 12px;
  --ancho: 42rem;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 125%; /* 20 px si el teléfono está en tamaño normal */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-wrap: break-word;
  font-family: var(--letra);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--texto);
  background: var(--fondo);
  padding-bottom: 5rem; /* espacio para el botón fijo de WhatsApp */
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

/* ---------- Estructura ---------- */

.saltar {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--texto);
  color: #fff;
  padding: 0.75rem 1rem;
  z-index: 100;
}
.saltar:focus {
  left: 0.5rem;
  top: 0.5rem;
}

.cabecera {
  border-bottom: 1px solid #d0d4da;
  background: var(--fondo);
}
.cabecera__dentro {
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.marca {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primario);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3rem;
}
.marca__sello {
  display: inline-grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 8px;
  background: var(--primario);
  color: #fff;
  font-size: 0.9rem;
}
.cabecera nav {
  display: flex;
  flex-wrap: wrap;
}
.cabecera nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  min-width: 2.5rem;
  padding: 0 0.3rem;
  color: var(--primario);
  font-weight: 700;
}

main {
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
}

.pie {
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
  border-top: 1px solid #d0d4da;
  color: var(--texto-suave);
  font-size: 0.9rem;
}
.pie a {
  color: var(--primario);
}

/* ---------- Texto ---------- */

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 1.5rem 0 0.75rem;
}
h1 {
  font-size: 1.6rem;
  margin-top: 0.5rem;
}
h2 {
  font-size: 1.3rem;
}
h3 {
  font-size: 1.1rem;
}
p,
li {
  max-width: 60ch;
}
a {
  color: var(--primario);
  text-underline-offset: 0.2em;
}
.suave {
  color: var(--texto-suave);
}
.chico {
  font-size: 0.9rem;
}
.sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Foco visible ---------- */

:focus-visible {
  outline: 3px solid var(--foco);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--texto);
}

/* ---------- Botones ---------- */

.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3.2rem;
  min-width: 3.2rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radio);
  border: 2px solid var(--primario);
  background: var(--primario);
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.boton:hover {
  background: var(--primario-oscuro);
  border-color: var(--primario-oscuro);
}
.boton--secundario {
  background: var(--fondo);
  color: var(--primario);
}
.boton--secundario:hover {
  background: var(--primario-claro);
  color: var(--primario-oscuro);
}
.boton--peligro {
  background: var(--fondo);
  color: var(--error);
  border-color: var(--error);
}
.boton--ancho {
  width: 100%;
}
.boton--grande {
  min-height: 3.6rem;
  font-size: 1.1rem;
}
.botones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.botones--pila {
  flex-direction: column;
}

/* Botón fijo de WhatsApp: siempre con texto, nunca solo ícono */
.ayuda-fija {
  position: fixed;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3.2rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: #075e35;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.ayuda-fija:hover {
  background: #044626;
}
.ayuda-fija svg {
  width: 1.3rem;
  height: 1.3rem;
  flex: none;
}

/* ---------- Tarjetas y avisos ---------- */

.tarjeta {
  border: 2px solid #c9ced6;
  border-radius: var(--radio);
  padding: 1rem 1.1rem;
  margin: 1rem 0;
  background: var(--fondo);
}
.tarjeta > :first-child {
  margin-top: 0;
}
.tarjeta > :last-child {
  margin-bottom: 0;
}
.tarjeta--suave {
  background: var(--fondo-suave);
  border-color: var(--fondo-suave);
}

.aviso {
  border-left: 6px solid var(--borde);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  margin: 1rem 0;
  background: var(--fondo-suave);
}
.aviso > :first-child {
  margin-top: 0;
}
.aviso > :last-child {
  margin-bottom: 0;
}
.aviso--ok {
  border-color: var(--ok);
  background: var(--ok-fondo);
}
.aviso--aviso {
  border-color: var(--aviso);
  background: var(--aviso-fondo);
}
.aviso--error {
  border-color: var(--error);
  background: var(--error-fondo);
}

/* Estado: siempre ícono + palabra, nunca solo color */
.estado {
  font-weight: 700;
}
.estado--ok {
  color: var(--ok);
}
.estado--aviso {
  color: var(--aviso);
}
.estado--error {
  color: var(--error);
}

.cifras {
  display: grid;
  gap: 0.75rem;
  margin: 1.25rem 0;
  padding: 0;
  list-style: none;
}
.cifras li {
  border-radius: var(--radio);
  background: var(--fondo-suave);
  padding: 0.9rem 1rem;
  max-width: none;
}
.cifras strong {
  display: block;
  font-size: 1.35rem;
  color: var(--primario);
}

/* ---------- Tablas ---------- */

.tabla-contenedor {
  overflow-x: auto;
  margin: 1rem 0;
}
table {
  border-collapse: collapse;
  width: 100%;
}
th,
td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid #c9ced6;
  vertical-align: top;
}
th {
  font-weight: 700;
}
caption {
  text-align: left;
  font-weight: 700;
  padding-bottom: 0.5rem;
}

/* ---------- Formularios ---------- */

fieldset {
  border: 0;
  padding: 0;
  margin: 1.5rem 0;
  min-width: 0;
}
legend {
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0;
  margin-bottom: 0.25rem;
}
label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.ayuda {
  display: block;
  color: var(--texto-suave);
  font-size: 0.9rem;
  margin: 0 0 0.6rem;
}
input[type='text'],
input[type='number'],
input[type='tel'],
select {
  font: inherit;
  width: 100%;
  min-height: 3.2rem;
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--borde);
  border-radius: 10px;
  background: #fff;
  color: var(--texto);
}
input::placeholder {
  color: #5f5f5f;
}
.campo {
  margin: 1.25rem 0;
}
.error-campo {
  color: var(--error);
  font-weight: 700;
  margin-top: 0.4rem;
}

/* Opciones grandes (radio y casilla) */
.opciones {
  display: grid;
  gap: 0.6rem;
}
.opcion {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border: 2px solid var(--borde);
  border-radius: var(--radio);
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 400;
  margin: 0;
  min-height: 3.2rem;
}
.opcion input {
  width: 1.5rem;
  height: 1.5rem;
  margin: 0.1rem 0 0;
  flex: none;
  accent-color: var(--primario);
}
.opcion__texto strong {
  display: block;
}
.opcion__texto span {
  display: block;
  color: var(--texto-suave);
  font-size: 0.9rem;
}
.opcion:has(input:checked) {
  border-color: var(--primario);
  background: var(--primario-claro);
  box-shadow: inset 0 0 0 1px var(--primario);
}
.opcion:has(input:focus-visible) {
  outline: 3px solid var(--foco);
  outline-offset: 3px;
}

/* Días de la semana: botones que se prenden y apagan */
.dias {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(3.4rem, 100%), 1fr));
  gap: 0.5rem;
}
@media (min-width: 30rem) {
  .dias {
    grid-template-columns: repeat(7, 1fr);
  }
}
.dia {
  min-height: 3.4rem;
  border: 2px solid var(--borde);
  border-radius: 10px;
  background: #fff;
  color: var(--texto);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  padding: 0.3rem;
}
.dia[aria-pressed='true'] {
  background: var(--primario);
  border-color: var(--primario);
  color: #fff;
}
.dia__marca {
  font-size: 0.9rem;
  font-weight: 400;
}

/* Selector + / − */
.contador {
  display: inline-flex;
  max-width: 100%;
  align-items: stretch;
  border: 2px solid var(--borde);
  border-radius: var(--radio);
  overflow: hidden;
}
.contador button {
  min-width: 3.4rem;
  min-height: 3.4rem;
  border: 0;
  background: var(--fondo-suave);
  color: var(--primario);
  font: inherit;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
}
.contador button:hover {
  background: var(--primario-claro);
}
.contador output {
  flex: 1 1 auto;
  min-width: 0;
  width: 7.5rem;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.15rem;
  padding: 0 0.5rem;
  border-left: 2px solid var(--borde);
  border-right: 2px solid var(--borde);
}

/* Paso a paso */
.progreso {
  margin: 0 0 1rem;
}
.progreso__texto {
  font-weight: 700;
  color: var(--texto-suave);
  margin: 0 0 0.4rem;
}
.progreso__barra {
  height: 0.6rem;
  border-radius: 999px;
  background: #d9dde3;
  overflow: hidden;
}
.progreso__relleno {
  height: 100%;
  background: var(--primario);
}

.lista-empleados {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: grid;
  gap: 0.5rem;
}
/* Información arriba a todo lo ancho, botones abajo */
.lista-empleados li {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  border: 2px solid #c9ced6;
  border-radius: var(--radio);
  padding: 0.9rem 1rem;
  max-width: none;
}
.lista-empleados li .botones {
  margin: 0;
}
.lista-empleados li .botones .boton {
  flex: 1 1 5rem;
}
.lista-empleados li > .boton {
  align-self: flex-start;
}

details {
  border: 2px solid #c9ced6;
  border-radius: var(--radio);
  padding: 0 1rem;
  margin: 0.75rem 0;
}
summary {
  min-height: 3.2rem;
  display: flex;
  align-items: center;
  font-weight: 700;
  cursor: pointer;
}
details[open] {
  padding-bottom: 1rem;
}
details[open] > summary {
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #c9ced6;
}

/* Resultados */
.resultado-empleado h3 {
  margin-bottom: 0.25rem;
}
.anios {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(7rem, 100%), 1fr));
  gap: 0.5rem;
}
@media (min-width: 30rem) {
  .anios {
    grid-template-columns: repeat(4, 1fr);
  }
}
.anios li {
  border-radius: 10px;
  padding: 0.5rem 0.6rem;
  background: var(--fondo-suave);
  max-width: none;
}
.anios li.no-cumple {
  background: var(--error-fondo);
}
.anios .anio {
  display: block;
  font-weight: 700;
}
.anios .detalle {
  display: block;
  font-size: 0.9rem;
  color: var(--texto-suave);
}

/* Planeador */
.planeador-dia {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  border-bottom: 1px solid #c9ced6;
  padding: 0.75rem 0;
}
.planeador-dia__fila {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(8rem, 100%), 1fr));
  gap: 0.5rem;
}
.planeador-dia__titulo {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
}
.planeador-dia label {
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}
.interruptor {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  margin: 0;
  min-height: 3rem;
}
.interruptor input {
  width: 1.5rem;
  height: 1.5rem;
  accent-color: var(--primario);
}
.total-empleado {
  font-size: 1.15rem;
  font-weight: 700;
}

/* ---------- Solo pantalla / solo impresión ---------- */

.solo-impresion {
  display: none;
}

@media print {
  html {
    font-size: 100%;
  }
  body {
    padding: 0;
    color: #000;
    font-size: 14pt;
  }
  .no-imprimir,
  .cabecera,
  .ayuda-fija,
  .botones,
  .boton,
  .saltar {
    display: none !important;
  }
  .solo-impresion {
    display: block;
  }
  .progreso,
  details:not([open]),
  details form {
    display: none !important;
  }
  main {
    max-width: none;
    padding: 0;
  }
  .tarjeta,
  .aviso {
    break-inside: avoid;
    border-color: #000;
  }
  a {
    color: #000;
    text-decoration: none;
  }
  .pie {
    border-top: 1px solid #000;
    color: #000;
    font-size: 11pt;
  }
  th,
  td {
    border: 1px solid #000;
    padding: 6pt;
  }
}

/* ---------- Agregados del diagnóstico ---------- */

.leyenda-titulo {
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
}
.sr-etiqueta {
  margin: 0 0 0.4rem;
}
.alertas {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0;
  display: grid;
  gap: 0.5rem;
}
.alertas li {
  max-width: none;
}
.alertas .estado {
  margin-right: 0.25rem;
}

/* ---------- Agregados del planeador ---------- */

.opciones--fila {
  grid-template-columns: repeat(auto-fill, minmax(min(7rem, 100%), 1fr));
}
@media (min-width: 30rem) {
  .opciones--fila {
    grid-template-columns: repeat(4, 1fr);
  }
}
.marca-agua {
  display: none;
}

@media print {
  @page {
    margin: 12mm;
  }
  @page rol {
    size: landscape;
  }
  .hoja-rol {
    page: rol;
  }
  .hoja-rol table {
    font-size: 11pt;
  }
  .hoja-empleado {
    break-before: page;
  }
  .hoja-rol h2,
  .hoja-empleado h2 {
    margin-top: 0;
  }
  .firma {
    margin-top: 24pt;
  }
  .marca-agua {
    display: block;
    text-align: center;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: 1px dashed #000;
    padding: 4pt;
    margin: 0 0 8pt;
  }
}

/* ---------- Kit ---------- */

.precio {
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primario);
}
.lista-empleados li.actual {
  border-color: var(--primario);
  background: var(--primario-claro);
}

/* ---------- Zoom grande o pantallas muy angostas ---------- */

.opcion,
.cifras li,
.opcion__texto,
.lista-empleados li > div {
  min-width: 0;
}
@media (max-width: 20rem) {
  main,
  .pie,
  .cabecera__dentro {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  .opcion,
  .tarjeta {
    padding-left: 0.6rem;
    padding-right: 0.6rem;
  }
}
@media (max-width: 20rem) {
  /* Con zoom grande el botón flotante taparía media pantalla: va al final de la página */
  body {
    padding-bottom: 0;
  }
  .ayuda-fija {
    position: static;
    display: flex;
    justify-content: center;
    margin: 0 0.5rem 1rem;
    box-shadow: none;
  }
}

/* ---------- Contenido para buscadores debajo de las herramientas ---------- */

.sobre {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 2px solid #c9ced6;
}
.lista-guias {
  padding-left: 1.25rem;
}
.lista-guias li {
  margin: 0.5rem 0;
}
.lista-guias a {
  display: inline-block;
  padding: 0.35rem 0;
  font-weight: 700;
}

.marca__sello svg {
  width: 1.4rem;
  height: 1.4rem;
}

/* ---------- Guías ---------- */

.migas ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  padding: 0;
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--texto-suave);
}
.migas li + li::before {
  content: '›';
  margin-right: 0.5rem;
  color: var(--texto-suave);
}
.migas a {
  display: inline-block;
  padding: 0.6rem 0;
}
.entrada {
  font-size: 1.1rem;
}
.llamado {
  margin: 2rem 0;
  padding: 1.1rem;
  border-radius: var(--radio);
  background: var(--primario-claro);
  border: 2px solid var(--primario);
}
.llamado p {
  margin-top: 0;
}
.fuentes li {
  margin: 0.4rem 0;
}
.tarjetas-guias {
  list-style: none;
  padding: 0;
}
.tarjetas-guias li {
  max-width: none;
}
.tarjetas-guias h2 {
  margin-top: 0;
  font-size: 1.15rem;
}
.tarjetas-guias h2 a {
  display: block;
  padding: 0.25rem 0;
}
