/* Agenda ampliada: planificador de OT (filas × días, mes), chips por tipo y barra de acciones en bloque */
.agp-g {
  display: grid;
  grid-template-columns: 110px repeat(var(--n), minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
}
.agp-cab,
.agp-fila {
  background: var(--surface-2);
  padding: 4px 6px;
  font-weight: 600;
  font-size: 12px;
}
.agp-cab.hoy {
  color: var(--accent, var(--ink));
  text-decoration: underline;
}
.agp-fila {
  display: flex;
  align-items: center;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agp-dia {
  background: var(--surface);
  min-height: 56px;
  padding: 3px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 120px;
}
.agp-dia.hoy {
  background: var(--surface-2);
  box-shadow: inset 0 3px 0 var(--ok);
}
.agp-dia.pv-sobre,
.pv-dia.pv-sobre {
  outline: 2px dashed var(--ok);
  outline-offset: -2px;
}
/* OT en la agenda: tarjeta con el número, la hora y el equipo; el color del lateral es el tipo de trabajo. */
.agp-ev {
  --c: var(--warn);
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 7px 8px 7px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  background: color-mix(in srgb, var(--c) 9%, var(--surface));
  color: var(--ink);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
  overflow: hidden;
  transition:
    box-shadow 0.12s,
    border-color 0.12s;
}
.agp-ev::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--c);
}
.agp-ev:hover {
  border-color: var(--c);
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.16);
}
.agp-ev.pre {
  --c: var(--ok);
}
.agp-ev.nor {
  --c: var(--vio);
}
/* Sin personal: contorno discontinuo y fondo vacío */
.agp-ev.sin {
  background: transparent;
  border-style: dashed;
}
.agp-ev.hecha {
  opacity: 0.55;
}
.agp-ev.sel {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px var(--ink);
}
.agp-ev input[type='checkbox'],
.agp-pend input[type='checkbox'] {
  width: 14px;
  height: 14px;
  min-width: 0;
  padding: 0;
  margin: 1px 0 0;
  flex: none;
}
.agp-ev input[type='checkbox'] {
  opacity: 0.3;
}
.agp-ev:hover input[type='checkbox'],
.agp-ev.sel input[type='checkbox'],
.agp-ev input[type='checkbox']:focus-visible {
  opacity: 1;
}
.agp-ev button {
  all: unset;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}
.agp-l1 {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.agp-n {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.agp-h {
  font-size: 11px;
  font-weight: 600;
  color: var(--c);
}
.agp-t,
.agp-q {
  font-size: 12px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agp-t {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}
.agp-q {
  white-space: nowrap;
}
.agp-q {
  font-size: 11px;
  color: var(--muted);
}
/* Leyenda, arriba y a la vista */
.agp-ley {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 4px 0 2px;
  font-size: 12px;
}
.agp-pt {
  --c: var(--warn);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
}
.agp-pt::before {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: var(--c);
}
.agp-pt.pre {
  --c: var(--ok);
}
.agp-pt.nor {
  --c: var(--vio);
}
.agp-pt.sin::before {
  background: transparent;
  border: 2px dashed var(--c);
}
.agp-masivo {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: flex-end;
  padding: 8px 10px;
  margin: 8px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}
.agp-masivo .fld.wide {
  min-width: 220px;
}
.agp-pend .item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.agp-pend .item .main {
  all: unset;
  cursor: pointer;
  display: block;
  flex: 1;
}
@media (max-width: 700px) {
  .agp-g {
    grid-template-columns: 80px repeat(var(--n), minmax(120px, 1fr));
  }
}
/* Usuario de un contratista: no crea, importa ni borra equipos ni contratos (lo ve, pero lo gestiona la casa). */
.rol-contratista [data-act='nuevoEquipo'],
.rol-contratista [data-act='eqImportar'],
.rol-contratista [data-act='famImportar'],
.rol-contratista [data-act='nuevoContrato'] {
  display: none;
}

/* Tarjeta de grupo: varias OT de una revisión el mismo día (parece una pila) */
.agp-ev.agp-gr {
  box-shadow:
    0 1px 2px rgb(0 0 0 / 0.08),
    3px 3px 0 -1px var(--surface),
    3px 3px 0 0 var(--line);
}
.agp-gr .agp-n {
  font-size: 15px;
}
/* Lista de la agenda: las OT de una revisión plegadas */
.ag-grupo {
  border-bottom: 1px solid var(--line);
}
.ag-grupo > summary {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 10px 12px;
  cursor: pointer;
  background: var(--surface-2);
}
.ag-grupo > summary::before {
  content: '▸';
  transition: transform 0.12s;
}
.ag-grupo[open] > summary::before {
  transform: rotate(90deg);
}
