/* Recibir por marca (computadora). Prefijo rm-. */
.rm-shell { display: grid; gap: 14px; color: var(--pos-text, #172033); }
.rm-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.rm-cab h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.rm-cab p { margin: 4px 0 0; max-width: 620px; color: var(--pos-muted, #687386); font-weight: 600; font-size: 13px; }
.rm-facturas { min-width: 280px; }
.rm-campo { display: grid; gap: 6px; font-weight: 800; font-size: 13px; }
.rm-campo small { color: var(--pos-muted, #687386); font-weight: 600; font-size: 12px; }
.rm-campo select, .rm-buscar { min-height: 40px; padding: 0 12px; border: 1px solid var(--pos-line, #cbd5e1); border-radius: 10px; background: var(--pos-card, #fff); color: inherit; font: inherit; font-size: 14px; }
.rm-facturas-campo select { border: 2px solid #0f766e; background: #ecfdf5; color: #064e3b; font-weight: 700; }

.rm-dos { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.rm-izq { display: grid; gap: 12px; min-width: 0; }
.rm-buscar { width: 100%; min-height: 44px; font-size: 15px; }
.rm-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.rm-chips:empty { display: none; }
.rm-chip { padding: 7px 14px; border: 1px solid var(--pos-line, #cbd5e1); border-radius: 999px; background: var(--pos-card, #fff); color: inherit; font: inherit; font-weight: 800; font-size: 13px; cursor: pointer; }
.rm-chip small { opacity: .7; }
.rm-chip.activo { background: #0f172a; border-color: #0f172a; color: #fff; }

.rm-marcas { display: flex; gap: 8px; flex-wrap: wrap; }
.rm-marca { display: grid; gap: 1px; justify-items: start; min-width: 130px; padding: 10px 14px; border: 2px solid transparent; border-radius: 12px; background: #e2e8f0; color: #0f172a; font: inherit; text-align: left; cursor: pointer; }
.rm-marca b { font-size: 14px; }
.rm-marca small { font-size: 11.5px; font-weight: 600; opacity: .75; }
.rm-marca.activa { border-color: var(--brand-color, #0d6efd); background: #dbeafe; }

.rm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.rm-tarjeta { content-visibility: auto; contain-intrinsic-size: auto 270px; display: grid; gap: 6px; align-content: start; justify-items: center; padding: 10px; border: 1px solid var(--pos-line, #dbe3ef); border-radius: 14px; background: var(--pos-card, #fff); text-align: center; }
.rm-tarjeta.con-entrada { border: 2px solid #18b88f; background: #ecfdf3; }
.rm-foto { display: grid; place-items: center; width: 100%; aspect-ratio: 1; max-height: 120px; overflow: hidden; border-radius: 10px; background: #f1f5f9; }
.rm-foto img { width: 100%; height: 100%; object-fit: contain; }
.rm-nombre { font-size: 13px; line-height: 1.25; min-height: 2.5em; }
.rm-hay { color: var(--pos-muted, #687386); font-weight: 700; font-size: 12px; }
.rm-esperado { padding: 1px 8px; border-radius: 999px; background: #dbeafe; color: #1d4ed8; }
.rm-cantidad { display: grid; grid-template-columns: 34px minmax(0, 1fr) 34px; gap: 6px; width: 100%; }
.rm-cantidad button, .rm-atajos button { border: 0; border-radius: 8px; background: #e2e8f0; color: #0f172a; font: inherit; font-weight: 800; cursor: pointer; }
.rm-cantidad button { height: 34px; font-size: 18px; }
.rm-cantidad input { min-width: 0; height: 34px; border: 1px solid var(--pos-line, #cbd5e1); border-radius: 8px; text-align: center; font: inherit; font-weight: 800; background: var(--pos-card, #fff); color: inherit; }
.rm-atajos { display: flex; gap: 6px; width: 100%; }
.rm-atajos button { flex: 1; padding: 6px 0; font-size: 12px; background: #dbeafe; color: #1d4ed8; }
.rm-atajos .rm-llego { background: #d1fae5; color: #065f46; }

.rm-der { position: sticky; top: 12px; display: grid; gap: 12px; padding: 16px; border: 1px solid var(--pos-line, #dbe3ef); border-radius: 16px; background: var(--pos-card, #fff); }
.rm-resumen-cab h3 { margin: 0; font-size: 17px; }
.rm-resumen-cab small { color: var(--pos-muted, #687386); font-weight: 600; }
.rm-acciones { display: flex; gap: 8px; flex-wrap: wrap; }
.rm-lineas { display: grid; gap: 4px; max-height: 340px; overflow-y: auto; }
.rm-linea { display: grid; grid-template-columns: minmax(0, 1fr) auto 24px; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; background: var(--pos-surface, #f4f7fb); font-size: 13px; }
.rm-linea span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-linea button { border: 0; background: none; color: #94a3b8; cursor: pointer; }
.rm-total { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; }
.rm-total b { font-size: 18px; }
.rm-btn { min-height: 36px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--pos-surface, #eef2f8); color: var(--pos-text, #172033); font: inherit; font-weight: 800; font-size: 13px; cursor: pointer; }
.rm-btn.principal { background: var(--brand-color, #0d6efd); color: #fff; }
.rm-btn.grande { min-height: 46px; font-size: 15px; }
.rm-btn:disabled { opacity: .45; cursor: not-allowed; }
.rm-enlace { padding: 0; border: 0; background: none; color: var(--brand-color, #0d6efd); font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; }
.rm-alerta { margin: 0; padding: 10px 12px; border-radius: 10px; background: #fef3c7; color: #92400e; font-weight: 700; font-size: 12.5px; }
.rm-nota { color: var(--pos-muted, #687386); font-weight: 600; font-size: 13.5px; }
.rm-completo { grid-column: 1 / -1; }

@media (max-width: 1100px) { .rm-dos { grid-template-columns: 1fr; } .rm-der { position: static; } }

/* El panel de la derecha no crece con el nombre mas largo de un proveedor: el selector se ajusta al panel. */
.rm-der { min-width: 0; box-sizing: border-box; }
.rm-der > * { min-width: 0; }
.rm-der .rm-campo select { width: 100%; max-width: 100%; min-width: 0; text-overflow: ellipsis; }
.rm-der .rm-total, .rm-der .rm-resumen-cab { min-width: 0; }

/* Recibir mercancia: buscador-escaner grande, ultimo escaneado y facturas con buscador */
.rm-escaner { min-height: 56px; border: 2px solid var(--brand-color, #0d6efd); border-radius: 16px; font-size: 17px; font-weight: 700; }
.rm-escaner:focus { outline: 0; box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-color, #0d6efd) 22%, transparent); }
.rm-ultimo:empty { display: none; }
.rm-ultimo-tarjeta { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 16px; border: 2px solid #18b88f; border-radius: 16px; background: #ecfdf3; animation: rmDestello .5s ease; }
@keyframes rmDestello { from { transform: scale(.985); box-shadow: 0 0 0 0 rgba(24, 184, 143, .5); } to { transform: none; box-shadow: 0 0 0 10px rgba(24, 184, 143, 0); } }
.rm-ultimo-foto { display: grid; place-items: center; width: 76px; height: 76px; overflow: hidden; border-radius: 12px; background: #fff; }
.rm-ultimo-foto img { width: 100%; height: 100%; object-fit: contain; }
.rm-ultimo-texto { display: grid; gap: 2px; min-width: 0; }
.rm-ultimo-texto small { color: #0f766e; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.rm-ultimo-texto b { font-size: 18px; line-height: 1.2; }
.rm-ultimo-texto span { color: var(--pos-muted, #687386); font-weight: 600; font-size: 13.5px; }
.rm-ultimo-texto strong { color: #0f172a; font-size: 16px; }
.rm-ultimo-mas { display: flex; gap: 8px; }
.rm-ultimo-mas button { width: 44px; height: 44px; border: 0; border-radius: 12px; background: #fff; color: #0f172a; font: inherit; font-size: 22px; font-weight: 800; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .12); }
.rm-mas { border: 2px dashed #94a3b8 !important; background: transparent !important; }

.rm-facturas { position: relative; display: grid; justify-items: end; gap: 8px; min-width: 0; }
.rm-facturas-panel { position: absolute; top: 46px; right: 0; z-index: 30; display: grid; gap: 8px; width: min(560px, 90vw); padding: 12px; border: 1px solid var(--pos-line, #dbe3ef); border-radius: 16px; background: var(--pos-card, #fff); box-shadow: 0 24px 60px rgba(15, 23, 42, .22); }
.rm-facturas-lista { display: grid; gap: 6px; max-height: 420px; overflow-y: auto; }
.rm-factura-fila { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid var(--pos-line, #e2e8f0); border-radius: 12px; background: var(--pos-surface, #f8fafc); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.rm-factura-fila:hover { border-color: var(--brand-color, #0d6efd); }
.rm-factura-fila span { display: grid; gap: 2px; min-width: 0; }
.rm-factura-fila b { font-size: 14px; }
.rm-factura-fila small { color: var(--pos-muted, #687386); font-weight: 600; font-size: 12.5px; }
.rm-factura-muestra { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-factura-fila strong { flex: none; font-size: 14px; }

body.oscuro .rm-ultimo-tarjeta { background: #0f3b2f; border-color: #16a34a; }
body.oscuro .rm-ultimo-foto, body.oscuro .rm-ultimo-mas button { background: #1f2b40; }
body.oscuro .rm-ultimo-texto strong { color: #f1f5f9; }
body.oscuro .rm-factura-fila { background: #1d293e; border-color: rgba(148, 163, 184, .22); }
body.oscuro .rm-facturas-panel { background: #151f31; border-color: rgba(148, 163, 184, .22); }

.rm-escaner-fila { display: flex; gap: 10px; align-items: stretch; }
.rm-escaner-fila .rm-escaner { flex: 1; min-width: 0; }
.rm-celular { flex: none; min-height: 56px; padding: 0 18px; border-radius: 16px; background: #e8f0ff; color: #1d4ed8; font-size: 14px; white-space: nowrap; }
body.oscuro .rm-celular { background: #1e2a44; color: #bfdbfe; }

/* ===== Recibir mercancia: diseño nuevo (marcas de color como en el celular, tarjetas grandes con foto, resumen con miniaturas) ===== */
.rm-shell { gap: 18px; }
.rm-cab h2 { font-size: 32px; letter-spacing: -.03em; }
.rm-cab p { font-size: 14px; }
.rm-dos { grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; }
.rm-izq { gap: 16px; }

/* buscador-escaner */
.rm-escaner { background: var(--pos-card, #fff); box-shadow: 0 10px 30px rgba(15, 23, 42, .08); }
.rm-celular { box-shadow: 0 10px 30px rgba(15, 23, 42, .06); }

/* marcas: fichas de color */
.rm-marcas { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.rm-marca { min-width: 0; padding: 14px 16px; border: 0; border-radius: 18px; background: linear-gradient(135deg, var(--marca, #475569), color-mix(in srgb, var(--marca, #475569) 62%, #0b1220)); color: #fff; box-shadow: 0 8px 18px color-mix(in srgb, var(--marca, #475569) 28%, transparent); transition: transform .15s ease, box-shadow .15s ease; }
.rm-marca:hover { transform: translateY(-2px); }
.rm-marca b { font-size: 17px; letter-spacing: -.01em; }
.rm-marca small { font-size: 12px; opacity: .92; font-weight: 700; }
.rm-marca.activa { transform: translateY(-2px); background: linear-gradient(135deg, var(--marca, #475569), color-mix(in srgb, var(--marca, #475569) 62%, #0b1220)); box-shadow: 0 0 0 3px var(--pos-card, #fff), 0 0 0 6px var(--marca, #475569), 0 14px 26px color-mix(in srgb, var(--marca, #475569) 36%, transparent); }
.rm-marca.rm-mas { background: transparent; color: var(--pos-text, #172033); border: 2px dashed #94a3b8; box-shadow: none; }
.rm-marca.rm-mas.activa { box-shadow: none; }

/* lineas / tipos */
.rm-chips { gap: 8px; }
.rm-chip { padding: 8px 16px; border-radius: 999px; font-size: 13.5px; box-shadow: 0 2px 8px rgba(15, 23, 42, .05); }
.rm-chip small { margin-left: 4px; padding: 1px 8px; border-radius: 999px; background: rgba(15, 23, 42, .08); opacity: 1; }
.rm-chip.activo small { background: rgba(255, 255, 255, .22); }
.rm-lineas-chips { margin-top: -4px; }

/* tarjetas de producto */
.rm-grid { grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 16px; }
.rm-tarjeta { position: relative; gap: 8px; padding: 12px; border: 1px solid var(--pos-line, #e2e8f0); border-radius: 22px; background: var(--pos-card, #fff); box-shadow: 0 8px 22px rgba(15, 23, 42, .06); transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.rm-tarjeta:hover { box-shadow: 0 14px 30px rgba(15, 23, 42, .1); }
.rm-tarjeta.con-entrada { border: 2px solid #18b88f; background: linear-gradient(180deg, #ecfdf3, var(--pos-card, #fff) 55%); }
.rm-foto { max-height: none; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .06); }
.rm-foto img { padding: 6px; box-sizing: border-box; }
.rm-nombre { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; font-weight: 800; letter-spacing: -.01em; }
.rm-hay { padding: 2px 12px; border-radius: 999px; background: #e2e8f0; color: #334155; font-size: 12.5px; font-weight: 800; }
.rm-hay.poco { background: #fee2e2; color: #b91c1c; }
.rm-palomita { position: absolute; top: 10px; right: 10px; z-index: 1; display: none; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #18b88f; color: #fff; font-size: 15px; font-weight: 900; box-shadow: 0 4px 10px rgba(24, 184, 143, .45); }
.rm-tarjeta.con-entrada .rm-palomita { display: grid; }
.rm-cantidad { grid-template-columns: 42px minmax(0, 1fr) 42px; gap: 6px; }
.rm-cantidad button { height: 42px; border-radius: 12px; font-size: 22px; }
.rm-cantidad input { height: 42px; border: 2px solid var(--pos-line, #cbd5e1); border-radius: 12px; font-size: 18px; }
.rm-cantidad input:focus { outline: 0; border-color: #18b88f; }
.rm-atajos button { padding: 7px 0; border-radius: 10px; font-size: 12.5px; }

/* panel de la derecha */
.rm-der { gap: 14px; padding: 20px; border-radius: 24px; box-shadow: 0 16px 40px rgba(15, 23, 42, .1); }
.rm-resumen-cab h3 { font-size: 20px; letter-spacing: -.02em; }
.rm-lineas { gap: 6px; max-height: 360px; }
.rm-linea { grid-template-columns: 36px minmax(0, 1fr) auto 24px; gap: 10px; padding: 6px 10px 6px 8px; border-left: 4px solid var(--marca, #94a3b8); border-radius: 12px; font-size: 13.5px; }
.rm-linea-mini { display: grid; place-items: center; width: 36px; height: 36px; overflow: hidden; border-radius: 9px; background: #fff; font-style: normal; }
.rm-linea-mini img { width: 100%; height: 100%; object-fit: contain; }
.rm-linea b { font-size: 15px; }
.rm-total { padding-top: 10px; border-top: 1px solid var(--pos-line, #e2e8f0); }
.rm-total b { font-size: 22px; letter-spacing: -.02em; }
#rmConfirmar { background: linear-gradient(135deg, #18b88f, #0f9d7a) !important; color: #fff; border-radius: 16px; box-shadow: 0 12px 24px rgba(24, 184, 143, .35); letter-spacing: -.01em; }
#rmConfirmar:disabled { box-shadow: none; background: #cbd5e1 !important; }

/* oscuro */
body.oscuro .rm-escaner, body.oscuro .rm-tarjeta, body.oscuro .rm-der { background: #151f31; border-color: rgba(148, 163, 184, .22); }
body.oscuro .rm-tarjeta.con-entrada { background: linear-gradient(180deg, #0f3b2f, #151f31 60%); border-color: #18b88f; }
body.oscuro .rm-foto, body.oscuro .rm-linea-mini { background: #1f2b40; }
body.oscuro .rm-hay { background: #243148; color: #e2e8f0; }
body.oscuro .rm-hay.poco { background: #7f1d1d; color: #fee2e2; }
body.oscuro .rm-cantidad input { background: #0f172a; color: #f1f5f9; border-color: rgba(148, 163, 184, .3); }
body.oscuro .rm-cantidad button { background: #243148; color: #f1f5f9; }
body.oscuro .rm-chip { background: #151f31; border-color: rgba(148, 163, 184, .25); color: #e2e8f0; }
body.oscuro .rm-chip.activo { background: #f1f5f9; color: #0f172a; }
body.oscuro .rm-chip small { background: rgba(148, 163, 184, .25); }
body.oscuro .rm-marca.rm-mas { color: #e2e8f0; border-color: #64748b; }
body.oscuro .rm-linea { background: #1d293e; }
body.oscuro .rm-total { border-color: rgba(148, 163, 184, .22); }
@media (max-width: 1100px) { .rm-dos { grid-template-columns: 1fr; } }

/* las fichas de marca conservan su color tambien en modo oscuro (gana al estilo oscuro general) */
body.oscuro .rm-marca:not(.rm-mas), body.oscuro .rm-marca.activa:not(.rm-mas) { background: linear-gradient(135deg, var(--marca, #475569), color-mix(in srgb, var(--marca, #475569) 62%, #0b1220)); color: #fff; border: 0; }
body.oscuro .rm-marca.rm-mas { background: transparent; }
.rm-marca small { color: #fff; opacity: .9; }
body.oscuro .rm-ultimo-mas button { background: #2b3a55; color: #f1f5f9; box-shadow: none; }
body.oscuro .rm-chip.activo small { background: rgba(15, 23, 42, .14); color: #0f172a; }

/* Recibir mercancia (abarrotes): caducidad por producto y pago al repartidor */
.rm-linea-datos { display: grid; gap: 2px; min-width: 0; }
.rm-fecha { display: flex; align-items: center; gap: 6px; color: var(--pos-muted, #687386); font-size: 11.5px; font-weight: 700; }
.rm-fecha input { min-width: 0; padding: 1px 4px; border: 1px solid var(--pos-line, #cbd5e1); border-radius: 6px; background: var(--pos-card, #fff); color: inherit; font: inherit; font-size: 11.5px; }
.rm-pago { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--pos-line, #dbe3ef); border-radius: 12px; background: var(--pos-surface, #f4f7fb); }
.rm-pago-toggle { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13.5px; cursor: pointer; }
.rm-pago-campos { display: grid; gap: 8px; }
.rm-pago-ayuda { color: var(--pos-muted, #687386); font-weight: 600; font-size: 12px; line-height: 1.35; }
.rm-der .rm-campo input.rm-buscar { width: 100%; box-sizing: border-box; }
body.oscuro .rm-pago { background: #1d293e; border-color: rgba(148, 163, 184, .22); }
body.oscuro .rm-fecha input { background: #151f31; border-color: rgba(148, 163, 184, .3); color: #e6ecff; }
