/**
 * Renombrar archivos en lote — diseño editorial de RÜM (oct 2026), igual que
 * las herramientas PDF (assets/css/rum_pdf_tools.css) y Criterios: fondo blanco,
 * Syne en títulos, Inter en texto, etiquetas y botones en versalitas, filetes
 * cálidos en vez de sombras y primario durazno en píldora. Tokens --rx-* de
 * assets/css/rum_shell_editorial.css (los carga navbar.php), con respaldo.
 * Ya no usa rum_operations_shell.css.
 */

@font-face { font-family: "Syne"; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/assets/home/fonts/syne-var.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/assets/home/fonts/inter-var.woff2) format("woff2"); }

html { background: #fff; }

body.rum-rn-ops {
  margin: 0;
  background: #fff;
  color: var(--rx-ink, #1C1F26);
  font-family: var(--rx-f-sans, "Inter", system-ui, -apple-system, "Segoe UI", sans-serif);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.rn {
  --ink: var(--rx-ink, #1C1F26);
  --ink-2: var(--rx-ink-2, #4A4F5A);
  --muted: #6B7079;
  --label: var(--rx-muted, #8A8F98);
  --rule: var(--rx-rule, #ECE4DA);
  --rule-strong: var(--rx-rule-strong, #DDD1C3);
  --paper-2: var(--rx-paper-2, #FAF7F3);
  --peach: var(--rx-peach, #F3D2B2);
  --peach-2: var(--rx-peach-2, #EEBF95);
  --peach-ink: var(--rx-peach-ink, #5C3A21);
  --terra: var(--rx-terracotta, #B8784C);
  --f-display: var(--rx-f-display, "Syne", "Inter", system-ui, sans-serif);
  --f-sans: var(--rx-f-sans, "Inter", system-ui, -apple-system, "Segoe UI", sans-serif);
  --f-mono: ui-monospace, "Cascadia Code", SFMono-Regular, Consolas, monospace;
  --ok: #3E7A4F;
  --mid: #9A6417;
  --mid-bg: rgba(201, 138, 43, .13);
  --bad: #B4483C;
  --bad-bg: rgba(180, 72, 60, .09);

  box-sizing: border-box;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(20px, 2.6vw, 40px) clamp(16px, 2.4vw, 36px) 64px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}

/* Sin esto el relleno de los campos se suma a su 100 % de ancho y se salen de su columna. */
#rnApp *,
#rnApp *::before,
#rnApp *::after {
  box-sizing: border-box;
}

.rn-field,
.rn-row > * {
  min-width: 0;
}

/* ---------- Encabezado ---------- */

.rn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 22px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--label);
  text-decoration: none;
  transition: color .2s ease;
}

.rn-back:hover,
.rn-back:focus-visible {
  color: var(--ink);
}

.rn .ed-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--rule);
}

.rn .ed-head__text {
  flex: 1 1 460px;
  min-width: 0;
}

.rn .ed-kicker {
  display: block;
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--terra);
}

.rn .ed-head h1 {
  margin: 0;
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(30px, 3.6vw, 52px);
  line-height: 1.02;
  letter-spacing: -.025em;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.rn .ed-lede {
  margin: 14px 0 0;
  max-width: 68ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.rn .ed-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
  max-width: 100%;
}

.rn .ed-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
}

/* ---------- Botones: píldora Inter en versalitas ---------- */

.rn :where(.rn-btn) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  margin: 0;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--peach);
  background: var(--peach);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background .25s ease, border-color .25s ease, color .25s ease;
}

.rn :where(.rn-btn):hover,
.rn :where(.rn-btn):focus-visible {
  background: var(--peach-2);
  border-color: var(--peach-2);
}

.rn :where(.rn-btn):focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.rn :where(.rn-btn--quiet) {
  background: transparent;
  border-color: var(--rule-strong);
}

.rn :where(.rn-btn--quiet):hover,
.rn :where(.rn-btn--quiet):focus-visible {
  background: transparent;
  border-color: var(--ink);
}

.rn :where(.rn-btn--sm) {
  min-height: 30px;
  padding: 0 12px;
  font-size: 10.5px;
}

.rn :where(.rn-btn--lg) {
  min-height: 42px;
  padding-inline: 22px;
  font-size: 11.5px;
}

.rn :where(.rn-btn):disabled {
  opacity: .45;
  cursor: not-allowed;
}

.rn :where(.rn-btn:not(.rn-btn--quiet)):disabled:hover {
  background: var(--peach);
  border-color: var(--peach);
}

.rn :where(.rn-btn--quiet):disabled:hover {
  border-color: var(--rule-strong);
}

.rn :where(.rn-btn)[hidden] {
  display: none;
}

/* ---------- Atajos: píldoras ---------- */

.rn-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 24px;
}

.rn-presets__label {
  margin-right: 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--terra);
}

.rn :where(.rn-preset) {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin: 0;
  padding: 0 13px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: 600 10.5px/1.2 var(--f-sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}

.rn :where(.rn-preset):hover,
.rn :where(.rn-preset):focus-visible {
  border-color: var(--ink);
  color: var(--ink);
  outline: none;
}

.rn :where(.rn-preset):active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.rn :where(.rn-preset--quiet) {
  border-color: transparent;
  color: var(--label);
}

.rn-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

/* ---------- Reglas ---------- */

.rn-rules {
  position: sticky;
  top: 12px;
  padding: 18px 20px 20px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: #fff;
}

.rn-rules h2,
.rn-files h2 {
  margin: 0 0 16px;
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--ink);
}

.rn-group {
  min-width: 0;
  margin: 0 0 16px;
  padding: 0 0 16px;
  border: 0;
  border-bottom: 1px solid var(--rule);
}

.rn-group:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.rn-group legend {
  padding: 0;
  margin: 0 0 10px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--terra);
}

.rn-field {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--label);
}

.rn-field:last-child {
  margin-bottom: 0;
}

/* El margen va en la fila, no en cada campo: si solo la primera columna lo
   tuviera, la cuadrícula estiraría la segunda y quedarían desalineadas. */
.rn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 12px;
}

.rn-row--gap {
  margin-top: 12px;
}

.rn-row:last-child {
  margin-bottom: 0;
}

.rn-row > .rn-field {
  margin-bottom: 0;
}

.rn-row--3 {
  grid-template-columns: 1.2fr .8fr .8fr;
}

.rn-field input[type="text"],
.rn-field input[type="number"],
.rn-field select {
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  outline: none;
  box-shadow: none;
  transition: border-color .2s ease;
}

.rn-field select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 32px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%231C1F26' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  cursor: pointer;
}

.rn-field input::placeholder {
  color: #A3A7AE;
}

.rn-field input[type="text"]:focus,
.rn-field input[type="number"]:focus,
.rn-field select:focus {
  border-color: var(--ink);
  outline: none;
  box-shadow: none;
}

#rnTemplate {
  font-family: var(--f-mono);
  font-size: 13.5px;
}

.rn-tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.rn :where(.rn-token) {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 0;
  padding: 0 11px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--terra);
  font: 500 12px/1 var(--f-mono);
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
}

.rn :where(.rn-token):hover,
.rn :where(.rn-token):focus-visible {
  border-color: var(--ink);
  color: var(--ink);
  outline: none;
}

.rn-hint {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.rn-field + .rn-hint {
  margin: -4px 0 12px;
}

.rn-hint[hidden] {
  display: none;
}

.rn-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
}

.rn-check:last-child {
  margin-bottom: 0;
}

.rn-check input {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--ink);
  cursor: pointer;
}

.rn-check input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.rn-check[hidden] {
  display: none;
}

/* ---------- Archivos ---------- */

.rn-files {
  position: relative;
  min-width: 0;
}

.rn-drop {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  min-height: 190px;
  padding: 28px 16px;
  border: 1px dashed var(--rule-strong);
  border-radius: 10px;
  background: var(--paper-2);
  text-align: center;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}

.rn-drop:hover,
.rn-drop:focus-visible {
  border-color: var(--ink);
  outline: none;
}

.rn-drop strong {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -.015em;
  color: var(--ink);
}

.rn-drop p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.rn-drop input[type="file"] {
  display: none;
}

.rn-drop__btns {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

#rnApp.has-files .rn-drop {
  min-height: 0;
  grid-template-columns: 1fr auto;
  justify-items: start;
  text-align: left;
  padding: 12px 16px;
  gap: 2px 14px;
}

#rnApp.has-files .rn-drop strong {
  font-size: 16px;
}

#rnApp.has-files .rn-drop p {
  grid-column: 1;
}

#rnApp.has-files .rn-drop__btns {
  grid-column: 2;
  grid-row: 1 / span 2;
  margin-top: 0;
}

#rnApp.is-dropping .rn-drop {
  border-color: var(--ink);
}

#rnApp.is-dropping .rn-files::after {
  content: attr(data-drop-label);
  position: absolute;
  inset: -8px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--ink);
  border-radius: 10px;
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  font-family: var(--f-display);
  font-size: 26px;
  letter-spacing: -.015em;
  pointer-events: none;
  z-index: 5;
}

.rn-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 22px 0 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}

.rn-actions .rn-spacer {
  flex: 1;
}

.rn-summary {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.rn-summary:empty {
  display: none;
}

.rn-status {
  min-height: 1.4em;
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--ink-2);
}

.rn-status.is-ok { color: var(--ok); font-weight: 600; }
.rn-status.is-warn { color: var(--mid); }
.rn-status.is-err { color: var(--bad); font-weight: 600; }

.rn-progress {
  height: 3px;
  margin: 0 0 12px;
  border-radius: 999px;
  background: var(--rule);
  overflow: hidden;
}

.rn-progress[hidden] {
  display: none;
}

.rn-progress > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--ink);
  transition: width .2s ease;
}

/* Antes → después: filas con filete, sin caja */

.rn-tablewrap {
  overflow-x: auto;
  border-top: 1px solid var(--rule-strong);
}

.rn-tablewrap[hidden],
#rnApp:not(.has-files) .rn-tablewrap {
  display: none;
}

#rnTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  table-layout: fixed;
}

#rnTable th,
#rnTable td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#rnTable th:first-child,
#rnTable td:first-child {
  padding-left: 0;
}

#rnTable thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding-top: 12px;
  padding-bottom: 10px;
  background: #fff;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--label);
}

#rnTable tbody tr {
  transition: background .15s ease;
}

#rnTable tbody tr:hover {
  background: var(--paper-2);
}

#rnTable .rn-col-n { width: 44px; color: var(--label); font-variant-numeric: tabular-nums; }
#rnTable .rn-arrow { width: 26px; padding-inline: 0; text-align: center; color: var(--terra); }
#rnTable .rn-size { width: 84px; color: var(--label); text-align: right; font-variant-numeric: tabular-nums; }
#rnTable .rn-del { width: 40px; padding: 4px; text-align: center; }
#rnTable .rn-old { color: var(--muted); }
#rnTable .rn-new { color: var(--ink); font-weight: 600; }

#rnTable tr.is-same .rn-new {
  font-weight: 400;
  color: var(--muted);
}

#rnTable tr.is-dup .rn-new {
  color: var(--mid);
}

.rn-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-left: 8px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--mid-bg);
  color: var(--mid);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  vertical-align: 1px;
}

.rn :where(.rn-x) {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--label);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}

.rn :where(.rn-x):hover,
.rn :where(.rn-x):focus-visible {
  background: var(--bad-bg);
  color: var(--bad);
  outline: none;
}

.rn-more {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.rn-more[hidden] {
  display: none;
}

.rn-privacy {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 26px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: 13px;
}

.rn-privacy::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  transform: translateY(-1px);
}

#rnApp.is-busy .rn-rules,
#rnApp.is-busy .rn-x {
  pointer-events: none;
  opacity: .7;
}

@media (max-width: 860px) {
  .rn-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .rn-rules {
    position: static;
    order: 2;
  }
  .rn-files {
    order: 1;
  }
}

@media (max-width: 640px) {
  .rn .ed-pill {
    display: none;
  }
  .rn-presets {
    margin-bottom: 20px;
  }
  .rn-presets__label {
    width: 100%;
  }
  .rn-rules {
    padding: 16px;
  }
}

@media (max-width: 560px) {
  #rnTable .rn-size,
  #rnTable thead .rn-size {
    display: none;
  }
  /* En celular el nombre nuevo se lee completo: cortarlo con "…" anula la vista previa. */
  #rnTable td.rn-old,
  #rnTable td.rn-new {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  #rnTable .rn-col-n {
    width: 30px;
  }
  #rnApp.has-files .rn-drop {
    grid-template-columns: 1fr;
  }
  #rnApp.has-files .rn-drop__btns {
    grid-column: 1;
    grid-row: auto;
    justify-content: flex-start;
  }
  .rn-actions .rn-btn {
    flex: 1 1 100%;
  }
  .rn-actions .rn-spacer {
    display: none;
  }
  .rn-row--3 {
    grid-template-columns: 1fr 1fr;
  }
  .rn-row--3 > :first-child {
    grid-column: 1 / -1;
  }
}
