/* ============================================================
   DURAN · Registro de Jornada
   Estética: calma profesional. Porcelana cálida, verde eucalipto,
   sombras difusas de color, serif elegante + sans refinada.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700;900&family=Inconsolata:wght@400;500;600;700&display=swap');

:root {
  --fondo: #faf8f4;
  --carta: #ffffff;
  --tinta: #2e3933;
  --tinta-suave: #79867f;
  --linea: #e8e4dc;

  --verde: #43836a;
  --verde-osc: #356a55;
  --verde-claro: #e7f1ec;
  --ambar: #b88a3c;
  --ambar-claro: #f7eedd;
  --rojo: #c2705a;
  --rojo-claro: #f9e9e3;
  --azul: #5a7d96;

  --sombra: 0 10px 32px rgba(86, 105, 96, 0.10), 0 2px 8px rgba(86, 105, 96, 0.06);
  --sombra-s: 0 4px 14px rgba(86, 105, 96, 0.10);
  --sombra-verde: 0 12px 28px rgba(67, 131, 106, 0.32);
  --radio: 18px;
  --radio-s: 12px;

  --fuente: 'Lato', 'Helvetica Neue', Arial, sans-serif;
  --serif: 'Lato', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Inconsolata', 'Menlo', monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--fuente);
  color: var(--tinta);
  line-height: 1.5;
  min-height: 100dvh;
  background:
    radial-gradient(1100px 520px at 85% -10%, rgba(67, 131, 106, 0.09), transparent 60%),
    radial-gradient(900px 480px at -15% 30%, rgba(184, 138, 60, 0.07), transparent 55%),
    radial-gradient(700px 500px at 50% 115%, rgba(90, 125, 150, 0.06), transparent 60%),
    var(--fondo);
}

::selection { background: rgba(67, 131, 106, 0.22); }

h1, h2, h3 { font-family: var(--fuente); font-weight: 900; letter-spacing: -0.01em; margin: 0; }

button { font-family: var(--fuente); cursor: pointer; }
input, select, textarea { font-family: var(--fuente); font-size: 16px; }

/* ---------- marca ---------- */

.marca { display: flex; align-items: center; gap: 11px; }
img.sello {
  width: 42px; height: 42px; flex: none;
  border-radius: 12px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--linea);
  box-shadow: 0 4px 12px rgba(86, 105, 96, 0.12);
  padding: 2px;
}
.marca b { font-weight: 800; font-size: 14.5px; display: block; line-height: 1.2; letter-spacing: 0.01em; }
.marca small { font-weight: 500; font-size: 11.5px; color: var(--tinta-suave); display: block; }

/* ---------- tarjetas ---------- */

.carta {
  background: var(--carta);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
}

.carta-pad { padding: 22px; }

.perforado {
  border-top: 1px solid var(--linea);
  margin: 18px -22px 0;
  padding: 16px 22px 0;
}

/* ---------- chips ---------- */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.02em;
  border: none;
  border-radius: 999px; padding: 4px 12px;
  background: #f1efe9; color: var(--tinta-suave);
}
.chip.verde { background: var(--verde-claro); color: var(--verde-osc); }
.chip.ambar { background: var(--ambar-claro); color: var(--ambar); }
.chip.rojo  { background: var(--rojo-claro);  color: var(--rojo); }
.chip.gris  { background: #f1efe9; color: var(--tinta-suave); }

/* ---------- botones ---------- */

.btn {
  border: 1px solid var(--linea);
  border-radius: 999px;
  background: var(--carta);
  color: var(--tinta);
  font-weight: 700; font-size: 15px;
  padding: 12px 22px;
  box-shadow: var(--sombra-s);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  min-height: 48px;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-verde {
  background: linear-gradient(150deg, #4d9276, var(--verde-osc));
  color: #fff; border: none;
  box-shadow: var(--sombra-verde);
}
.btn-verde:hover { box-shadow: 0 14px 32px rgba(67, 131, 106, 0.4); }
.btn-tinta { background: var(--tinta); color: var(--fondo); border: none; box-shadow: 0 10px 24px rgba(46, 57, 51, 0.28); }
.btn-ambar { background: linear-gradient(150deg, #caa05a, var(--ambar)); color: #fff; border: none; box-shadow: 0 10px 24px rgba(184, 138, 60, 0.3); }
.btn-rojo  { background: linear-gradient(150deg, #cf8169, var(--rojo)); color: #fff; border: none; box-shadow: 0 10px 24px rgba(194, 112, 90, 0.3); }
.btn-mini {
  min-height: 36px; padding: 6px 14px; font-size: 13px;
  box-shadow: none;
}
.btn-fantasma { background: transparent; box-shadow: none; }
.btn-fantasma:hover { background: rgba(67, 131, 106, 0.07); }

/* ---------- formularios ---------- */

label.campo { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 14px; }
label.campo > span { display: block; margin-bottom: 6px; color: var(--tinta-suave); letter-spacing: 0.03em; text-transform: uppercase; font-size: 11px; }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=time], input[type=month], input[type=number], select, textarea {
  width: 100%;
  border: 1px solid var(--linea);
  border-radius: var(--radio-s);
  background: #fdfcfa;
  padding: 11px 14px;
  color: var(--tinta);
  font-weight: 500;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--verde);
  box-shadow: 0 0 0 4px rgba(67, 131, 106, 0.13);
}
textarea { resize: vertical; min-height: 72px; }

/* ---------- tablas ---------- */

.tabla-scroll { overflow-x: auto; border-radius: var(--radio); }
table.tabla {
  width: 100%; border-collapse: collapse; font-size: 14px;
  background: var(--carta);
}
.tabla th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  background: #f6f4ef; color: var(--tinta-suave);
  padding: 10px 12px; position: sticky; top: 0; white-space: nowrap;
  border-bottom: 1px solid var(--linea);
}
.tabla td { padding: 9px 12px; border-bottom: 1px solid #f1efe9; vertical-align: top; }
.tabla tr:last-child td { border-bottom: none; }
.tabla .num { font-family: var(--mono); font-weight: 500; text-align: right; white-space: nowrap; }
.tabla .mono { font-family: var(--mono); }
.tabla tr.apagado td { color: #b3bcb6; }
.tabla tr.hoy td { background: var(--verde-claro); }

.pos { color: var(--verde-osc); }
.neg { color: var(--rojo); }

/* ---------- avisos ---------- */

.aviso {
  border: none; background: var(--ambar-claro); color: #8a6a32;
  border-radius: var(--radio-s); padding: 12px 16px; font-size: 14px; font-weight: 600;
}
.aviso.rojo { background: var(--rojo-claro); color: #a05743; }
.aviso.verde { background: var(--verde-claro); color: var(--verde-osc); }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(8px);
  background: var(--tinta); color: #fdfcf9;
  border-radius: 14px; padding: 13px 22px; font-weight: 600; font-size: 14px;
  box-shadow: 0 16px 40px rgba(46, 57, 51, 0.3); opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease; z-index: 60;
  max-width: min(90vw, 480px); text-align: center;
}
.toast.ver { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--rojo); }

/* ---------- modal ---------- */

dialog.modal {
  border: none; border-radius: var(--radio);
  box-shadow: 0 30px 80px rgba(46, 57, 51, 0.25); background: var(--carta); color: var(--tinta);
  padding: 24px; width: min(94vw, 460px);
}
dialog.modal::backdrop { background: rgba(46, 57, 51, 0.4); backdrop-filter: blur(3px); }
dialog.modal h3 { margin-bottom: 16px; font-size: 20px; }

/* ---------- utilidades ---------- */

.fila { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.fila > * { flex: 1; min-width: 130px; }
.fila > .fijo { flex: none; }
.derecha { text-align: right; }
.suave { color: var(--tinta-suave); }
.mono { font-family: var(--mono); }
.mt { margin-top: 16px; }
.oculto { display: none !important; }

@keyframes aparecer {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
.anim { animation: aparecer 0.5s cubic-bezier(0.22, 0.8, 0.3, 1) both; }
.anim-1 { animation-delay: 0.07s; }
.anim-2 { animation-delay: 0.14s; }
.anim-3 { animation-delay: 0.21s; }

/* ============================================================
   LOGIN
   ============================================================ */

.login-cuerpo {
  min-height: 100dvh; display: grid; place-items: center; padding: 20px;
}
.login-carta { width: min(94vw, 410px); padding: 32px 30px; }
.login-carta .marca { margin-bottom: 26px; }
.login-titulo { font-size: 32px; margin-bottom: 6px; }
.login-sub { color: var(--tinta-suave); font-size: 14.5px; margin: 0 0 22px; }

/* ============================================================
   EMPLEADO
   ============================================================ */

.cabecera {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; max-width: 760px; margin: 0 auto;
}
.cabecera .acciones { display: flex; gap: 8px; }

main.empleado { max-width: 760px; margin: 0 auto; padding: 0 16px 96px; }

.reloj-zona { text-align: center; padding: 10px 0 20px; }
.reloj {
  font-family: var(--mono); font-weight: 600;
  font-size: clamp(48px, 14vw, 76px); letter-spacing: -0.03em; line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--tinta);
}
.reloj .seg { font-size: 0.42em; color: var(--tinta-suave); font-weight: 500; }
.fecha-hoy { font-size: 13.5px; font-weight: 600; color: var(--tinta-suave); margin-top: 8px; text-transform: capitalize; }

.estado-grande { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.estado-grande .titulo { font-size: 23px; font-weight: 900; }
.estado-grande .sub { font-size: 13.5px; color: var(--tinta-suave); font-weight: 500; margin-top: 2px; }

.botonera { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 18px; }
.btn-fichar {
  font-size: 19px; font-weight: 800; padding: 22px; min-height: 76px;
  letter-spacing: 0.01em;
}
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpi { text-align: center; padding: 12px 6px; }
.kpi .dato { font-family: var(--mono); font-weight: 600; font-size: 20px; }
.kpi .eti { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--tinta-suave); font-weight: 700; margin-top: 3px; }

.marcas-hoy { list-style: none; margin: 0; padding: 0; }
.marcas-hoy li {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid #f1efe9;
  font-size: 14.5px;
}
.marcas-hoy li:last-child { border-bottom: none; }
.marcas-hoy .hora { font-family: var(--mono); font-weight: 600; font-size: 15px; min-width: 56px; }
.marcas-hoy .punto { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.marcas-hoy .punto.entrada { background: var(--verde); box-shadow: 0 0 0 4px rgba(67, 131, 106, 0.15); }
.marcas-hoy .punto.salida { background: var(--azul); box-shadow: 0 0 0 4px rgba(90, 125, 150, 0.15); }

/* pestañas inferiores (empleado) */
.pestanas {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--linea);
  display: flex; justify-content: center;
}
.pestanas button {
  flex: 1; max-width: 254px; border: none; background: none;
  padding: 13px 6px calc(13px + env(safe-area-inset-bottom));
  font-size: 12px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  color: #a8b2ab; border-top: 2.5px solid transparent; margin-top: -1px;
  transition: color 0.15s ease;
}
.pestanas button.activa { color: var(--verde-osc); border-top-color: var(--verde); }

section.panel { margin-top: 16px; }

/* ============================================================
   ADMIN
   ============================================================ */

.admin-cuerpo { display: flex; min-height: 100dvh; }

aside.lateral {
  width: 232px; flex: none;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--linea);
  padding: 22px 16px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100dvh;
}
aside.lateral .marca { margin-bottom: 22px; }
aside.lateral nav { display: flex; flex-direction: column; gap: 3px; }
aside.lateral nav button {
  text-align: left; border: none; background: none;
  border-radius: 12px; padding: 10px 14px; font-size: 14.5px; font-weight: 600;
  color: var(--tinta-suave); display: flex; justify-content: space-between; align-items: center;
  transition: background 0.15s ease, color 0.15s ease;
}
aside.lateral nav button:hover { background: rgba(67, 131, 106, 0.07); }
aside.lateral nav button.activa {
  background: var(--verde-claro); color: var(--verde-osc); font-weight: 800;
}
aside.lateral .abajo { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }

.badge {
  font-size: 11.5px; font-weight: 800;
  background: var(--rojo); color: #fff; border-radius: 999px;
  min-width: 21px; height: 21px; display: inline-grid; place-items: center; padding: 0 7px;
}

main.admin { flex: 1; padding: 26px clamp(16px, 3vw, 38px) 60px; min-width: 0; }
main.admin h2 { font-size: 27px; margin-bottom: 4px; }
main.admin .descr { color: var(--tinta-suave); font-size: 14px; margin: 0 0 20px; max-width: 720px; }

/* tarjetas de solicitud */
.solicitud { padding: 18px 20px; margin-bottom: 12px; }
.solicitud .cab { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.solicitud .quien { font-weight: 800; font-size: 15.5px; }
.solicitud .detalle { font-family: var(--mono); font-size: 13.5px; margin: 8px 0 2px; color: var(--tinta); }
.solicitud .motivo { font-size: 14px; background: #f7f5f0; border-radius: var(--radio-s); padding: 10px 12px; margin: 10px 0; color: #5d6a63; }
.solicitud .acciones { display: flex; gap: 8px; flex-wrap: wrap; }

h3.subseccion { font-size: 18px; margin: 26px 0 10px; }

/* responsive admin */
@media (max-width: 860px) {
  .admin-cuerpo { flex-direction: column; }
  aside.lateral {
    width: 100%; height: auto; position: static;
    border-right: none; border-bottom: 1px solid var(--linea); padding: 14px 16px;
  }
  aside.lateral nav { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  aside.lateral nav button { white-space: nowrap; }
  aside.lateral .abajo { margin: 10px 0 0; flex-direction: row; }
}

@media (min-width: 560px) {
  .botonera.doble { grid-template-columns: 1fr 1fr; }
}

/* ---------- impresión de informes ---------- */
@media print {
  body { background: #fff; }
  body.imprimiendo-informe aside.lateral,
  body.imprimiendo-informe .no-imprimir { display: none !important; }
  body.imprimiendo-informe main.admin { padding: 0; }
  .carta { box-shadow: none; border: 1px solid #ddd; }
}

/* ---------- dashboard (Inicio) ---------- */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}
.kpi-carta {
  text-align: left;
  background: var(--carta);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  box-shadow: var(--sombra-s);
  padding: 18px;
  display: flex; flex-direction: column; gap: 2px;
  cursor: pointer; font-family: var(--fuente);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border-top: 4px solid var(--linea);
}
.kpi-carta:hover { transform: translateY(-2px); box-shadow: var(--sombra); }
.kpi-carta .numero { font-family: var(--mono); font-size: 34px; font-weight: 700; line-height: 1.1; }
.kpi-carta .titulo { font-size: 14px; font-weight: 900; color: var(--tinta); }
.kpi-carta .detalle { font-size: 11.5px; color: var(--tinta-suave); }
.kpi-carta.verde { border-top-color: var(--verde); }
.kpi-carta.verde .numero { color: var(--verde-osc); }
.kpi-carta.rojo { border-top-color: var(--rojo); }
.kpi-carta.rojo .numero { color: var(--rojo); }
.kpi-carta.ambar { border-top-color: var(--ambar); }
.kpi-carta.ambar .numero { color: var(--ambar); }
.kpi-carta.azul { border-top-color: var(--azul); }
.kpi-carta.azul .numero { color: var(--azul); }
.kpi-carta.gris { border-top-color: #c9cfc9; }
.kpi-carta.vacia { opacity: 0.6; border-top-color: var(--linea); }
.kpi-carta.vacia .numero { color: var(--tinta-suave); }

.lista-personas { list-style: none; margin: 0; padding: 0; }
.lista-personas li {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 0; border-bottom: 1px solid #f1efe9; font-size: 14.5px;
}
.lista-personas li:last-child { border-bottom: none; }
