/* =============================================================================
   IDENTIDAD VISUAL — MÓDULO REMITOS
   =============================================================================
   Manual: docs/identidad-visual.md. Implementaciones hermanas: rrhh-ui.css
   (cabecera plena) y facturas-ui.css (cabecera lite).

   TODO va scopeado bajo `.rm-ui` y con prefijo `rm-`. El resto de GS sigue en
   Tailwind con su paleta: si los tokens fueran a `:root` o las clases se
   llamaran `.card`, se filtrarían y romperían lo que ya funciona (manual §6).

   ── POR QUÉ LA CABECERA "LITE" ───────────────────────────────────────────────
   Igual que Facturación: las tres pantallas del módulo son grillas largas que se
   recorren mucho rato (el listado de remitos, la auditoría de correlatividad y
   el listado de talonarios). Regla del manual §1.2 llevada al límite: la única
   superficie navy rellena es el botón de acción principal. La marca la sostienen
   el filete de 3px y el color del título.

   ── LO QUE ESTE MÓDULO AGREGA AL SISTEMA ─────────────────────────────────────
   `.rm-next` — el "próximo remito a emitir". Es el dato más operativo del módulo
   (tiene que coincidir con la hoja física cargada en la impresora) y antes vivía
   enterrado en una pestaña que ni siquiera era la de entrada. Ahora va fijo en la
   barra de navegación y cambia de nivel solo cuando el talonario se agota.
   ========================================================================== */

/* LA PALETA NO ESTÁ ACÁ. Vive en src/core/tokens.css, que la declara una sola
   vez para los cuatro módulos con identidad y se carga antes que este archivo.
   Remitos no se aparta en nada: usa los tokens tal cual salen.

   La trampa §7 del manual (`.hidden` de Tailwind perdiendo contra cualquier
   `.rm-ui .rm-btn`) también se resuelve allá. Lo único que queda acá es el
   caso del ROOT de un modal, que lleva `.rm-ui` él mismo. */
.rm-ui.rm-modal.hidden { display: none; }

.rm-ui .material-symbols-outlined { font-variation-settings: 'wght' 400; vertical-align: middle; }

/* =============================================================================
   ESTRUCTURA
   ========================================================================== */

.rm-ui .rm-shell {
    background: var(--canvas);
    border-radius: var(--r-card);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* La cabecera del módulo (.rm-hdr) y su botón fantasma (.rm-ghost) se fueron a
   la barra superior del armazón, junto con el encabezado de cada pantalla
   (.rm-ph). El nombre lo pone el rail; la sección, la descripción y las acciones
   las publica RM_NAV vía shellSetContexto / shellSetAcciones. Ver src/core/shell.js. */

/* ── Navegación de sección — subrayado que crece desde el centro ───────────── */
.rm-ui .rm-secnav {
    background: var(--surface);
    border-bottom: 1px solid var(--hair);
    display: flex; gap: 2px; padding: 0 14px;
    flex-wrap: wrap;
}
.rm-ui .rm-secnav button {
    position: relative; background: none; border: 0;
    font: inherit; font-size: 12.8px; font-weight: 600; color: var(--muted);
    padding: 12px 15px 13px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 7px;
    transition: color .15s, background .15s;
}
.rm-ui .rm-secnav button .material-symbols-outlined {
    font-size: 18px; transition: transform .18s cubic-bezier(.2, .8, .3, 1);
}
/* Un border-bottom no se puede animar (manual §7): va un ::after con scaleX. */
.rm-ui .rm-secnav button::after {
    content: ''; position: absolute; left: 10px; right: 10px; bottom: 0;
    height: 2.5px; background: var(--navy); border-radius: 2px 2px 0 0;
    transform: scaleX(0); transition: transform .18s cubic-bezier(.2, .8, .3, 1);
}
.rm-ui .rm-secnav button:hover, .rm-ui .rm-secnav button:focus-visible {
    color: var(--navy); background: var(--navy-050); outline: none;
}
.rm-ui .rm-secnav button:hover::after, .rm-ui .rm-secnav button:focus-visible::after { transform: scaleX(.55); }
.rm-ui .rm-secnav button:hover .material-symbols-outlined { transform: scale(1.18); }
.rm-ui .rm-secnav button.on { color: var(--navy); font-weight: 700; }
.rm-ui .rm-secnav button.on::after { transform: scaleX(1); }
.rm-ui .rm-secnav .tail { margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 5px 0; }

/* Sin padding lateral: las tarjetas y la barra van de borde a borde (ver más
   abajo) y son ELLAS las que aplican `--gutter` a su contenido. Así el texto de
   la tabla arranca en la misma columna que el título del módulo. */
.rm-ui .rm-view { padding: 16px 0 22px; background: var(--canvas); flex: 1; min-height: 0; }

/* Bloques a ancho completo dentro del área de trabajo. Se les saca el radio y
   los bordes laterales porque ya no tienen a los lados nada de qué separarse.
   No alcanza a los modales, que cuelgan del <body> y conservan su tarjeta. */
.rm-ui .rm-view .rm-card,
.rm-ui .rm-view .rm-bar {
    border-radius: 0;
    border-left-width: 0;
    border-right-width: 0;
}
/* Lo que no es tarjeta se alinea con el mismo canal. */
.rm-ui .rm-view .rm-seg,
.rm-ui .rm-view .rm-nota,
.rm-ui .rm-view .rm-kpis,
.rm-ui .rm-view .rm-risk { margin-left: var(--gutter); margin-right: var(--gutter); }

/* =============================================================================
   PRÓXIMO REMITO A EMITIR (al lado de la navegación, siempre visible)
   =============================================================================
   El número que GS va a consumir tiene que coincidir con la hoja física que hay
   en la impresora. Es el dato que más caro sale equivocar en todo el módulo, así
   que vive fijo arriba y no adentro de una pestaña. Sube de nivel solo: navy
   mientras sobre talonario, warn cuando esté por agotarse, crit si se agotó. */
.rm-ui .rm-next {
    display: inline-flex; align-items: center; gap: 10px;
    background: transparent;
    border: 1px solid var(--hair-strong);
    border-left: 3px solid var(--navy-500);
    border-radius: 8px; padding: 5px 12px;
    cursor: pointer; font: inherit; text-align: left;
    transition: background .15s, border-color .15s, transform .15s cubic-bezier(.2, .8, .3, 1);
}
.rm-ui .rm-next:hover, .rm-ui .rm-next:focus-visible {
    background: var(--navy-050); border-color: var(--navy-500); transform: translateY(-1px); outline: none;
}
.rm-ui .rm-next .k {
    font-size: .58rem; text-transform: uppercase; letter-spacing: .1em;
    font-weight: 700; color: var(--faint); display: block;
}
.rm-ui .rm-next .v {
    font-family: 'Consolas', 'SF Mono', 'Roboto Mono', monospace;
    font-size: .95rem; font-weight: 800; color: var(--navy);
    line-height: 1.15; font-variant-numeric: tabular-nums; display: block;
}
.rm-ui .rm-next .x {
    font-size: 11px; font-weight: 700; color: var(--muted);
    font-variant-numeric: tabular-nums; white-space: nowrap;
}
.rm-ui .rm-next.wrn { border-left-color: var(--warn); }
.rm-ui .rm-next.wrn:hover, .rm-ui .rm-next.wrn:focus-visible { background: var(--warn-050); border-color: var(--warn); }
.rm-ui .rm-next.wrn .x { color: var(--warn); }
.rm-ui .rm-next.neg { border-left-color: var(--crit); }
.rm-ui .rm-next.neg:hover, .rm-ui .rm-next.neg:focus-visible { background: var(--crit-050); border-color: var(--crit); }
.rm-ui .rm-next.neg .v, .rm-ui .rm-next.neg .x { color: var(--crit); }

/* =============================================================================
   SEGMENTO — es un FILTRO dentro de la pantalla, no una sección
   ========================================================================== */
.rm-ui .rm-seg {
    display: inline-flex; background: var(--surface);
    border: 1px solid var(--hair-strong); border-radius: 9px;
    padding: 3px; gap: 2px; margin-bottom: 14px; flex-wrap: wrap;
}
.rm-ui .rm-seg button {
    background: none; border: 0; font: inherit; font-size: 12.4px; font-weight: 600;
    color: var(--muted); padding: 7px 15px; border-radius: 6px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    transition: color .15s, background .15s, box-shadow .15s;
}
.rm-ui .rm-seg button .material-symbols-outlined { font-size: 17px; }
.rm-ui .rm-seg button:hover, .rm-ui .rm-seg button:focus-visible {
    color: var(--navy); background: var(--navy-050); outline: none;
}
/* Activo por TRAZO (barra interior), no por relleno navy — manual §1.2. */
.rm-ui .rm-seg button.on {
    color: var(--navy); font-weight: 700; background: var(--navy-050);
    box-shadow: inset 0 -2.5px 0 var(--navy);
}
.rm-ui .rm-seg .n { font-size: 11px; font-weight: 700; color: var(--faint); font-variant-numeric: tabular-nums; }
.rm-ui .rm-seg button.on .n { color: var(--navy-500); }

/* =============================================================================
   TARJETA
   ========================================================================== */
.rm-ui .rm-card {
    background: var(--surface); border: 1px solid var(--hair);
    border-radius: var(--r-card); box-shadow: var(--shadow);
    overflow: hidden; margin-bottom: 14px;
}
.rm-ui .rm-card-h {
    background: #fafbfc; border-bottom: 1px solid var(--hair);
    padding: 10px var(--gutter); display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.rm-ui .rm-card-h h4 {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .11em;
    font-weight: 700; color: var(--muted); margin: 0;
}
.rm-ui .rm-card-h .r { margin-left: auto; display: flex; gap: 7px; flex-wrap: wrap; }
.rm-ui .rm-card-b { padding: 14px var(--gutter); }
.rm-ui .rm-card-f {
    padding: 12px var(--gutter); text-align: center;
    border-top: 1px solid var(--hair); background: #fafbfc;
}

/* =============================================================================
   BARRA DE TRABAJO — una línea con lo que se usa siempre
   ========================================================================== */
.rm-ui .rm-bar {
    background: var(--surface); border: 1px solid var(--hair);
    border-radius: 10px; box-shadow: var(--shadow);
    padding: 10px var(--gutter); display: flex; flex-wrap: wrap;
    align-items: center; gap: 8px; margin-bottom: 12px;
}
/* Fila secundaria dentro de la barra (los tramos de antigüedad, que sólo
   aparecen cuando el filtro activo es "pendientes de facturar"). */
.rm-ui .rm-bar-sub {
    border-top: 1px solid var(--hair); margin-top: 9px; padding-top: 10px;
    width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.rm-ui .rm-bar-sub .rot {
    font-size: .58rem; text-transform: uppercase; letter-spacing: .1em;
    font-weight: 700; color: var(--faint); margin-right: 2px;
}
/* Atajo directo: aparece sólo cuando lo tipeado parece un N° de remito. */
.rm-ui .rm-bar-hint {
    width: 100%; display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
    padding: 9px 11px; margin-top: 9px;
    background: var(--navy-050); border: 1px solid #d3e0f2; border-radius: 8px;
    font-size: 12.2px; color: var(--navy);
}
.rm-ui .rm-bar-hint b { font-family: 'Consolas', 'SF Mono', monospace; }

/* =============================================================================
   CONTROLES
   ========================================================================== */
.rm-ui .rm-in, .rm-ui .rm-txt {
    font: inherit; font-size: 12.8px; color: var(--ink);
    background: var(--surface); border: 1px solid var(--hair-strong);
    border-radius: 8px; padding: 7px 10px; outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.rm-ui .rm-txt { width: 100%; resize: vertical; min-height: 74px; line-height: 1.5; }
.rm-ui .rm-in:focus, .rm-ui .rm-txt:focus {
    border-color: var(--navy-500); box-shadow: 0 0 0 3px rgba(21, 74, 148, .12);
}
.rm-ui .rm-in:disabled { background: #f6f8fa; color: var(--faint); cursor: not-allowed; }
.rm-ui .rm-in.mono { font-family: 'Consolas', 'SF Mono', 'Roboto Mono', monospace; font-variant-numeric: tabular-nums; }

.rm-ui .rm-lbl {
    display: block; font-size: .58rem; text-transform: uppercase; letter-spacing: .1em;
    font-weight: 700; color: var(--faint); margin-bottom: 4px;
}

.rm-ui .rm-btn {
    background: var(--navy); color: #fff; border: 0; border-radius: 8px;
    font: inherit; font-size: 12.8px; font-weight: 700; padding: 8px 17px;
    cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
    transition: transform .15s cubic-bezier(.2, .8, .3, 1), box-shadow .15s, background .15s, color .15s, border-color .15s;
}
.rm-ui .rm-btn:hover, .rm-ui .rm-btn:focus-visible {
    background: var(--navy-700); transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 43, 107, .28); outline: none;
}
.rm-ui .rm-btn:active { transform: translateY(-1px); }
.rm-ui .rm-btn .material-symbols-outlined { font-size: 17px; }
.rm-ui .rm-btn:disabled {
    background: #c3ccd9; color: #fff; cursor: not-allowed;
    transform: none; box-shadow: none;
}
/* Secundario: texto gris en reposo; navy sólo al apuntarlo (manual §1.2). */
.rm-ui .rm-btn.sec { background: var(--surface); color: var(--muted); border: 1px solid var(--hair-strong); }
.rm-ui .rm-btn.sec:hover, .rm-ui .rm-btn.sec:focus-visible {
    background: var(--navy-050); color: var(--navy); border-color: var(--navy-500);
    box-shadow: 0 5px 14px rgba(20, 40, 80, .12);
}
.rm-ui .rm-btn.sec:disabled { background: #f6f8fa; color: var(--faint); border-color: var(--hair); }
.rm-ui .rm-btn.ok { background: var(--ok); }
.rm-ui .rm-btn.ok:hover, .rm-ui .rm-btn.ok:focus-visible { background: #0b5c3e; box-shadow: 0 6px 16px rgba(15, 122, 82, .28); }
.rm-ui .rm-btn.ln { background: none; border: 0; color: var(--muted); font-weight: 600; padding: 8px 10px; }
.rm-ui .rm-btn.ln:hover, .rm-ui .rm-btn.ln:focus-visible {
    background: var(--navy-050); color: var(--navy); transform: none; box-shadow: none;
}

/* Buscador con lupa embebida */
.rm-ui .rm-search { position: relative; flex: 1; min-width: 230px; }
.rm-ui .rm-search > .material-symbols-outlined {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    color: var(--faint); font-size: 19px; pointer-events: none;
}
.rm-ui .rm-search input { width: 100%; padding-left: 35px; }

/* Chip de filtro — activo por borde + barra interior, nunca por relleno.
   Los tramos de antigüedad lo usan con nivel semántico. */
.rm-ui .rm-chip {
    background: var(--surface); border: 1px solid var(--hair-strong);
    color: var(--muted); border-radius: 20px; padding: 5px 13px;
    font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
    display: inline-flex; align-items: center; gap: 7px;
    transition: transform .15s cubic-bezier(.2, .8, .3, 1), border-color .15s, color .15s, box-shadow .15s;
}
.rm-ui .rm-chip:hover, .rm-ui .rm-chip:focus-visible {
    color: var(--navy); border-color: var(--navy-500); transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(20, 40, 80, .12); outline: none;
}
.rm-ui .rm-chip .n { font-weight: 800; font-variant-numeric: tabular-nums; }
.rm-ui .rm-chip.on {
    color: var(--navy); font-weight: 700; border-color: var(--navy);
    box-shadow: inset 3px 0 0 var(--navy);
}
.rm-ui .rm-chip.wrn .n { color: var(--warn); }
.rm-ui .rm-chip.wrn.on { color: var(--warn); border-color: var(--warn); box-shadow: inset 3px 0 0 var(--warn); }
.rm-ui .rm-chip.neg .n { color: var(--crit); }
.rm-ui .rm-chip.neg.on { color: var(--crit); border-color: var(--crit); box-shadow: inset 3px 0 0 var(--crit); }

/* Íconos de acción — blanco de clic chico, así que crecen al apuntarlos */
.rm-ui .rm-x {
    background: none; border: 0; color: var(--muted);
    padding: 4px; border-radius: 6px; cursor: pointer;
    transition: transform .15s cubic-bezier(.2, .8, .3, 1), background .15s, color .15s;
}
.rm-ui .rm-x .material-symbols-outlined { font-size: 19px; display: block; }
.rm-ui .rm-x:hover, .rm-ui .rm-x:focus-visible {
    color: var(--navy); background: var(--navy-050); transform: scale(1.18); outline: none;
}
.rm-ui .rm-x:active { transform: scale(1.02); }
.rm-ui .rm-x.del:hover, .rm-ui .rm-x.del:focus-visible { color: var(--crit); background: var(--crit-050); }
.rm-ui .rm-x.on { color: var(--ok); }
.rm-ui .rm-x:disabled { opacity: .35; cursor: not-allowed; transform: none; background: none; }

/* Casilla de selección */
.rm-ui .rm-ck { width: 15px; height: 15px; accent-color: var(--navy); cursor: pointer; vertical-align: middle; }

/* Giro de "cargando" */
.rm-ui .rm-spin { animation: rm-spin 1s linear infinite; display: inline-block; }
@keyframes rm-spin { to { transform: rotate(360deg); } }

/* =============================================================================
   TABLA
   ========================================================================== */
.rm-ui .rm-tbl { overflow-x: auto; }
.rm-ui table.rm-g { width: 100%; border-collapse: collapse; font-size: 12.8px; }
/* Encabezado BLANCO con regla de 2px, nunca una franja navy: es lo que más
   cansa cuando la tabla se mira 20 minutos (manual §1.2). */
.rm-ui table.rm-g th {
    background: var(--surface); color: var(--muted);
    font-size: .6rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 700;
    text-align: left; padding: 9px 12px;
    border-bottom: 2px solid var(--ink); white-space: nowrap;
}
/* NINGÚN valor se parte al medio. Un "R" arriba y su número abajo, o un "Kg"
   separado de su cantidad, no se leen como un dato: se leen como dos. Los
   únicos que pueden envolver son el cliente y el comentario, que son texto de
   largo variable y llevan `.wrap` explícito. */
.rm-ui table.rm-g td {
    padding: 9px 12px; border-bottom: 1px solid var(--hair);
    color: var(--ink); vertical-align: middle; white-space: nowrap;
}
.rm-ui table.rm-g td.wrap, .rm-ui table.rm-g th.wrap {
    white-space: normal; min-width: 190px;
}
.rm-ui table.rm-g tbody tr { transition: background .13s; }
.rm-ui table.rm-g tbody tr:hover { background: var(--navy-050); }
.rm-ui table.rm-g .n { text-align: right; font-variant-numeric: tabular-nums; }
.rm-ui table.rm-g .c { text-align: center; }
.rm-ui table.rm-g .mono {
    font-family: 'Consolas', 'SF Mono', 'Roboto Mono', monospace;
    font-weight: 700; font-variant-numeric: tabular-nums;
}
.rm-ui table.rm-g .vacia { padding: 34px 16px; text-align: center; color: var(--faint); font-style: italic; }

/* FRANJA DE ESTADO a la izquierda de la fila. Es lo que reemplaza a las
   pastillas de color: el ojo encuentra lo que pide acción sin leer la fila.
   La franja de 3px + 19px de padding suman `--gutter`, así el texto de la
   primera columna queda a plomo con el título del módulo. */
.rm-ui table.rm-g td:first-child { border-left: 3px solid transparent; padding-left: calc(var(--gutter) - 3px); }
.rm-ui table.rm-g th:first-child { padding-left: var(--gutter); }
.rm-ui table.rm-g th:last-child,
.rm-ui table.rm-g td:last-child { padding-right: var(--gutter); }
.rm-ui table.rm-g tr.st-ok  td:first-child { border-left-color: var(--ok-hair); }
.rm-ui table.rm-g tr.st-wrn td:first-child { border-left-color: var(--warn); }
.rm-ui table.rm-g tr.st-neg td:first-child { border-left-color: var(--crit); }
.rm-ui table.rm-g tr.st-neg { background: rgba(198, 40, 40, .035); }
/* Fila apagada: el remito existe pero ya no opera (anulado). Baja de peso sin
   perder legibilidad — nada de opacidad global, que arruina el contraste. */
.rm-ui table.rm-g tr.apagada td { color: var(--muted); }
.rm-ui table.rm-g tr.apagada .mono { font-weight: 600; }

.rm-ui .dim { color: var(--faint); }
/* Un dato ausente es información: se ve distinto (manual §1.4). */
.rm-ui .vacio { color: var(--faint); font-style: italic; }

/* =============================================================================
   ESTADO — badges y marcas de nivel
   ========================================================================== */
.rm-ui .rm-b {
    display: inline-block; font-size: 10.5px; font-weight: 700;
    padding: 2px 8px; border-radius: 20px; letter-spacing: .02em; border: 1px solid;
    white-space: nowrap;
}
.rm-ui .rm-b.ok  { background: var(--ok-050);   color: var(--ok);   border-color: var(--ok-hair); }
.rm-ui .rm-b.wrn { background: var(--warn-050); color: var(--warn); border-color: var(--warn-hair); }
.rm-ui .rm-b.neg { background: var(--crit-050); color: var(--crit); border-color: var(--crit-hair); }
.rm-ui .rm-b.nav { background: var(--navy-050); color: var(--navy); border-color: #d3e0f2; }
.rm-ui .rm-b.mut { background: #f4f6f9; color: var(--muted); border-color: var(--hair); }

/* Marca de estado en línea: ícono + texto, sin pastilla */
.rm-ui .rm-mark { font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.rm-ui .rm-mark .material-symbols-outlined { font-size: 16px; }
.rm-ui .rm-mark.ok  { color: var(--ok); }
.rm-ui .rm-mark.wrn { color: var(--warn); }
.rm-ui .rm-mark.neg { color: var(--crit); }
.rm-ui .rm-mark.mut { color: var(--faint); }
/* Antigüedad de un pendiente, pegada a la marca. Es un número chico y crudo:
   no lleva pastilla porque el nivel ya lo da el color de la marca. */
.rm-ui .rm-mark .d { font-weight: 800; font-variant-numeric: tabular-nums; opacity: .85; }

/* Aviso contextual */
.rm-ui .rm-risk {
    display: flex; align-items: flex-start; gap: 9px;
    padding: 10px 13px; border-radius: 9px; font-size: 12.2px;
    border: 1px solid; border-left-width: 3px; margin-bottom: 12px; line-height: 1.5;
}
.rm-ui .rm-risk .material-symbols-outlined { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.rm-ui .rm-risk .sp { margin-left: auto; display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.rm-ui .rm-risk.info    { background: var(--navy-050); border-color: #d3e0f2;         border-left-color: var(--navy-500); color: var(--navy); }
.rm-ui .rm-risk.alerta  { background: var(--warn-050); border-color: var(--warn-hair); border-left-color: var(--warn);     color: #8a4a00; }
.rm-ui .rm-risk.critico { background: var(--crit-050); border-color: var(--crit-hair); border-left-color: var(--crit);     color: #9b1f1f; }

.rm-ui .rm-nota { font-size: 11px; color: var(--faint); margin-top: 10px; line-height: 1.55; max-width: 78ch; }
.rm-ui .rm-nota b { color: var(--muted); }

/* =============================================================================
   KPIs
   ========================================================================== */
.rm-ui .rm-kpis { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.rm-ui .rm-kpi {
    background: var(--surface); border: 1px solid var(--hair);
    border-radius: 10px; padding: 10px 14px; min-width: 130px;
    box-shadow: var(--shadow);
}
.rm-ui .rm-kpi .k {
    font-size: .58rem; text-transform: uppercase; letter-spacing: .1em;
    font-weight: 700; color: var(--faint); display: block;
}
.rm-ui .rm-kpi .v {
    font-size: 1.25rem; font-weight: 800; color: var(--ink);
    line-height: 1.25; font-variant-numeric: tabular-nums;
}
.rm-ui .rm-kpi .v.mono { font-family: 'Consolas', 'SF Mono', 'Roboto Mono', monospace; }
.rm-ui .rm-kpi .v.ok { color: var(--ok); }
.rm-ui .rm-kpi .v.wrn { color: var(--warn); }
.rm-ui .rm-kpi .v.neg { color: var(--crit); }
.rm-ui .rm-kpi .x { font-size: 11px; color: var(--muted); display: block; margin-top: 1px; }
/* Acento a la IZQUIERDA */
.rm-ui .rm-kpi.side { border-left: 3px solid var(--navy); }
.rm-ui .rm-kpi.side.ok  { border-left-color: var(--ok); }
.rm-ui .rm-kpi.side.wrn { border-left-color: var(--warn); }
.rm-ui .rm-kpi.side.neg { border-left-color: var(--crit); }

/* Consumo del talonario: cuánto se usó de la chequera */
.rm-ui .rm-meter { height: 6px; background: var(--hair); border-radius: 20px; overflow: hidden; min-width: 90px; }
.rm-ui .rm-meter .fill { display: block; height: 100%; background: var(--navy-500); border-radius: 20px; transition: width .25s cubic-bezier(.2, .8, .3, 1); }
.rm-ui .rm-meter .fill.wrn { background: var(--warn); }
.rm-ui .rm-meter .fill.neg { background: var(--crit); }

/* =============================================================================
   MODAL
   ========================================================================== */
/* Doble clase para no depender del orden en que cargue Tailwind (manual §7). */
.rm-ui.rm-modal, .rm-ui .rm-modal {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(20, 28, 44, .55);
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.rm-ui .rm-modal-panel {
    background: var(--surface); border-radius: var(--r-card);
    box-shadow: 0 20px 60px rgba(10, 20, 40, .35);
    width: 100%; max-width: 560px; max-height: 92vh;
    display: flex; flex-direction: column; overflow: hidden;
}
.rm-ui .rm-modal-panel.ancho { max-width: 860px; }
.rm-ui .rm-modal-hdr {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 18px; border-bottom: 1px solid var(--hair); background: #fafbfc;
}
.rm-ui .rm-modal-hdr h3 { font-size: .92rem; font-weight: 700; color: var(--ink); margin: 0; }
.rm-ui .rm-modal-hdr p { font-size: 11.5px; color: var(--muted); margin: 1px 0 0; }
.rm-ui .rm-modal-hdr .x { margin-left: auto; }
.rm-ui .rm-modal-b { padding: 16px 18px; overflow-y: auto; flex: 1; }
.rm-ui .rm-modal-f {
    padding: 12px 18px; border-top: 1px solid var(--hair); background: #fafbfc;
    display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap;
}
/* Rejilla de campos del modal */
.rm-ui .rm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rm-ui .rm-grid .full { grid-column: 1 / -1; }
.rm-ui .rm-grid .rm-in { width: 100%; }

/* Bloque plegable (datos opcionales del emisor) */
.rm-ui .rm-fold {
    background: #fafbfc; border: 1px solid var(--hair);
    border-radius: 9px; padding: 10px 12px; margin-top: 12px;
}
.rm-ui .rm-fold > summary {
    font-size: .58rem; text-transform: uppercase; letter-spacing: .1em;
    font-weight: 700; color: var(--faint); cursor: pointer; list-style: none;
}
.rm-ui .rm-fold > summary::-webkit-details-marker { display: none; }
.rm-ui .rm-fold > summary::before { content: '▸ '; color: var(--muted); }
.rm-ui .rm-fold[open] > summary::before { content: '▾ '; }

/* Interruptor con su explicación al lado */
.rm-ui .rm-switch {
    display: flex; align-items: center; gap: 11px; cursor: pointer;
    background: #fafbfc; border: 1px solid var(--hair);
    border-radius: 10px; padding: 11px 13px; margin-top: 12px;
    transition: border-color .15s, background .15s;
}
.rm-ui .rm-switch:hover { border-color: var(--navy-500); background: var(--navy-050); }
.rm-ui .rm-switch .t { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.rm-ui .rm-switch .s { font-size: 11px; color: var(--muted); }

/* =============================================================================
   ACCESIBILIDAD — el movimiento se apaga, el destaque NO
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .rm-ui *, .rm-ui *::after, .rm-ui *::before {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
    .rm-ui .rm-btn:hover, .rm-ui .rm-btn:focus-visible,
    .rm-ui .rm-chip:hover, .rm-ui .rm-chip:focus-visible,
    .rm-ui .rm-next:hover, .rm-ui .rm-next:focus-visible { transform: none; }
    .rm-ui .rm-x:hover, .rm-ui .rm-x:focus-visible { transform: none; }
    .rm-ui .rm-secnav button:hover .material-symbols-outlined { transform: none; }
}
