/* ==========================================================================
   Coches de empresa — añadidos sobre panel.css
   --------------------------------------------------------------------------
   panel.css es copia literal de scrapper-Competidores/static/css/panel.css y
   no se toca: si cambia allí, se vuelve a copiar. Aquí solo va lo que el
   panel no tiene (calendario, formularios, firma, acceso), siempre con sus
   tokens y sus medidas.
   ========================================================================== */

/* ---------- Contraste ---------------------------------------------------- */

/* Un punto más de contraste que el panel de competencia, pedido el 29 sep 2026.
   Se redefinen aquí sus tokens (panel.css no se toca): grises de texto y líneas
   más oscuros, fondo algo más gris para que destaquen las tarjetas y textos de
   las píldoras más intensos. Para volver al aspecto exacto del panel, borrar
   este bloque. */
:root {
  --bg: #eceff0;
  --surface-2: #f5f7f7;
  --ink: #080d0e;
  --ink-2: #3d494e;
  --ink-3: #64727a;
  --line: #d9dfe1;
  --line-2: #c3ccd0;
  --accent-ink: #00575c;
  --up-ink: #9a1d16;
  --down-ink: #0b653c;
  --new-ink: #213fa6;
  --gone-ink: #544c45;
  --stock-ink: #744f00;
  /* Días sin llaves (rayas) y festivos (rosa) en el calendario. */
  --sinllaves-a: #edf0f2;
  --sinllaves-b: transparent;
  --festivo-bg: #fde2ee;
  --festivo-ink: #b0245f;
  --shadow: 0 1px 2px rgba(12, 17, 18, 0.08), 0 2px 6px -2px rgba(12, 17, 18, 0.06);
}

:root[data-theme="dark"] {
  --bg: #090c0e;
  --surface-2: #1d252a;
  --ink: #f0f4f6;
  --ink-2: #b4bfc4;
  --ink-3: #8e9aa0;
  --line: #2b353a;
  --line-2: #3a464d;
  --accent-ink: #9cecf0;
  --up-ink: #f7aca5;
  --down-ink: #86e0ad;
  --new-ink: #b3c4f8;
  --gone-ink: #c9c1b9;
  --stock-ink: #ecc985;
  --sinllaves-a: #1c2429;
  --sinllaves-b: transparent;
  --festivo-bg: rgba(236, 72, 153, 0.2);
  --festivo-ink: #f7a8cb;
}

.navitem { color: rgba(255, 255, 255, 0.84); }
.navitem__count { color: rgba(255, 255, 255, 0.66); }
.rail__section { color: rgba(255, 255, 255, 0.52); }
.rail__clock { color: rgba(255, 255, 255, 0.56); }
.rail__search input::placeholder { color: rgba(255, 255, 255, 0.55); }
.tabla th { color: var(--ink-2); }
/* Cabecera de las tablas (Mis reservas, Histórico, Usuarios…): franja turquesa para que se
   distinga de las filas de un vistazo. */
.tabla thead th {
  background: var(--accent-wash); color: var(--accent-ink);
  font-weight: 600; font-size: 0.688rem; text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 2px solid var(--accent);
}

/* ---------- Barra lateral ------------------------------------------------ */

.rail__marca { display: flex; align-self: flex-start; }
.rail__nav form { margin: 0; }

/* «Salir» es un POST: botón con la misma pinta que un .navitem. */
.navitem--boton {
  width: 100%;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
}

/* Flota: cada coche abre el calendario filtrado por él; conserva su color de libre / ocupado. */
.navitem--coche, .navitem--coche:hover { color: rgba(255, 255, 255, 0.84); }
.navitem--own.navitem--coche:hover { background: rgba(0, 167, 175, 0.34); }
.navitem--rival.navitem--coche:hover { background: rgba(212, 63, 53, 0.32); }
.navitem--coche.is-active { color: #fff; }
.navitem--own.navitem--coche.is-active { background: rgba(0, 167, 175, 0.46); }
.navitem--rival.navitem--coche.is-active { background: rgba(212, 63, 53, 0.42); }

/* En la flota la cuenta es texto («Libre», «Con Robert»), no un número. */
.navitem--own .navitem__count,
.navitem--rival .navitem__count { font-family: "IBM Plex Sans", system-ui, sans-serif; }

/* ---------- Cabecera ----------------------------------------------------- */

.topbar__acciones { margin-left: auto; display: flex; align-items: center; gap: 8px; }
a.btn-sync, a.btn-sync:hover { color: #fff; }
.topbar__acciones .pastilla { height: 34px; border-radius: 10px; }

/* ---------- Pastillas extra ---------------------------------------------- */

a.pastilla { color: var(--ink-2); }
a.pastilla.is-active, a.pastilla.is-active:hover { color: #fff; }
.pastilla--enlinea { display: inline-flex; }
.pastilla--peligro { color: var(--up-ink); border-color: var(--up-ink); }
.pastilla--peligro:hover { color: var(--up-ink); background: var(--up-bg); border-color: var(--up-ink); }
.filtros-tienda form { margin: 0; }

/* Selects y fechas de filtro con forma de pastilla. */
.pastilla--select {
  appearance: none;
  -webkit-appearance: none;
  width: auto;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  padding-right: 12px;
}
select.pastilla--select {
  padding-right: 28px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
                    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 13px, calc(100% - 11px) 13px;
  background-size: 4px 4px;
  background-repeat: no-repeat;
}
.pastilla--select:focus { outline: none; border-color: var(--accent); }

/* ---------- Calendario --------------------------------------------------- */

.calendario { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendario__cab-mes { scroll-margin-top: 12px; }
.calendario__leyenda { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.calendario__cab {
  font-weight: 500;
  font-size: 0.719rem;
  color: var(--ink-3);
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
}

.dia {
  min-width: 0;
  height: 100px;   /* fija: todos los meses miden lo mismo (como mucho dos reservas y «+N más») */
  position: relative;
  padding: 8px 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.dia:nth-child(7n) { border-right: 0; }
.calendario .dia:nth-last-child(-n + 7) { border-bottom: 0; }
.dia--fuera { background: var(--surface-2); }
.dia--fuera .dia__num { color: var(--ink-3); opacity: 0.6; }
/* Viernes, fin de semana o festivo: no se recogen ni se devuelven llaves (laborables.py). */
.dia--sinllaves, .calendario__sinllaves {
  background: repeating-linear-gradient(135deg, var(--sinllaves-a) 0 7px, var(--sinllaves-b) 7px 14px);
}
.dia--sinllaves .dia__num { color: var(--ink-3); }
/* Festivo: el número en rosa y, a su derecha, el nombre (en el móvil, solo el número). */
.dia--festivo .dia__num { background: var(--festivo-bg); color: var(--festivo-ink); font-weight: 600; }
.dia--hoy.dia--festivo .dia__num { background: var(--accent); color: #fff; }
.dia__cab { display: flex; align-items: center; gap: 6px; min-width: 0; }
.dia__cab .dia__num { align-self: center; flex: none; }
.dia__festivo {
  min-width: 0; overflow: hidden;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;   /* hasta dos líneas */
  font-size: 0.656rem; font-weight: 600; line-height: 1.2; padding: 2px 7px; border-radius: 8px;
  background: var(--festivo-bg); color: var(--festivo-ink);
}
.calendario__sinllaves, .calendario__festivo {
  font-size: 0.688rem; color: var(--ink-2); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-2);
}
.calendario__festivo { background: var(--festivo-bg); color: var(--festivo-ink); border-color: transparent; font-weight: 600; }

.dia__num {
  align-self: flex-start;
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 4px;
  border-radius: 999px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  color: var(--ink-2);
}
.dia__num:hover { background: var(--accent-wash); color: var(--accent-ink); }
.dia--hoy .dia__num, .dia--hoy .dia__num:hover { background: var(--accent); color: #fff; }

.dia__evento {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 7px;
  padding: 2px 7px;
  font-size: 0.719rem;
}
.dia__evento:hover { filter: brightness(1.08); }
.dia__evento b { font-weight: 600; }
.dia__horas { font-family: "IBM Plex Mono", monospace; font-size: 0.656rem; opacity: 0.8; }

/* Día con la jornada entera cogida: la misma reserva, pero ocupa la casilla. */
.dia__evento--completo { flex: 1; min-height: 20px; }

/* El calendario deja salir la lista de «+N más»; las esquinas de abajo se redondean a mano. */
.bloque--calendario { overflow: visible; }
.calendario .dia:nth-last-child(7) { border-bottom-left-radius: 14px; }
.calendario .dia:last-child { border-bottom-right-radius: 14px; }
.dia__mas > summary { list-style: none; cursor: pointer; align-self: flex-start; }
.dia__mas > summary::-webkit-details-marker { display: none; }
.dia__lista {
  position: absolute; z-index: 5; left: 4px; top: 30px; width: max(100%, 200px);
  display: flex; flex-direction: column; gap: 4px; padding: 10px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(12, 17, 18, 0.18);
}
.dia:nth-child(7n) .dia__lista, .dia:nth-child(7n - 1) .dia__lista { left: auto; right: 4px; }
.dia__lista .dia__evento--completo { flex: none; min-height: 0; }
.dia__lista-titulo { font-size: 0.719rem; color: var(--ink-2); margin-bottom: 2px; }

/* ---------- Ficha y movimientos ------------------------------------------ */

.tabla--ficha th {
  width: 170px;
  border-bottom: 1px solid var(--line);
  padding: 11px 14px;
  vertical-align: top;
}
.tabla--ficha td { white-space: normal; }
.tabla--ficha tbody tr:last-child th { border-bottom: 0; }
.tabla--ficha .t-sku { margin-left: 6px; }

.firma {
  display: block;
  width: 100%;
  max-width: 320px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.aviso--info { background: var(--new-bg); color: var(--new-ink); }
.aviso + .aviso { margin-top: 10px; }   /* dos avisos seguidos no van pegados */

/* ---------- Conductor (fijo: la reserva es de quien la hace) ------------ */

.conductor {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2);
  font-size: 0.844rem;
}
.conductor b { font-weight: 600; }
.conductor span { font-family: "IBM Plex Mono", monospace; font-size: 0.75rem; color: var(--ink-2); }

/* ---------- Llaves: estado «en curso» y los tres pasos -------------------- */

/* Rampa turquesa del acento para «En curso / tiene las llaves» (panel.css no la tiene). */
.pildora--curso { background: var(--accent-wash); color: var(--accent-ink); }

/* Estados de las reservas (calendario, Mis reservas, histórico, ficha, registro): más color que el
   tono pálido del panel, sin llegar a relleno entero. Fondo translúcido y borde del color del estado,
   con la tinta del tema (claro u oscuro). */
.pildora--new, .pildora--stock, .pildora--up, .pildora--down, .pildora--gone { font-weight: 600; border: 1px solid; }
.pildora--new { background: rgba(47, 99, 214, 0.2); border-color: rgba(47, 99, 214, 0.5); color: var(--new-ink); }
.pildora--stock { background: rgba(242, 165, 22, 0.28); border-color: rgba(214, 140, 0, 0.6); color: var(--stock-ink); }
.pildora--up { background: rgba(214, 58, 47, 0.2); border-color: rgba(214, 58, 47, 0.5); color: var(--up-ink); }
.pildora--down { background: rgba(31, 138, 76, 0.2); border-color: rgba(31, 138, 76, 0.5); color: var(--down-ink); }
.pildora--gone { background: rgba(139, 130, 121, 0.2); border-color: rgba(139, 130, 121, 0.5); color: var(--gone-ink); }
a.pildora:hover { filter: brightness(1.08); }

/* Lo siguiente que toca en una reserva: un botón grande (o dos, si al admin le toca también). */
.siguiente { display: flex; flex-wrap: wrap; gap: 10px; }
.siguiente__boton {
  flex: 1 1 240px; display: flex; flex-direction: column; justify-content: center; gap: 3px;
  min-height: 64px; padding: 12px 18px; border-radius: 14px;
  background: var(--accent); color: #fff; font-size: 1rem; font-weight: 600; text-decoration: none;
}
.siguiente__boton small { font-size: 0.75rem; font-weight: 400; opacity: 0.85; }
.siguiente__boton:hover { filter: brightness(1.07); color: #fff; }
.siguiente__boton--2 { background: var(--surface); color: var(--accent-ink); border: 1px solid var(--accent); }
.siguiente__boton--2:hover { color: var(--accent-ink); }

/* Lo secundario de la ficha (firmas, observaciones, registro): plegado hasta que se pulsa. */
.plegable > summary {
  display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  font-size: 0.844rem; font-weight: 500; color: var(--ink);
}
.plegable > summary::-webkit-details-marker { display: none; }
.plegable > summary::before { content: "›"; color: var(--ink-3); transition: transform 0.15s; }
.plegable[open] > summary::before { transform: rotate(90deg); }
.plegable > summary small { color: var(--ink-3); font-family: "IBM Plex Mono", monospace; font-weight: 400; }
.plegable__ayuda { margin-left: auto; font-size: 0.75rem; font-weight: 400; color: var(--ink-3); }
.plegable[open] > summary { margin-bottom: 10px; }
.observacion-form__enviar { margin-left: auto; }
.observacion-form .campo { flex: 1 1 100%; margin-bottom: 10px; }

/* Mis reservas: cada grupo con el color de su estado, y las cuatro tablas con las columnas
   en el mismo sitio (anchos fijos), estén llenas o vacías. */
.tabla--mias { table-layout: fixed; min-width: 560px; }
.tabla--mias .c-destino { width: 42%; }
.tabla--mias .c-cuando { width: 38%; }
.tabla--mias .c-coche { width: 20%; }
.tabla--mias td { overflow: hidden; text-overflow: ellipsis; }
.grupo__titulo { font-size: 0.813rem; padding: 4px 12px; }
.grupo__titulo small { margin-left: 4px; opacity: 0.75; }

/* Ventana que obliga a decidir (recibir llaves sin los km del conductor). */
.modal {
  max-width: 440px; width: calc(100% - 32px); padding: 22px 22px 18px;
  border: 1px solid var(--line); border-top: 4px solid var(--up-ink); border-radius: 14px;
  background: var(--surface); color: var(--ink); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
.modal::backdrop { background: rgba(12, 17, 18, 0.55); }
.modal__titulo { margin: 0 0 10px; font-size: 1.05rem; color: var(--up-ink); }
.modal__texto { margin: 0 0 10px; font-size: 0.875rem; line-height: 1.5; color: var(--ink-2); }
.modal__texto b { color: var(--ink); }
.modal__acciones { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
/* Aviso sin alarma (horario de llaves): turquesa en vez de rojo. */
.modal--info { border-top-color: var(--accent); }
.modal--info .modal__titulo { color: var(--accent-ink); }
.modal__lista { margin: 0 0 10px; padding-left: 18px; font-size: 0.875rem; line-height: 1.5; color: var(--ink-2); }
.modal__lista li + li { margin-top: 6px; }

/* ---------- Observaciones con fotos ---------------------------------------- */

.observacion-form { border-bottom: 1px solid var(--line); }
/* Filas de tabla que abren su reserva (coches.js). */
.fila-enlace { cursor: pointer; }

.subir-fotos { height: 34px; cursor: pointer; }
.subir-fotos__botones { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.subir-fotos__botones .campo__ayuda { margin-top: 0; }
.observacion { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.observacion:last-child { border-bottom: 0; }
.observacion__cab { display: flex; justify-content: space-between; gap: 10px; font-size: 0.813rem; }
.observacion__cab b { font-weight: 600; }
.observacion__texto { margin: 6px 0 0; font-size: 0.844rem; color: var(--ink); }
.observacion__fotos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.observacion__fotos img {
  display: block; width: 220px; height: 165px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line);
}
/* Fotos elegidas y aún sin guardar: vista previa grande, con ✕ para quitarla. */
.previas { display: flex; flex-wrap: wrap; gap: 10px; }
.previas:not(:empty) { margin-top: 12px; }
.previa { position: relative; }
.previa img {
  display: block; width: 220px; height: 165px; object-fit: cover; border-radius: 10px;
  border: 2px solid var(--accent);
}
.previa__quitar {
  position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%;
  border: 0; background: rgba(12, 17, 18, 0.7); color: #fff; font-size: 0.875rem; cursor: pointer;
}
.previa__quitar:hover { background: var(--up-ink); }
.observacion__fotos a:hover img { border-color: var(--accent); }

/* ---------- Alta y gestión de usuarios ------------------------------------- */

/* Fecha de nacimiento en tres desplegables en línea (día, mes, año). */
.formulario select[name$="_day"], .formulario select[name$="_month"], .formulario select[name$="_year"] {
  width: auto; display: inline-block; margin-right: 6px;
}
.acciones-fila { display: flex; gap: 6px; justify-content: flex-end; }
.acciones-fila form { margin: 0; }

/* ---------- Registro de cambios ----------------------------------------- */

.tabla--registro td { vertical-align: top; }
.registro__cambios { white-space: normal !important; min-width: 22em; font-size: 0.781rem; color: var(--ink-2); }
.registro__cambios b { font-weight: 500; color: var(--ink); }
.registro__cambios s { color: var(--ink-3); }
.registro__foto { font-size: 0.75rem; color: var(--ink-3); }
.registro__nota { margin-top: 3px; font-size: 0.75rem; color: var(--ink-2); font-style: italic; }
.tabla--registro .t-sku { display: block; margin: 2px 0 0; }

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

select, textarea { font: inherit; }

.bloque--form { max-width: 680px; width: 100%; align-self: center; }
.bloque--form > .bloque__filtros { border-radius: 14px 14px 0 0; }

.formulario { padding: 18px 16px 16px; display: flex; flex-wrap: wrap; gap: 0 12px; }
.formulario > * { flex-basis: 100%; }

.campo { margin-bottom: 16px; min-width: 0; }
.campo--mitad { flex: 1 1 220px; }
.campo__rotulo { display: block; margin-bottom: 6px; font-size: 0.719rem; letter-spacing: 0.02em; color: var(--ink-3); }
.campo__error { margin-top: 5px; font-size: 0.75rem; color: var(--up-ink); }
.campo__obligatorio { margin-left: 3px; color: var(--up-ink); font-weight: 600; }

.formulario input:not([type=radio]):not([type=checkbox]):not([type=hidden]),
.formulario select,
.formulario textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.844rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.formulario input:focus, .formulario select:focus, .formulario textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.formulario select:disabled { background: var(--surface-2); color: var(--ink-2); }
.campo--error input, .campo--error select, .campo--error textarea, .campo--error .lienzo { border-color: var(--up-ink) !important; }


/* Opciones de radio (combustible) como pastillas; la elegida, en acento. */
.opcion input { position: absolute; opacity: 0; pointer-events: none; }
.opcion { position: relative; }
.opcion:has(input:checked) { background: var(--accent); border-color: var(--accent); color: #fff; }
.opcion:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Casilla (sí/no) como una pastilla con su marca. */
.opcion--casilla { display: inline-flex; gap: 8px; }
.opcion--casilla input { position: static; opacity: 1; pointer-events: auto; width: 14px; height: 14px; margin: 0; accent-color: #fff; }
.opcion--casilla:has(input:not(:checked)) input { accent-color: var(--accent); }
/* Campo bloqueado (p. ej. tu propio rol): se ve, pero no invita a tocarlo. */
.opcion--fija { cursor: default; opacity: 0.7; }

.campo__ayuda { margin-top: 5px; font-size: 0.75rem; color: var(--ink-3); max-width: 60ch; }
.campo__ayuda + .campo__ayuda { margin-top: 2px; }
.campo__ayuda b { font-weight: 500; color: var(--ink-2); }

.lienzo {
  display: block;
  width: 100%;
  height: 190px;
  margin-bottom: 8px;
  border: 1px dashed var(--line-2);
  border-radius: 10px;
  background: #fff;
  touch-action: none;
}

.formulario__acciones { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding-top: 4px; }
.formulario__acciones .pastilla { height: 34px; border-radius: 10px; }
.formulario__acciones--borrar { justify-content: space-between; margin: 0 16px; padding: 14px 0 16px; border-top: 1px solid var(--line); }
.formulario__acciones--borrar .campo__ayuda { margin-top: 0; }
.pastilla[disabled] { opacity: 0.45; cursor: not-allowed; }

/* ---------- Selector de fecha y hora (fecha_hora.js) ------------------- */

.selfecha { position: relative; }
.selfecha__boton {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.844rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.selfecha__boton svg { color: var(--ink-3); flex: none; }
.selfecha__boton:hover { border-color: var(--ink-3); }
.selfecha__boton:disabled { cursor: default; background: var(--surface-2); color: var(--ink-2); border-color: var(--line); }
.selfecha__boton[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.selfecha__vacio { color: var(--ink-3); }
.campo--error .selfecha__boton { border-color: var(--up-ink); }

.selfecha__pop {
  position: absolute;
  z-index: 25;
  top: calc(100% + 6px);
  left: 0;
  display: grid;
  grid-template-columns: 252px 176px;
  gap: 14px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  box-shadow: 0 12px 32px -8px rgba(12, 17, 18, 0.22), 0 2px 6px rgba(12, 17, 18, 0.06);
}
.selfecha__pop[hidden] { display: none; }
.selfecha__pop--derecha { left: auto; right: 0; }
/* panel.css recorta los bloques (overflow: hidden); el del formulario deja salir el desplegable. */
.bloque--form { overflow: visible; }

.selfecha__cab { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.selfecha__cab b {
  font-family: Archivo, sans-serif; font-style: italic; font-weight: 800; font-size: 0.813rem;
  text-transform: uppercase; letter-spacing: 0.01em;
}
.selfecha__dias { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.selfecha__sem { text-align: center; font-size: 0.688rem; color: var(--ink-3); padding: 2px 0 4px; }
.selfecha__dia {
  position: relative;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.781rem;
  cursor: pointer;
}
.selfecha__dia:hover { background: var(--accent-wash); color: var(--accent-ink); }
.selfecha__dia.es-fuera { color: var(--ink-3); opacity: 0.55; }
.selfecha__dia.es-hoy { box-shadow: inset 0 0 0 1.5px var(--accent); }
.selfecha__dia.es-sinllaves { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-3); }
.selfecha__dia.es-festivo { color: var(--festivo-ink); background: var(--festivo-bg); text-decoration-color: var(--festivo-ink); }
.selfecha__dia.es-entero { background: var(--up-bg); color: var(--up-ink); }
.selfecha__dia.es-parte::after {
  content: ""; position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: var(--up-ink);
}
.selfecha__dia.es-sel, .selfecha__dia.es-sel:hover { background: var(--accent); color: #fff; }
.selfecha__dia.es-sel::after { background: #fff; }

.selfecha__leyenda { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 0.688rem; color: var(--ink-3); }
.selfecha__leyenda span { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.selfecha__leyenda .es-entero { background: var(--up-bg); box-shadow: inset 0 0 0 1px var(--up-ink); }
.selfecha__leyenda .es-parte { width: 6px; height: 6px; border-radius: 50%; background: var(--up-ink); margin-left: 6px; }

.selfecha__horas { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); padding-left: 14px; }
.selfecha__titulo { font-size: 0.719rem; color: var(--ink-3); margin-bottom: 8px; text-transform: capitalize; }
.selfecha__lista {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px;
  max-height: 262px; overflow-y: auto; padding-right: 4px; align-content: start;
}
.selfecha__hora { justify-content: center; font-family: "IBM Plex Mono", monospace; }
.selfecha__hora.es-ocupada { color: var(--up-ink); background: var(--up-bg); border-color: transparent; text-decoration: line-through; }
.selfecha__hora.es-ocupada.is-active { text-decoration: none; }
.selfecha__hora.es-fuerahora:not(.is-active) { opacity: 0.45; }
.selfecha__hora:disabled { opacity: 0.4; cursor: default; }


/* ---------- Acceso ------------------------------------------------------- */

.acceso { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.acceso__caja { width: 100%; max-width: 380px; }
.acceso__cab { background: #000; padding: 20px 20px 18px; }
.acceso .formulario__acciones .btn-sync { width: 100%; justify-content: center; height: 38px; }
.acceso .topbar__sub { display: block; margin-top: 4px; white-space: normal; }
.acceso__form { display: block; }
.acceso .aviso { margin-bottom: 14px; }
.acceso__enlace { margin: 14px 0 0; text-align: center; font-size: 0.781rem; }

/* ---------- Fichaje sencillo con QR: botones grandes para el móvil ------- */

.fichaje__boton { justify-content: center; min-height: 52px; font-size: 1rem; }
.fichaje__foto { min-height: 44px; margin-top: 6px; }

/* Pantalla del QR: dos botones cuadrados (el que no toca, apagado) y «Hacer una reserva» debajo,
   todo centrado en la página. */
.fichaje-qr {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  min-height: calc(100dvh - 200px); width: min(100%, 480px); margin: 0 auto; padding: 8px 0;
}
.fichaje-qr__aviso { width: 100%; margin: 0; text-align: center; }
.fichaje-qr__par { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; }
.fichaje-qr__boton {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  border-radius: 18px; background: var(--accent); color: #fff; text-decoration: none;
  font-size: 1.25rem; font-weight: 600; text-align: center; box-shadow: 0 2px 8px rgba(12, 17, 18, 0.12);
}
/* Sin «filter» al pasar por encima: en el móvil el :hover se queda puesto tras tocar y Safari, con
   un filtro, a veces deja de pintar el icono de dentro. Solo con ratón, y cambiando el color. */
@media (hover: hover) {
  .fichaje-qr__boton:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); color: #fff; }
}
.fichaje-qr__boton svg { flex: none; display: block; }
.fichaje__boton--apagado,
.fichaje__boton--apagado:hover {
  background: var(--line); color: var(--ink-3); box-shadow: none; cursor: not-allowed;
}
.fichaje-qr__reserva { width: 100%; justify-content: center; min-height: 48px; font-size: 1rem; }
/* Coche en marcha mientras la tienes: traquetea, las líneas de velocidad pasan y la carretera corre. */
.fichaje-qr__conduciendo { color: var(--accent); line-height: 0; }
.fichaje-qr__carroceria { animation: traqueteo 0.5s ease-in-out infinite alternate; }
.fichaje-qr__lineas path { animation: velocidad 0.9s linear infinite; }
.fichaje-qr__lineas path:nth-child(2) { animation-delay: 0.3s; }
.fichaje-qr__lineas path:nth-child(3) { animation-delay: 0.6s; }
.fichaje-qr__carretera { animation: carretera 0.6s linear infinite; }
@keyframes traqueteo { to { transform: translateY(-1.5px); } }
@keyframes velocidad { from { transform: translateX(8px); opacity: 0; } 40% { opacity: 1; } to { transform: translateX(-8px); opacity: 0; } }
@keyframes carretera { to { stroke-dashoffset: 14; } }
@media (prefers-reduced-motion: reduce) {
  .fichaje-qr__carroceria, .fichaje-qr__lineas path, .fichaje-qr__carretera { animation: none !important; }
}

/* ---------- Móvil: nada se sale por los lados ---------------------------- */

@media (max-width: 900px) {
  /* Nada más ancho que la pantalla: sin arrastrar hacia los lados. */
  html, body { overflow-x: hidden; }
  .panel { overflow-x: clip; }
  /* Con letra de menos de 16 px, el iPhone amplía la página al tocar un campo (al entrar tras
     escanear el QR) y se queda ampliada: se podía arrastrar hacia los lados. */
  input, select, textarea,
  .formulario input:not([type=radio]):not([type=checkbox]):not([type=hidden]),
  .formulario select, .formulario textarea, select.pastilla--select { font-size: 16px; }
}

/* ---------- Pantalla estrecha -------------------------------------------- */

@media (max-width: 560px) {
  .topbar__acciones .btn-sync span { display: none; }
  .topbar__acciones .btn-sync { padding: 0 12px; }
  .calendario__cab { padding: 7px 0; text-align: center; }
  .dia { height: 66px; padding: 3px 2px 5px; gap: 2px; }
  .dia__num { min-width: 22px; height: 22px; font-size: 0.688rem; }
  .dia__evento { font-size: 0.625rem; padding: 1px 3px; border-radius: 4px; }
  .dia__horas { display: none; }
  /* En el móvil no cabe el nombre del festivo: queda el número en rosa. */
  .dia__festivo { display: none; }
  .calendario__leyenda { display: none; }
  .dia__evento--completo { min-height: 0; }
  .dia__mas > summary { padding: 0 4px; font-size: 0.625rem; min-height: 0; height: 16px; }
  .dia__lista { top: 26px; }
  .dia__lista .dia__horas { display: inline; }
  .tabla--ficha th { width: 110px; }
  .topbar { flex-wrap: wrap; }
  .topbar__acciones { flex-basis: 100%; margin-left: 0; flex-wrap: wrap; }
  .plegable__ayuda { display: none; }
  .previa, .observacion__fotos a { flex: 1 1 calc(50% - 10px); }
  .previa img, .observacion__fotos img { width: 100%; height: 140px; }
  .selfecha__pop { position: fixed; left: 8px !important; right: 8px !important; top: auto; bottom: 8px;
    grid-template-columns: 1fr; max-height: calc(100dvh - 16px); overflow-y: auto; }
  .selfecha__horas { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 10px; }
  .selfecha__lista { grid-template-columns: repeat(4, 1fr); max-height: 150px; }
}
