/* Gestión de vacaciones (saldos por persona, cruces y cálculo), casillas de plazo vencido y adelanto en la solicitud.
   Las animaciones quedan neutralizadas por el bloque prefers-reduced-motion de base.css. */

.vm-tabs, .vm-pane { min-width: 0; }
.vm-pane.is-entering { animation: vm-enter .32s var(--ease) both; }
@keyframes vm-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes vm-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Saldos por persona: glosario, resumen del total con atajos de orden y tabla. Cada tipo de día lleva siempre
   el mismo color (obtenidas azul, vencidas rojo, truncas gris); el resto de la tabla no usa color de adorno. */
.pace-view { display: grid; gap: 16px; min-width: 0; }
.pace-page-head { align-items: center; }
.pace-page-head p { max-width: 62ch; }

.pace-glossary { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.pace-glossary summary {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  color: var(--ink-2); font-size: 13px; font-weight: 700; list-style: none; cursor: pointer;
  border-radius: var(--r-md); transition: color .18s var(--ease), background-color .18s var(--ease);
}
.pace-glossary summary::-webkit-details-marker { display: none; }
.pace-glossary summary:hover { color: var(--ink); background: var(--surface-2); }
.pace-glossary summary .i { width: 16px; height: 16px; color: var(--blue-600); }
.pace-glossary .pace-glossary-caret { margin-left: auto; color: var(--ink-3); transition: transform .25s var(--ease); }
.pace-glossary[open] .pace-glossary-caret { transform: rotate(180deg); }
.pace-glossary dl {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px 22px;
  margin: 0; padding: 4px 16px 16px; animation: vm-rise .25s var(--ease) both;
}
.pace-glossary dt { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 13px; font-weight: 750; }
.pace-glossary dd { margin: 4px 0 0 16px; color: var(--ink-2); font-size: 12.5px; line-height: 1.5; }
.pace-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--dot); }
.pace-dot.is-obtained { --dot: var(--state-earned); }
.pace-dot.is-expired { --dot: var(--state-expired); }
.pace-dot.is-truncated { --dot: var(--state-progress); }
.pace-dot.is-total { --dot: var(--ink); }
.pace-dot.is-pace { --dot: var(--state-hold); }

/* Resumen: el total del grupo, de qué está hecho y los atajos «Ver primero a quién tiene más…». */
.pace-overview {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px 24px; padding: 18px 22px;
}
.pace-overview-total { display: grid; gap: 2px; }
.pace-overview-total strong {
  color: var(--ink); font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.pace-overview-total span { color: var(--ink-3); font-size: 12.5px; }
.pace-overview .meter { height: 12px; }
.pace-legend { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px 20px; margin: -4px 0 0; padding: 0; list-style: none; }
.pace-legend li { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.pace-legend b { color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; }
.pace-quick {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px;
  padding-top: 14px; border-top: 1px solid var(--line-soft);
}
.pace-quick > span, .pace-show > span { color: var(--ink-2); font-size: 13px; font-weight: 700; }
.pace-quick .seg, .pace-show .seg { flex-wrap: wrap; max-width: 100%; }
.pace-quick .seg button, .pace-show .seg button { min-height: 36px; }

.pace-card { overflow: hidden; }
.pace-toolbar { border-bottom: 0; padding-bottom: 6px; }
.pace-toolbar .control { flex: 1 1 220px; }
.pace-toolbar select.input { flex: 0 1 180px; min-width: 0; height: 38px; font-size: 13px; }
.pace-toolbar .seg button { min-height: 34px; }
.pace-toolbar .pace-sort-select { display: none; }
.pace-show {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding: 6px 16px 14px; border-bottom: 1px solid var(--line-soft);
}

.pace-table th { padding: 0; }
.pace-sort {
  display: inline-flex; align-items: center; gap: 4px; width: 100%; min-height: 40px; padding: 0 16px;
  color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; text-align: inherit;
  transition: color .15s var(--ease);
}
.pace-table th.num .pace-sort { justify-content: flex-end; }
.pace-sort:hover, .pace-sort.is-on { color: var(--ink); }
.pace-sort:focus-visible { outline-offset: -3px; }
.pace-sort-arrow { width: 13px; height: 13px; color: var(--blue-600); transition: transform .2s var(--ease); }
.pace-sort-arrow.is-desc { transform: rotate(180deg); }
.pace-table td { padding: 11px 16px; }
.pace-person { display: flex; align-items: center; gap: 10px; min-width: 220px; max-width: 300px; }
.pace-person > div { min-width: 0; }
.pace-person strong { display: block; overflow: hidden; color: var(--ink); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.pace-person small { display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; }
.pace-person small span { overflow: hidden; text-overflow: ellipsis; }
.pace-total-cell { min-width: 110px; }
.pace-total-cell .meter { margin-top: 6px; }
.pace-num { color: var(--state-earned); font-weight: 750; font-variant-numeric: tabular-nums; }
.pace-num.is-total { color: var(--ink); font-size: 15px; font-weight: 800; }
.pace-num.is-expired { color: var(--red-700); }
.pace-num.is-truncated { color: var(--ink-2); font-weight: 650; }
.pace-none { color: var(--ink-4); font-weight: 500; }
.pace-usage { display: grid; gap: 4px; min-width: 210px; }
.pace-usage small { margin: 0; }
.pace-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pace-chips:empty { display: none; }
.pace-note { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }
.pace-note .i { width: 14px; height: 14px; color: var(--amber-800); }
.pace-expiry { display: block; color: var(--ink-2); font-weight: 650; white-space: nowrap; }
.pace-expiry.is-soon { color: var(--amber-800); }
.pace-table .badge { height: 22px; font-size: 11.5px; }

/* Entrada: escalonada solo la primera vez; al filtrar u ordenar, un fundido corto. */
.pace-enter { animation: vm-rise .3s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
.pace-body.is-swapping { animation: pace-swap .15s var(--ease); }
@keyframes pace-swap { from { opacity: .35; } to { opacity: 1; } }

/* En pantallas angostas cada persona es una tarjeta compacta: nombre, cifras en línea y su uso a tiempo. */
@media (max-width: 720px) {
  .pace-overview { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .pace-legend { grid-column: 1; }
  .pace-toolbar .pace-sort-select { display: block; }
  .pace-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .pace-table, .pace-table tbody { display: block; }
  .pace-table tr {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: dense; gap: 10px 12px;
    padding: 14px 16px; border-bottom: 1px solid var(--line-soft);
  }
  .pace-table tr:last-child { border-bottom: 0; }
  .pace-table td, .pace-table td.num { display: block; padding: 0; border: 0; text-align: left; }
  .pace-table td.pace-person-cell, .pace-table td.pace-usage-cell { grid-column: 1 / -1; }
  .pace-table td[data-label]::before {
    content: attr(data-label); display: block; margin-bottom: 2px;
    color: var(--ink-3); font-size: 10.5px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase;
  }
  .pace-person { min-width: 0; max-width: none; }
  .pace-total-cell, .pace-usage { min-width: 0; }
}
@media (max-width: 520px) {
  .pace-overview-total strong { font-size: 26px; }
  .pace-toolbar select.input { flex: 1 1 140px; }
}

/* Casillas de plazo vencido y adelanto en el formulario de solicitud */
.rq-options {
  display: grid; gap: 8px; margin: 0; padding: 12px;
  border: 1px dashed var(--line); border-radius: 12px; background: var(--surface-2);
  animation: pop .3s var(--spring);
}
.rq-options legend { display: inline-flex; align-items: center; gap: 6px; padding: 0 6px; color: var(--ink); font-size: 12.5px; font-weight: 800; }
.rq-options legend .i { width: 15px; height: 15px; color: var(--state-hold); }
.rq-option {
  display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 10px; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line-soft); border-radius: 10px; background: var(--surface); cursor: pointer;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
}
.rq-option:hover { border-color: var(--tone); transform: translateY(-1px); }
.rq-option:has(input:checked) { border-color: var(--tone); box-shadow: 0 0 0 3px var(--tone-soft); }
.rq-option:has(input:focus-visible) { outline: 3px solid var(--tone-soft); outline-offset: 2px; }
.rq-option input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--tone); }
.rq-option b { display: block; color: var(--tone-ink); font-size: 13px; }
.rq-option small { display: block; margin-top: 2px; color: var(--ink-2); font-size: 12px; line-height: 1.4; }
.rq-options-note { display: flex; align-items: center; gap: 6px; margin: 2px 2px 0; color: var(--ink-2); font-size: 12px; font-weight: 600; }
.rq-options-note .i { width: 14px; height: 14px; }

/* Etiquetas de una solicitud con plazo vencido, adelanto o en revisión de RR. HH. */
.req-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.req-tags .chip { font-size: 10.5px; }

/* Feriados de Perú y Ecuador (solo RR. HH.) */
.holidays-head { flex-wrap: wrap; }
.holidays-head h3 { display: flex; align-items: center; gap: 8px; }
.holidays-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.holidays-toolbar .seg button { min-height: 36px; }
.holidays-note { display: flex; gap: 10px; margin: 0 22px; padding: 11px 14px; border-radius: var(--r-md); font-size: 13px; line-height: 1.5; color: var(--tone-ink); background: var(--tone-soft); }
.holidays-note .i { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.holidays-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px 22px; padding: 18px 22px 22px; }
.holidays-list > .empty { grid-column: 1 / -1; }
.holidays-month h4 { margin: 0 0 8px; font-size: 13px; font-weight: 750; color: var(--ink-3); }
.holidays-month ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.holiday-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--surface);
  animation: vm-rise .35s var(--spring) both;
  transition: transform .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.holiday-row:hover { border-color: var(--coral-500); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.holiday-row .date-block { width: 42px; height: 44px; flex: none; border-radius: 12px; }
.holiday-text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.holiday-text strong { font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.holiday-text small { font-size: 12px; color: var(--ink-3); }
.holiday-row .row-actions { display: flex; gap: 2px; }
@media (max-width: 560px) {
  .holidays-toolbar { justify-content: flex-start; }
  .holidays-note { margin: 0 16px; }
  .holidays-list { padding: 16px; grid-template-columns: 1fr; }
}
