/* Saona SAT — sistema visual.
   Sobrio y corporativo: neutros fríos, verde Saona como acento, una escala tipográfica
   corta, bordes y sombras sutiles. Móvil primero; claro y oscuro. */

:root {
  /* escala tipográfica */
  --t-xs: 0.8125rem; /* 13 */
  --t-s: 0.9375rem; /* 15 */
  --t-m: 1.0625rem; /* 17 — cuerpo */
  --t-l: 1.25rem; /* 20 */
  --t-xl: 1.5rem; /* 24 */
  --t-xxl: 1.75rem; /* 28 */
  /* espaciado */
  --e-1: 4px;
  --e-2: 8px;
  --e-3: 12px;
  --e-4: 16px;
  --e-5: 20px;
  --e-6: 24px;
  --e-8: 32px;
  --radio: 14px;
  --radio-s: 10px;
  --radio-xs: 8px;
  --ancho: 720px;
  --alto-barra: 64px;

  /* color (claro) */
  --fondo: #f3f5f5;
  --superficie: #ffffff;
  --superficie-2: #f6f8f8;
  --superficie-3: #eceff0;
  --texto: #101c1b;
  --texto-2: #4a5958;
  --texto-3: #6b7978;
  --borde: #e1e6e6;
  --borde-2: #cdd5d4;
  --acento: #0b5f5a;
  --acento-hover: #084c48;
  --acento-texto: #ffffff;
  --acento-suave: #e4f1ef;
  --acento-tinta: #0b5f5a;
  --foco: #2563eb;
  --sombra-1: 0 1px 2px rgb(16 28 27 / 6%);
  --sombra-2: 0 1px 2px rgb(16 28 27 / 5%), 0 4px 12px rgb(16 28 27 / 6%);
  --sombra-3: 0 8px 28px rgb(16 28 27 / 14%);

  /* tonos de estado: [texto, fondo, punto] */
  --nuevo-t: #1d4ed8;
  --nuevo-f: #e8efff;
  --pendiente-t: #92400e;
  --pendiente-f: #fdf1dc;
  --espera-t: #475569;
  --espera-f: #edf0f4;
  --programada-t: #0b5f5a;
  --programada-f: #e2f2ef;
  --ok-t: #166534;
  --ok-f: #e3f5e8;
  --cerrada-t: #52606d;
  --cerrada-f: #eef1f3;
  --anulada-t: #9f1d1d;
  --anulada-f: #fbeaea;
  --peligro: #b42318;
  --peligro-suave: #fdecea;
  --atencion-borde: #f0d39a;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #0c1312;
    --superficie: #141d1c;
    --superficie-2: #182321;
    --superficie-3: #1f2b29;
    --texto: #e8efee;
    --texto-2: #a9b8b6;
    --texto-3: #8a9997;
    --borde: #24312f;
    --borde-2: #33433f;
    --acento: #4fbfb2;
    --acento-hover: #6fd0c4;
    --acento-texto: #04201d;
    --acento-suave: #12302c;
    --acento-tinta: #6fd0c4;
    --foco: #7fb2ff;
    --sombra-1: none;
    --sombra-2: 0 0 0 1px rgb(255 255 255 / 3%);
    --sombra-3: 0 8px 28px rgb(0 0 0 / 50%);
    --nuevo-t: #a9c3ff;
    --nuevo-f: #17233f;
    --pendiente-t: #f5c77a;
    --pendiente-f: #33260f;
    --espera-t: #b8c3d1;
    --espera-f: #1e2632;
    --programada-t: #7fd8cd;
    --programada-f: #11302c;
    --ok-t: #86d9a0;
    --ok-f: #13301d;
    --cerrada-t: #a3adb7;
    --cerrada-f: #1f2629;
    --anulada-t: #f4a3a3;
    --anulada-f: #3a1717;
    --peligro: #ff8a7f;
    --peligro-suave: #3a1714;
    --atencion-borde: #6b5520;
    color-scheme: dark;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* los saltos de foco y anclas no quedan debajo de la cabecera fija */
  scroll-padding-top: calc(72px + env(safe-area-inset-top));
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--fondo);
  color: var(--texto);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', 'DejaVu Sans', sans-serif;
  font-size: var(--t-m);
  line-height: 1.5;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100vh;
  min-height: 100dvh;
}

main {
  max-width: var(--ancho);
  margin: 0 auto;
  padding: var(--e-4) var(--e-4) calc(var(--e-8) + env(safe-area-inset-bottom));
}

body.con-barra main {
  padding-bottom: calc(var(--alto-barra) + var(--e-8) + env(safe-area-inset-bottom));
}

main:focus,
h1:focus {
  outline: none;
}

h1 {
  font-size: var(--t-xxl);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: var(--e-2) 0 var(--e-4);
}

h2 {
  font-size: var(--t-xs);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--texto-3);
  margin: 0 0 var(--e-3);
}

p {
  margin: 0 0 var(--e-3);
}

a {
  color: var(--acento-tinta);
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 3px solid var(--foco);
  outline-offset: 2px;
  border-radius: 6px;
}

[hidden] {
  display: none !important;
}

.icono {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.solo-lector,
.oculto-accesible {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.texto-romper {
  overflow-wrap: anywhere;
}

.dato-suave {
  color: var(--texto-2);
  font-size: var(--t-s);
}

/* ================================================================ carcasa */
.cabecera {
  position: sticky;
  top: 0;
  z-index: 20;
  /* Opaca: lo que se desplaza por debajo no se transparenta ni «se monta». */
  background: var(--superficie);
  border-bottom: 1px solid var(--borde);
  box-shadow: 0 1px 3px rgb(16 28 27 / 6%);
  padding-top: env(safe-area-inset-top);
}

.cabecera-interior {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--e-3);
  max-width: 1080px;
  margin: 0 auto;
  min-height: 60px;
  padding: 0 var(--e-4);
}

.marca {
  display: flex;
  align-items: center;
  gap: var(--e-3);
  min-height: 48px;
  min-width: 0;
  color: var(--texto);
  text-decoration: none;
}

.marca-textos {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.marca-nombre {
  font-weight: 700;
  font-size: var(--t-m);
  letter-spacing: -0.01em;
}

.marca-empresa {
  font-size: var(--t-xs);
  color: var(--texto-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo {
  width: 36px;
  height: 36px;
  flex: none;
}

.logo-fondo {
  fill: var(--acento);
}

.logo-trazo {
  fill: none;
  stroke: var(--acento-texto);
  stroke-width: 3;
  stroke-linejoin: round;
}

/* navegación: arriba en escritorio, abajo en móvil */
.nav-escritorio {
  display: none;
  gap: var(--e-1);
}

.nav-enlace {
  display: inline-flex;
  align-items: center;
  gap: var(--e-2);
  min-height: 44px;
  padding: 0 var(--e-3);
  border-radius: var(--radio-s);
  color: var(--texto-2);
  font-weight: 600;
  font-size: var(--t-s);
  text-decoration: none;
}

.nav-enlace:hover {
  background: var(--superficie-3);
  color: var(--texto);
}

.nav-enlace[aria-current='page'] {
  color: var(--acento-tinta);
  background: var(--acento-suave);
}

.barra-inferior {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* Opaca, como la cabecera: lo que pasa por debajo no se transparenta. */
  background: var(--superficie);
  border-top: 1px solid var(--borde);
  box-shadow: 0 -1px 3px rgb(16 28 27 / 5%);
  padding-bottom: env(safe-area-inset-bottom);
}

.barra-enlace {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: var(--alto-barra);
  color: var(--texto-3);
  font-size: var(--t-xs);
  font-weight: 600;
  text-decoration: none;
}

.barra-enlace .icono {
  width: 24px;
  height: 24px;
}

.barra-enlace[aria-current='page'] {
  color: var(--acento-tinta);
}

@media (min-width: 760px) {
  .nav-escritorio {
    display: flex;
  }

  .barra-inferior {
    display: none;
  }

  body.con-barra main {
    padding-bottom: calc(var(--e-8) + env(safe-area-inset-bottom));
  }
}

.barra-red {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--e-2);
  padding: var(--e-2) var(--e-4);
  background: var(--pendiente-f);
  color: var(--pendiente-t);
  font-size: var(--t-s);
  font-weight: 600;
}

/* ================================================================ botones */
.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--e-2);
  min-height: 48px;
  padding: 10px 18px;
  border: 1px solid var(--acento);
  border-radius: var(--radio-s);
  background: var(--acento);
  color: var(--acento-texto);
  font: inherit;
  font-weight: 650;
  font-size: var(--t-m);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--sombra-1);
  transition: background-color 0.15s, border-color 0.15s, transform 0.05s;
}

.boton:hover {
  background: var(--acento-hover);
  border-color: var(--acento-hover);
}

.boton:active {
  transform: translateY(1px);
}

.boton:disabled,
.boton[aria-busy='true'] {
  opacity: 0.6;
  cursor: progress;
}

.boton-grande {
  min-height: 54px;
  font-size: var(--t-m);
}

.boton-ancho {
  display: flex;
  width: 100%;
}

.boton-secundario {
  background: var(--superficie);
  color: var(--texto);
  border-color: var(--borde-2);
}

.boton-secundario:hover {
  background: var(--superficie-2);
  border-color: var(--borde-2);
}

.boton-texto {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--acento-tinta);
}

.boton-texto:hover {
  background: var(--acento-suave);
  border-color: transparent;
}

.boton-peligro {
  background: var(--peligro);
  border-color: var(--peligro);
  color: #fff;
}

.boton-peligro:hover {
  background: var(--peligro);
  filter: brightness(0.93);
}

.boton-texto-peligro {
  color: var(--peligro);
}

.boton-texto-peligro:hover {
  background: var(--peligro-suave);
}

@media (prefers-color-scheme: dark) {
  .boton-peligro {
    color: #2a0c09;
  }
}

.boton-icono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--texto-2);
  cursor: pointer;
}

.boton-icono:hover {
  background: var(--superficie-3);
}

.boton-redondo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 999px;
  background: var(--acento-suave);
  color: var(--acento-tinta);
}

.boton-redondo:hover {
  filter: brightness(0.96);
}

.enlace-boton {
  display: inline-flex;
  align-items: center;
  gap: var(--e-2);
  min-height: 44px;
  color: var(--acento-tinta);
  font-weight: 600;
  text-decoration: none;
}

.enlace-boton:hover {
  text-decoration: underline;
}

.volver {
  display: inline-flex;
  align-items: center;
  gap: var(--e-1);
  min-height: 44px;
  margin: 0 0 var(--e-1) -8px;
  padding: 0 10px 0 4px;
  border-radius: var(--radio-s);
  color: var(--acento-tinta);
  font-weight: 600;
  font-size: var(--t-s);
  text-decoration: none;
}

.volver:hover {
  background: var(--acento-suave);
}

.acciones-fila {
  display: flex;
  flex-wrap: wrap;
  gap: var(--e-3);
}

/* ================================================================ tarjetas y secciones */
.tarjeta-base,
.seccion {
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra-1);
}

.seccion {
  margin: 0 0 var(--e-4);
  padding: var(--e-4);
}

.seccion > h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* filas de lista agrupada (estilo ajustes) */
.filas {
  list-style: none;
  margin: 0 calc(-1 * var(--e-4));
  padding: 0;
}

.fila {
  display: flex;
  align-items: center;
  gap: var(--e-3);
  min-height: 56px;
  padding: var(--e-3) var(--e-4);
}

.fila + .fila {
  border-top: 1px solid var(--borde);
}

.fila-cuerpo {
  flex: 1;
  min-width: 0;
}

.fila-titulo {
  margin: 0;
  font-weight: 600;
}

.fila-sub {
  margin: 0;
  color: var(--texto-2);
  font-size: var(--t-s);
}

.fila-acciones {
  display: flex;
  gap: var(--e-2);
}

.fila-enlace {
  color: var(--texto);
  text-decoration: none;
}

.fila-enlace:hover {
  background: var(--superficie-2);
}

.fila-enlace > .icono:last-child {
  color: var(--texto-3);
}

/* ================================================================ chips de estado */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  font-size: var(--t-xs);
  font-weight: 650;
  line-height: 1.4;
  white-space: nowrap;
  background: var(--espera-f);
  color: var(--espera-t);
}

.chip::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.chip-nuevo {
  background: var(--nuevo-f);
  color: var(--nuevo-t);
}

.chip-pendiente {
  background: var(--pendiente-f);
  color: var(--pendiente-t);
}

.chip-espera {
  background: var(--espera-f);
  color: var(--espera-t);
}

.chip-programada {
  background: var(--programada-f);
  color: var(--programada-t);
}

.chip-ok {
  background: var(--ok-f);
  color: var(--ok-t);
}

.chip-cerrada {
  background: var(--cerrada-f);
  color: var(--cerrada-t);
}

.chip-anulada {
  background: var(--anulada-f);
  color: var(--anulada-t);
}

.sr {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--acento-tinta);
}

/* ================================================================ cajas de mensaje */
.caja {
  display: flex;
  gap: var(--e-3);
  align-items: flex-start;
  margin: 0 0 var(--e-4);
  padding: var(--e-3) var(--e-4);
  border-radius: var(--radio-s);
  border: 1px solid var(--borde);
  background: var(--superficie);
  font-size: var(--t-s);
}

.caja > .icono {
  margin-top: 1px;
}

.caja > div {
  flex: 1;
  min-width: 0;
}

.caja p:last-child {
  margin-bottom: 0;
}

.caja strong {
  display: block;
  margin-bottom: 2px;
  font-size: var(--t-m);
}

.caja p strong {
  display: inline;
  font-size: inherit;
}

.caja-info {
  background: var(--acento-suave);
  border-color: transparent;
}

.caja-info > .icono {
  color: var(--acento-tinta);
}

.caja-ok {
  background: var(--ok-f);
  border-color: transparent;
}

.caja-ok > .icono {
  color: var(--ok-t);
}

.caja-atencion {
  background: var(--pendiente-f);
  border-color: var(--atencion-borde);
}

.caja-atencion > .icono {
  color: var(--pendiente-t);
}

.caja-error {
  background: var(--peligro-suave);
  border-color: transparent;
}

.caja-error > .icono {
  color: var(--peligro);
}

blockquote {
  margin: 4px 0 0;
  padding: 0 0 0 var(--e-3);
  border-left: 3px solid var(--atencion-borde);
}

#avisos {
  position: fixed;
  left: var(--e-4);
  right: var(--e-4);
  bottom: calc(var(--e-4) + env(safe-area-inset-bottom));
  z-index: 30;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

body.con-barra #avisos {
  bottom: calc(var(--alto-barra) + var(--e-3) + env(safe-area-inset-bottom));
}

@media (min-width: 760px) {
  body.con-barra #avisos {
    bottom: calc(var(--e-4) + env(safe-area-inset-bottom));
  }
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--e-3);
  max-width: 560px;
  width: 100%;
  padding: var(--e-3) var(--e-4);
  border-radius: var(--radio-s);
  background: #13201f;
  color: #f2f7f6;
  box-shadow: var(--sombra-3);
  font-weight: 600;
  font-size: var(--t-s);
  pointer-events: auto;
  transition: opacity 0.4s;
}

.toast .icono {
  color: #7fd8cd;
}

.toast-error {
  background: var(--peligro);
  color: #fff;
}

.toast-error .icono {
  color: #fff;
}

.toast-fuera {
  opacity: 0;
}

/* ================================================================ estados: carga, vacío, error */
.esqueleto {
  display: flex;
  flex-direction: column;
  gap: var(--e-3);
  padding-top: var(--e-2);
}

.esq {
  border-radius: var(--radio-xs);
  background: linear-gradient(90deg, var(--superficie-3) 0%, var(--superficie-2) 50%, var(--superficie-3) 100%);
  background-size: 200% 100%;
  animation: brillo 1.4s ease-in-out infinite;
}

.esq-titulo {
  height: 30px;
  width: 45%;
  margin-bottom: var(--e-2);
}

.esq-tarjeta {
  height: 132px;
  border-radius: var(--radio);
}

@keyframes brillo {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.estado-vacio {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--e-2);
  padding: var(--e-8) var(--e-4);
  color: var(--texto-2);
}

.estado-vacio-icono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: var(--e-2);
  border-radius: 50%;
  background: var(--acento-suave);
  color: var(--acento-tinta);
}

.estado-vacio-icono .icono {
  width: 28px;
  height: 28px;
}

.estado-vacio-titulo {
  margin: 0;
  color: var(--texto);
  font-weight: 650;
  font-size: var(--t-l);
}

.estado-error .estado-vacio-icono {
  background: var(--peligro-suave);
  color: var(--peligro);
}

/* ================================================================ formularios */
.formulario {
  display: flex;
  flex-direction: column;
  gap: var(--e-5);
  margin: 0 0 var(--e-4);
}

.campo {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.campo > label,
.etiqueta-campo {
  margin: 0;
  font-weight: 650;
  font-size: var(--t-s);
}

.ayuda {
  margin: 0;
  color: var(--texto-2);
  font-size: var(--t-s);
}

input[type='text'],
input[type='email'],
input[type='password'],
textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--borde-2);
  border-radius: var(--radio-s);
  background: var(--superficie);
  color: var(--texto);
  font: inherit;
  font-size: var(--t-m); /* ≥ 16 px: iOS no hace zoom al enfocar */
  box-shadow: inset 0 1px 1px rgb(16 28 27 / 3%);
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
  resize: vertical;
  min-height: 112px;
}

input::placeholder,
textarea::placeholder {
  color: var(--texto-3);
}

input:focus,
textarea:focus {
  border-color: var(--acento);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--acento) 25%, transparent);
}

[aria-invalid='true'] {
  border-color: var(--peligro) !important;
}

.error-campo {
  margin: 0;
  color: var(--peligro);
  font-weight: 600;
  font-size: var(--t-s);
}

.con-boton {
  position: relative;
  display: flex;
}

.con-boton input {
  padding-right: 56px;
}

.boton-ver {
  position: absolute;
  right: 3px;
  top: 3px;
  bottom: 3px;
  width: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--texto-3);
  cursor: pointer;
}

.boton-ver[aria-pressed='true'] {
  color: var(--acento-tinta);
}

.con-sufijo {
  position: relative;
  display: flex;
}

.con-sufijo input {
  padding-right: 44px;
  font-variant-numeric: tabular-nums;
  font-size: var(--t-l);
  font-weight: 600;
}

.sufijo {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--texto-3);
  font-weight: 600;
}

.selector-botones {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--e-2);
}

.selector-botones .boton {
  font-size: var(--t-s);
  box-shadow: none;
}

.selector-botones:focus {
  outline: none;
}

.fichero-elegido {
  display: flex;
  align-items: center;
  gap: var(--e-3);
  padding: 6px 6px 6px var(--e-3);
  border: 1px solid var(--borde);
  border-radius: var(--radio-s);
  background: var(--superficie-2);
}

.fichero-elegido > .icono {
  color: var(--acento-tinta);
}

.fichero-elegido .texto-romper {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: var(--t-s);
}

/* pie fijo con la acción principal (pantallas de un paso) */
.pie-accion {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: var(--e-2);
  margin: var(--e-2) calc(-1 * var(--e-4)) 0;
  padding: var(--e-3) var(--e-4) calc(var(--e-3) + env(safe-area-inset-bottom));
  background: var(--fondo);
  border-top: 1px solid var(--borde);
}

@media (min-width: 760px) {
  .pie-accion {
    position: static;
    margin: var(--e-2) 0 0;
    padding: 0;
    background: none;
    border: 0;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* interruptores: toda la fila es zona de toque */
.interruptor {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--e-3);
  min-height: 48px;
  cursor: pointer;
}

.interruptor-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.interruptor-input:disabled {
  cursor: not-allowed;
}

.interruptor-texto {
  order: 0;
  font-size: var(--t-s);
}

.interruptor-pista {
  order: 1;
  position: relative;
  width: 51px;
  height: 31px;
  flex: none;
  border-radius: 16px;
  background: var(--borde-2);
  transition: background-color 0.15s;
}

.interruptor-pista::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
  transition: transform 0.15s;
}

.interruptor-input:checked + .interruptor-pista {
  background: var(--acento);
}

.interruptor-input:checked + .interruptor-pista::after {
  transform: translateX(20px);
}

.interruptor-input:disabled + .interruptor-pista {
  opacity: 0.5;
}

.interruptor-input:focus-visible + .interruptor-pista {
  outline: 3px solid var(--foco);
  outline-offset: 2px;
}

/* ================================================================ acceso */
.acceso {
  max-width: 440px;
  margin: 0 auto;
  padding-top: var(--e-8);
}

.acceso-marca {
  display: flex;
  align-items: center;
  gap: var(--e-3);
  margin-bottom: var(--e-6);
}

.acceso-marca .logo {
  width: 44px;
  height: 44px;
}

.acceso-marca-nombre {
  display: block;
  font-size: var(--t-l);
  font-weight: 750;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.acceso-marca-sub {
  display: block;
  color: var(--texto-2);
  font-size: var(--t-s);
}

.acceso-tarjeta {
  padding: var(--e-6) var(--e-5);
}

.acceso-tarjeta h1 {
  font-size: var(--t-xl);
  margin-top: 0;
  margin-bottom: var(--e-2);
}

.entradilla {
  color: var(--texto-2);
  margin-bottom: var(--e-5);
}

.acceso-pie {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--e-1);
  margin-top: var(--e-4);
}

/* ================================================================ Mis OT */
.cabeza-pagina {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--e-3);
  margin: var(--e-2) 0 var(--e-4);
}

.cabeza-pagina h1 {
  margin: 0;
}

.cabeza-pagina-sub {
  margin: 2px 0 0;
  color: var(--texto-2);
  font-size: var(--t-s);
}

.pestanas {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin: 0 0 var(--e-4);
  padding: 3px;
  border-radius: 12px;
  background: var(--superficie-3);
}

.pestana {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 4px 6px;
  border-radius: 9px;
  color: var(--texto-2);
  font-size: var(--t-s);
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  line-height: 1.15;
}

.pestana.activa {
  background: var(--superficie);
  color: var(--texto);
  box-shadow: var(--sombra-2);
}

.recuento {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--borde);
  color: var(--texto-2);
  font-size: var(--t-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pestana.activa .recuento {
  background: var(--acento);
  color: var(--acento-texto);
}

.lista-ot {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--e-3);
}

.tarjeta {
  display: block;
  overflow: hidden;
  color: var(--texto);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tarjeta:hover {
  border-color: var(--borde-2);
  box-shadow: var(--sombra-2);
}

.tarjeta-cuerpo {
  padding: var(--e-4) var(--e-4) var(--e-3);
}

.tarjeta-cabeza {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--e-2);
  margin-bottom: var(--e-2);
}

.tarjeta .sr {
  font-size: var(--t-s);
}

.tarjeta-titulo {
  margin: 0 0 var(--e-2);
  font-size: var(--t-m);
  font-weight: 650;
  line-height: 1.35;
}

.metas {
  display: flex;
  flex-wrap: wrap;
  gap: 4px var(--e-4);
  margin: 0;
  color: var(--texto-2);
  font-size: var(--t-s);
}

.meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.meta .icono {
  width: 17px;
  height: 17px;
  color: var(--texto-3);
}

.tarjeta-pie {
  display: flex;
  align-items: center;
  gap: var(--e-2);
  min-height: 48px;
  padding: var(--e-2) var(--e-4);
  border-top: 1px solid var(--borde);
  background: var(--superficie-2);
  color: var(--texto-2);
  font-size: var(--t-s);
}

.tarjeta-pie .icono {
  width: 18px;
  height: 18px;
}

.tarjeta-pie-texto {
  flex: 1;
  min-width: 0;
}

.tarjeta-toca .tarjeta-pie {
  background: var(--acento-suave);
  color: var(--acento-tinta);
  font-weight: 650;
}

.tarjeta-toca .tarjeta-pie-rotulo {
  display: block;
  font-size: var(--t-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.8;
}

.tarjeta-toca .tarjeta-pie-accion {
  font-size: var(--t-m);
}

.banner-ios {
  align-items: flex-start;
}

/* ================================================================ ficha */
.ficha-cabeza {
  margin-bottom: var(--e-4);
}

.ficha-sr-fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--e-3);
  flex-wrap: wrap;
}

.ficha-sr-fila .sr {
  font-size: var(--t-l);
}

.ficha-titulo {
  margin: var(--e-2) 0 var(--e-2);
}

.panel-paso {
  margin: 0 0 var(--e-4);
  padding: var(--e-4);
  border-left: 4px solid var(--acento);
}

.panel-paso-rotulo {
  margin: 0 0 var(--e-1);
  color: var(--texto-3);
  font-size: var(--t-xs);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.panel-paso-titulo {
  margin: 0 0 var(--e-3);
  font-size: var(--t-l);
  font-weight: 700;
}

.panel-paso-texto {
  margin: 0 0 var(--e-3);
  color: var(--texto-2);
}

.panel-paso.espera {
  border-left-color: var(--espera-t);
}

.panel-paso.fin {
  border-left-color: var(--borde-2);
}

.panel-paso .boton + .boton {
  margin-top: var(--e-2);
}

.nota-llamar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--e-2);
  margin: var(--e-3) 0 0;
  padding-top: var(--e-3);
  border-top: 1px solid var(--borde);
  color: var(--texto-2);
  font-size: var(--t-s);
}

.enlace-tel {
  display: inline-flex;
  align-items: center;
  gap: var(--e-2);
  min-height: 44px;
  font-weight: 700;
  text-decoration: none;
}

.fecha-grande {
  margin: 0;
  font-size: var(--t-l);
  font-weight: 700;
}

.local-nombre {
  margin: 0;
  font-weight: 650;
}

.descripcion {
  white-space: pre-line;
  margin: 0;
}

.miniaturas {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--e-2);
}

.miniatura,
.miniatura-editable {
  position: relative;
  display: block;
  aspect-ratio: 1;
  border-radius: var(--radio-s);
  overflow: hidden;
  background: var(--superficie-3);
  border: 1px solid var(--borde);
}

.miniatura img,
.miniatura-editable img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.miniatura-caida {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px;
  border-style: dashed;
  background: transparent;
  color: var(--texto-3);
  font-size: var(--t-xs);
  text-align: center;
  line-height: 1.2;
}

.miniaturas-editables {
  margin-top: var(--e-1);
}

.quitar-foto {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgb(0 0 0 / 60%);
  color: #fff;
}

.quitar-foto:hover {
  background: rgb(0 0 0 / 78%);
}

.presupuesto + .presupuesto {
  border-top: 1px solid var(--borde);
}

.importe {
  font-size: var(--t-l);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.sin-iva {
  font-size: var(--t-s);
  font-weight: 500;
  color: var(--texto-2);
}

.motivo {
  margin: var(--e-2) 0 0;
  padding: var(--e-2) var(--e-3);
  border-radius: var(--radio-xs);
  background: var(--pendiente-f);
  font-size: var(--t-s);
}

/* progreso */
.pasos {
  list-style: none;
  margin: 0;
  padding: 0;
}

.paso {
  position: relative;
  display: flex;
  gap: var(--e-3);
  padding-bottom: var(--e-4);
}

.paso:last-child {
  padding-bottom: 0;
}

.paso:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 26px;
  bottom: 2px;
  width: 2px;
  background: var(--borde);
}

.paso-hecho:not(:last-child)::before {
  background: var(--acento);
}

.paso-marca {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--borde-2);
  background: var(--superficie);
}

.paso-marca .icono {
  width: 14px;
  height: 14px;
  stroke-width: 3;
}

.paso-hecho .paso-marca {
  background: var(--acento);
  border-color: var(--acento);
  color: var(--acento-texto);
}

.paso-actual .paso-marca {
  border: 2px solid var(--acento);
  box-shadow: 0 0 0 4px var(--acento-suave);
}

.paso-actual .paso-marca::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--acento);
}

.paso-texto {
  display: flex;
  flex-direction: column;
  font-size: var(--t-s);
}

.paso-pendiente .paso-nombre {
  color: var(--texto-3);
}

.paso-actual .paso-nombre {
  font-weight: 700;
}

.paso-cuando {
  font-size: var(--t-xs);
  color: var(--texto-3);
}

/* resumen de la OT en las pantallas de un paso */
.resumen-ot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 var(--e-4);
  padding: var(--e-3) var(--e-4);
}

.resumen-ot-titulo {
  font-weight: 650;
}

/* ================================================================ selector de fecha */
.selector-fecha {
  display: flex;
  flex-direction: column;
  gap: var(--e-5);
}

.selector-bloque {
  display: flex;
  flex-direction: column;
  gap: var(--e-2);
}

.selector-dias {
  position: relative;
  display: flex;
  gap: var(--e-2);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  margin: 0 calc(-1 * var(--e-4));
  padding: 4px var(--e-4) 6px;
  -webkit-overflow-scrolling: touch;
}

.selector-dias::-webkit-scrollbar {
  display: none;
}

.dia {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 64px;
  min-height: 76px;
  padding: 6px 4px;
  border: 1px solid var(--borde-2);
  border-radius: 12px;
  background: var(--superficie);
  color: var(--texto);
  font: inherit;
  line-height: 1.15;
  cursor: pointer;
  scroll-snap-align: center;
}

.dia-etiqueta {
  font-size: var(--t-xs);
  font-weight: 600;
  color: var(--texto-2);
}

.dia-numero {
  font-size: var(--t-xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dia-mes {
  font-size: var(--t-xs);
  color: var(--texto-3);
}

.dia.elegido {
  border-color: var(--acento);
  background: var(--acento);
  color: var(--acento-texto);
  box-shadow: var(--sombra-2);
}

.dia.elegido .dia-etiqueta,
.dia.elegido .dia-mes {
  color: var(--acento-texto);
  opacity: 0.9;
}

.dia[aria-disabled='true'] {
  opacity: 0.4;
  cursor: not-allowed;
}

.selector-franjas {
  display: flex;
  flex-direction: column;
  gap: var(--e-4);
}

.selector-franjas:focus {
  outline: none;
}

.grupo-franjas-titulo {
  margin: 0 0 var(--e-2);
  color: var(--texto-3);
  font-size: var(--t-xs);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.franjas {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--e-2);
}

@media (min-width: 560px) {
  .franjas {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.franja {
  min-height: 44px;
  padding: 0 4px;
  border: 1px solid var(--borde-2);
  border-radius: 10px;
  background: var(--superficie);
  color: var(--texto);
  font: inherit;
  font-size: var(--t-s);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.franja:hover:not([aria-disabled='true']),
.dia:hover:not([aria-disabled='true']):not(.elegido) {
  border-color: var(--acento);
}

.franja.elegida {
  border-color: var(--acento);
  background: var(--acento);
  color: var(--acento-texto);
}

.franja[aria-disabled='true'] {
  background: transparent;
  border-style: dashed;
  color: var(--texto-3);
  text-decoration: line-through;
  cursor: not-allowed;
}

.resumen-fecha {
  display: flex;
  gap: var(--e-3);
  align-items: center;
  padding: var(--e-3) var(--e-4);
  border-radius: var(--radio-s);
  background: var(--acento-suave);
  color: var(--acento-tinta);
}

.resumen-fecha-texto {
  margin: 0;
  font-weight: 700;
  color: var(--texto);
}

.resumen-fecha-zona {
  margin: 0;
  font-size: var(--t-xs);
  color: var(--texto-2);
}

.resumen-fecha.resumen-pendiente {
  background: var(--superficie-3);
  color: var(--texto-3);
}

.resumen-fecha.resumen-pendiente .resumen-fecha-texto {
  color: var(--texto-2);
  font-weight: 600;
}

/* ================================================================ ajustes */
.cuenta {
  display: flex;
  align-items: center;
  gap: var(--e-3);
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 50%;
  background: var(--acento);
  color: var(--acento-texto);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.preferencia + .preferencia {
  border-top: 1px solid var(--borde);
}

.preferencia {
  padding: var(--e-3) 0;
}

.preferencia:first-child {
  padding-top: 0;
}

.preferencia-nombre {
  margin: 0;
  font-weight: 650;
}

.preferencias {
  list-style: none;
  margin: 0;
  padding: 0;
}

.preferencia .dato-suave {
  margin: 0 0 var(--e-1);
}

.guardado {
  min-height: 1.5em;
  margin: var(--e-2) 0 0;
}

.dispositivo {
  display: flex;
  flex-direction: column;
  gap: var(--e-3);
}

.dispositivo .caja {
  margin: 0;
}

.estado-permiso {
  margin: 0;
}

/* guía de instalación */
.guia {
  list-style: none;
  margin: 0;
  padding: 0;
}

.guia-paso {
  display: flex;
  gap: var(--e-3);
  align-items: flex-start;
}

.guia-paso + .guia-paso {
  margin-top: var(--e-4);
}

.guia-numero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  background: var(--acento);
  color: var(--acento-texto);
  font-weight: 700;
  font-size: var(--t-s);
}

.guia-titulo {
  margin: 2px 0 2px;
  font-weight: 650;
}

.guia-paso .dato-suave {
  margin: 0;
}

.icono-en-linea {
  display: inline-flex;
  vertical-align: middle;
  padding: 2px;
  border-radius: 6px;
  background: var(--superficie-3);
  color: var(--acento-tinta);
}

.icono-en-linea .icono {
  width: 18px;
  height: 18px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  .esq {
    animation: none !important;
    transition: none !important;
  }
}

/* ================================================================ ficha: hitos, ahora, historial */
.metas .meta + .meta::before {
  content: none;
}

.hitos {
  display: flex;
  list-style: none;
  margin: 0 0 var(--e-4);
  padding: 0;
}

.hito {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

/* línea entre hitos */
.hito:not(:first-child)::before {
  content: '';
  position: absolute;
  top: 11px;
  right: calc(50% + 14px);
  left: calc(-50% + 14px);
  height: 2px;
  border-radius: 2px;
  background: var(--borde-2);
}

.hito-hecho:not(:first-child)::before,
.hito-actual:not(:first-child)::before {
  background: var(--acento);
}

.hito-marca {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--borde-2);
  background: var(--superficie);
}

.hito-marca .icono {
  width: 14px;
  height: 14px;
  stroke-width: 3;
}

.hito-hecho .hito-marca {
  border-color: var(--acento);
  background: var(--acento);
  color: var(--acento-texto);
}

.hito-actual .hito-marca {
  border-color: var(--acento);
  box-shadow: 0 0 0 4px var(--acento-suave);
}

.hito-actual .hito-marca::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--acento);
}

.hito-nombre {
  max-width: 100%;
  padding: 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  letter-spacing: -0.01em;
  color: var(--texto-3);
}

.hito-hecho .hito-nombre {
  color: var(--texto-2);
}

.hito-actual .hito-nombre {
  color: var(--texto);
  font-weight: 700;
}

.ahora-cabeza {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--e-2);
  flex-wrap: wrap;
  margin-bottom: var(--e-1);
}

.ahora-cabeza .panel-paso-rotulo {
  margin: 0;
}

.quien {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: var(--t-xs);
  font-weight: 650;
}

.quien .icono {
  width: 15px;
  height: 15px;
}

.quien-tu {
  background: var(--acento);
  color: var(--acento-texto);
}

.quien-mantenimiento,
.quien-local {
  background: var(--espera-f);
  color: var(--espera-t);
}

.panel-paso .boton-texto {
  margin-top: var(--e-1);
}

.historial {
  padding: 0;
}

.historial-resumen {
  display: flex;
  align-items: center;
  gap: var(--e-2);
  min-height: 52px;
  padding: 0 var(--e-4);
  cursor: pointer;
  list-style: none;
  font-weight: 650;
  color: var(--texto);
}

.historial-resumen::-webkit-details-marker {
  display: none;
}

.historial-resumen > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: var(--e-2);
  flex: 1;
}

.historial-resumen > span:first-child .icono {
  color: var(--texto-3);
}

.historial-cuenta {
  min-width: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--superficie-3);
  color: var(--texto-2);
  font-size: var(--t-xs);
  text-align: center;
}

.historial-resumen > .icono:last-child {
  color: var(--texto-3);
}

.historial[open] .historial-resumen > .icono:last-child {
  transform: rotate(180deg);
}

.historial-lista {
  list-style: none;
  margin: 0;
  padding: 0 var(--e-4) var(--e-4);
  border-top: 1px solid var(--borde);
}

.evento {
  position: relative;
  display: flex;
  gap: var(--e-3);
  padding-top: var(--e-3);
}

.evento:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 4px;
  top: calc(var(--e-3) + 16px);
  bottom: -10px;
  width: 2px;
  background: var(--borde);
}

.evento-punto {
  flex: none;
  width: 10px;
  height: 10px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--acento);
}

.evento-texto {
  margin: 0;
  font-weight: 550;
  font-size: var(--t-s);
}

.evento-cuando {
  margin: 0;
  color: var(--texto-3);
  font-size: var(--t-xs);
}

.espacio-arriba {
  margin-top: var(--e-3);
}

.presupuesto {
  align-items: flex-start;
}

.presupuesto .fila-titulo {
  margin-bottom: 2px;
}

.fila-enlace {
  min-height: 56px;
}

.pila {
  display: flex;
  flex-direction: column;
  gap: var(--e-5);
}

.formulario > .seccion {
  margin: 0;
}

.resumen-ot .tarjeta-cabeza {
  margin-bottom: 0;
}

.fila-cuerpo > span {
  display: block;
}

.evento-cuerpo {
  min-width: 0;
}

.evento-quien {
  font-weight: 650;
  color: var(--texto-2);
}

/* ---------------------------------------------------------------- importe leído del PDF */
.campo-importe {
  display: flex;
  flex-direction: column;
  gap: var(--e-2);
}

.estado-lectura:empty {
  display: none;
}

.marca-pdf {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--e-3);
  border: 1px solid var(--atencion-borde);
  border-radius: var(--radio-s);
  background: var(--pendiente-f);
}

.marca-pdf-titulo {
  display: flex;
  align-items: center;
  gap: var(--e-2);
  margin: 0;
  color: var(--pendiente-t);
  font-weight: 650;
  font-size: var(--t-s);
}

.marca-pdf-titulo .icono {
  width: 18px;
  height: 18px;
}

.marca-pdf-linea {
  margin: 0 0 var(--e-1);
  color: var(--texto-2);
  font-size: var(--t-xs);
  overflow-wrap: anywhere;
}

/* casilla propia: toda la fila es zona de toque */
.casilla {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--e-3);
  min-height: 44px;
  font-weight: 600;
  font-size: var(--t-s);
  cursor: pointer;
}

.casilla-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.casilla-caja {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: none;
  border: 2px solid var(--borde-2);
  border-radius: 7px;
  background: var(--superficie);
  color: transparent;
}

.casilla-caja .icono {
  width: 16px;
  height: 16px;
  stroke-width: 3;
}

.casilla-input:checked + .casilla-caja {
  border-color: var(--acento);
  background: var(--acento);
  color: var(--acento-texto);
}

.casilla-input:focus-visible + .casilla-caja {
  outline: 3px solid var(--foco);
  outline-offset: 2px;
}

/* ================================================================ parte de trabajo */
.parte-horario {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--e-3);
  margin: 0 0 var(--e-2);
}

.parte-horario dt {
  color: var(--texto-3);
  font-size: var(--t-xs);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.parte-horario dd {
  margin: 2px 0 0;
  font-weight: 650;
}

.parte-operarios {
  margin-bottom: var(--e-3);
}

.parte-horas {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.parte-total {
  background: var(--superficie-2);
}

.parte-total .fila-titulo {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: var(--t-xs);
  color: var(--texto-2);
}

/* editor de operarios */
.operarios {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--e-3);
}

.operario {
  display: flex;
  flex-direction: column;
  gap: var(--e-2);
  padding: var(--e-3);
  border: 1px solid var(--borde);
  border-radius: var(--radio-s);
  background: var(--superficie-2);
}

.operario-cabeza {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--e-2);
}

.operario-cabeza .etiqueta-campo {
  margin: 0;
}

.operario-horas {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--e-3);
}

.paso-horas {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--borde-2);
  border-radius: var(--radio-s);
  background: var(--superficie);
  overflow: hidden;
}

.paso-horas button {
  width: 48px;
  height: 46px;
  border: 0;
  background: transparent;
  color: var(--acento-tinta);
  font: inherit;
  font-size: var(--t-l);
  font-weight: 700;
  cursor: pointer;
}

.paso-horas button:disabled {
  color: var(--texto-3);
  cursor: not-allowed;
}

.paso-horas output {
  min-width: 72px;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.total-horas {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: var(--e-3) 0 0;
  padding: var(--e-3) var(--e-4);
  border-radius: var(--radio-s);
  background: var(--acento-suave);
  font-weight: 700;
}

.total-horas output {
  font-size: var(--t-l);
  color: var(--acento-tinta);
  font-variant-numeric: tabular-nums;
}

.parte-horario-editor {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--borde);
  border-radius: var(--radio-s);
  overflow: hidden;
}

.parte-plegable + .parte-plegable {
  border-top: 1px solid var(--borde);
}

.parte-resumen {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--e-3);
  min-height: 56px;
  padding: var(--e-2) var(--e-3);
  list-style: none;
  cursor: pointer;
}

.parte-resumen::-webkit-details-marker {
  display: none;
}

.parte-resumen-titulo {
  color: var(--texto-3);
  font-size: var(--t-xs);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  min-width: 56px;
}

.parte-resumen-valor {
  font-weight: 700;
  font-size: var(--t-s);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.parte-resumen-cambiar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--acento-tinta);
  font-size: var(--t-s);
  font-weight: 650;
}

.parte-resumen-cambiar .icono {
  width: 18px;
  height: 18px;
}

.parte-plegable[open] .parte-resumen-cambiar .icono {
  transform: rotate(180deg);
}

.parte-selector {
  padding: var(--e-3) var(--e-3) var(--e-4);
  border-top: 1px solid var(--borde);
  background: var(--superficie);
}

.parte-selector .selector-dias {
  margin: 0 calc(-1 * var(--e-3));
  padding-left: var(--e-3);
  padding-right: var(--e-3);
}

/* Parte opcional (19-oct-2026): el parte «si los tienes» y la marca «Parte pendiente». */
.tarjeta-chips { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; min-width: 0; }
.parte-opcional-cabeza { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.parte-opcional-cabeza h2 { margin: 0; }
.parte-opcional .dato-suave { margin: 8px 0 12px; }
.parte-hueco:not(:empty) { margin: 12px 0; }
.parte-pendiente .boton { margin-top: 12px; }

/* Total de horas del cierre (20-oct-2026): obligatorio, con el control ±0,5 h. */
.total-cierre .paso-horas-total { margin-top: var(--e-2); }
.total-cierre .paso-horas-total[aria-invalid="true"] { border-color: var(--peligro, #b42318); }
.total-cierre-nota { margin-top: var(--e-2); }
