/* Fichaje Averías — móvil primero, botones gigantes, un niño de 6 años lo entiende */
:root {
  --verde: #16a34a;
  --rojo: #dc2626;
  --azul: #2563eb;
  --naranja: #ea8a00;
  --gris: #6b7280;
  --fondo: #f3f4f6;
  --texto: #111827;
  --tarjeta: #ffffff;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fondo);
  color: var(--texto);
  font-size: 17px;
}
.oculto { display: none !important; }

/* ---- Pantallas ---- */
.pantalla {
  max-width: 560px;
  margin: 0 auto;
  padding: 18px 16px 90px;
  min-height: 100vh;
}
h1 { font-size: 26px; margin: 6px 0 16px; }
h2 { font-size: 18px; margin: 22px 0 8px; color: var(--gris); }

/* ---- Botones ---- */
.boton {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 18px;
  padding: 15px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 12px;
  font-family: inherit;
}
.boton:active { transform: scale(0.98); }
.boton.gigante { padding: 26px 18px; font-size: 24px; }
.boton.verde { background: var(--verde); color: #fff; }
.boton.rojo  { background: var(--rojo);  color: #fff; }
.boton.azul  { background: var(--azul);  color: #fff; }
.boton.naranja { background: var(--naranja); color: #fff; }
.boton.gris  { background: #e5e7eb; color: var(--texto); }

/* ---- Principal ---- */
.cabecera { text-align: center; }
.gauge { max-width: 320px; margin: 0 auto; }
.gauge svg { width: 100%; height: auto; display: block; }
.horas-hoy { font-size: 22px; font-weight: 800; margin: 4px 0 0; }
.estado-linea { font-size: 14px; color: var(--gris); margin: 4px 0 0; }
.acciones-principales { margin-top: 26px; }

/* ---- Formulario avería ---- */
.etiqueta { display: block; font-size: 15px; font-weight: 700; color: var(--gris); margin: 14px 0 6px; }
.entrada {
  width: 100%;
  border: 2px solid #d1d5db;
  border-radius: 14px;
  padding: 14px;
  font-size: 20px;
  font-family: inherit;
  background: #fff;
}
.entrada:focus { border-color: var(--azul); outline: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 2px solid #d1d5db;
  background: #fff;
  border-radius: 999px;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.chip.elegido { background: var(--azul); border-color: var(--azul); color: #fff; }

/* ---- Pantalla activa ---- */
.etiqueta-estado { font-size: 18px; font-weight: 700; color: var(--gris); text-align: center; margin: 10px 0 0; }
.reloj { font-size: 64px; font-weight: 800; text-align: center; margin: 6px 0; font-variant-numeric: tabular-nums; }
.detalle-estado { text-align: center; color: var(--gris); margin: 0 0 14px; min-height: 24px; }
.acciones { display: flex; flex-direction: column; gap: 4px; }
.finalizar-dia {
  display: block;
  margin: 26px auto 0;
  background: none;
  border: none;
  color: var(--gris);
  font-size: 16px;
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
}

/* ---- Resumen ---- */
.tabla-resumen { width: 100%; border-collapse: collapse; background: var(--tarjeta); border-radius: 16px; overflow: hidden; }
.tabla-resumen td { padding: 16px; font-size: 20px; border-bottom: 1px solid #e5e7eb; }
.tabla-resumen td:last-child { text-align: right; font-weight: 800; }
/* Fila principal (lo que de verdad cuenta) */
.tabla-resumen tr.total td { font-size: 24px; font-weight: 800; background: #f0fdf4; }
.tabla-resumen tr.total td:last-child { color: var(--verde); }
/* Desglose: ya incluido arriba, no lo sumes otra vez */
.tabla-resumen tr.aparte td { font-size: 16px; color: var(--gris); padding-left: 28px; }
/* Lo que NO cuenta */
.tabla-resumen tr.nocuenta td { font-size: 16px; color: var(--gris); }

/* ---- Mapa ---- */
.pantalla-mapa { position: fixed; inset: 0 0 64px 0; }
#map { width: 100%; height: 100%; }

/* ---- Ajustes ---- */
.fila { background: var(--tarjeta); border-radius: 14px; padding: 16px; font-weight: 700; margin-top: 10px; }
.caja-form { background: var(--tarjeta); border-radius: 14px; padding: 14px; margin-top: 8px; }
.caja-form .boton { margin-top: 12px; }
.nota { font-size: 14px; color: var(--gris); margin: 10px 0 0; }
.nota.rojo { color: var(--rojo); }
.credito { font-size: 12px; color: var(--gris); text-align: center; margin-top: 24px; }
a { color: var(--azul); }

/* ---- Calendario de días marcados ---- */
.cal-cabecera { display: flex; align-items: center; gap: 10px; }
.cal-cabecera strong { flex: 1; text-align: center; font-size: 18px; }
.cal-cabecera .boton { margin-top: 0; padding: 10px; font-size: 22px; }
.cal-semana,
.cal-rejilla { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-semana span { text-align: center; font-size: 13px; font-weight: 700; color: var(--gris); margin-top: 8px; }
.cal-celda {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  background: #f3f4f6;
  border-radius: 10px;
  font-size: 15px; font-weight: 700;
}
.cal-celda.cal-vacia { background: transparent; }
.cal-celda.nacional { background: var(--rojo); color: #fff; cursor: pointer; }
.cal-celda.vacacion { background: #7c3aed; color: #fff; cursor: pointer; }
.cal-celda.local    { background: var(--azul); color: #fff; cursor: pointer; }
.cal-celda.sabado   { background: #d1d5db; color: #4b5563; }
.cal-celda.hoy { outline: 3px solid var(--texto); }

/* ---- Modal ---- */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-caja {
  background: #fff;
  border-radius: 22px;
  padding: 24px;
  width: 100%;
  max-width: 380px;
}
.modal-texto { font-size: 24px; font-weight: 800; text-align: center; margin: 0 0 18px; }

/* ---- Toast ---- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  max-width: 90%;
  z-index: 1100;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* ---- Navegación ---- */
#navegacion {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  display: flex;
  z-index: 900;
  padding-bottom: env(safe-area-inset-bottom);
}
#navegacion button {
  flex: 1;
  border: 0;
  background: none;
  font-size: 22px;
  padding: 8px 0 6px;
  cursor: pointer;
  color: var(--gris);
  font-family: inherit;
}
#navegacion button span { display: block; font-size: 12px; font-weight: 700; }
#navegacion button.activo { color: var(--azul); }

@media (min-width: 700px) {
  .reloj { font-size: 80px; }
  .gauge { max-width: 360px; }
}
