/* Catálogo › Actualizar catálogo (B16). Solo jerarquía y estados del flujo; usa los tokens de crm.css
   (tinta / dorado / café), así que hereda el modo oscuro sin reglas propias de color. */

.sync-intro { max-width: 78ch; margin: 0 0 16px; color: var(--text-2); font-size: var(--fs-base); }

/* Sub-pestañas Actualizar / Historial (role=tab: el estado va en aria-selected) */
.sync-tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-2); }
.sync-tabs button:hover:not([aria-selected="true"]) { color: var(--text); }
/* El título del paso recibe el foco al avanzar (lectores de pantalla) sin dibujar un anillo de teclado. */
.sync-stage [tabindex="-1"]:focus { outline: none; }

/* Pasos 1 · 2 · 3 */
.sync-steps { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; counter-reset: step; }
.sync-steps li { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: var(--fs-sm); font-weight: 500; counter-increment: step; }
.sync-steps li::before { content: counter(step); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); font-size: var(--fs-xs); font-weight: 600; font-variant-numeric: tabular-nums; }
.sync-steps li[aria-current="step"] { color: var(--text); font-weight: 600; }
.sync-steps li[aria-current="step"]::before { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.sync-steps li.done { color: var(--text-2); }
.sync-steps li.done::before { content: "✓"; background: var(--accent-soft, var(--surface-3)); border-color: var(--accent); color: var(--text); }

.sync-drop { flex-direction: column; text-align: center; padding: 34px 20px; gap: 10px; }
.sync-drop strong { font-size: 1.02rem; }
.sync-side { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-top: 12px; font-size: var(--fs-sm); color: var(--muted); }

/* Contadores que filtran la tabla */
.sync-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.sync-count { text-align: left; cursor: pointer; font: inherit; color: inherit; }
.sync-count[aria-pressed="true"] { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.sync-count:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sync-count.is-retire .value { color: var(--err-ink); }
.sync-count.is-new .value { color: var(--ok-ink); }

.sync-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* Cambio antes → después */
.sync-change { display: block; font-size: var(--fs-sm); line-height: 1.45; }
.sync-change s { color: var(--muted); }
.sync-change b { font-weight: 600; }
.sync-notes { margin: 4px 0 0; padding: 0; list-style: none; font-size: var(--fs-xs); color: var(--muted); }
.sync-notes li + li { margin-top: 2px; }

/* Barra de acción del paso: secundarias a la izquierda, primaria única a la derecha */
.sync-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.sync-actions .spacer { flex: 1; }
.sync-confirm { display: grid; gap: 8px; margin-top: 14px; }
.sync-confirm input { max-width: 220px; text-transform: uppercase; letter-spacing: .04em; }

/* Historial */
.sync-hist-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.sync-hist-row:last-child { border-bottom: 0; }
.sync-hist-main { min-width: 0; }
.sync-hist-main .title { font-weight: 600; overflow-wrap: anywhere; }
.sync-hist-main .meta { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }
.sync-hist-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sync-hist-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.sync-hist-row > * { min-width: 0; }
.sync-hist-detail { grid-column: 1 / -1; }
.sync-hist-detail[hidden] { display: none; }

@media (max-width: 640px) {
    .sync-hist-row { grid-template-columns: 1fr; }
    .sync-hist-btns { justify-content: flex-start; }
    .sync-actions { justify-content: stretch; }
    .sync-actions .btn { flex: 1 1 auto; }
    .sync-actions .spacer { display: none; }
    /* En el teléfono la foto ocupa lo que necesita el detalle del cambio. */
    .sync-stage .tbl th:first-child, .sync-stage .tbl td:first-child { display: none; }
}
