/* Página del trabajador: marcar entrada y salida con foto y ubicación.
   Celular: una columna, con el panel de grafito arriba. Pantalla grande: dos columnas (grafito a la izquierda, acciones a la derecha). */
body.marcar { font-size: 16px; min-height: 100vh; min-height: 100dvh; }
.vista { animation: aparece .28s ease-out; }

/* ---------- estructura en dos partes ---------- */
.dividida { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.lado {
  position: relative; display: flex; flex-direction: column;
  background: var(--grafito); color: var(--grafito-texto);
  padding: calc(18px + env(safe-area-inset-top, 0px)) 22px 30px;
  border-radius: 0 0 var(--r-4) var(--r-4);
}
.lado-centro { margin-top: 36px; }
.lado h1 { font-size: 31px; line-height: 1.08; font-weight: 700; letter-spacing: -.028em; margin: 0 0 10px; text-wrap: balance; }
.lado-bajada { margin: 0; color: var(--grafito-gris); font-size: 15px; line-height: 1.55; max-width: 40ch; text-wrap: pretty; }
.lado-pie { display: none; }
.hoja {
  flex: 1; width: 100%; max-width: 520px; margin: 0 auto;
  padding: 20px 16px calc(32px + env(safe-area-inset-bottom, 0px));
}
.tarjeta { background: var(--superficie); border: 1px solid var(--linea); border-radius: 20px; padding: 22px 20px; box-shadow: var(--sombra-1); }
.tarjeta + .tarjeta { margin-top: 14px; }

/* marca */
.marca { display: flex; align-items: center; gap: 12px; }
.marca .empresa { font-size: 14.5px; font-weight: 700; letter-spacing: .01em; margin: 0; line-height: 1.2; }
.marca .sub { margin: 1px 0 0; font-size: 12.5px; color: var(--grafito-gris); }

/* ---------- ingreso ---------- */
label.primero { margin-top: 0; }
.label-nota { font-weight: 500; color: var(--gris-2); margin-left: 4px; }
.campo-grande { font-size: 20px !important; font-weight: 600 !important; letter-spacing: .04em; min-height: 56px !important; padding: 12px 16px !important; font-variant-numeric: tabular-nums; }
.campo-grande::placeholder { font-size: 16px; letter-spacing: 0; font-weight: 450; }
#pin.campo-grande { letter-spacing: .22em; }
.marcar .check { font-size: 14.5px; color: var(--tinta-2); }
.privacidad { margin: 8px 0 0 32px; font-size: 13.5px; color: var(--gris); }
.privacidad summary {
  cursor: pointer; font-weight: 600; color: var(--gris); list-style: none; display: inline-flex; align-items: center; gap: 6px;
  text-decoration: underline; text-decoration-color: var(--linea-2); text-underline-offset: 4px;
}
.privacidad summary::-webkit-details-marker { display: none; }
.privacidad summary::after {
  content: ""; width: 14px; height: 14px; background: currentColor; transition: transform .2s var(--suave-in);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.privacidad[open] summary::after { transform: rotate(180deg); }
.privacidad p { margin: 10px 0 2px; line-height: 1.6; padding: 12px 14px; background: var(--papel); border-radius: var(--r-2); }
.rol-admin { margin: 16px 0 0; padding: 11px 14px; border-radius: var(--r-2); background: var(--acento-suave); color: var(--acento-tinta); font-size: 14px; font-weight: 600; }
.pie-ingreso { margin: 22px 0 0; text-align: center; color: var(--gris); font-size: 13.5px; line-height: 1.6; }

/* ---------- botón principal grande ---------- */
.btn.grande {
  width: 100%; min-height: 60px; margin-top: 18px; border-radius: var(--r-3);
  font-size: 17px; font-weight: 700; letter-spacing: -.005em; gap: 10px;
}
.btn.grande .ico { width: 22px; height: 22px; stroke-width: 2; }
.btn.grande.entrada { background: var(--acento); color: var(--acento-texto); }
.btn.grande.entrada:hover { background: var(--acento-2); }
.btn.grande.secundario { background: var(--superficie); color: var(--tinta); min-height: 54px; margin-top: 10px; box-shadow: inset 0 0 0 1px var(--linea-2); font-size: 16px; }
.btn.grande.secundario:hover { background: var(--papel); }
.cancelar { display: block; margin: 20px auto 0; color: var(--gris); font-size: 14.5px; }

/* ---------- pantalla principal ---------- */
.fila-usuario { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--acento); color: var(--acento-texto); font-size: 14px; font-weight: 700; letter-spacing: .02em;
}
.fila-usuario .quien { min-width: 0; }
.fila-usuario strong { display: block; font-size: 15.5px; font-weight: 650; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fila-usuario .empresa { display: block; font-size: 12.5px; color: var(--grafito-gris); }
.fila-acciones { margin-left: auto; display: flex; gap: 6px; flex: none; }
.salir {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; text-decoration: none;
  height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--grafito-linea);
  background: transparent; color: var(--grafito-texto); font-size: 13px; font-weight: 600;
  transition: background .15s, border-color .15s;
}
.salir:hover { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .18); }
.salir .ico { width: 16px; height: 16px; opacity: .8; }
.salir:focus-visible, .lado .enlace:focus-visible { outline-color: var(--acento); }

.fecha { color: var(--grafito-gris); font-size: 14.5px; font-weight: 550; margin: 0; }
.fecha::first-letter { text-transform: uppercase; }
.reloj {
  font-size: clamp(84px, 27vw, 128px); line-height: .95; font-weight: 250; letter-spacing: -.05em;
  margin: 6px 0 0 -.04em; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.reloj small { font-size: .2em; font-weight: 600; letter-spacing: .01em; margin-left: .45em; color: var(--acento); vertical-align: .2em; }
.estado {
  display: flex; align-items: flex-start; gap: 10px; margin: 22px 0 0; padding: 12px 14px;
  border: 1px solid var(--grafito-linea); border-radius: var(--r-2);
  color: rgba(244, 245, 243, .86); font-size: 14px; font-weight: 500; line-height: 1.45;
}
.estado::before { content: ""; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--grafito-gris); flex: none; }
.estado.abierta { border-color: rgba(62, 196, 120, .28); background: rgba(62, 196, 120, .07); color: #DDF3E5; }
.estado.abierta::before { background: #3EC478; box-shadow: 0 0 0 3px rgba(62, 196, 120, .22); animation: late 2s ease-in-out infinite; }
@keyframes late { 50% { box-shadow: 0 0 0 6px rgba(62, 196, 120, 0); } }
.marca-pie { align-items: center; gap: 10px; }
.marca-pie .logo { height: 26px; max-width: 120px; border-radius: 7px; }

.obra label { margin-top: 0; display: flex; align-items: center; gap: 7px; color: var(--gris); font-size: 13px; font-weight: 600; }
.obra label .ico { width: 16px; height: 16px; }
.obra select { font-size: 18px; font-weight: 650; min-height: 56px; letter-spacing: -.01em; }
.gps {
  display: flex; gap: 10px; align-items: center; margin: 12px 0 0; padding: 11px 13px; border-radius: var(--r-2);
  background: var(--papel); color: var(--gris); font-size: 14px; font-weight: 550; line-height: 1.4;
}
.punto { width: 8px; height: 8px; border-radius: 50%; background: var(--gris-2); flex: none; }
.gps.ok { background: var(--ok-suave); color: var(--ok); }
.gps.ok .punto { background: var(--ok); box-shadow: 0 0 0 3px rgba(21, 115, 71, .16); }
.gps.lejos { background: var(--alerta-suave); color: var(--alerta); }
.gps.lejos .punto { background: var(--alerta); }
.gps.buscando { background: var(--acento-suave); color: var(--acento-tinta); }
.gps.buscando .punto { background: var(--acento); animation: pulso 1.1s ease-in-out infinite; }
@keyframes pulso { 50% { opacity: .3; transform: scale(.7); } }
.ayuda { display: flex; gap: 10px; align-items: flex-start; color: var(--gris); font-size: 13.5px; line-height: 1.5; margin: 16px 4px 0; }
.ayuda .ico { margin-top: 1px; color: var(--gris-2); width: 17px; height: 17px; }

/* ---------- confirmar ---------- */
.lado-foto { padding-bottom: 22px; }
.titulo-hoja { font-size: 24px !important; margin: 4px 0 16px !important; }
.marco-foto { position: relative; border-radius: 18px; overflow: hidden; background: var(--grafito-2); }
.foto { width: 100%; aspect-ratio: 1; max-height: 46vh; object-fit: cover; display: block; }
.marco-foto .sello-tipo {
  position: absolute; left: 12px; bottom: 12px; background: rgba(22, 26, 30, .72); color: #fff;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums;
}
.resumen { margin: 0; padding: 0; list-style: none; }
.resumen li { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--linea); font-size: 15px; }
.resumen li:first-child { padding-top: 0; }
.resumen li:last-child { border-bottom: 0; padding-bottom: 0; }
.resumen li span:first-child { color: var(--gris); }
.resumen li span:last-child { font-weight: 650; text-align: right; }

/* ---------- hecho ---------- */
.hecho { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: calc(32px + env(safe-area-inset-top, 0px)) 22px calc(32px + env(safe-area-inset-bottom, 0px)); text-align: center; }
.hecho-caja { width: 100%; max-width: 420px; }
.sello {
  width: 88px; height: 88px; border-radius: 50%; margin: 0 auto 26px; display: grid; place-items: center;
  background: var(--ok); color: #fff; box-shadow: 0 0 0 10px var(--ok-suave);
  animation: sello .5s var(--suave-in);
}
.sello .ico { width: 42px; height: 42px; stroke-width: 2.4; }
.hecho.revisar .sello { background: var(--acento); color: var(--acento-texto); box-shadow: 0 0 0 10px var(--acento-suave); }
.hecho h2 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.hecho .hora { font-size: 64px; line-height: 1.05; font-weight: 250; letter-spacing: -.045em; margin: 8px 0 14px; font-variant-numeric: tabular-nums; }
.hecho .lugar {
  display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; font-size: 15px;
  background: var(--superficie); border: 1px solid var(--linea); padding: 8px 16px 8px 12px; border-radius: 999px;
}
.hecho .lugar .ico { color: var(--gris); width: 17px; height: 17px; }
.hecho .nota { max-width: 340px; margin: 18px auto 0; font-size: 14px; line-height: 1.55; }
.hecho .nota:empty { display: none; }
.hecho .btn.grande { margin-top: 36px; }
@keyframes sello { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- coordenadas ---------- */
.coords {
  font-size: 22px; font-weight: 650; line-height: 1.3; letter-spacing: -.01em; font-variant-numeric: tabular-nums;
  background: var(--papel); border-radius: var(--r-2); padding: 18px; margin: 0; word-break: break-all;
}

/* ---------- celulares muy angostos ---------- */
@media (max-width: 360px) {
  .lado h1 { font-size: 27px; }
  .salir span { display: none; }
  .salir { padding: 0 10px; }
}

/* ---------- pantalla grande: dos columnas ---------- */
@media (min-width: 900px) {
  .dividida { display: grid; grid-template-columns: minmax(400px, 46%) minmax(0, 1fr); }
  .lado {
    position: sticky; top: 0; height: 100vh; height: 100dvh; border-radius: 0;
    padding: 40px clamp(40px, 5vw, 84px); justify-content: space-between;
  }
  .lado-centro { margin: 0; }
  .lado h1 { font-size: clamp(40px, 3.6vw, 58px); line-height: 1.02; max-width: 11ch; margin-bottom: 18px; }
  .lado-bajada { font-size: 16px; }
  .lado-pie { display: block; margin: 0; color: var(--grafito-gris); font-size: 13px; line-height: 1.55; max-width: 46ch; }
  .marca-pie { display: flex; }
  .hoja {
    max-width: none; display: flex; flex-direction: column; justify-content: center;
    padding: 56px max(48px, calc((100% - 440px) / 2));
  }
  .tarjeta { padding: 30px 28px; border-radius: var(--r-4); }
  .reloj { font-size: clamp(120px, 10.5vw, 196px); margin-top: 10px; }
  .fecha { font-size: 16px; }
  .estado { display: inline-flex; margin-top: 30px; max-width: 440px; }

  .lado-foto { justify-content: center; padding-top: 48px; padding-bottom: 48px; }
  .lado-foto .titulo-hoja { font-size: 34px !important; margin-bottom: 24px !important; max-width: none; }
  .lado-foto .marco-foto { width: 100%; max-width: 520px; }
  .lado-foto .foto { max-height: 62vh; }
}
@media (min-width: 900px) and (max-height: 640px) {
  .reloj { font-size: 104px; }
  .lado h1 { font-size: 38px; }
}
