.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 15.5rem 1fr;
}
.side {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 1.1rem 0.75rem 2rem;
}
.side .marca { display: inline-block; margin: 0.3rem 0.6rem 1rem; }
button.btn-danger, a.btn-danger { background: var(--danger); color: #fff; border: 0; text-decoration: none; }
a.quiet.danger { color: var(--danger); border-color: var(--danger); }

.badge-vencido {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: var(--danger);
  color: #fff;
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  vertical-align: middle;
}
.marca-logo::before { display: none; }
.marca-logo img { display: block; height: 2rem; width: auto; }
.acceso .marca-logo { margin-bottom: 0.6rem; }
.acceso .marca-logo img { height: 2.4rem; }
.side nav { display: flex; flex-direction: column; gap: 0.15rem; }
.side a, .side button.nav {
  display: block;
  width: 100%;
  text-align: left;
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  min-height: 44px;
  font-weight: 600;
}
.side a[aria-current="page"] { background: var(--primary); color: var(--primary-ink); }
.side form { margin-top: 1rem; }
.side button.quiet { width: 100%; }
.main { padding: clamp(1.2rem, 3vw, 2.2rem); max-width: 72rem; }
.main h1 { margin: 0 0 0.4rem; font-size: 1.8rem; letter-spacing: -0.03em; }
.kicker { margin: 0 0 1.2rem; color: var(--muted); }
.cerrado { background: var(--honey); color: var(--on-honey); padding: 0.85rem 1rem; margin: 0 0 1.2rem; }

.ficha { padding: 1.1rem 0; border-top: 1px solid var(--line); }
.ficha h2 { margin: 0 0 0.2rem; font-size: 1.2rem; }
.meta { color: var(--muted); margin: 0 0 0.6rem; }
.rejilla {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0 1rem;
}
.acceso {
  min-height: 100vh;
  display: grid;
  align-content: center;
  justify-items: start;
  padding: clamp(1.5rem, 5vw, 4rem);
  max-width: 36rem;
}
.persona { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.persona h2 { font-size: 1.15rem; margin: 0; }
.fila-acciones { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: center; }
.periodos { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.6rem 0 1rem; }
.periodos a {
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-weight: 600;
}
.periodos a[aria-current="page"] { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.fecha-form { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: end; max-width: 28rem; }
.fecha-form label { margin-top: 0; }
.exportar { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1rem 0; }
.exportar a { font-weight: 600; }
.tabla-wrap { overflow-x: auto; }
.tabla-wrap table { min-width: 34rem; }

.side .sucursal { margin: 0 0.4rem 0.7rem; }
.side .sucursal label { margin: 0 0 0.2rem; font-size: 0.85rem; }
.side .sucursal select { min-height: 40px; }

.cal-nav { display: flex; align-items: center; gap: 1rem; margin: 0.6rem 0; }
.cal-nav a { text-decoration: none; }
.cal-titulo { text-transform: capitalize; font-size: 1.15rem; }
.cal-buscar { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: end; margin-bottom: 1rem; }
.cal-buscar label { margin-top: 0; }
table.calendario { table-layout: fixed; min-width: 40rem; }
table.calendario th { text-align: center; text-transform: capitalize; }
.cal-celda { vertical-align: top; height: 6rem; border: 1px solid var(--line); padding: 0.3rem; }
.cal-celda a { display: block; text-decoration: none; color: inherit; min-height: 5.4rem; }
.cal-celda.fuera { opacity: 0.45; }
.cal-celda.hoy { outline: 2px solid var(--primary); outline-offset: -2px; }
.cal-celda.sel { background: var(--surface); }
.cal-dia { font-weight: 700; }
.cal-festivo { display: block; font-size: 0.72rem; color: var(--danger); font-weight: 600; line-height: 1.15; }
.cal-marcas { display: flex; flex-wrap: wrap; gap: 0.2rem; margin-top: 0.25rem; }
.cal-tag { font-size: 0.68rem; padding: 0.05rem 0.3rem; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.cal-tag.dom { background: var(--honey); color: var(--on-honey); border-color: transparent; }
.cal-tag.desc { background: var(--surface); }
.cal-tag.reg { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.leyenda { color: var(--muted); font-size: 0.85rem; }

.acciones-empleado, .expediente, .notas { margin-top: 1.8rem; }
.nota-lista { list-style: none; padding: 0; margin: 0.8rem 0 0; display: grid; gap: 0.6rem; }
.nota-lista li { border-left: 3px solid var(--line); padding: 0.3rem 0 0.3rem 0.8rem; }
.nota-texto { margin: 0; white-space: pre-wrap; }
.nota-lista .meta { margin: 0.15rem 0 0; font-size: 0.85rem; }
.documentos { display: grid; gap: 0.6rem; margin-top: 0.8rem; }
.documento { border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 0.8rem; }
.documento summary { cursor: pointer; font-weight: 600; }
.documento summary .meta { font-weight: 400; font-size: 0.85rem; }
.documento iframe { width: 100%; height: 32rem; border: 1px solid var(--line); border-radius: 8px; margin-top: 0.6rem; background: var(--surface); }
.documento img { max-width: 100%; max-height: 32rem; border-radius: 8px; margin-top: 0.6rem; }

.buscar { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: end; margin: 0.8rem 0 1rem; max-width: 40rem; }
.buscar label { margin-top: 0; }

.horario { margin: 0.6rem 0 1rem; max-width: 36rem; }
.horario-fila { display: grid; grid-template-columns: 6rem 1fr 1fr 7rem; gap: 0.5rem; align-items: center; margin-bottom: 0.4rem; }
.horario-encabezado { font-weight: 600; color: var(--muted); font-size: 0.85rem; }
.horario-dia { text-transform: capitalize; }
.horario input[type="time"] { min-height: 40px; }
.horario .check { margin: 0; }

.foto-mini { width: 44px; height: 56px; object-fit: cover; border-radius: 6px; display: block; }
.foto-celda { width: 56px; }
.sin-foto { color: var(--muted); }
.btn-ver {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0.3rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  color: var(--ink);
}
.ficha-empleado { display: grid; grid-template-columns: minmax(10rem, 15rem) 1fr; gap: 2rem; align-items: start; margin-top: 1rem; }
.foto-grande img { width: 100%; border-radius: 10px; display: block; }
.perfil { display: grid; grid-template-columns: minmax(9rem, auto) 1fr; gap: 0.3rem 1rem; margin: 1rem 0; }
.perfil dt { color: var(--muted); font-weight: 600; }
.perfil dd { margin: 0; }
@media (max-width: 800px) { .ficha-empleado { grid-template-columns: 1fr; } }

.calc-form { margin: 0.5rem 0 1rem; }
.resultado-calc { margin-top: 1.2rem; }
.resultado-calc .total td { font-weight: 700; border-top: 2px solid var(--line); }
code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.8em;
  word-break: break-all;
}
.cam { margin: 0.6rem 0 1rem; }
.cam video { width: min(100%, 22rem); background: var(--kiosk); aspect-ratio: 3/4; object-fit: cover; }
.cam .fila-acciones { margin-top: 0.5rem; }
.ayuda { color: var(--muted); max-width: 62ch; }
.estilo-layout {
  display: grid;
  grid-template-columns: minmax(0, 28rem) minmax(16rem, 22rem);
  gap: 2rem;
  align-items: start;
}
.colores {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem 1rem;
  align-items: center;
  margin-bottom: 0.4rem;
}
.colores label { margin: 0; }
.colores input[type="color"] {
  width: 3.4rem;
  height: 44px;
  padding: 0.2rem;
}
label.check { font-weight: 500; margin-top: 0.8rem; }
.previa {
  --k-bg: #141414;
  --k-ink: #f6f3ee;
  --k-btn: #8a4b12;
  --k-btn-ink: #fffaf5;
  --k-oval: #efc56a;
  background: var(--k-bg);
  color: var(--k-ink);
  border-radius: 12px;
  min-height: 28rem;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.previa-top { display: flex; justify-content: space-between; gap: 0.6rem; align-items: flex-start; }
.previa-nombre, .previa-frase, .previa-reloj, .previa-boton { margin: 0; }
.previa-nombre, .previa-reloj { font-weight: 700; }
.previa-frase { font-size: 0.9rem; max-width: 22ch; }
.previa-logo { display: block; max-width: 6.5rem; max-height: 2.4rem; object-fit: contain; margin-bottom: 0.3rem; }
.previa-marco {
  flex: 1;
  min-height: 12rem;
  background: #000;
  position: relative;
}
.previa-marco::after {
  content: "";
  position: absolute;
  inset: 12% 22%;
  border: 2px solid var(--k-oval);
  border-radius: 50%;
}
.previa-boton {
  background: var(--k-btn);
  color: var(--k-btn-ink);
  text-align: center;
  font-weight: 700;
  border-radius: 8px;
  min-height: 3rem;
  display: grid;
  place-items: center;
}
.previa-wrap .quiet { margin-top: 0.6rem; }

@media (max-width: 800px) {
  .estilo-layout { grid-template-columns: 1fr; }
  .previa-wrap { order: -1; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .side {
    position: sticky;
    top: 0;
    z-index: 10;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0.4rem;
  }
  .side .marca { margin: 0.35rem 0.5rem; }
  .side nav { flex-direction: row; overflow-x: auto; }
  .side a, .side button.nav { width: auto; white-space: nowrap; }
  .side form { margin: 0 0 0 auto; }
  .tabla-wrap { overflow-x: auto; }
}
