:root { --naranja: #ef7d00; --naranja-oscuro: #c46500; --gris: #5f6368; --borde: #e0e0e0; }
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: #f6f6f6; color: #202124; }
[hidden] { display: none !important; }
.tarjeta { max-width: 360px; margin: 12vh auto 0; background: #fff; padding: 28px 24px; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,.1); }
h1 { margin: 0 0 4px; color: var(--naranja); font-size: 1.5rem; }
.sub { margin: 0 0 16px; color: var(--gris); }
label { display: block; margin: 12px 0 4px; font-size: .9rem; color: var(--gris); }
input { width: 100%; padding: 12px; font-size: 1rem; border: 1px solid var(--borde); border-radius: 8px; }
input:focus { outline: 2px solid var(--naranja); border-color: transparent; }
button { cursor: pointer; font-size: 1rem; border: 0; border-radius: 8px; padding: 12px 16px; background: var(--naranja); color: #fff; }
form button { width: 100%; margin-top: 18px; }
button:hover { background: var(--naranja-oscuro); }
button:disabled { opacity: .6; cursor: default; }
button.secundario { background: transparent; color: #fff; border: 1px solid #fff; padding: 6px 12px; margin-left: 8px; }
button.secundario:hover { background: rgba(255,255,255,.15); }
.error { color: #b3261e; margin: 12px 0 0; }
.barra { display: flex; justify-content: space-between; align-items: center; background: var(--naranja); color: #fff; padding: 12px 16px; }
.contenido { max-width: 900px; margin: 0 auto; padding: 16px; }
.tabla-caja { overflow-x: auto; background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--borde); white-space: nowrap; }
th { background: #fafafa; font-size: .85rem; color: var(--gris); }
td.num, th.num { text-align: right; }

.caja { background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.08); padding: 16px; margin-bottom: 16px; }
.caja h3 { margin: 0 0 4px; }
.acciones { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
button.pequeno { padding: 8px 14px; font-size: .95rem; }
button.verde { background: #2e7d32; }
button.verde:hover { background: #1b5e20; }
.casilla { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; color: #202124; font-size: .95rem; }
.rc-fecha { display: flex; gap: 6px; align-items: center; }
.rc-fecha input { flex: 1; min-width: 0; }
.rc-ruta { display: flex; gap: 6px; align-items: center; margin: 6px 0; }
.rc-color { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.casilla input { width: auto; margin-top: 3px; }
.reporte { margin-top: 12px; font-size: .95rem; }
.reporte .titulo { font-weight: 600; margin-bottom: 6px; }
.reporte ul { margin: 4px 0 8px; padding-left: 20px; }
.reporte .aviso { color: #8a5a00; }
.reporte .error { color: #b3261e; }

.filtros { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.filtros input { flex: 1; min-width: 200px; }
select { padding: 12px; font-size: 1rem; border: 1px solid var(--borde); border-radius: 8px; background: #fff; }
.campo { margin-bottom: 8px; }
.campo select, .campo input { max-width: 320px; width: 100%; }
.dias { display: flex; gap: 6px; flex-wrap: wrap; }
.dias label { display: flex; align-items: center; gap: 4px; margin: 0; padding: 6px 10px; border: 1px solid var(--borde); border-radius: 8px; color: #202124; cursor: pointer; }
.dias input { width: auto; }
button.gris { background: #757575; }
button.gris:hover { background: #5f5f5f; }
button.rojo { background: #b3261e; }
button.rojo:hover { background: #8c1d18; }
#tabla-clientes tbody tr { cursor: pointer; }
#tabla-clientes tbody tr:hover { background: #fff4e5; }
#tabla-clientes tbody tr.elegido { background: #ffe8c7; }

.subform { margin-top: 12px; padding: 12px; border: 1px solid var(--borde); border-radius: 8px; background: #fafafa; }
.subform h4 { margin: 0 0 8px; }
#tabla-rutas tbody tr, #tabla-camionetas tbody tr { cursor: pointer; }
#tabla-rutas tbody tr:hover, #tabla-camionetas tbody tr:hover { background: #fff4e5; }
tr.inactiva td { color: #9e9e9e; }

/* Formulario de cliente */
fieldset { border: 1px solid var(--borde); border-radius: 8px; padding: 8px 12px 12px; margin: 12px 0 0; }
legend { font-weight: 600; padding: 0 6px; color: var(--naranja-oscuro); }
.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 16px; }
.rejilla .campo input, .rejilla .campo select { max-width: none; }
.rejilla .ancho { grid-column: 1 / -1; }
textarea { width: 100%; padding: 12px; font-size: 1rem; font-family: inherit; border: 1px solid var(--borde); border-radius: 8px; resize: vertical; }
textarea:focus, select:focus { outline: 2px solid var(--naranja); border-color: transparent; }
.ayuda { margin: 4px 0 0; font-size: .85rem; color: var(--gris); }
.ayuda a { color: var(--naranja-oscuro); }
.opciones-tipo { display: flex; gap: 24px; flex-wrap: wrap; }
.opciones-tipo .casilla { margin-top: 4px; }
.filtros button { white-space: nowrap; }
#pe-producto { width: 100%; margin-top: 6px; padding: 4px; }
.dato { margin: 0; padding: 12px 0; font-weight: 600; }
td .pequeno { padding: 4px 10px; font-size: .85rem; }

/* Usuarios y permisos */
#tabla-usuarios tbody tr { cursor: pointer; }
#tabla-usuarios tbody tr:hover { background: #fff4e5; }
.grupo-permisos { margin-top: 12px; }
.grupo-permisos h4 { margin: 8px 0 4px; color: var(--naranja-oscuro); }
.permiso { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--borde); flex-wrap: wrap; }
.permiso span { flex: 1; min-width: 200px; }
.permiso small { display: block; color: var(--gris); }
.permiso select { padding: 6px 8px; }

/* Inventario */
.pestanas { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.pestana { background: #fff; color: var(--gris); border: 1px solid var(--borde); padding: 8px 14px; font-size: .95rem; }
.pestana:hover { background: #fff4e5; }
.pestana.activa { background: var(--naranja); color: #fff; border-color: var(--naranja); }
#tabla-mv input { width: 80px; padding: 6px 8px; text-align: right; }
#tabla-mv tr.con-cantidad td { background: #fff4e5; }
td.negativo { color: #b3261e; font-weight: 600; }
.etiqueta { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: .8rem; background: #eee; }
.etiqueta.pendiente { background: #fff0c2; color: #7a5600; }
.etiqueta.aplicada { background: #dff3e1; color: #1b5e20; }
.etiqueta.cancelada { background: #fde2e1; color: #8c1d18; }
.bitacora { background: #202124; color: #e8eaed; padding: 12px; border-radius: 8px; font-size: .8rem; white-space: pre-wrap; word-break: break-all; min-height: 80px; }

/* Ventana para autorizar / cambiar contraseña */
.modal-fondo { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.modal { background: #fff; border-radius: 12px; padding: 20px; width: 100%; max-width: 380px; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.modal h3 { margin: 0 0 4px; }

/* Liquidación */
#tabla-liq-pend tbody tr, #tabla-liq-cons tbody tr { cursor: pointer; }
#tabla-liq-pend tbody tr:hover, #tabla-liq-cons tbody tr:hover { background: #fff4e5; }
#liq-detalle h4 { margin: 16px 0 6px; color: var(--naranja-oscuro); }
#liq-detalle table { font-size: .9rem; }
#liq-detalle th, #liq-detalle td { padding: 6px 8px; }
.cuadre { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-top: 10px; }
.cuadre div { background: #fafafa; border: 1px solid var(--borde); border-radius: 8px; padding: 10px; }
.cuadre b { display: block; font-size: 1.15rem; }
.cuadre small { color: var(--gris); }
.cuadra-si { color: #1b5e20; font-weight: 700; }
.cuadra-no { color: #b3261e; font-weight: 700; }
#liq-detalle input.merma { width: 80px; padding: 6px 8px; text-align: right; }
tr.total-fila td { font-weight: 700; border-top: 2px solid var(--borde); }
@media print {
  .no-imprimir, .barra, .acciones, button { display: none !important; }
  body { background: #fff; }
  .caja, .tabla-caja { box-shadow: none; }
  .contenido { max-width: none; padding: 0; }
}

/* Mapa de rutas */
body.pagina-mapa { height: 100vh; display: flex; flex-direction: column; }
.enlace-barra { color: #fff; border: 1px solid #fff; border-radius: 8px; padding: 6px 12px; text-decoration: none; }
.mapa-cuerpo { flex: 1; display: flex; min-height: 0; }
.mapa-panel { width: 340px; max-width: 45vw; overflow-y: auto; padding: 12px; background: #fff; border-right: 1px solid var(--borde); }
.mapa-panel .campo select, .mapa-panel input { max-width: none; width: 100%; }
.mapa-lienzo { flex: 1; min-height: 300px; background: #e8eaed; }
.mapa-vacio { padding: 24px; color: var(--gris); }
.leyenda { display: flex; flex-wrap: wrap; gap: 6px; }
.dia-chip { background: #fff; color: #202124; border: 1px solid var(--borde); padding: 6px 10px; font-size: .85rem; display: flex; align-items: center; gap: 6px; }
.dia-chip:hover { background: #fff4e5; }
.dia-chip.apagado { opacity: .4; }
.dia-chip .punto { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.lista-mapa { list-style: none; padding: 0; margin: 6px 0; }
.lista-mapa li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--borde); }
.lista-mapa li small { display: block; color: var(--gris); font-size: .8rem; }
.info-cliente { font-size: .9rem; line-height: 1.5; max-width: 260px; }
.info-cliente .gris { color: var(--gris); }
.info-cliente button { margin-top: 6px; }
@media (max-width: 700px) { .mapa-cuerpo { flex-direction: column; } .mapa-panel { width: auto; max-width: none; max-height: 40vh; } }

/* ---------- Acomodo principal: 6 menús (como Sicar 4.0, en naranja VIZAR) ---------- */
.barra-principal { position: sticky; top: 0; z-index: 20; display: flex; align-items: stretch; gap: 8px; background: var(--naranja); color: #fff; padding: 0 12px; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.barra-principal .marca { display: flex; flex-direction: column; justify-content: center; font-weight: 800; font-size: 1.3rem; letter-spacing: .04em; padding: 0 10px 0 4px; line-height: 1; }
.barra-principal .marca small { font-size: .7rem; font-weight: 600; letter-spacing: .2em; opacity: .85; }
.menus-principales { display: flex; flex: 1; overflow-x: auto; }
.menu-principal { background: transparent; border-radius: 0; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 14px 8px; min-width: 104px; font-size: .9rem; font-weight: 600; border-bottom: 4px solid transparent; }
.menu-principal:hover { background: rgba(255,255,255,.12); }
.menu-principal.activo { background: var(--naranja-oscuro); border-bottom-color: #fff; }
.usuario-barra { display: flex; align-items: center; gap: 4px; white-space: nowrap; font-size: .9rem; }
.usuario-barra #nombre-usuario { margin-right: 4px; font-weight: 600; }
.usuario-barra .sucursal-actual { font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.18); }
.usuario-barra .elegir-sucursal { font-weight: 700; padding: 5px 8px; border-radius: 8px; max-width: 220px; }
.subbarra { display: flex; justify-content: space-between; align-items: center; background: #fff; border-bottom: 1px solid var(--borde); padding: 10px 16px; }
.subbarra strong { color: var(--naranja-oscuro); font-size: 1.1rem; }
.subbarra button.secundario { color: var(--naranja-oscuro); border-color: var(--naranja); }
.subbarra button.secundario:hover { background: #fff4e5; }
.menu-contenido { max-width: 1000px; text-align: center; }
.titulo-favoritos { margin: 8px 0 6px; color: var(--gris); font-weight: 600; }
.favoritos { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; min-height: 48px; }
.favorito { background: #fff; color: var(--naranja-oscuro); border: 1px solid var(--borde); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 10px; font-size: .75rem; min-width: 84px; }
.favorito:hover { background: #fff4e5; }
.buscador-menu { margin: 14px auto 6px; max-width: 420px; }
.titulo-menu { margin: 10px 0 14px; color: #202124; font-size: 1.2rem; }
.cuadricula { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.modulo { position: relative; background: #fff; border-radius: 10px; padding: 18px 10px 14px; box-shadow: 0 1px 4px rgba(0,0,0,.08); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; outline: none; }
.modulo:hover, .modulo:focus-visible { box-shadow: 0 0 0 2px var(--naranja); }
.modulo-icono { color: var(--naranja); margin-bottom: 4px; }
.modulo b { font-size: .98rem; }
.modulo small { color: var(--gris); font-size: .8rem; }
.modulo.en-construccion { opacity: .55; }
.modulo.en-construccion .modulo-icono { color: var(--gris); }
.etiqueta-pronto { font-size: .68rem; background: #eee; color: #555; border-radius: 8px; padding: 1px 7px; margin-top: 2px; }
.estrella { position: absolute; top: 4px; right: 4px; background: transparent; color: #bdbdbd; font-size: 1.15rem; padding: 2px 6px; }
.estrella:hover { background: transparent; color: var(--naranja); }
.estrella.marcada { color: var(--naranja); }
@media (max-width: 760px) {
  .barra-principal { flex-wrap: wrap; padding: 0 6px; }
  .menu-principal { min-width: 78px; padding: 8px 6px; font-size: .75rem; }
  .usuario-barra { width: 100%; justify-content: flex-end; padding-bottom: 6px; }
  .cuadricula { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

/* ---------- Venta en sucursal ---------- */
.contenido-ancho { max-width: 1280px; }
.sub-titulo { color: var(--gris); font-weight: 400; font-size: .9rem; }
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.pos-izq { position: relative; min-height: 420px; }
.pos-buscar input { font-size: 1.1rem; }
.pos-resultados { list-style: none; margin: 4px 0 0; padding: 0; position: absolute; left: 16px; right: 16px; z-index: 5; background: #fff; border: 1px solid var(--borde); border-radius: 8px; max-height: 340px; overflow-y: auto; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.pos-der .pos-resultados { position: static; }
.pos-resultados li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; cursor: pointer; border-bottom: 1px solid #f0f0f0; }
.pos-resultados li:hover, .pos-resultados li.primero { background: #fff4e5; }
.pos-resultados li small { color: var(--gris); }
#v-carrito { margin-top: 12px; }
#v-carrito input.cant { width: 60px; padding: 5px 6px; text-align: center; }
button.mini { padding: 3px 9px; font-size: .85rem; margin: 0 2px; }
.pos-cliente { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.pos-cliente b { color: var(--naranja-oscuro); }
.pos-totales div { display: flex; justify-content: space-between; padding: 4px 0; }
.pos-totales .pos-total { font-size: 1.6rem; font-weight: 800; border-top: 2px solid var(--borde); margin-top: 6px; padding-top: 8px; }
.grande-pos { width: 100%; font-size: 1.2rem; padding: 14px; margin-top: 8px; }
.modal-ancho { max-width: 460px; }
.cobro-total { font-size: 1.3rem; margin: 6px 0 10px; display: flex; justify-content: space-between; }
.cobro-total b { font-size: 1.8rem; color: var(--naranja-oscuro); }
.pago-fila { display: grid; grid-template-columns: 1fr 150px; align-items: center; gap: 8px; margin-bottom: 6px; }
.pago-fila label { margin: 0; color: #202124; }
.pago-fila input { text-align: right; font-size: 1.05rem; padding: 8px; }
.billetes { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
button.blanco { background: #fff; color: #202124; border: 1px solid var(--borde); }
button.blanco:hover { background: #fff4e5; }
.cobro-cambio { display: flex; justify-content: space-between; font-size: 1.2rem; margin-top: 8px; }
.cobro-cambio b { font-size: 1.5rem; }
.resumen-corte { list-style: none; padding: 0; margin: 0; max-width: 420px; }
.resumen-corte li { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid #f0f0f0; }
#k-tabla input.monto { width: 130px; text-align: right; padding: 6px 8px; }
@media (max-width: 900px) { .pos { grid-template-columns: 1fr; } }

/* ---------- Ticket de 80 mm (solo al imprimir) ---------- */
#ticket { display: none; }
@page ticket { size: 80mm auto; margin: 2mm; }
@media print {
  body.imprimiendo-ticket > *:not(#ticket) { display: none !important; }
  body.imprimiendo-ticket { background: #fff; }
  body.imprimiendo-ticket #ticket { display: block; page: ticket; width: 76mm; font-family: "Courier New", monospace; font-size: 9.5pt; color: #000; }
  #ticket pre { margin: 0 0 1.5mm; white-space: pre-wrap; font-family: inherit; font-size: inherit; }
  #ticket .t-centro { text-align: center; }
  #ticket .t-grande { font-size: 12.5pt; font-weight: bold; }
}

/* Después de la venta: consultas, devoluciones y abonos */
.con-lista { position: relative; }
#cv-tabla tbody tr, #cc-tabla tbody tr { cursor: pointer; }
#cv-tabla tbody tr:hover { background: #fff4e5; }
#cv-tabla tbody tr.elegida { background: #ffe2bf; }
#cv-d-lineas input.cant { width: 70px; }
tr.clicable { cursor: pointer; }
tr.clicable:hover { background: #fff4e5; }
#mod-cuerpo input.cant { width: 80px; }
#mod-cuerpo input.monto { width: 110px; }
#mod-cuerpo .filtros { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
#mod-cuerpo .filtros input, #mod-cuerpo .filtros select { width: auto; flex: 1 1 200px; max-width: 360px; }
/* Reportes y estadísticas */
.datos-resumen { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 12px; }
.dato { background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.08); padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.dato small { color: #666; font-size: .8rem; }
.dato b { font-size: 1.25rem; color: #222; }
.dato.alerta { border-left: 4px solid #b3261e; }
.dos-columnas { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 14px; }
.grafica-envoltura { position: relative; }
.grafica { display: flex; align-items: stretch; gap: 6px; height: 220px; padding: 8px 0 0; border-bottom: 1px solid #ddd; overflow-x: auto; }
.grafica-col { flex: 1 0 28px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; cursor: default; outline: none; }
.grafica-col:hover .grafica-seg, .grafica-col:focus .grafica-seg { filter: brightness(.9); }
.grafica-pila { flex: 1; width: 70%; max-width: 46px; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
.grafica-seg { width: 100%; min-height: 2px; }
.grafica-pila .grafica-seg:first-child { border-radius: 4px 4px 0 0; }
.grafica-col small { font-size: .7rem; color: #666; margin-top: 4px; white-space: nowrap; max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
.grafica-tip { position: absolute; top: 0; background: #fff; border: 1px solid #ddd; border-radius: 6px; padding: 6px 10px; font-size: .85rem; box-shadow: 0 4px 12px rgba(0,0,0,.12); pointer-events: none; min-width: 150px; z-index: 3; }
.leyenda { display: flex; gap: 14px; font-size: .85rem; margin-bottom: 6px; }
.punto { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
/* ===== Pantalla de ventas tipo Sicar (barras de acciones con teclas) ===== */
#pantalla-ventas .contenido-ancho { max-width: none; padding: 10px 12px; }
.pv { background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.08); overflow: hidden; }
.pv-barra-sup { display: flex; flex-wrap: wrap; gap: 2px; background: #f1ece6; border-bottom: 1px solid var(--borde); padding: 4px 4px 4px 112px; }
.pv-acc { background: transparent; color: #3c3c3c; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 12px; border-radius: 8px; font-size: .82rem; font-weight: 600; min-width: 84px; }
.pv-acc svg { color: var(--naranja); }
.pv-acc:hover, .pv-acc:focus-visible { background: #fff4e5; outline: none; }
.pv-acc kbd { font-family: inherit; font-size: .72rem; color: var(--gris); font-weight: 500; }
.pv-cuerpo { display: flex; min-height: calc(100vh - 210px); }
.pv-barra-lat { width: 108px; flex: 0 0 108px; background: #f1ece6; border-right: 1px solid var(--borde); display: flex; flex-direction: column; gap: 4px; padding: 8px 4px; }
.pv-barra-lat .pv-acc { min-width: 0; }
.pv-cobrar svg { color: #2e7d32; }
.pv-centro { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 12px; gap: 10px; }
.pv-cabeza { display: flex; gap: 14px; align-items: stretch; }
.pv-foto { width: 150px; height: 150px; flex: 0 0 150px; border: 1px solid var(--borde); border-radius: 10px; background: #fafafa; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; text-align: center; padding: 6px; gap: 4px; }
.pv-foto img { max-width: 100%; max-height: 100%; object-fit: contain; flex: 1; min-height: 0; }
.pv-foto small { font-size: .72rem; color: var(--gris); line-height: 1.2; max-height: 2.4em; overflow: hidden; }
.pv-logo { font-size: 1.5rem; font-weight: 800; color: var(--naranja); letter-spacing: .04em; }
.pv-sin-foto { color: #9e9e9e; font-size: .85rem; flex: 1; display: flex; align-items: center; }
.pv-campos { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pv-fila { display: flex; gap: 8px; align-items: center; }
.pv-fila input { flex: 1; min-width: 0; font-size: 1.1rem; }
.pv-boton-ico { background: #f1ece6; color: var(--naranja-oscuro); padding: 10px 12px; display: flex; align-items: center; justify-content: center; }
.pv-boton-ico.gris { color: #b3261e; }
.pv-boton-ico:hover { background: #ffe2bf; }
.pv-cliente { flex: 1; min-width: 0; background: #fff; color: #1a237e; border: 1px solid var(--borde); text-align: left; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 1.05rem; padding: 10px 12px; }
.pv-cliente svg { color: var(--naranja); flex: 0 0 auto; }
.pv-cliente span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-info { margin: 0; font-size: .85rem; color: var(--gris); min-height: 1.2em; }
.pv-tabla { flex: 1; min-height: 260px; max-height: calc(100vh - 430px); overflow-y: auto; position: relative; }
.pv-tabla table { width: 100%; }
.pv-tabla thead th { position: sticky; top: 0; background: #5f5f5f; color: #fff; z-index: 1; }
#v-carrito tbody tr { cursor: pointer; }
#v-carrito tbody tr.elegida, .pv-lista tbody tr.elegida { background: #ffe2bf; }
#v-carrito td.negativo { color: #b3261e; }
.pv-vacio { padding: 18px; text-align: center; }
.pv-pie { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.pv-pie .reporte { margin: 2px 0 0; font-weight: 600; }
.pv-totales { min-width: 300px; }
.pv-totales div { display: flex; justify-content: space-between; padding: 2px 0; }
.pv-totales .pv-total { font-size: 2rem; font-weight: 800; color: var(--naranja-oscuro); border-top: 2px solid var(--borde); padding-top: 6px; margin-top: 4px; }
/* ventanas */
.pv-modal { max-width: 420px; max-height: 92vh; overflow-y: auto; }
.pv-modal.modal-grande { max-width: 980px; }
.pv-modal-cabeza { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.pv-cerrar { background: transparent; color: #444; font-size: 1.8rem; line-height: 1; padding: 0 6px; }
.pv-busq { display: flex; gap: 14px; align-items: stretch; margin-bottom: 8px; }
.pv-busq-der { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.pv-foto-chica { width: 120px; height: 120px; flex-basis: 120px; }
.pv-busq-tabla { max-height: 52vh; overflow-y: auto; border: 1px solid var(--borde); border-radius: 8px; }
.pv-lista { width: 100%; border-collapse: collapse; }
.pv-lista th { position: sticky; top: 0; background: #5f5f5f; color: #fff; text-align: left; padding: 8px; font-size: .85rem; }
.pv-lista th.num, .pv-lista td.num { text-align: right; }
.pv-lista td { padding: 7px 8px; border-bottom: 1px solid #f0f0f0; cursor: pointer; }
.pv-lista td small { color: var(--gris); }
.pv-lista tbody tr:hover { background: #fff4e5; }
.pv-dato-fijo { font-size: 1.3rem; font-weight: 700; padding: 6px 0; }
.pv-check { display: flex; gap: 20px; margin-top: 12px; align-items: flex-start; }
.pv-foto-check { width: 300px; height: 300px; flex-basis: 300px; }
.pv-check-datos { flex: 1; text-align: center; }
.pv-check-clave { color: var(--gris); font-weight: 600; }
.pv-check-nombre { font-size: 1.5rem; font-weight: 700; color: var(--naranja-oscuro); margin: 6px 0; }
.pv-check-precio { font-size: 3rem; font-weight: 800; margin: 12px 0; }
.pv-check-rejilla { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; text-align: left; margin-top: 10px; }
.pv-check-rejilla small { display: block; color: var(--gris); font-size: .8rem; }
.pv-check-rejilla b { font-size: 1.1rem; }
/* cobro (Esc) */
.pv-cobro { max-width: 720px; }
.pv-cobro-total { text-align: center; margin: 4px 0 14px; }
.pv-cobro-total small { display: block; color: var(--gris); }
.pv-cobro-total b { font-size: 3rem; color: var(--naranja-oscuro); }
.pv-formas { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.pv-forma-caja input { text-align: right; font-size: 1.15rem; font-weight: 600; }
.pv-forma { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 0 0 4px; color: #444; font-size: .85rem; }
.pv-forma svg { color: var(--naranja); }
.pv-cobro-pie { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-top: 16px; border-top: 1px solid var(--borde); padding-top: 12px; }
.pv-cobro-cliente { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.pv-cobro-cliente b { color: #1a237e; }
.pv-cobro-cliente small { color: var(--gris); }
.pv-cambio { text-align: right; }
.pv-cambio small { display: block; color: #2e7d32; font-weight: 700; }
.pv-cambio b { font-size: 3rem; color: #2e7d32; }
.pv-cambio b.falta { color: #b3261e; }
@media (max-width: 900px) {
  .pv-barra-sup { padding-left: 4px; }
  .pv-cuerpo { flex-direction: column; }
  .pv-barra-lat { width: auto; flex-direction: row; flex-wrap: wrap; }
  .pv-cabeza { flex-direction: column; }
  .pv-foto { width: 100%; height: 120px; }
  .pv-check { flex-direction: column; } .pv-foto-check { width: 100%; }
}

/* Globo de aviso (clientes de la app por registrar) */
.globo { position: absolute; top: 6px; right: 6px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #d32f2f; color: #fff;
  font-size: .72rem; font-weight: 700; line-height: 20px; text-align: center; box-shadow: 0 0 0 2px #fff; }
.menu-principal { position: relative; }
.modulo .estrella ~ .globo, .modulo .globo { right: auto; left: 6px; }
.acciones-fila { display: inline-flex; gap: 6px; }

/* Productos estilo Sicar */
.pr-barra { display: flex; flex-wrap: wrap; gap: 4px; background: #f1f1f1; border-radius: 10px; padding: 6px; margin-bottom: 12px; }
.pr-cmd { background: transparent; color: #333; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 12px; font-size: .8rem; font-weight: 600; border-radius: 8px; min-width: 92px; }
.pr-cmd:hover { background: #fff; }
.pr-cmd-ic { font-size: 1.4rem; line-height: 1.2; color: var(--naranja); }
.pr-cmd.verde-ic .pr-cmd-ic { color: #2e7d32; }
.pr-cmd.rojo-ic .pr-cmd-ic { color: #c62828; }
.pr-busqueda { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.pr-busqueda .pr-buscar { flex: 1 1 320px; font-size: 1.05rem; }
.pr-lupa { padding: 8px 14px; }
.pr-cuerpo { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; align-items: start; }
@media (max-width: 860px) { .pr-cuerpo { grid-template-columns: 1fr; } }
.pr-clave small { display: block; color: #777; font-size: .78rem; }
.pr-clave span { font-weight: 600; }
tr.seleccionada td { background: #fff3e0 !important; }
tr.apagada td { color: #999; }
.pr-paginas { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 10px 0; }
.pr-panel { background: #fff; border-radius: 10px; padding: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.08); position: sticky; top: 90px; }
.pr-panel h4 { margin: 0 0 10px; color: #666; font-weight: 600; text-align: center; }
.pr-panel .pv-foto { margin: 0 auto 10px; }
.pr-nombre { display: block; margin-bottom: 8px; font-size: 1.05rem; }
.pr-dato { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid #f0f0f0; font-size: .9rem; }
.pr-dato span { color: #777; }
.aj-opciones { display: grid; gap: 12px; max-width: 640px; margin: 0 auto 16px; }
.aj-opcion { display: flex; gap: 16px; align-items: center; text-align: left; background: #fff; color: #222; border-radius: 16px; padding: 18px 20px; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.aj-opcion:hover { outline: 2px solid var(--naranja); }
.aj-opcion b { display: block; font-size: 1.1rem; }
.aj-opcion small { color: #666; font-size: .9rem; }
.aj-ic { font-size: 1.8rem; color: var(--naranja); width: 40px; text-align: center; }
.aj-elegido { align-self: center; }
.aj-opcion:hover, .aj-opcion:focus-visible { background: #fff8f0; color: #222; }
.pr-cmd:hover, .pr-cmd:focus-visible { color: #333; }

/* Ficha del producto (ventana con pestañas laterales) */
.fp-ventana { display: grid; grid-template-columns: 190px minmax(0, 1fr); background: #fff; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.12); overflow: hidden; max-width: 1100px; margin: 0 auto; }
.fp-lateral { background: #f1f1f1; display: flex; flex-direction: column; padding: 10px 0; gap: 2px; }
.fp-tab { background: transparent; color: #444; display: flex; align-items: center; gap: 10px; text-align: left; padding: 12px 14px; border-radius: 0; font-weight: 600; font-size: .92rem; border-left: 4px solid transparent; }
.fp-tab:hover, .fp-tab:focus-visible { background: #fff8f0; color: #222; }
.fp-tab.activa { background: #fff; color: var(--naranja); border-left-color: var(--naranja); }
.fp-tab-ic { font-size: 1.2rem; width: 24px; text-align: center; }
.fp-derecha { padding: 16px 22px 18px; min-width: 0; }
.fp-titulo { margin: 0 0 12px; text-align: center; color: var(--naranja); }
.fp-sub { margin: 18px 0 8px; color: #555; border-bottom: 1px solid #eee; padding-bottom: 4px; }
.fp-opciones { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.fp-botones { display: flex; justify-content: center; gap: 12px; margin-top: 18px; border-top: 1px solid #eee; padding-top: 14px; }
.fp-botones button { min-width: 150px; }
.fp-carrusel { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 10px 0; }
.fp-foto { width: 320px; height: 320px; border: 1px solid var(--borde); border-radius: 12px; background: #fafafa; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.fp-foto img { max-width: 100%; max-height: 100%; object-fit: contain; }
.fp-flecha { background: transparent; color: #888; font-size: 2.4rem; padding: 0 10px; }
.fp-flecha:hover { background: #f5f5f5; color: #333; }
.fp-foto-acciones { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.fp-mejor td { background: #e8f5e9 !important; font-weight: 600; }
.fp-aviso { padding: 30px; text-align: center; }
@media (max-width: 760px) { .fp-ventana { grid-template-columns: 1fr; } .fp-lateral { flex-direction: row; overflow-x: auto; } .fp-foto { width: 220px; height: 220px; } }

/* Filtro de productos */
.pr-filtro-btn { background: #fff; color: #444; border: 1px solid var(--borde); padding: 8px 14px; }
.pr-filtro-btn:hover { background: #fff8f0; color: #222; }
.pr-filtro-btn.con-filtro { border-color: var(--naranja); color: var(--naranja); font-weight: 700; }
.pr-filtro { background: #fff; border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.15); padding: 16px; margin-bottom: 12px; max-width: 640px; }
.pr-grupo { margin-bottom: 10px; }
.pr-grupo > b { display: block; font-size: .85rem; color: #555; margin-bottom: 4px; }
.pr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: #eee; color: #333; border-radius: 16px; padding: 5px 14px; font-size: .85rem; font-weight: 600; }
.chip:hover { background: #e0e0e0; color: #222; }
.chip.activo { background: var(--naranja); color: #fff; }
.pr-filtro-acciones { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.rojo-borde { background: #fff; color: #c62828; border: 1px solid #c62828; }
.rojo-borde:hover { background: #fdecea; color: #c62828; }
td.pr-total { font-weight: 700; }
.fp-con-boton { display: flex; gap: 6px; }
.fp-con-boton input { flex: 1; min-width: 0; }
.pr-busqueda { position: relative; }
.pr-filtro { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; width: min(560px, 100%); margin: 0; max-height: 75vh; overflow: auto; }

/* Pantallas fijas (Clientes, Productos): la barra, los botones y el buscador se quedan quietos; solo se mueve la lista */
@media (min-width: 861px) {
  body:has(> .fija:not([hidden])) { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
  body > .fija:not([hidden]) { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .fija > main { flex: 1; min-height: 0; display: flex; flex-direction: column; width: 100%; box-sizing: border-box; padding-bottom: 6px; }
  .fija .lista-fija { flex: 1; min-height: 0; overflow: auto; }
  .fija .lista-fija thead th { position: sticky; top: 0; z-index: 1; }
  .fija .pr-paginas { padding: 6px 0 0; }
  .fija .pr-cuerpo { flex: 1; min-height: 0; align-items: stretch; }
  .fija .pr-lista { display: flex; flex-direction: column; min-height: 0; }
  .fija .pr-lista > .tabla-caja { flex: 1; min-height: 0; overflow: auto; }
  .fija .pr-lista thead th { position: sticky; top: 0; z-index: 1; }
  .fija .pr-panel { position: static; overflow: auto; }
  .fija .pr-barra, .fija .pr-busqueda { flex-shrink: 0; }
}

/* Clientes */
#aviso-clientes:empty { display: none; }
#tabla-clientes .cl-nombre b { display: block; font-weight: 600; }
#tabla-clientes .cl-nombre small { display: block; color: #777; font-size: .8rem; }
#tabla-clientes tbody tr.cl-fijo { background: #fafafa; }
#tabla-clientes tbody tr.cl-fijo.elegido, #tabla-clientes tbody tr.elegido { background: #ffe8c7; }
.pr-busqueda select { width: auto; }
#ventana-cliente { z-index: 40; }
.cl-ventana { position: relative; width: min(1000px, 100%); height: min(720px, calc(100vh - 32px)); }
.cl-ventana .fp-derecha { overflow: auto; display: flex; flex-direction: column; }
.cl-ventana .cl-panel { flex: 1; }
.cl-ventana .fp-botones { position: sticky; bottom: -18px; background: #fff; margin-bottom: -18px; padding-bottom: 14px; }
.cl-cerrar { position: absolute; top: 8px; right: 10px; background: transparent; color: #666; font-size: 1.8rem; line-height: 1; padding: 2px 10px; }
.cl-cerrar:hover { background: #f1f1f1; color: #222; }
.solo-lectura { background: #f1f1f1; color: #555; font-weight: 700; }
.obligatorio { color: #d32f2f; }
@media (max-width: 760px) { .cl-ventana { height: calc(100vh - 32px); } }

/* Precios especiales (pestaña del cliente): buscador y captura arriba, lista fija abajo (solo se desplaza la lista) */
.pe-bloque { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.pe-bloque .sub { margin: 0; }
.pe-form { display: flex; flex-direction: column; gap: 8px; }
.pe-resultados { max-height: 190px; overflow: auto; }
.pe-resultados thead th, .pe-lista thead th { position: sticky; top: 0; z-index: 1; }
#pe-resultados tbody tr { cursor: pointer; }
#pe-resultados tbody tr:hover { background: #fff4e5; }
#pe-resultados tbody tr.elegido { background: #ffe8c7; }
.pe-bloque td.pr-clave { white-space: normal; }
.pe-captura { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 10px; align-items: end; }
.pe-captura .campo { margin: 0; }
.pe-captura .dato { margin: 0; padding: 9px 0; font-weight: 700; }
.pe-bloque .fp-sub { margin: 6px 0 0; }
.pe-lista { min-height: 120px; }
#mensaje-precios:empty { display: none; }
.cl-ventana .fp-derecha.pe-fija { overflow: hidden; }
.fp-derecha.pe-fija .cl-panel { display: flex; flex-direction: column; min-height: 0; }
.fp-derecha.pe-fija .pe-bloque { flex: 1; }
.fp-derecha.pe-fija .pe-lista { flex: 1; overflow: auto; }
@media (max-width: 760px) { .pe-captura { grid-template-columns: 1fr 1fr; } .cl-ventana .fp-derecha.pe-fija { overflow: auto; } }
.pv-btn-credito { margin-top: 6px; background: #fff; color: #1a237e; border: 2px solid #1a237e; font-weight: 700; padding: 8px 16px; }
.pv-btn-credito:hover { background: #e8eaf6; color: #1a237e; }
.pv-btn-credito.activo { background: #1a237e; color: #fff; }
.modal-fondo.modal-alto { z-index: 40; }
.prov-ventana { height: min(560px, calc(100vh - 32px)); }
.pv-nombre-contacto span { font-weight: 600; }
.pv-nombre-contacto small { display: block; color: #777; font-size: .8rem; }

/* Formato «catálogo» (Configuración) */
.cat-sub { margin: 0 0 8px; flex-shrink: 0; }
.cat-ventana { height: min(620px, calc(100vh - 32px)); }
.cat-ventana.sin-pestanas { grid-template-columns: 1fr; }
.cat-ventana.chica { width: min(560px, 100%); height: auto; max-height: calc(100vh - 32px); }
.cat-ventana.mediana { width: min(760px, 100%); height: min(480px, calc(100vh - 32px)); }
.cat-ventana .fp-lateral { overflow-y: auto; }
.cat-ventana .permiso small { display: block; color: #777; font-size: .8rem; }
.cat-ventana .permiso select { width: auto; min-width: 170px; }
.cat-ventana .grupo-permisos { margin-top: 0; }
.cat-pestanas { display: flex; gap: 4px; margin-bottom: 10px; border-bottom: 2px solid var(--borde); flex-shrink: 0; }
.cat-pestana { background: transparent; color: #555; border-radius: 8px 8px 0 0; padding: 10px 22px; font-weight: 700; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.cat-pestana:hover { background: #fff8f0; color: #222; }
.cat-pestana.activa { color: var(--naranja); border-bottom-color: var(--naranja); background: #fff; }

/* Roles (estilo Sicar): menús, tarjetas de módulos y opciones con casillas */
.rol-ventana { position: relative; background: #fff; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.25); width: min(1150px, 100%);
  height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden; }
.rol-cabeza { display: flex; align-items: flex-end; gap: 10px; padding: 14px 56px 10px 18px; border-bottom: 1px solid #eee; flex-shrink: 0; }
.rol-cabeza .campo { flex: 1; margin: 0; }
.rol-cabeza .cl-cerrar { top: 10px; }
.rol-nota { margin: 6px 18px; }
.rol-menus { display: flex; background: var(--naranja); flex-shrink: 0; overflow-x: auto; }
.rol-menu { background: transparent; color: #fff; border-radius: 0; padding: 10px 16px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 700; flex: 1; min-width: 110px; }
.rol-menu small { font-weight: 500; opacity: .85; font-size: .75rem; }
.rol-menu:hover { background: rgba(255,255,255,.15); color: #fff; }
.rol-menu.activo { background: #fff; color: var(--naranja-oscuro); }
.rol-modulos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; padding: 12px 18px; max-height: 32vh; overflow-y: auto; flex-shrink: 0; background: #fafafa; border-bottom: 1px solid #eee; }
.rol-modulo { position: relative; background: #fff; color: #333; border: 1px solid var(--borde); border-radius: 10px; padding: 10px 10px 8px; text-align: left; display: flex; flex-direction: column; gap: 2px; }
.rol-modulo:hover { border-color: var(--naranja); background: #fff8f0; color: #222; }
.rol-modulo.activo { background: var(--naranja); border-color: var(--naranja); color: #fff; }
.rol-modulo small { color: inherit; opacity: .75; font-size: .75rem; }
.rol-punto { position: absolute; top: 8px; right: 8px; width: 10px; height: 10px; border-radius: 50%; background: #c8c8c8; }
.rol-punto.si { background: #2e7d32; box-shadow: 0 0 0 2px #fff; }
.rol-barra-perm { display: flex; gap: 10px; align-items: center; padding: 10px 18px 4px; flex-shrink: 0; flex-wrap: wrap; }
.rol-barra-perm b { color: var(--naranja-oscuro); margin-right: auto; }
.rol-barra-perm input { width: min(320px, 100%); }
.rol-ventana > .reporte { margin: 0 18px; }
.rol-permisos { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; padding: 8px 18px 12px; align-content: start; }
.rol-opcion { background: #f6f6f6; border-radius: 8px; padding: 8px 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rol-opcion.si { background: #e8f5e9; }
.rol-opcion.entrar { outline: 2px solid #ffe0b2; }
.rol-opcion.apagada { opacity: .5; }
.rol-opcion label { display: flex; gap: 8px; align-items: center; margin: 0; cursor: pointer; color: #222; font-weight: 500; }
.rol-opcion label input { width: 18px; height: 18px; flex-shrink: 0; }
.rol-opcion label small { color: #777; }
.rol-opcion select { width: auto; font-size: .8rem; padding: 4px 6px; }

/* Compras (tipo Sicar) */
.cp-cabeza { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: 10px; align-items: end; margin-bottom: 8px; flex-shrink: 0; }
.cp-cabeza .campo { margin: 0; }
.cp-neto { margin: 0 0 10px; white-space: nowrap; }
@media (max-width: 860px) { .cp-cabeza { grid-template-columns: 1fr 1fr; } }
td.cp-sube { color: #c62828; font-weight: 700; }
.cp-util span { display: block; font-weight: 600; }
.cp-util small { display: block; color: #777; font-size: .78rem; }
.cp-util.negativo span, .cp-util.negativo small { color: #c62828; }
.cp-pie { display: flex; gap: 22px; align-items: center; justify-content: flex-end; padding: 8px 4px 0; flex-shrink: 0; flex-wrap: wrap; }
.cp-dato small, .cp-total small { display: block; color: #777; font-size: .78rem; }
.cp-dato b { font-size: 1rem; }
.cp-total { background: #5f5f5f; color: #fff; border-radius: 8px; padding: 6px 16px; text-align: right; }
.cp-total small { color: #ddd; }
.cp-total b { font-size: 1.6rem; }
.cat-ventana.cp-buscar { width: min(1100px, 100%); height: min(680px, calc(100vh - 32px)); }
.cp-buscador { display: flex; gap: 14px; align-items: flex-start; height: 100%; }
.cp-buscador-der { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cp-res { max-height: 430px; overflow: auto; }
.cp-res thead th { position: sticky; top: 0; z-index: 1; }
.cp-resumen { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 16px; }
.cp-cobro { text-align: center; margin-bottom: 10px; }
.cp-cobro small { display: block; color: #777; }
.cp-cobro b { display: block; font-size: 2.4rem; color: var(--naranja-oscuro); }
@media (max-width: 760px) { .cp-buscador { flex-direction: column; } }
/* Pago de la compra (Pago de caja / Crédito / Otro medio) */
.cat-ventana.pago { width: min(760px, 100%); height: auto; max-height: calc(100vh - 32px); }
.cp-pagos { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.cp-pago-bloque { border: 1px solid var(--borde); border-radius: 10px; padding: 8px 12px; }
.cp-pago-bloque.apagado > :not(label) { display: none; }
.cp-pago-bloque:not(.apagado) { border-color: var(--naranja); background: #fff8f0; }
.cp-pago-op { font-weight: 700; margin: 0; }
b.negativo { color: #b3261e; }

/* Ventana «Artículo» de Compras (formato Sicar) */
.cat-ventana.articulo { width: min(900px, 100%); height: auto; max-height: calc(100vh - 24px); }
.cat-ventana.articulo .fp-titulo { margin-bottom: 4px; }
.ar-seccion { border-top: 1px solid #e5e5e5; padding: 8px 0 10px; }
.ar-seccion h4 { margin: 0 0 8px; text-align: center; color: #2e7d32; font-size: 1rem; }
.ar-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 16px; }
.ar-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; margin-bottom: 8px; }
.ar-ancho { grid-column: span 2; }
.ar-dato { display: flex; gap: 6px; align-items: baseline; font-size: .92rem; }
.ar-dato span { color: #555; font-weight: 600; white-space: nowrap; }
.ar-dato b { color: #1a4d8f; font-weight: 600; }
.ar-fila-listas { display: flex; gap: 10px; align-items: stretch; overflow-x: auto; }
.ar-etq { display: flex; flex-direction: column; justify-content: space-around; min-width: 150px; color: #555; font-weight: 600; font-size: .88rem; }
.ar-listas { display: flex; gap: 8px; flex: 1; }
.ar-lista { display: flex; flex-direction: column; gap: 4px; align-items: stretch; text-align: right; min-width: 92px; flex: 1; }
.ar-lista small { color: #777; text-align: center; font-size: .75rem; }
.ar-lista span { color: #1a4d8f; }
.ar-lista b { color: #1a4d8f; font-weight: 600; }
.ar-lista input { width: 100%; text-align: right; }
.ar-num { display: inline-block; margin: 0 auto; width: 20px; height: 20px; line-height: 18px; border: 1.5px solid #2e7d32; border-radius: 50%; color: #2e7d32 !important; font-weight: 700; }
.ar-detalle { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; align-items: start; }
.ar-imp { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--borde); border-radius: 8px; padding: 8px; }
.ar-imp small { text-align: center; font-weight: 700; color: #555; }
.ar-campos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; align-items: end; }
.ar-campos .campo { margin: 0; }
.ar-costo { display: flex; gap: 6px; align-items: center; }
.ar-costo input { flex: 1; min-width: 0; text-align: right; }
.ar-costo select { width: auto; }
.ar-unidad { font-weight: 600; color: #555; }
.ar-sinimp { text-align: center; margin-top: 8px; }
.ar-sinimp small { display: block; color: #555; font-weight: 600; }
.ar-sinimp div { display: flex; gap: 40px; justify-content: center; margin: 2px 0; }
.ar-sinimp b { color: #1a4d8f; font-weight: 600; }
@media (max-width: 760px) { .ar-grid3, .ar-grid2, .ar-detalle, .ar-campos { grid-template-columns: 1fr; } .ar-ancho { grid-column: auto; } }
.ar-sat { align-items: center; }
.ar-sat input { width: 110px; padding: 4px 6px; }
.boton-mini { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; background: #e8f5e9; color: #2e7d32; font-weight: 800; text-decoration: none; border: 1px solid #c8e6c9; }
.boton-mini:hover { background: #c8e6c9; }
.ar-anteriores { display: flex; gap: 10px; justify-content: flex-start; border-top: 1px solid #e5e5e5; padding-top: 10px; }
/* Importar factura XML */
.cat-ventana.cp-xml { width: min(1200px, 100%); height: calc(100vh - 24px); }
.xm-tabla { max-height: 46vh; overflow: auto; margin: 6px 0; }
.xm-tabla thead th { position: sticky; top: 0; z-index: 1; }
.xm-tabla td { white-space: normal; vertical-align: top; }
.xm-prod { display: flex; flex-direction: column; gap: 4px; min-width: 180px; }
.xm-acc { display: flex; gap: 4px; }
.xm-aviso { display: block; color: #b26a00; font-size: .78rem; }
/* Compras: aviso de devolución o de pedido que se surte; menú de pedidos */
.cp-bandera { background: #e3f2fd; color: #0d47a1; border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; font-weight: 600; flex-shrink: 0; }
.cp-bandera.devolucion { background: #fde2e1; color: #8c1d18; }
.cp-menu-ped { display: grid; gap: 10px; }
.cp-menu-ped .aj-opcion { border: 1px solid var(--borde); box-shadow: none; padding: 14px 16px; }
.etiqueta.parcial { background: #e3f2fd; color: #0d47a1; }
.etiqueta.surtido { background: #dff3e1; color: #1b5e20; }
/* Consultas → Ventas (formato Sicar) */
.cv-filtros { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 12px; margin-bottom: 6px; flex-shrink: 0; }
.cv-filtros .campo { margin: 0; }
@media (max-width: 1000px) { .cv-filtros { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cv-buscar { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; flex-shrink: 0; }
.cv-buscar .casilla { margin: 0; white-space: nowrap; }
.cv-buscar input:not([type=checkbox]) { flex: 1; }
tr.cv-cancelada td { color: #c62828; background: #fdecea; }
td.cv-est { text-align: center; font-weight: 700; }
td.cv-est.D { color: #b26a00; }
.cv-lineas { max-height: 42vh; overflow: auto; margin: 8px 0; }
.cv-lineas thead th { position: sticky; top: 0; z-index: 1; }
.cv-pie-ticket { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; border-top: 1px solid #e5e5e5; padding-top: 8px; }
.cv-pie-ticket > div:first-child { display: flex; flex-direction: column; gap: 4px; }
.cv-cancel { color: #c62828 !important; }
.cv-dev-dinero { border: 1px solid var(--borde); border-radius: 8px; padding: 8px 12px; margin: 6px 0 10px; }
.cv-totalito { text-align: right; font-weight: 700; margin: 4px 0 10px; }
.fija .cc-tabla { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.fija .cc-tabla > .lista-fija { flex: 1; min-height: 0; overflow: auto; }

/* Compras con el mismo diseño que Ventas */
#mod-cuerpo:has(> .cp-pv) { max-width: none; padding: 10px 12px; }
.cp-pv .pv-tabla { max-height: calc(100vh - 470px); }
.cp-fila-prov { background: #fff; border: 1px solid var(--borde); border-radius: 8px; padding: 0 0 0 10px; }
.cp-fila-prov svg { color: var(--naranja); flex: 0 0 auto; }
.cp-proveedor { flex: 1; min-width: 0; border: 0; font-size: 1.05rem; font-weight: 600; color: #1a237e; padding: 10px 8px; background: transparent; }
.cp-datos { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; gap: 10px; align-items: end; }
.cp-datos .campo { margin: 0; }
.cp-datos .cp-neto { margin-bottom: 8px; }
.cp-pv .pv-barra-lat .cp-dev svg { color: #c62828; }
.cp-pv .cp-bandera { margin: 0; }
.cp-pv tbody tr.seleccionada { background: #ffe2bf; }
@media (max-width: 860px) { .cp-datos { grid-template-columns: 1fr 1fr; } }

/* Corte de caja tipo Sicar */
.kc-cuerpo { padding: 14px 16px; }
.kc-barra { padding-left: 4px; }
.kc-resumen { max-width: 560px; }
.kc-cerrada { padding: 20px 0; color: var(--gris); }
.kc-modal { max-width: 820px; max-height: 92vh; overflow-y: auto; }
.kc-modal input.monto { max-width: 140px; text-align: right; }
.kc-modal input.monto.error { border-color: #c62828; background: #fdecea; }
.kc-modal tfoot th, .kc-tabla tfoot th { border-top: 2px solid var(--borde); }
.kc-tabla { width: 100%; }
.kc-tabla th.num, .kc-tabla td.num, #k-tabla th.num, #k-tabla td.num { text-align: right; }
td.positivo { color: #2e7d32; }
.kc-fondo { display: flex; justify-content: space-between; align-items: center; background: #fff4e5; border-radius: 8px; padding: 10px 14px; margin: 10px 0; font-weight: 600; }
.kc-fondo b { font-size: 1.4rem; color: var(--naranja-oscuro); }
#v-fondo-nota { display: block; margin-top: 4px; }
.kc-mov { max-height: 52vh; overflow: auto; }
.kc-mov thead th { position: sticky; top: 0; z-index: 1; }
.kc-saldos { display: flex; justify-content: flex-end; gap: 24px; padding: 10px 4px 0; }
.kc-saldos small { display: block; color: #777; font-size: .78rem; }
.kc-saldos b { font-size: 1.1rem; }
.cat-ventana.articulo.kc-ventana { width: min(1150px, 100%); }

/* Movimientos de caja y abonos tipo Sicar */
td.mc-entrada { color: #2e7d32; font-weight: 600; }
td.mc-salida { color: #c62828; font-weight: 600; }
.ab-cambio { font-weight: 700; color: #2e7d32; font-size: 1.1rem; }

/* Consultas tipo Sicar: existencias y kardex */
.ex-bajo td:nth-child(2) { color: #b3261e; }
td.ex-total { font-weight: 700; }
.kx-filtros .kx-busca { grid-column: span 2; position: relative; }
.kx-producto { display: flex; gap: 10px; align-items: baseline; padding: 4px 2px 6px; flex-shrink: 0; }
.kx-producto small { color: var(--gris); font-weight: 600; }
.kx-producto b { font-size: 1.1rem; color: var(--naranja-oscuro); }
td.kx-inicial { font-weight: 700; }
.kx-tabla td:nth-child(2), .kx-tabla td:nth-child(3) { white-space: normal; }
.kx-tabla th, .kx-tabla td { padding: 8px 10px; }

/* Reportes tipo Sicar: pestañas arriba, filtros a la izquierda y la hoja del reporte a la derecha */
.rp-pestanas { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 2px solid var(--borde); margin-bottom: 8px; flex-shrink: 0; }
.rp-pestana { background: #f1f1f1; color: #444; border-radius: 8px 8px 0 0; padding: 8px 14px; font-size: .88rem; font-weight: 600; }
.rp-pestana.activa { background: var(--naranja); color: #fff; }
.rp-cuerpo { display: flex; gap: 12px; align-items: stretch; flex: 1; min-height: 0; }
.rp-filtros { width: 230px; flex: 0 0 230px; background: #f7f7f7; border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 6px; overflow: auto; }
.rp-filtros .campo { margin: 0; }
.rp-hoja { flex: 1; min-width: 0; background: #fff; border: 1px solid var(--borde); border-radius: 10px; padding: 16px 20px; overflow: auto; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.rp-encabezado { text-align: center; border-bottom: 2px solid var(--borde); margin-bottom: 10px; padding-bottom: 6px; }
.rp-encabezado h2 { margin: 2px 0; font-size: 1.25rem; color: var(--naranja-oscuro); }
.rp-empresa { font-weight: 800; letter-spacing: .03em; }
.rp-periodo, .rp-impreso { margin: 0; color: var(--gris); font-size: .85rem; }
/* Tiempos y movimientos */
.tm-dia { margin: 18px 0 8px; font-size: 1.05rem; border-bottom: 2px solid var(--borde); padding-bottom: 4px; }
tr.tm-alerta td { background: #fdecea; }
tr.tm-efectiva td:first-child { box-shadow: inset 4px 0 0 #2e9e5b; }
td.rp-total { font-weight: 800; }
tr.total-fila td { font-weight: 700; border-top: 2px solid var(--borde); }
@media (max-width: 860px) { .rp-cuerpo { flex-direction: column; } .rp-filtros { width: auto; flex: none; } }
#reporte-impresion { display: none; }
@media print {
  body.imprimiendo-reporte > *:not(#reporte-impresion) { display: none !important; }
  body.imprimiendo-reporte { background: #fff; }
  body.imprimiendo-reporte #reporte-impresion { display: block; }
  body.imprimiendo-reporte .rp-hoja { border: 0; box-shadow: none; padding: 0; overflow: visible; }
  body.imprimiendo-reporte th, body.imprimiendo-reporte td { padding: 4px 6px; font-size: 9pt; }
  body.imprimiendo-reporte .tabla-caja { overflow: visible; max-height: none; }
}

/* Configuración del sistema */
.cf-tickets { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }
.cf-previa { background: #fffdf7; border: 1px dashed var(--borde); border-radius: 6px; padding: 10px; font-family: "Courier New", monospace; font-size: 11px; line-height: 1.35; white-space: pre; overflow: auto; margin: 4px 0 0; }
@media (max-width: 860px) { .cf-tickets { grid-template-columns: 1fr; } }

/* Conteo físico */
.cn-hoja .cn-tabla { max-height: 52vh; overflow: auto; }
.cn-hoja .cn-tabla thead th { position: sticky; top: 0; z-index: 1; }
.pr-cmd.mv-op.activa { background: #fff; box-shadow: inset 0 -3px 0 var(--naranja); }
#pest-movimiento #tabla-mv { width: 100%; }
.pre-detalle { margin: 6px 2px 0; min-height: 1.2em; flex-shrink: 0; }

/* Importar y Exportar */
.im-panel .casilla { display: flex; gap: 6px; align-items: flex-start; font-size: .9rem; }
.im-archivo { background: #fff; border: 1px dashed var(--borde); border-radius: 8px; padding: 8px; overflow-wrap: anywhere; }
.im-archivo small { display: block; color: var(--gris); }
.im-hoja .tabla-caja { max-height: 48vh; overflow: auto; }
.im-columnas td:nth-child(3) { white-space: normal; }
.ex-cuenta { background: #fff4e5; border-radius: 10px; padding: 12px 16px; display: inline-block; margin-bottom: 10px; }
.ex-cuenta small { display: block; color: var(--gris); }
.ex-cuenta b { font-size: 1.8rem; color: var(--naranja-oscuro); }
.ex-pasos li { margin: 4px 0; }
.loc-fila { display: flex; gap: 6px; align-items: center; }
.loc-fila select { flex: 1; min-width: 0; }
.loc-mas { padding: 6px 12px; font-size: 1.2rem; font-weight: 800; line-height: 1; background: var(--naranja); color: #fff; border-radius: 8px; }

/* Respaldos */
.rs-estado { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-bottom: 10px; flex-shrink: 0; }
.rs-estado .dato.alerta { border-left: 4px solid #c62828; }
.rs-estado .dato small.error { color: #c62828; }

/* ===== Esqueleto nuevo de reportes (base para todos; 21/nov). Colores del sistema: naranja + tarjetas blancas ===== */
.rn { --rn-bien: #2e7d32; --rn-aviso: #a15c00; --rn-mal: #b3261e; display: flex; flex-direction: column; gap: 12px; overflow: auto; min-height: 0; flex: 1; padding-bottom: 24px; }
.rn-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.rn-cab h2 { margin: 0; font-size: 1.25rem; color: #202124; }
.rn-sub, .rn-periodo { display: block; color: var(--gris); font-size: .82rem; }
.rn-periodo { color: var(--naranja-oscuro); font-weight: 600; margin-top: 2px; }
.rn-iconos { display: flex; gap: 6px; }
.rn-icono { background: #fff; color: #333; border: 1px solid var(--borde); padding: 6px 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 1rem; }
.rn-icono small { font-size: .7rem; color: var(--gris); }
.rn-icono:hover { background: #fff4e8; border-color: var(--naranja); }
.rn-pestanas { display: flex; gap: 6px; flex-wrap: wrap; }
.rn-pestana { background: #fff; color: #444; border: 1px solid var(--borde); border-radius: 999px; padding: 8px 16px; font-size: .88rem; font-weight: 600; }
.rn-pestana:hover { background: #fff4e8; }
.rn-pestana.activa { background: var(--naranja); border-color: var(--naranja); color: #fff; }
.rn-filtros, .rn-tarjeta, .rn-dia { background: #fff; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.08); padding: 14px 16px; }
.rn-rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 14px; }
.rn-rejilla .campo { margin: 0; }
.rn-rejilla label { margin-top: 6px; }
.rn-rejilla input, .rn-rejilla select { width: 100%; }
.rn-avanzados { margin-top: 10px; border-top: 1px solid var(--borde); padding-top: 8px; }
.rn-avanzados summary { cursor: pointer; font-weight: 600; color: #333; padding: 4px 0; }
.rn-avanzados summary:hover { color: var(--naranja-oscuro); }
.rn-avanzados .sub { margin: 8px 0 0; font-size: .82rem; }
.rn-acciones { display: flex; justify-content: flex-end; margin-top: 12px; }
.rn-hoja { display: flex; flex-direction: column; gap: 12px; }
.rn-dia { display: flex; flex-direction: column; gap: 12px; background: #fafafa; border: 1px solid var(--borde); box-shadow: none; }
.rn-dia-cab { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.rn-dia-cab h3 { margin: 0; font-size: 1.05rem; }
.rn-dia-cab span { color: var(--gris); font-size: .88rem; }
.rn-tarjeta h4 { margin: 0 0 10px; font-size: .95rem; color: #333; }
.rn-grandes { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.rn-grande { background: #fff; border: 1px solid var(--borde); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; border-top: 4px solid var(--naranja); }
.rn-grande small { color: var(--gris); font-size: .82rem; }
.rn-grande b { font-size: 1.6rem; color: #202124; }
.rn-grande .rn-nota { font-size: .8rem; color: var(--gris); }
.rn-grande.bien { border-top-color: var(--rn-bien); }
.rn-grande.bien b, .rn-grande.bien .rn-nota { color: var(--rn-bien); }
.rn-grande.mal { border-top-color: var(--rn-mal); }
.rn-grande.mal b, .rn-grande.mal .rn-nota { color: var(--rn-mal); }
.rn-seguimiento { display: flex; justify-content: space-between; align-items: baseline; }
.rn-cifra { font-size: 1.5rem; }
.rn-progreso { height: 8px; background: #eee; border-radius: 999px; margin: 8px 0 12px; overflow: hidden; }
.rn-progreso-relleno { height: 100%; background: var(--naranja); border-radius: 999px; }
.rn-conteos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rn-conteo { display: flex; flex-direction: column; }
.rn-conteo b { font-size: 1.35rem; }
.rn-conteo small { color: var(--gris); font-size: .8rem; }
.rn-conteo.bien b { color: var(--rn-bien); } .rn-conteo.aviso b { color: var(--rn-aviso); } .rn-conteo.mal b { color: var(--rn-mal); }
.rn-dos { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.rn-lista { margin: 0; }
.rn-lista div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed #eee; }
.rn-lista div:last-child { border-bottom: 0; }
.rn-lista dt { color: #444; font-size: .9rem; }
.rn-lista dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.rn-lista .mal dd { color: var(--rn-mal); }
.rn-subpestanas { display: flex; gap: 16px; border-bottom: 1px solid var(--borde); margin-bottom: 8px; flex-wrap: wrap; }
.rn-subpestanas button { background: none; color: var(--gris); padding: 8px 2px; border-radius: 0; font-size: .9rem; font-weight: 600; border-bottom: 3px solid transparent; }
.rn-subpestanas button:hover { background: none; color: #202124; }
.rn-subpestanas button.activa { color: var(--naranja-oscuro); border-bottom-color: var(--naranja); }
.rn-tabla-caja { overflow-x: auto; }
.rn-tabla { font-size: .85rem; }
.rn-tabla th, .rn-tabla td { padding: 7px 10px; }
.rn-tabla td { font-variant-numeric: tabular-nums; }
.rn-tabla tr.rn-grupos th { background: #fff4e8; color: var(--naranja-oscuro); text-transform: uppercase; font-size: .72rem; letter-spacing: .04em; border-left: 2px solid #fff; }
.rn-tabla .rn-clave { color: var(--gris); }
.rn-tabla .rn-bien { color: var(--rn-bien); font-weight: 600; }
.rn-tabla .rn-mal { color: var(--rn-mal); font-weight: 600; }
.rn-tabla .rn-gris { color: var(--gris); }
.rn-tabla .rn-alertas { color: var(--rn-mal); white-space: normal; min-width: 140px; }
.rn-tabla tr.rn-fila-alerta td { background: #fdf1f0; }
.rn-tabla tr.rn-fila-efectiva td:first-child { color: var(--rn-bien); font-weight: 700; }
.rn-tabla tr.rn-fila-alerta td:first-child { color: var(--rn-mal); font-weight: 700; }
.rn-tabla .rn-vacio, .rn-vacio { text-align: center; color: var(--gris); padding: 24px; }
.rn-kpis tbody th { background: #fff; color: #333; font-weight: 600; font-size: .85rem; position: sticky; left: 0; }
.rn-kpis thead th small { display: block; font-weight: 400; font-size: .72rem; }
.rn-kpis .rn-total { background: #fff4e8; font-weight: 700; }
.rn-leyenda { display: flex; gap: 14px; flex-wrap: wrap; align-items: baseline; margin: 10px 0 0; font-size: .82rem; }
.rn-ley.bien { color: var(--rn-bien); font-weight: 600; } .rn-ley.mal { color: var(--rn-mal); font-weight: 600; }
.rn-leyenda .sub { margin: 0; font-size: .78rem; }
/* gráficas */
.rn-barrash { display: flex; flex-direction: column; gap: 8px; }
.rn-bh-fila { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 8px; align-items: center; font-size: .85rem; }
.rn-bh-fila:focus { outline: 2px solid var(--naranja); }
.rn-bh-et { color: #444; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rn-bh-pista { height: 18px; }
.rn-bh-barra { height: 100%; border-radius: 0 4px 4px 0; }
.rn-bh-val { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 80px; text-align: right; }
.rn-columnas .leyenda { margin-bottom: 8px; }
.rn-col-cuerpo { position: relative; height: 220px; padding-left: 34px; }
.rn-col-guias { position: absolute; inset: 0 0 22px 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.rn-col-guias div { border-top: 1px solid #eee; height: 0; }
.rn-col-guias small { position: relative; top: -8px; left: 0; font-size: .7rem; color: #888; display: inline-block; width: 30px; text-align: right; }
.rn-col-area { position: absolute; inset: 0 0 0 34px; display: flex; gap: 10px; align-items: stretch; }
.rn-col-grupo { flex: 1; display: flex; flex-direction: column; min-width: 0; cursor: default; }
.rn-col-grupo:focus { outline: 2px solid var(--naranja); }
.rn-col-barras { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; margin-bottom: 4px; }
.rn-col-barra { width: min(28px, 40%); border-radius: 4px 4px 0 0; min-height: 1px; }
.rn-col-grupo small { height: 18px; text-align: center; font-size: .72rem; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rn-impresion h2 { margin: 2px 0; }
@media print { body.imprimiendo-reporte .rn-subpestanas, body.imprimiendo-reporte .rn-leyenda .sub { display: none; } }
@media (max-width: 640px) { .rn-conteos { grid-template-columns: repeat(2, 1fr); } .rn-grande b { font-size: 1.3rem; } }
.rn-buscar { max-width: 320px; margin-bottom: 8px; padding: 8px 12px; }
.rn-pie { margin: 8px 0 0; font-size: .8rem; }
.rn-tabla tr.rn-fila-total td { font-weight: 700; background: #fff4e8; border-top: 2px solid var(--naranja); }
.rn-part { display: inline-block; width: 48px; height: 6px; background: #eee; border-radius: 999px; vertical-align: middle; overflow: hidden; }
.rn-part i { display: block; height: 100%; background: #eb6834; }
.rn > .reporte:empty { display: none; }
.rn-filtro-linea { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.rn-filtro-linea .rn-buscar { margin-bottom: 0; }
.rn-filtro-linea select { max-width: 260px; padding: 8px; }
.rn-lista .rn-li-total { border-top: 2px solid var(--borde); border-bottom: 0; }
.rn-lista .rn-li-total dt, .rn-lista .rn-li-total dd { font-weight: 800; color: #202124; }
.rn-tabla .rn-aviso { color: var(--rn-aviso); font-weight: 600; }
.rn-tabla .rn-negrita { font-weight: 700; }
.rn-calor { border-collapse: separate; border-spacing: 2px; width: auto; }
.rn-calor th { background: none; font-size: .72rem; color: var(--gris); padding: 2px 4px; text-align: center; }
.rn-calor tbody th { text-align: right; }
.rn-calor td { width: 30px; height: 26px; padding: 0; border: 0; border-radius: 4px; }
.rn-calor-ley { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
.rn-calor-ley i { width: 22px; height: 12px; border-radius: 3px; display: inline-block; }
.rn-calor-ley small { color: var(--gris); font-size: .75rem; margin: 0 4px; }
.rn-tabla .rn-clase { font-weight: 800; text-align: center; }
.rn-tabla .rn-clase-A { color: var(--rn-bien); } .rn-tabla .rn-clase-B { color: var(--rn-aviso); } .rn-tabla .rn-clase-C { color: var(--gris); }
.rn-er tr.rn-sub-total th, .rn-er tr.rn-sub-total td { font-weight: 700; border-top: 1px solid #ccc; }
.rn-er tr.rn-final th, .rn-er tr.rn-final td { font-weight: 800; font-size: .95rem; border-top: 2px solid var(--naranja); background: #fff4e8; }
.rn-er tr.rn-gris th { font-weight: 400; color: #555; padding-left: 18px; }
.rn-er tbody th { white-space: normal; min-width: 170px; }
.kc-salida { margin-top: 12px; padding: 14px 16px; border-radius: 10px; background: #fff4e8; border: 2px solid var(--naranja); }
.kc-salida p { margin: 0 0 10px; font-weight: 600; }
.pv-cajero { display: flex; align-items: baseline; gap: 8px; background: #fff; color: #202124; border-radius: 999px; padding: 4px 16px; }
.pv-cajero b { font-size: 1.35rem; color: var(--naranja-oscuro); }
.pv-cajero small { color: var(--gris); font-size: .8rem; }
.pv-cajero.otro { background: #fdecea; border: 2px solid #b3261e; }
.pv-cajero.otro small:last-child { color: #b3261e; font-weight: 700; }

/* ===== Mapa de rutas con herramientas en pestañas (21/nov) ===== */
.pagina-mapa .mp { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 10px 12px; gap: 8px; background: #f6f6f6; }
.mp-barra { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 18px; background: #fff; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.08); padding: 8px 14px; }
.mp-barra .campo { margin: 0; }
.mp-barra label { margin-top: 0; }
.mp-ruta select { min-width: 220px; }
.mp-dias { flex: 1; min-width: 280px; }
.mp-conteo { margin: 0 0 6px; }
.pagina-mapa .mp > .reporte:empty { display: none; }
.mp-cuerpo { flex: 1; display: flex; gap: 12px; min-height: 0; }
.pagina-mapa .mp-panel { width: 44%; min-width: 340px; max-width: 560px; border: 0; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.08); padding: 12px 14px; }
.mp-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.mp-tabs button { background: #fff; color: #444; border: 1px solid var(--borde); border-radius: 999px; padding: 6px 12px; font-size: .85rem; font-weight: 600; }
.mp-tabs button:hover { background: #fff4e8; }
.mp-tabs button.activa { background: var(--naranja); border-color: var(--naranja); color: #fff; }
.mp-sec h3 { margin: 0 0 6px; }
.mp-mapa-caja { flex: 1; position: relative; display: flex; min-height: 420px; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.mp-mapa-caja .mapa-lienzo { flex: 1; }
.mp-ampliar { position: absolute; z-index: 5; bottom: 24px; left: 10px; background: #fff; color: #202124; border: 1px solid var(--borde); padding: 6px 12px; font-size: .85rem; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.mp-ampliar:hover { background: #fff4e8; }
.mp.grande .mp-panel { display: none; }
.mp.grande .mp-mapa-caja { max-height: none; }
.mp-rejilla { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
/* Orden del día: lista que se arrastra (como Google Keep) */
.mp-orden { list-style: none; padding: 0; margin: 8px 0; }
.mp-orden li { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--borde); border-radius: 8px; padding: 6px 8px; margin-bottom: 4px; cursor: grab; }
.mp-orden li.arrastrando { opacity: .4; }
.mp-orden li.antes { box-shadow: inset 0 3px 0 var(--naranja); }
.mp-orden li.despues { box-shadow: inset 0 -3px 0 var(--naranja); }
.mp-orden li.cambio { background: #fff8e1; }
.mp-orden .asa { color: #999; font-size: 1.1rem; cursor: grab; user-select: none; }
.mp-orden .num { min-width: 26px; height: 26px; border-radius: 50%; background: var(--naranja); color: #fff; font-weight: 700; font-size: .8rem; display: flex; align-items: center; justify-content: center; }
.mp-orden .num.sin { background: #9e9e9e; }
.mp-orden .txt { flex: 1; min-width: 0; }
.mp-orden .txt small { display: block; color: var(--gris); font-size: .75rem; }
.mp-orden .flechas button { background: none; color: #555; padding: 2px 6px; font-size: .85rem; }
.mp-orden .flechas button:hover { background: #eee; }
.mp-orden-resumen { font-size: .85rem; color: #333; }
.mp-cg-cab { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.mp-cg-lista { list-style: none; padding: 0; margin: 6px 0; max-height: 320px; overflow-y: auto; border: 1px solid var(--borde); border-radius: 8px; }
.mp-cg-lista li { border-bottom: 1px solid #f0f0f0; }
.mp-cg-lista label { display: flex; gap: 8px; align-items: center; margin: 0; padding: 6px 10px; color: #202124; cursor: pointer; }
.mp-cg-lista input { width: auto; }
@media (max-width: 900px) { .mp-cuerpo { flex-direction: column; } .pagina-mapa .mp-panel { width: auto; max-width: none; min-width: 0; max-height: 45vh; overflow-y: auto; } .mp-mapa-caja { min-height: 360px; } }
.mp-panel .casilla input { width: auto; flex: none; margin-top: 3px; }
/* Recarga y descarga (23/nov): buscador con lista, cuadro con scroll interno y columnas que se ajustan arrastrando el borde */
.mv-buscador { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 6px; flex-wrap: wrap; }
.mv-buscar-caja { position: relative; flex: 1; min-width: 260px; }
.mv-buscar-caja input { width: 100%; }
.mv-resultados { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 2px 0 0; padding: 0; list-style: none; background: #fff; border: 1px solid var(--borde); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.15); max-height: 320px; overflow-y: auto; }
.mv-resultados li { padding: 8px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; }
.mv-resultados li small { color: var(--gris); }
.mv-resultados li.activo, .mv-resultados li:hover { background: #fff4e8; }
.mv-caja { max-height: 48vh; min-height: 140px; overflow: auto; border: 1px solid var(--borde); }
.mv-tabla { table-layout: fixed; width: 100%; min-width: 640px; }
.mv-tabla th { position: sticky; top: 0; z-index: 2; }
.mv-tabla th, .mv-tabla td { overflow: hidden; text-overflow: ellipsis; }
.mv-tabla .asa-col { position: absolute; top: 0; right: 0; width: 6px; height: 100%; cursor: col-resize; z-index: 3; }
.mv-tabla .asa-col:hover, .mv-tabla .asa-col.moviendo { background: var(--naranja); }
.mv-tabla td input { width: 90px; text-align: right; padding: 6px 8px; }
.mv-tabla td .quitar { background: none; color: #b3261e; padding: 4px 8px; font-size: 1rem; }
.mv-tabla tr.nuevo td { animation: mv-resalta 1.2s ease-out; }
@keyframes mv-resalta { from { background: #fff4c2; } to { background: transparent; } }

/* Ambiente de pruebas (25/nov) */
.franja-pruebas { background: #c62828; color: #fff; text-align: center; font-weight: 700; padding: 6px 10px; letter-spacing: .5px; }
