/* Fichar · Reusalia — mismos tokens que altas/caja/citas, pero todo MÁS GRANDE.
   Esto es un kiosco: se usa de pie, con prisa, a veces con las manos ocupadas. Los objetivos
   táctiles nunca bajan de 56px y el flujo entero son dos toques (nombre → 4 cifras). */
:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #1b2430;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #4f46e5;
  --brand-ink: #ffffff;
  --ok: #16a34a;
  --ok-soft: #dcfce7;
  --amber: #d97706;
  --err: #dc2626;
  --err-soft: #fee2e2;
  --radius: 16px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 8px 24px rgba(0, 0, 0, .05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216; --panel: #171b21; --ink: #e8eaed; --muted: #9aa3af;
    --line: #262b33; --brand: #6366f1; --ok-soft: #14321f; --err-soft: #3b1717;
    --shadow: 0 1px 3px rgba(0,0,0,.4);
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100svh; display: flex; flex-direction: column;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.centro { text-align: center; }

/* Cabecera con reloj */
.cab {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.marca { display: flex; align-items: center; gap: 10px; }
.marca .logo { font-size: 26px; }
.marca h1 { font-size: 18px; margin: 0; }
.marca .sub { margin: 0; font-size: 12px; color: var(--muted); }
.reloj { text-align: right; }
#relojHora { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }

.aviso-config {
  background: var(--err); color: #fff; padding: 10px 16px; font-size: 14px; font-weight: 600;
}

.pantalla { flex: 1; padding: 18px 16px 8px; max-width: 720px; width: 100%; margin: 0 auto; }
.titulo-paso { text-align: center; font-size: 19px; margin: 4px 0 18px; }
.cargando { text-align: center; color: var(--muted); }

/* Paso 1 — tarjetas de empleada */
.rejilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tarjeta-emp {
  background: var(--panel); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 20px 14px; min-height: 104px; cursor: pointer; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  box-shadow: var(--shadow); color: var(--ink); font-family: inherit; transition: transform .1s ease;
}
.tarjeta-emp:active { transform: scale(.97); }
.tarjeta-emp .nom { font-size: 20px; font-weight: 700; }
.tarjeta-emp .est { font-size: 13px; color: var(--muted); }
.tarjeta-emp.dentro { border-color: var(--ok); background: var(--ok-soft); }
.tarjeta-emp.dentro .est { color: var(--ok); font-weight: 600; }

/* Paso 2 — PIN */
.btn-atras {
  background: none; border: none; color: var(--brand); font-size: 16px; font-family: inherit;
  padding: 8px 4px; cursor: pointer; min-height: 44px;
}
.accion-prevista { text-align: center; font-size: 17px; margin: -10px 0 14px; color: var(--muted); }
.accion-prevista strong { color: var(--ink); }
.pin-puntos { display: flex; gap: 16px; justify-content: center; margin: 6px 0 14px; }
.pin-puntos span {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--muted); display: block;
}
.pin-puntos span.on { background: var(--brand); border-color: var(--brand); }
.pin-error {
  text-align: center; color: var(--err); background: var(--err-soft); border-radius: 10px;
  padding: 10px 12px; margin: 0 auto 12px; max-width: 420px; font-size: 14.5px;
}
.teclado {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  max-width: 340px; margin: 0 auto 12px;
}
.tecla {
  min-height: 68px; font-size: 26px; font-weight: 600; font-family: inherit;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--radius); cursor: pointer; box-shadow: var(--shadow);
}
.tecla:active { background: var(--brand); color: var(--brand-ink); }
.tecla-aux { font-size: 22px; }

/* Paso 3 — confirmación */
.hecho { text-align: center; padding: 22px 12px; }
.hecho-icono { font-size: 66px; line-height: 1; }
.hecho h2 { font-size: 24px; margin: 10px 0 2px; }
.hecho-hora { font-size: 46px; font-weight: 800; margin: 6px 0; font-variant-numeric: tabular-nums; }
.hecho.err .hecho-hora { font-size: 20px; font-weight: 600; }
.btn-grande {
  margin-top: 20px; min-height: 60px; width: 100%; max-width: 320px; font-size: 19px;
  font-family: inherit; font-weight: 600; border: none; border-radius: var(--radius);
  background: var(--brand); color: var(--brand-ink); cursor: pointer;
}

/* Mis horas */
.horas-resumen { display: flex; gap: 12px; margin: 12px 0 16px; }
.tarjeta-dato {
  flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; text-align: center; box-shadow: var(--shadow);
}
.tarjeta-dato span { display: block; font-size: 26px; font-weight: 700; }
.tarjeta-dato small { color: var(--muted); }
.tabla-horas { display: flex; flex-direction: column; gap: 8px; }
.fila-hora {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; display: flex; align-items: center; gap: 12px; justify-content: space-between;
}
.fila-hora .dia { font-weight: 600; min-width: 96px; }
.fila-hora .tramo { color: var(--muted); font-variant-numeric: tabular-nums; }
.fila-hora .tot { font-weight: 700; }
.fila-hora.incompleta { border-color: var(--amber); }
.fila-hora.incompleta .tot { color: var(--amber); }

.pie {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 16px; border-top: 1px solid var(--line); background: var(--panel);
}
.pie a { color: var(--muted); }

/* ---- Panel de dirección ---- */
.panel-wrap { max-width: 1100px; margin: 0 auto; padding: 16px; width: 100%; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tab {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  border-radius: 999px; padding: 9px 16px; cursor: pointer; font-size: 14.5px; font-family: inherit;
  min-height: 42px;
}
.tab.active { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.barra {
  display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px;
}
.campo { display: flex; flex-direction: column; gap: 4px; }
.campo label { font-size: 12.5px; color: var(--muted); }
.campo input, .campo select, .campo textarea {
  font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); color: var(--ink); min-height: 42px;
}
.btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-family: inherit;
  border-radius: 10px; padding: 9px 14px; cursor: pointer; font-size: 14.5px; min-height: 42px;
}
.btn-primario { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn-peligro { color: var(--err); border-color: var(--err); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
table.datos { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.datos th, table.datos td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14.5px; }
table.datos th { background: color-mix(in srgb, var(--brand) 8%, var(--panel)); font-size: 13px; color: var(--muted); }
table.datos tr:last-child td { border-bottom: none; }
.tabla-scroll { overflow-x: auto; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-avisa { background: #fef3c7; color: var(--amber); }
.chip-mal { background: var(--err-soft); color: var(--err); }
.chip-gris { background: var(--line); color: var(--muted); }
.anulado { opacity: .55; text-decoration: line-through; }
.nota {
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--brand);
  border-radius: 10px; padding: 12px 14px; margin: 12px 0; font-size: 14px;
}
.seccion { margin: 22px 0 10px; font-size: 17px; }
.acciones-fila { display: flex; gap: 6px; flex-wrap: wrap; }
.acciones-fila .btn { padding: 5px 10px; min-height: 34px; font-size: 13px; }

/* Modal del panel */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 40; }
.modal {
  position: fixed; z-index: 41; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(460px, calc(100vw - 24px)); background: var(--panel); border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.35); padding: 18px; max-height: 90svh; overflow: auto;
}
.modal h3 { margin: 0 0 12px; font-size: 18px; }
.modal .campo { margin-bottom: 12px; }
.modal .campo input, .modal .campo select, .modal .campo textarea { width: 100%; }
.modal-pie { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }

@media print {
  .tabs, .barra, .acciones-fila, .pie, .cab .reloj, .btn { display: none !important; }
  body { background: #fff; }
  table.datos { box-shadow: none; }
  table.datos th, table.datos td { border-bottom: 1px solid #999; }
}
