/* Inter (SIL OFL), alojada en el repo: latin 400–700 variable. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(assets/fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }

/* GestOp · rediseño (Claude Design, 28/09) — etapa 1 (base: colores, menú, franja de la llave) y
   etapa 2 (Centro de mensajes › Conversaciones). Ver design_handoff en docs/DISENO-CENTRO-MENSAJES.md.
   Etapa 5 (v0.22.0): las páginas viejas (Dashboard, Panel, Agente, Alertas, Pruebas) usan los mismos
   tokens (los colores fijos de index.html pasaron a var(--…)), así que el modo oscuro vale en todo. */

:root {
  --g-bg:#f4efe3; --surface:#fffdf7; --surface2:#efe8d6; --ink:#212122; --g-muted:#5f5b53; --line:#ddd4bf; --line2:#ebe4d3;
  --accent:#661317; --accent-fg:#f1ead8; --accent-tx:#661317; --sel:#f1e6cc; --chat:#ece5d3; --in:#fffdf7;
  --bot:#dde3ee; --human:#f2dcd3; --tpl:#fbf6e8; --tplline:#a8925c; --tpl-fg:#6a5626;
  --bot-bg:#dde3ee; --bot-fg:#314263; --hum-bg:#f5e1b3; --hum-fg:#634400; --ok-bg:#d9e9da; --ok-fg:#2b5533;
  --wait-bg:#661317; --wait-fg:#f7efdc; --fac-bg:#eedcdc; --warn:#8a5a00; --g-danger:#9b1c22;
  --bad-bg:#f4dcdc; --amb-bg:#f7ebc9; --pur-bg:#e9e2f1; --pur-fg:#4f3474;

  /* Variables de las páginas existentes → paleta Loekemeyer */
  --bg:var(--g-bg); --card:var(--surface); --text:var(--ink); --muted:var(--g-muted);
  --primary:var(--accent); --primary-hover:#4d0e11; --border:var(--line);
  --success:var(--ok-fg); --warning:var(--warn); --danger:var(--g-danger);
  --sidebar-bg:#212122; --sidebar-text:#f1ead8;
}
html.dark {
  --g-bg:#161617; --surface:#212122; --surface2:#2c2c2e; --ink:#f1ead8; --g-muted:#aba497; --line:#3a3a3d; --line2:#2d2d30;
  --accent:#8f2127; --accent-fg:#f7efdc; --accent-tx:#ea9a9e; --sel:#302b22; --chat:#1a1a1b; --in:#2c2c2e;
  --bot:#26314a; --human:#44282b; --tpl:#29261f; --tplline:#8a7a52; --tpl-fg:#d8c48e;
  --bot-bg:#26314a; --bot-fg:#bac7e4; --hum-bg:#4a3a14; --hum-fg:#f0cf85; --ok-bg:#1f3a26; --ok-fg:#a3d4ad;
  --wait-bg:#8f2127; --wait-fg:#f7efdc; --fac-bg:#3e2426; --warn:#e3b451; --g-danger:#f08489;
  --bad-bg:#4a2326; --amb-bg:#3e3316; --pur-bg:#352a47; --pur-fg:#cbb8ea;
}
/* Etapa 5 (v0.22.0): las páginas viejas usan los mismos tokens, así que el modo oscuro vale en todo el sistema. */

body { font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif; font-size: 14px; font-feature-settings: 'cv11', 'ss01'; -webkit-font-smoothing: antialiased; background: var(--g-bg); color: var(--ink); }
button, select, input, textarea { font-family: inherit; }

/* ── Sidebar ──────────────────────────────────────────────────────────── */
.app .sidebar.sb2 { width: 212px; flex: none; background: #212122; color: #f1ead8; border-right: 1px solid #38383b; padding: 0; }
.sb2 .sb-logo { padding: 18px 16px 14px; display: flex; flex-direction: column; gap: 8px; }
.sb2 .sb-logo img { width: 150px; height: auto; display: block; }
.sb2 .sb-logo div { display: flex; flex-direction: column; gap: 3px; }
.sb2 .sb-logo .sb-nombre b { font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.sb2 .sb-logo .sb-nombre span { font-size: 10px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; opacity: .7; }
.sb2 .sb-mods { display: flex; flex-direction: column; padding: 6px 0; gap: 2px; overflow: auto; min-height: 0; }
.sb2 .sb-mod { margin: 0 8px; padding: 8px 10px; background: transparent; border: 0; color: #f1ead8; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; gap: 8px; cursor: pointer; text-align: left; border-radius: 2px; }
.sb2 .sb-mod:hover { background: #2c2c2e; }
.sb2 .sb-mod.cerrado-actual { background: #661317; }
.sb2 .sb-mod .flecha { margin-left: auto; font-size: 9px; transition: transform .15s; }
.sb2 .sb-mod.cerrado .flecha { transform: rotate(-90deg); }
.sb2 .sb-secs { margin: 2px 8px 6px 26px; border-left: 1px solid #4a4a4d; display: flex; flex-direction: column; gap: 1px; }
.sb2 .sb-sec { background: transparent; border: 0; text-align: left; padding: 6px 10px; font-size: 12px; font-weight: 700; color: #c9c2b3;
  cursor: pointer; display: flex; align-items: center; gap: 6px; border-radius: 2px; }
.sb2 .sb-sec:hover { color: #f7efdc; }
.sb2 .sb-sec.activa { background: #661317; color: #f7efdc; }
.g-badge { margin-left: auto; min-width: 18px; padding: 0 5px; background: #f7efdc; color: #661317; font-size: 11px; font-weight: 900;
  border-radius: 2px; text-align: center; line-height: 16px; }
.sb2 .user-info { padding: 12px 16px; border-top: 1px solid #38383b; color: #aba497; font-size: 12px; }
.sb2 .user-info b { color: #f1ead8; display: block; font-size: 13px; }
.sb2 .user-info a { color: #aba497 !important; }
/* Barra lateral (Luis, 05/10): al entrar se ve ABIERTA, como siempre; el botón « la pliega y » la vuelve a fijar.
   Plegada (#app.sb-plegada) queda una tira de 12 px y la barra sale al pasar el mouse, por encima del contenido (no lo
   empuja). Abre a los 0,1 s y cierra a los 0,3 s, así un paso rápido del mouse por el borde no la dispara ni la cierra de
   golpe. Con el teclado (Tab) también sale: :focus-visible, no :focus, porque un clic deja el foco en el botón y la barra
   quedaría abierta tapando la bandeja. La tira se pinta si hay gente esperando (sb-espera / sb-urgente, de
   pintarEsperaBanner), porque el aviso de espera queda adentro de la barra escondida. No se recuerda entre entradas: Luis
   pidió verla abierta al entrar. (02/10 era al revés: escondida siempre, sin botón.)
   Debajo de 1100 px la barra ya no se muestra (se navega con el selector del encabezado). */
.app .sidebar.sb2 { position: relative; }
.sb2 .sb-plegar { position: absolute; top: 12px; right: 8px; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  padding: 0; background: transparent; border: 1px solid #4a4a4d; color: #c9c2b3; border-radius: 2px; cursor: pointer; font-size: 14px; font-weight: 700; }
.sb2 .sb-plegar:hover { color: #f7efdc; border-color: #c9c2b3; }
@media (min-width: 1101px) {
  .app.sb-plegada .sidebar.sb2 { --riel: 12px; position: fixed; top: 0; bottom: 0; left: 0; z-index: 1400;
    transform: translateX(calc(-100% + var(--riel))); transition: transform .18s ease .3s, box-shadow .18s ease .3s; }
  .app.sb-plegada .sidebar.sb2:hover, .app.sb-plegada .sidebar.sb2:has(:focus-visible) { transform: none; box-shadow: 10px 0 40px rgba(0,0,0,.35); transition-delay: .1s; }
  /* Recién plegada con el botón: queda plegada aunque el mouse siga encima (si no, el :hover de arriba la reabría y parecía que el botón no hacía nada). gestop2.js la saca al primer mouseleave. */
  .app.sb-plegada .sidebar.sb2.sb-forzada { transform: translateX(calc(-100% + var(--riel))) !important; box-shadow: none !important; transition-delay: 0s; }
  .app.sb-plegada .sidebar.sb2.sb-forzada::after { opacity: 1 !important; transition-delay: 0s; }
  .app.sb-plegada .sidebar.sb2::after { content: "›"; position: absolute; top: 0; right: 0; bottom: 0; width: var(--riel); display: flex; align-items: center;
    justify-content: center; background: #212122; color: #aba497; font-size: 13px; font-weight: 700; pointer-events: none; transition: opacity .15s ease .3s; }
  .app.sb-plegada .sidebar.sb2.sb-espera::after { background: #8a5a00; color: #f7efdc; }
  .app.sb-plegada .sidebar.sb2.sb-urgente::after { background: #9b1c22; color: #f7efdc; }
  .app.sb-plegada .sidebar.sb2:hover::after, .app.sb-plegada .sidebar.sb2:has(:focus-visible)::after { opacity: 0; transition-delay: .1s; }
  .app.sb-plegada .main.main2 { margin-left: 12px; }
}

/* ── Columna principal: llave + header + páginas ─────────────────────── */
.app .main.main2 { flex-direction: column; min-width: 0; background: var(--g-bg); }
.main2 .pages { flex: 1; display: flex; min-height: 0; overflow: hidden; }

.llave-band { flex: none; display: flex; align-items: center; gap: 14px; padding: 8px 16px; min-height: 44px; flex-wrap: wrap; }
.llave-band.m-0 { background: #4a4a4d; color: #f1ead8; }
.llave-band.m-prueba { background: #e2b13c; color: #212122; }
.llave-band.m-1 { background: #2f5a37; color: #f1ead8; }
.llave-band .lk-k { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.llave-band .lk-modo { border: 2px solid currentColor; padding: 1px 8px; font-size: 15px; font-weight: 900; letter-spacing: .08em; }
.llave-band .lk-desc { font-size: 13px; }
.llave-band .lk-hoy { margin-left: auto; font-size: 12px; }
.llave-band button { background: transparent; border: 1px solid currentColor; color: inherit; padding: 5px 10px; border-radius: 2px; cursor: pointer; font-size: 12px; }

.mod-head { flex: none; display: flex; align-items: flex-end; gap: 18px; padding: 10px 16px 0; background: var(--surface); border-bottom: 1px solid var(--line); }
.mod-head h1 { font-size: 17px; font-weight: 900; letter-spacing: -.01em; margin: 0 0 10px; white-space: nowrap; }
.mod-head .mod-tabs { display: flex; gap: 2px; overflow-x: auto; flex: 1; min-width: 0; }
.mod-head .mod-tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 8px 12px 9px; font-weight: 700; color: var(--g-muted);
  cursor: pointer; white-space: nowrap; display: flex; gap: 6px; align-items: center; font-size: 13px; }
.mod-head .mod-tab.activa { border-bottom-color: var(--accent); color: var(--ink); }
.mod-head .mod-tab .g-badge { background: var(--accent); color: var(--accent-fg); margin-left: 0; }
.mod-head .mod-der { display: flex; gap: 8px; margin: 0 0 8px auto; align-items: center; }
.g-btn { background: var(--surface2); border: 1px solid var(--line); color: var(--ink); padding: 6px 11px; border-radius: 2px; cursor: pointer; font-size: 12px; font-weight: 700; }
.g-btn:hover { border-color: var(--ink); }
.g-btn.prim { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.g-btn.prim:hover { filter: brightness(1.15); }
.g-btn:disabled { opacity: .45; cursor: default; }
.mod-select { display: none; padding: 5px 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 2px; font-weight: 700; }

/* ── Chips de estado (color + texto) ─────────────────────────────────── */
.est { display: inline-block; padding: 1px 6px; border-radius: 2px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.est.esperando { background: var(--wait-bg); color: var(--wait-fg); }
.est.humano { background: var(--hum-bg); color: var(--hum-fg); }
.est.respondida { background: var(--ok-bg); color: var(--ok-fg); outline: 1px dashed var(--ok-fg); outline-offset: -1px; }
.est.bot { background: var(--bot-bg); color: var(--bot-fg); }
.est.resuelta, .est.ok { background: var(--ok-bg); color: var(--ok-fg); }
.est.gris { background: var(--surface2); color: var(--g-muted); }
.edad-0 { color: var(--ink); } .edad-1 { color: var(--warn); } .edad-2 { color: var(--g-danger); }

/* ── Centro de mensajes › Conversaciones ─────────────────────────────── */
#pageConv.active { display: flex; min-width: 0; }
.cm { flex: 1; display: flex; min-width: 0; min-height: 0; background: var(--g-bg); color: var(--ink); }
.cm-bandeja { width: 340px; flex: none; min-width: 0; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); min-height: 0; }
.cm-top { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--line); }
.cm-prio { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; background: var(--wait-bg); color: var(--wait-fg); border: 0; padding: 8px 10px; cursor: pointer; text-align: left; border-radius: 2px; }
.cm-prio b { font-size: 22px; font-weight: 900; }
.cm-prio .v { margin-left: auto; font-size: 12px; }
.cm-prio.cero { background: var(--ok-bg); color: var(--ok-fg); }
.cm-buscar { padding: 7px 9px; border: 1px solid var(--line); background: var(--g-bg); color: var(--ink); border-radius: 2px; }
.cm-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.cm-chip { background: var(--surface); border: 1px solid var(--line); padding: 3px 7px; font-size: 12px; cursor: pointer; border-radius: 2px; color: var(--ink); }
.cm-chip.activo { background: var(--ink); color: var(--g-bg); border-color: var(--ink); }
.cm-filtros { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 6px; }
.cm-filtros select { padding: 5px 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 2px; min-width: 0; }
.cm-lista { flex: 1; overflow-y: auto; }
.cm-fila { padding: 9px 12px; border-bottom: 1px solid var(--line2); cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.cm-fila:hover { background: var(--g-bg); }
.cm-fila.sel { background: var(--sel); }
.cm-fila .l1 { display: flex; justify-content: space-between; gap: 8px; }
.cm-fila .l1 b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-fila .l1 i { color: var(--g-muted); }
.cm-fila .l1 span { color: var(--g-muted); font-size: 12px; flex: none; }
.cm-fila .l2 { color: var(--g-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-fila .l3 { display: flex; gap: 6px; align-items: center; font-size: 12px; flex-wrap: wrap; }
.cm-fila .l3 .meta { color: var(--g-muted); }
.cm-fila .l3 .canal { margin-left: auto; border: 1px solid var(--line); padding: 0 4px; font-size: 10px; font-weight: 700; color: var(--g-muted); }
.cm-vacio { padding: 18px 14px; color: var(--g-muted); }

.cm-chat { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.cm-chat-head { background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
.cm-chat-head .t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cm-chat-head .t b { font-size: 15px; font-weight: 900; }
.cm-chat-head .sub { color: var(--g-muted); font-size: 12px; }
.cm-acciones { display: flex; gap: 6px; flex-wrap: wrap; }
.cm-volver { display: none; }
.cm-hilo { flex: 1; overflow-y: auto; background: var(--chat); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.bb { max-width: min(560px, 84%); border-radius: 4px; padding: 6px 9px 4px; line-height: 1.4; white-space: pre-wrap; word-wrap: break-word; }
.bb .et { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; display: block; margin-bottom: 2px; }
.bb .h { font-size: 10px; color: var(--g-muted); text-align: right; margin-top: 2px; }
.bb.in { align-self: flex-start; background: var(--in); border: 1px solid var(--line); }
.bb.bot { align-self: flex-end; background: var(--bot); }
.bb.bot .et { color: var(--bot-fg); }
.bb.hum { align-self: flex-end; background: var(--human); }
.bb.hum .et { color: var(--accent-tx); }
.bb.tpl { align-self: flex-end; background: var(--tpl); border: 1px dashed var(--tplline); }
.bb.tpl .et { color: var(--tpl-fg); }
.sys { align-self: center; font-size: 11px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 2px 10px; color: var(--g-muted); }
.dia { align-self: center; font-size: 11px; color: var(--g-muted); background: var(--surface); border-radius: 10px; padding: 1px 10px; border: 1px solid var(--line); }

.cm-caja { background: var(--surface); border-top: 1px solid var(--line); padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.cm-caja .fila { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.cm-caja .info { font-size: 12px; color: var(--g-muted); }
.cm-caja textarea { width: 100%; min-height: 64px; resize: vertical; padding: 8px; border: 1px solid var(--line); background: var(--g-bg); color: var(--ink); border-radius: 2px; line-height: 1.4; }
.aviso-ambar { background: var(--hum-bg); color: var(--hum-fg); padding: 8px 10px; border-radius: 2px; font-size: 12px; line-height: 1.4; }

.cm-ficha { width: 300px; flex: none; background: var(--surface); border-left: 1px solid var(--line); overflow-y: auto; }
.cm-ficha section { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.cm-ficha h4 { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--g-muted); margin: 0 0 8px; }
.cm-ficha .rs { font-size: 15px; font-weight: 900; }
.cm-ficha .kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 12px; margin-top: 8px; }
.cm-ficha .kv span:nth-child(odd) { color: var(--g-muted); }
.cm-ficha .it { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 12px; padding: 4px 0; border-bottom: 1px solid var(--line2); }
.cm-ficha .it:last-child { border-bottom: 0; }
.cm-ficha-cerrar { display: none; }
/* Ficha plegable (Luis, 02/10): en la computadora (≥ 1320 px, donde la ficha es columna) se pliega a una tira de 34 px
   para darle ancho a la charla, y se recuerda (gestop_ficha_plegada). Debajo de 1320 px ya es un panel que se abre y
   cierra con "Ficha del cliente" / "Cerrar", así que el botón no se muestra. */
.cm-ficha { position: relative; }
.cm-ficha-plegar { display: none; }
@media (min-width: 1320px) {
  .cm-ficha { transition: width .15s; }
  .cm-ficha-plegar { display: flex; position: absolute; top: 7px; right: 8px; z-index: 1; width: 26px; height: 26px; align-items: center; justify-content: center;
    gap: 10px; padding: 0; background: var(--surface2); border: 1px solid var(--line); color: var(--ink); border-radius: 2px; cursor: pointer; font-weight: 900; font-size: 15px; }
  .cm-ficha-plegar:hover { border-color: var(--ink); }
  .cm-ficha-plegar .tx { display: none; }
  .cm.ficha-plegada .cm-ficha { width: 34px; overflow: hidden; }
  .cm.ficha-plegada #cmFicha { display: none; }
  .cm.ficha-plegada .cm-ficha-plegar { position: static; width: 100%; height: 100%; flex-direction: column; justify-content: flex-start; padding-top: 10px;
    border: 0; background: transparent; }
  .cm.ficha-plegada .cm-ficha-plegar:hover { background: var(--surface2); }
  .cm.ficha-plegada .cm-ficha-plegar .fl { transform: rotate(180deg); }
  .cm.ficha-plegada .cm-ficha-plegar .tx { display: inline; writing-mode: vertical-rl; font-size: 11px; font-weight: 700; letter-spacing: .14em;
    text-transform: uppercase; color: var(--g-muted); }
}

/* Modal y toast */
.g-modal-fondo { position: fixed; inset: 0; background: rgba(15,15,16,.55); display: flex; align-items: center; justify-content: center; z-index: 2000; padding: 16px; }
.g-modal { background: var(--surface); color: var(--ink); max-width: 540px; width: 100%; border-top: 6px solid var(--accent); box-shadow: 0 20px 60px rgba(0,0,0,.4);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 32px); overflow-y: auto; }
.md-motivos { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; text-align: left; }
.md-motivos label { cursor: pointer; }
#mdNota { width: 100%; box-sizing: border-box; margin-bottom: 6px; }
.g-modal h3 { margin: 0; font-size: 17px; font-weight: 900; }
.g-modal .kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; }
.g-modal .kv span:nth-child(odd) { color: var(--g-muted); }
.g-modal .texto { background: var(--g-bg); border: 1px solid var(--line); padding: 8px 10px; white-space: pre-wrap; line-height: 1.4; }
.g-modal .nota { padding: 6px 10px; font-size: 12px; border-radius: 2px; }
.g-modal .botones { display: flex; justify-content: flex-end; gap: 8px; }
.g-modal .botones .g-btn { min-height: 44px; padding: 0 18px; font-size: 13px; }
.g-modal .opcion { border: 1px solid var(--line); padding: 10px 12px; display: flex; gap: 12px; align-items: center; cursor: pointer; background: var(--surface); text-align: left; color: var(--ink); }
.g-modal .opcion.elegida { border: 2px solid var(--ink); }
.g-modal .opcion .caja { min-width: 118px; text-align: center; font-weight: 900; letter-spacing: .08em; padding: 3px 0; }
.g-modal input[type=text] { padding: 8px 10px; border: 1px solid var(--line); background: var(--g-bg); color: var(--ink); border-radius: 2px; }
.g-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #212122; color: #f1ead8; font-weight: 700; padding: 10px 16px;
  border-radius: 2px; z-index: 2100; max-width: calc(100vw - 32px); }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1319px) {
  .cm-ficha { position: fixed; top: 0; right: 0; bottom: 0; width: min(360px, 100%); z-index: 1500; box-shadow: -20px 0 50px rgba(0,0,0,.3); display: none; }
  .cm.ficha-abierta .cm-ficha { display: block; }
  .cm-ficha-cerrar { display: inline-block; }
}
@media (max-width: 1100px) {
  .app .sidebar.sb2 { display: none !important; }
  .mod-select { display: inline-block; }
}
@media (max-width: 1000px) { .cm-bandeja { width: 300px; } }
@media (max-width: 900px) { .llave-band .lk-hoy { display: none; } }
@media (max-width: 760px) {
  .app.active { flex-direction: column; }
  .mod-head { flex-wrap: wrap; align-items: center; padding-top: 8px; }
  .mod-head h1 { margin: 0; font-size: 15px; }
  .mod-head .mod-tabs { order: 3; flex-basis: 100%; }
  .mod-head .mod-tab { padding: 8px 7px 9px; font-size: 12px; }
  .mod-head .mod-der { margin: 0 0 0 auto; }
  .llave-band { gap: 8px; padding: 8px 12px; }
  .llave-band .lk-desc { flex-basis: 100%; order: 3; }
  .cm-bandeja { width: 100%; border-right: 0; }
  .cm .cm-chat { display: none; }
  .cm.con-charla .cm-bandeja { display: none; }
  .cm.con-charla .cm-chat { display: flex; }
  .cm-volver { display: inline-block; }
  .g-btn { min-height: 36px; }
}

/* ── Centro de mensajes › Tareas (etapa 3) ───────────────────────────── */
#pageTareas.active { display: flex; min-width: 0; }
.tk { flex: 1; display: flex; min-width: 0; min-height: 0; background: var(--g-bg); color: var(--ink); }
.tk-lista-col { width: 440px; flex: none; min-width: 0; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); min-height: 0; }
.tk-resumen { font-size: 12px; color: var(--g-muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tk-resumen b { color: var(--ink); font-size: 15px; font-weight: 900; }
.tk-resumen .g-btn { margin-left: auto; padding: 3px 8px; font-size: 11px; }
.tk-fila .l1 .edad-0 { color: var(--g-muted); }
.tk-fila .l1 .edad-1 { color: var(--warn); font-weight: 900; }
.tk-fila .l1 .edad-2 { color: var(--g-danger); font-weight: 900; }
.tk-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; margin-right: 2px; }
.tk-dot.rojo { background: #c62828; } .tk-dot.amarillo { background: #e0a100; } .tk-dot.verde { background: #2e7d32; }
.est.tipo-tel { background: var(--bot-bg); color: var(--bot-fg); }
.est.tipo-cob { background: var(--wait-bg); color: var(--wait-fg); }
.est.tipo-der { background: var(--hum-bg); color: var(--hum-fg); }
.est.tipo-alta { background: var(--ok-bg); color: var(--ok-fg); }
.est.tipo-aud { background: var(--pur-bg); color: var(--pur-fg); }
.est.tipo-ped { background: var(--ok-bg); color: var(--ok-fg); }
.tk-detalle { flex: 1; min-width: 0; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.tk-card { background: var(--surface); border: 1px solid var(--line); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.tk-card h4 { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--g-muted); margin: 0; }
.tk-card .tit { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tk-card .tit b { font-size: 17px; font-weight: 900; }
.tk-card .kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 13px; }
.tk-card .kv span:nth-child(odd) { color: var(--g-muted); }
.tk-card .cita { background: var(--g-bg); border-left: 3px solid var(--accent); padding: 8px 10px; white-space: pre-wrap; line-height: 1.4; }
.tk-card .alerta { color: var(--g-danger); font-weight: 700; }
.tk-card .aviso { font-size: 12px; padding: 6px 10px; background: var(--g-bg); border: 1px dashed var(--line); color: var(--g-muted); }
.tk-tels { display: flex; flex-direction: column; max-width: 380px; }
.tk-tels .it { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line2); }
.tk-tels .it:last-child { border-bottom: 0; }
.tk-tels a { color: var(--accent-tx, var(--accent)); font-weight: 700; text-decoration: none; }
.tk .cm-acciones .g-btn { min-height: 34px; }
.tk-volver { display: none; align-self: flex-start; }
.g-modal textarea { width: 100%; min-height: 60px; padding: 8px; border: 1px solid var(--line); background: var(--g-bg); color: var(--ink); border-radius: 2px; resize: vertical; }
@media (max-width: 1000px) { .tk-lista-col { width: 340px; } }
@media (max-width: 760px) {
  .tk-lista-col { width: 100%; border-right: 0; }
  .tk .tk-detalle { display: none; padding: 12px; }
  .tk.con-detalle .tk-lista-col { display: none; }
  .tk.con-detalle .tk-detalle { display: flex; }
  .tk-volver { display: inline-block; }
}

/* ── Centro de mensajes › Salientes (etapa 4) ────────────────────────── */
#pageSalientes.active { display: block; min-width: 0; overflow-y: auto; }
.sl { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; color: var(--ink); max-width: 1200px; }
.sl-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--g-muted); }
.sl-top select { padding: 5px 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 2px; }
.sl-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.sl-kpi { background: var(--surface); padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.sl-kpi span { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--g-muted); }
.sl-kpi b { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.sl-kpi i { font-style: normal; font-size: 12px; color: var(--g-muted); }
.sl-card { background: var(--surface); border: 1px solid var(--line); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sl-card h4 { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--g-muted); margin: 0; }
.sl-card .nota { font-size: 12px; color: var(--g-muted); }
.sl-scroll { overflow-x: auto; }
.sl-tab { border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.sl-tab th { font-size: 11px; font-weight: 700; color: var(--g-muted); text-align: right; padding: 4px 8px; border-bottom: 1px solid var(--line); vertical-align: bottom; }
.sl-tab th:first-child, .sl-tab td:first-child { text-align: left; }
.sl-tab td { padding: 4px 8px; border-bottom: 1px solid var(--line2); text-align: right; white-space: nowrap; }
.sl-tab td.cero { color: var(--g-muted); }
.sl-tab td.mal { color: var(--g-danger); font-weight: 700; }
.sl-tab td.ret { color: var(--warn); font-weight: 700; }
.sl-tab tr.tot td { font-weight: 900; border-top: 2px solid var(--line); border-bottom: 0; }
.sl-tab tr.hoy td { background: var(--sel); }
.sl-barra { display: flex; height: 10px; width: 160px; background: var(--line2); }
.sl-barra i { display: block; height: 100%; }
.sl-barra .b-bot { background: var(--accent); } .sl-barra .b-otr { background: #8a8577; } .sl-barra .b-fal { background: #c62828; }
.sl-ley { display: flex; gap: 12px; font-size: 12px; color: var(--g-muted); flex-wrap: wrap; }
.sl-ley i { display: inline-block; width: 10px; height: 10px; margin-right: 4px; vertical-align: -1px; }
.sl-2col { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; }
.sl-mot { display: grid; grid-template-columns: minmax(0,1fr) 120px 40px; gap: 6px 10px; align-items: center; font-size: 13px; }
.sl-mot .bar { height: 8px; background: #c62828; }
@media (max-width: 900px) { .sl-2col { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 760px) { .sl { padding: 12px; } .sl-kpi b { font-size: 18px; } }

/* ── Informes › Proyección de avisos y gasto (v0.27.0) ───────────────── */
#pageProyeccion.active { display: block; min-width: 0; overflow-y: auto; }
#pagePorConfirmar.active { display: block; min-width: 0; overflow-y: auto; }
#pageSinStock.active { display: block; min-width: 0; overflow-y: auto; }
#pageFacturas.active { display: block; min-width: 0; overflow-y: auto; }
.pr-barras { display: grid; grid-template-columns: auto minmax(100px, 360px) auto; gap: 6px 10px; align-items: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.pr-barras .b { display: flex; height: 12px; background: var(--line2); }
.pr-barras .b i { display: block; height: 100%; }
.pr-barras b { text-align: right; }
.sl-tab .pr-sep { border-left: 1px solid var(--line); }
.sl-tab th.pr-emp, .sl-tab td.pr-emp { text-align: left; }
.sl-tab td:first-child .nota { white-space: normal; max-width: 340px; text-align: left; }
.pr-pct { color: var(--g-muted); font-size: 11px; }
.pr-notas { margin: 0; padding-left: 18px; font-size: 12px; color: var(--g-muted); display: flex; flex-direction: column; gap: 4px; }

/* ── Etapa 5: páginas viejas (Dashboard, Panel, Agente, Alertas, Pruebas) con los tokens nuevos ── */
html.dark { color-scheme: dark; }
.pages input:not([type=checkbox]):not([type=radio]):not([type=range]), .pages select, .pages textarea {
  background-color: var(--g-bg); color: var(--ink); border-color: var(--line);
}
.pages input::placeholder, .pages textarea::placeholder { color: var(--g-muted); }
.pages table { color: var(--ink); }
.pages th { color: var(--g-muted); }
/* El título y las pestañas de cada página ya están en el encabezado nuevo (mod-head): no se repiten. */
#pageDash > .config-page > h2:first-child, #pageConfig > .config-page > h2:first-child,
#pageAlertas > .config-page > h2:first-child, #pageAgente > .config-page > div:first-child > h2 { display: none; }
#pageConfig > .config-page > .subtabs, #pageAgente > .config-page > .subtabs { display: none; }
#pageAgente > .config-page > div:first-child { justify-content: flex-end !important; }
/* Simulador de WhatsApp (Pruebas) en oscuro: la paleta oscura de WhatsApp. */
html.dark { --wa-bg:#0b141a; --wa-in:#202c33; --wa-out:#005c4b; }
html.dark .chat-messages { background-image: none; }

/* Ficha › Agendar con un click (v0.23.0) */
.cm-ficha .agendar { font-size: 12px; }
.cm-ficha .agendar p { margin: 4px 0 8px; color: var(--g-muted); line-height: 1.4; }
.cm-ficha section.agendar { border-left: 3px solid var(--warn); padding-left: 10px; }
.cm-ficha div.agendar { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.cm-ficha .agendar input { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); }

/* Login (v0.27.24, Pablo 07/10: "armame algo así", con un mockup).
   Antes (v0.27.18): escena bordó y crema con tres abrelatas en abanico y tarjeta de vidrio. Ahora: fondo de vidrio roto con rejilla,
   el grupo de productos de la marca (foto recortada del mockup, se mezcla con "screen" sobre el fondo oscuro) con haces de luz que
   van hacia un marco de metal con vidrio y neón (cian a la izquierda, magenta a la derecha). Todo el marco escala con --w (el ancho del
   marco): el tamaño de letra del marco es --w / 24, así que logo, GestOp y botón guardan las proporciones del mockup en cualquier pantalla.
   Escena y fondo son decoración (aria-hidden): si la foto no carga se saca sola (onerror) y el resto queda.
   Escritorio: productos a la izquierda y marco a la derecha. Hasta 900 px: una columna, productos arriba. Hasta 560 px: sólo el marco. */
.login-overlay {
  --w: min(46vw, 820px, calc((100vh - 70px) * 1.15)); --sh: min(72vh, var(--w));
  --cian: #2fe3ff; --magenta: #ff3f93;
  display: grid; grid-template-columns: minmax(0, 1fr) var(--w); align-items: center; padding: 0 4.3vw 0 0;
  overflow: hidden; isolation: isolate;
  background:
    radial-gradient(880px 560px at 27% 46%, rgba(70, 100, 130, 0.20), transparent 70%),
    radial-gradient(640px 460px at 100% 100%, rgba(150, 40, 100, 0.15), transparent 70%),
    radial-gradient(620px 420px at 0 0, rgba(90, 120, 150, 0.13), transparent 70%),
    #0b1016;
}
.login-overlay::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(34vw 62vh at calc(100% - 4.3vw - var(--w) * 0.96) 52%, rgba(47, 227, 255, 0.12), transparent 70%),
    radial-gradient(26vw 62vh at calc(100% - 4.3vw) 50%, rgba(255, 63, 147, 0.14), transparent 70%);
}
.login-overlay::after {
  content: "Loekemeyer Hnos – mayorista de artículos de cocina y bazar";
  position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; z-index: 2;
  color: rgba(214, 226, 238, 0.66); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase;
}

/* Fondo: grietas de vidrio y rejilla de plano */
.lg-fondo { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.lg-grietas {
  position: absolute; inset: 0; width: 100%; height: 100%; scale: 1.04;
  translate: calc(var(--mx, 0) * 10px) calc(var(--my, 0) * 7px); transition: translate 0.5s ease-out;
  -webkit-mask-image: radial-gradient(ellipse 92% 92% at 50% 50%, #000 38%, transparent 100%); mask-image: radial-gradient(ellipse 92% 92% at 50% 50%, #000 38%, transparent 100%);
}
.lg-rejilla {
  position: absolute; left: 0; top: 18%; width: 30%; height: 50%;
  background-image: linear-gradient(rgba(110, 170, 210, 0.13) 1px, transparent 1px), linear-gradient(90deg, rgba(110, 170, 210, 0.13) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 25% 50%, #000 10%, transparent 100%); mask-image: radial-gradient(ellipse 70% 70% at 25% 50%, #000 10%, transparent 100%);
}
.le-grano {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0.06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Escena: productos + haces de luz. La caja termina donde empieza el marco, así los haces llegan al borde. */
.lg-escena {
  position: relative; z-index: 1; justify-self: end; height: var(--sh); aspect-ratio: 530 / 507; pointer-events: none;
  mix-blend-mode: screen; /* va ACÁ y no en los hijos: translate crea un contexto de apilado y aislaría el blend de la foto */
  translate: calc(var(--mx, 0) * -12px) calc(var(--my, 0) * -8px); transition: translate 0.4s ease-out;
}
.lg-prod { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; animation: lg-in 0.9s ease-out both; }
.lg-fibras { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 0 3px rgba(60, 210, 255, 0.9)); }
.lg-fibras path { stroke: rgba(160, 238, 255, 0.95); stroke-dasharray: 20 700; animation: lg-flujo var(--d, 4s) linear infinite; animation-delay: var(--r, 0s); }
@keyframes lg-flujo { from { stroke-dashoffset: 20; } to { stroke-dashoffset: -700; } }
@keyframes lg-in { from { opacity: 0; } }

/* Marco de metal con vidrio (columna derecha). Los chaflanes y las pestañas del borde son polígonos en em. */
.login-box {
  position: relative; z-index: 3; width: var(--w); padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none; text-align: center; color: #e8f1f8;
  font-size: max(calc(var(--w) / 24), 14px);
  filter: drop-shadow(-0.55em 0 1.1em rgba(47, 227, 255, 0.20)) drop-shadow(0.55em 0 1.1em rgba(255, 63, 147, 0.22)) drop-shadow(0 1.2em 2em rgba(0, 0, 0, 0.6));
  animation: lb-in 0.7s cubic-bezier(.2, .8, .2, 1) both;
}
.lb-marco {
  --c: 1.3em; --t: 0.5em; position: relative; padding: 1em 1em 0;
  background: linear-gradient(135deg, #f1f6fb 0, #7f8b98 22%, #323b45 48%, #8c98a5 74%, #e4ecf4 100%);
  clip-path: polygon(0 calc(var(--c) + var(--t)), var(--c) var(--t), 17% var(--t), calc(17% + var(--t)) 0, calc(83% - var(--t)) 0, 83% var(--t), calc(100% - var(--c)) var(--t), 100% calc(var(--c) + var(--t)),
    100% calc(100% - var(--c) - var(--t)), calc(100% - var(--c)) calc(100% - var(--t)), 83% calc(100% - var(--t)), calc(83% - var(--t)) 100%, calc(17% + var(--t)) 100%, 17% calc(100% - var(--t)), var(--c) calc(100% - var(--t)), 0 calc(100% - var(--c) - var(--t)));
}
.lb-marco::before {
  content: ""; position: absolute; inset: 0.1em; z-index: 0; pointer-events: none;
  background:
    linear-gradient(112deg, rgba(255, 255, 255, 0.20) 0, rgba(255, 255, 255, 0) 24%, rgba(255, 255, 255, 0) 60%, rgba(255, 255, 255, 0.10) 82%, rgba(255, 255, 255, 0) 100%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, rgba(0, 0, 0, 0.06) 1px 3px),
    linear-gradient(180deg, #a3afbc 0, #5b6773 3%, #2b333c 10%, #1a2027 50%, #29313a 90%, #66727f 97%, #a3afbc 100%);
  clip-path: polygon(0 calc(var(--c) + var(--t)), var(--c) var(--t), 17% var(--t), calc(17% + var(--t)) 0, calc(83% - var(--t)) 0, 83% var(--t), calc(100% - var(--c)) var(--t), 100% calc(var(--c) + var(--t)),
    100% calc(100% - var(--c) - var(--t)), calc(100% - var(--c)) calc(100% - var(--t)), 83% calc(100% - var(--t)), calc(83% - var(--t)) 100%, calc(17% + var(--t)) 100%, 17% calc(100% - var(--t)), var(--c) calc(100% - var(--t)), 0 calc(100% - var(--c) - var(--t)));
}
.lb-cristal {
  --c2: 1.05em; position: relative; z-index: 1; margin-top: var(--t);
  background: linear-gradient(90deg, var(--cian), #6e8fff 50%, var(--magenta));
  clip-path: polygon(var(--c2) 0, calc(100% - var(--c2)) 0, 100% var(--c2), 100% calc(100% - var(--c2)), calc(100% - var(--c2)) 100%, var(--c2) 100%, 0 calc(100% - var(--c2)), 0 var(--c2));
}
.lb-cristal::before {
  content: ""; position: absolute; inset: 0.08em; z-index: 0;
  background:
    radial-gradient(95% 75% at 0 42%, rgba(0, 190, 230, 0.34), transparent 64%),
    radial-gradient(95% 75% at 100% 55%, rgba(255, 50, 140, 0.30), transparent 64%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 32%),
    linear-gradient(160deg, #0d2b39, #0a1722 52%, #1a1021);
  clip-path: polygon(var(--c2) 0, calc(100% - var(--c2)) 0, 100% var(--c2), 100% calc(100% - var(--c2)), calc(100% - var(--c2)) 100%, var(--c2) 100%, 0 calc(100% - var(--c2)), 0 var(--c2));
}
.lb-cristal > * { position: relative; z-index: 1; }
.lb-cristal { padding: 2.1em 1.5em 1.2em; }
.lb-marca {
  width: 11.6em; max-width: 78%; aspect-ratio: 1240 / 125; margin: 0 auto 0.5em;
  background: linear-gradient(180deg, #ffffff 0, #d3dce6 42%, #8e9ba8 54%, #e3eaf2 100%);
  -webkit-mask: url("assets/logo.png") 0 0 / 100% auto no-repeat; mask: url("assets/logo.png") 0 0 / 100% auto no-repeat;
  filter: drop-shadow(0 0.07em 0.05em rgba(0, 0, 0, 0.55));
}
.login-box .lb-gestop { width: 8.7em; max-width: 70%; margin: 0 auto; line-height: 0; font-size: inherit; }
.lb-gestop svg { display: block; width: 100%; height: auto; overflow: visible; }
.lb-bot {
  display: flex; align-items: center; justify-content: center; gap: 0.4em; margin-top: -0.2em;
  font-size: 0.92em; font-weight: 700; font-style: italic; color: #e2f7ff; text-shadow: 0 0 0.55em rgba(47, 227, 255, 0.55);
}
.lb-bot svg { height: 0.78em; width: auto; fill: var(--cian); filter: drop-shadow(0 0 0.25em rgba(47, 227, 255, 0.9)); }
.login-box .lb-bienvenido { margin: 1.05em 0 0.9em; font-size: 1.3em; font-weight: 500; letter-spacing: 0.01em; color: #f4f8fb; }
.login-box .google-btn {
  width: 84%; margin: 0 auto; height: 3.1em; font-size: max(0.78em, 15px); white-space: nowrap; font-weight: 500; color: #e9f1f7; border-radius: 0.55em;
  border: 1px solid #1a2128; border-top-color: #b4bfcb;
  background: linear-gradient(180deg, #5e6a76 0, #3b4550 9%, #2b333b 52%, #222930 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), inset 0 -2px 0 rgba(0, 0, 0, 0.35), 0 0.3em 0.9em rgba(0, 0, 0, 0.5), 0 0 0 0.16em rgba(18, 26, 34, 0.85);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.login-box .google-btn:hover { filter: brightness(1.14); transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -2px 0 rgba(0, 0, 0, 0.35), 0 0.4em 1.1em rgba(0, 0, 0, 0.55), 0 0 0 0.16em rgba(18, 26, 34, 0.85), 0 0 1.2em rgba(47, 227, 255, 0.35); }
.login-box .google-btn:focus-visible { outline: 2px solid var(--cian); outline-offset: 3px; }
.login-box .login-error { color: #ff9db9; font-size: max(0.5em, 13px); margin-top: 0.7em; }
.lb-pie { position: relative; z-index: 1; padding: 1.5em 1em 2.2em; font-size: max(0.6em, 12px); color: rgba(226, 236, 246, 0.86); letter-spacing: 0.01em; }
@keyframes lb-in { from { opacity: 0; transform: translateY(10px); } }

/* Pantallas medianas y chicas */
@media (max-width: 900px) {
  .login-overlay { --w: min(92vw, 560px, calc((100vh - 70px) * 1.15)); --sh: min(44vh, 100vw); grid-template-columns: minmax(0, 1fr); justify-items: center; align-items: end; padding: 0 0 clamp(48px, 9vh, 90px); }
  .login-overlay::before { background: radial-gradient(60vw 40vh at 50% 70%, rgba(47, 227, 255, 0.10), transparent 70%), radial-gradient(60vw 40vh at 80% 80%, rgba(255, 63, 147, 0.12), transparent 70%); }
  .lg-escena { position: absolute; top: 3vh; left: 50%; justify-self: auto; translate: -50% 0; }
  .lg-prod { -webkit-mask-image: linear-gradient(90deg, #000 68%, transparent); mask-image: linear-gradient(90deg, #000 68%, transparent); }
  .lg-fibras { display: none; }
}
@media (max-width: 560px) {
  .login-overlay { --sh: min(34vh, 92vw); padding-bottom: clamp(40px, 8vh, 70px); }
  .lg-escena { top: 4vh; }
  .login-overlay::after { font-size: 10px; letter-spacing: 0; bottom: 36px; padding: 0 16px; }
  .login-box .google-btn { width: 92%; }
  .lb-cristal { padding: 2em 1em 1.1em; }
}
@media (max-height: 600px) and (max-width: 900px) {
  .login-overlay { align-items: center; padding-bottom: 0; }
  .lg-escena, .lg-rejilla { display: none; }
}
@media (prefers-reduced-motion: reduce) { .lg-prod, .lg-fibras path, .login-box { animation: none; } .lg-fibras { display: none; } }

/* ── Botones unificados (Pablo, 29/09: "botones desordenados") ─────────────────────────────────────────────
   Había dos sistemas: .config-btn (páginas viejas: sin borde, gris del navegador, radio 6px) y .g-btn (rediseño:
   borde, radio 2px, 12px). Ahora los dos comparten altura, radio, letra y 3 jerarquías:
     principal  = .config-btn.primary / .g-btn.prim   (color de la marca, UNO por grupo)
     secundario = .config-btn / .g-btn                (fondo claro con borde)
     peligro    = .config-btn.danger                  (borde y texto rojo; relleno rojo sólo al pasar el mouse)
   .small = compacto (tablas, listas) · .icono = sólo un ícono (⟳ ✕ 🗑️), cuadrado. */
.config-btn, .g-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 0 14px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1.2;
  cursor: pointer; white-space: nowrap; vertical-align: middle; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, filter .15s;
}
.config-btn:hover, .g-btn:hover { background: var(--surface2); border-color: var(--g-muted); }
.config-btn.primary, .g-btn.prim { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.config-btn.primary:hover, .g-btn.prim:hover { background: var(--accent); border-color: var(--accent); filter: brightness(1.15); }
.config-btn.danger { background: transparent; border-color: var(--g-danger); color: var(--g-danger); }
.config-btn.danger:hover { background: var(--g-danger); color: var(--surface); }
.config-btn.small, .tk-resumen .g-btn { min-height: 28px; padding: 0 10px; font-size: 12px; border-radius: 5px; }
.config-btn.icono, .g-btn.icono { min-width: 28px; padding: 0 6px; }
.config-btn:disabled, .g-btn:disabled, .config-btn:disabled:hover, .g-btn:disabled:hover { opacity: .45; cursor: default; filter: none; }
.config-btn:focus-visible, .g-btn:focus-visible { outline: 2px solid var(--accent-tx); outline-offset: 2px; }
/* Grupos de acciones: siempre con el mismo aire entre botones, y que bajen de renglón en vez de apretarse. */
.cm-acciones, .g-modal .botones, .acciones { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.al-tabla td .config-btn + .config-btn { margin-left: 4px; }
.g-modal .botones .g-btn { min-height: 40px; padding: 0 18px; font-size: 13px; }
/* Los "← Volver" / "Cerrar" que sólo existen en pantallas chicas: el display de arriba no los tiene que mostrar en
   la computadora (misma lógica que sus reglas originales, con más prioridad). */
.g-btn.cm-volver, .g-btn.tk-volver, .g-btn.cm-ficha-cerrar, .config-btn.conv-volver { display: none; }
@media (max-width: 1319px) { .g-btn.cm-ficha-cerrar { display: inline-flex; } }
@media (max-width: 760px) { .g-btn.cm-volver, .g-btn.tk-volver { display: inline-flex; } }
@media (max-width: 640px) { .conv-layout.con-charla .config-btn.conv-volver { display: inline-flex; } }
@media (max-width: 640px) {
  .config-btn, .g-btn { min-height: 38px; }
  .config-btn.small { min-height: 32px; }
}

/* ── Celular (Pablo, 29/09: "revisá cómo se ve en el celular") ───────────────────────────────────────────────
   En el Dashboard las secciones medían 738px en un teléfono de 390px y se cortaban a la derecha: los flex no
   podían achicarse (faltaba min-width:0) y el encabezado de cada sección no bajaba de renglón. */
.page, .config-page { min-width: 0; }
.dash-section > summary { flex-wrap: wrap; row-gap: 0.25rem; }
@media (max-width: 640px) {
  .config-page { padding: 1rem; }
  .dash-sec-hint { flex: 1 1 100%; order: 3; }
  .ia-stat { min-width: calc(50% - 0.25rem); }
  /* Configuración › listas de números: el número ocupa todo el renglón; etiqueta/motivo y "+ Agregar" abajo
     (antes los dos campos quedaban cortados: "Número (ej: 5", "Etiqueta (opc"). */
  .bl-add-row { flex-wrap: wrap; }
  .bl-add-row input:first-child { flex: 1 1 100%; }
}

/* ── Inicio (Luis, 05/10: "una pantalla de inicio para que no sea tan chocante") ─────────────────────────────────────
   Primera pantalla después del login: saludo, lo que espera a una persona, tareas, envíos de hoy, últimas charlas y accesos.
   Sólo usa datos que el panel ya trae (lk_conversaciones list, lk_alertas, lk_vinculaciones, la llave): nada que cobre.
   Entra con un fundido corto; la animación está en el contenedor, así el refresco de cada 45 s no la repite. */
#pageInicio { container-type: inline-size; }
#pageInicio.active { display: block; min-width: 0; overflow-y: auto; animation: iniEntra .35s ease both; }
@keyframes iniEntra { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #pageInicio.active { animation: none; } }
.ini { padding: 28px 28px 32px; display: flex; flex-direction: column; gap: 18px; color: var(--ink); max-width: 1320px; }
/* Dos columnas cuando el ÁREA de Inicio (no la ventana) mide 1.000 px o más: así cuenta si la barra está abierta o plegada.
   Derecha: estado del bot, gasto de IA y accesos (Luis, 05/10). Más angosto, todo en una columna. */
.ini-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.ini-izq, .ini-der { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
@container (min-width: 1000px) {
  .ini-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .ini-der .ini-mods { grid-template-columns: minmax(0, 1fr); }
}
.ini-der .g-btn { align-self: flex-start; }
.ini-llave { display: inline-block; padding: 2px 10px; font-size: 14px; font-weight: 900; letter-spacing: .08em; border-radius: 2px; }
.ini-llave.m-0 { background: #4a4a4d; color: #f1ead8; }
.ini-llave.m-prueba { background: #e2b13c; color: #212122; }
.ini-llave.m-1 { background: #2f5a37; color: #f1ead8; }
.ini-gasto { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.ini-gasto div { display: flex; flex-direction: column; gap: 2px; }
.ini-gasto span { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--g-muted); }
.ini-gasto b { font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; }
.ini-gasto i { font-style: normal; font-size: 12px; color: var(--g-muted); }
.ini-hola h2 { margin: 0; font-size: 24px; font-weight: 900; letter-spacing: -.01em; }
.ini-hola p { margin: 4px 0 0; color: var(--g-muted); font-size: 14px; }
.ini-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.ini-card { text-align: left; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--line); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px; cursor: pointer; color: var(--ink); font: inherit; border-radius: 2px; }
.ini-card:hover { border-color: var(--ink); }
.ini-card.urg { border-top-color: var(--accent); }
.ini-card.ok { border-top-color: var(--ok-fg); }
.ini-card span { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--g-muted); }
.ini-card b { font-size: 30px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ini-card i { font-style: normal; font-size: 12px; color: var(--g-muted); }
.ini-card em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--accent-tx); margin-top: 6px; }
.ini-conv { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 4px 12px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line2);
  cursor: pointer; font-size: 13px; }
.ini-conv:last-child { border-bottom: 0; }
.ini-conv:hover b { text-decoration: underline; }
.ini-conv .tx { grid-column: 1 / -1; color: var(--g-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ini-mods { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; }
.ini-mod { text-align: left; background: var(--surface); border: 1px solid var(--line); padding: 10px 12px; cursor: pointer; color: var(--ink); font: inherit;
  border-radius: 2px; display: flex; flex-direction: column; gap: 2px; }
.ini-mod:hover { border-color: var(--ink); }
.ini-mod b { font-size: 14px; }
.ini-mod i { font-style: normal; font-size: 12px; color: var(--g-muted); }
@media (max-width: 760px) { .ini { padding: 16px 12px; } .ini-hola h2 { font-size: 20px; } .ini-card b { font-size: 24px; } }

/* ── Pedidos (v0.31.1, Pablo Olejavetzky 19/10: «meterle mucha más onda, no se entiende nada» y «tomá la de Pedidos web») ──
   Por confirmar y Pedidos web hablan el mismo idioma: números grandes arriba, filtros en chips y una tabla del ancho de su
   contenido donde cada fila se despliega con el detalle. */
#pagePedidosWeb.active { display: block; min-width: 0; overflow-y: auto; }
.pd { max-width: 1240px; }
.pd-cab { display: flex; align-items: baseline; gap: 4px 14px; flex-wrap: wrap; }
.pd-cab h2 { margin: 0; font-size: 20px; font-weight: 900; color: var(--ink); }
.pd-cab .sub { color: var(--g-muted); font-size: 13px; }
.pd-cab .g-btn { align-self: center; }
.pd-cab .sub { flex-basis: 100%; order: 3; }
.pd-tit { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--g-muted); margin: 4px 0 -6px; }
/* Los tres pasos del circuito: el del medio es el de la persona que mira la pantalla. */
.pd-pasos { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pd-paso { display: flex; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--line); padding: 7px 12px 7px 8px; font-size: 12.5px; line-height: 1.3; }
.pd-paso .n { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 12px; background: var(--surface2); color: var(--g-muted); }
.pd-paso.vos { border-color: var(--accent); }
.pd-paso.vos .n { background: var(--accent); color: var(--accent-fg); }
.pd-flecha { color: var(--g-muted); font-weight: 900; }
/* Números grandes: del ancho de lo que muestran, no estirados a toda la pantalla. */
.pd-kpis { display: flex; flex-wrap: wrap; gap: 1px; background: var(--line); border: 1px solid var(--line); width: fit-content; max-width: 100%; }
.pd-kpi { background: var(--surface); padding: 10px 18px 11px; display: flex; flex-direction: column; gap: 1px; min-width: 130px; }
.pd-kpi span { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--g-muted); white-space: nowrap; }
.pd-kpi b { font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pd-kpi i { font-style: normal; font-size: 12px; color: var(--g-muted); white-space: nowrap; }
.pd-kpi.rojo b { color: var(--g-danger); } .pd-kpi.amb b { color: var(--warn); } .pd-kpi.verde b { color: var(--ok-fg); }
.pd-vacio { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--ok-fg);
  padding: 14px 18px; width: fit-content; max-width: 100%; }
.pd-vacio .ic { font-size: 30px; line-height: 1; }
.pd-vacio b { display: block; font-size: 16px; font-weight: 900; color: var(--ink); }
.pd-vacio span { color: var(--g-muted); font-size: 13px; }
/* Filtros */
.pd-barra { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.pd-barra input[type=search] { padding: 6px 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 2px; min-width: 250px; font-size: 13px; }
.pd-barra .carga { font-size: 12px; color: var(--g-muted); }
.pd-seg { display: inline-flex; border: 1px solid var(--line); }
.pd-seg button { background: var(--surface); border: 0; border-right: 1px solid var(--line); padding: 5px 11px; font-weight: 700; font-size: 12px; color: var(--g-muted); cursor: pointer; }
.pd-seg button:last-child { border-right: 0; }
.pd-seg button.activo { background: var(--ink); color: var(--g-bg); }
.pd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-chip { background: var(--surface); border: 1px solid var(--line); padding: 4px 9px; font-size: 12px; font-weight: 700; cursor: pointer; border-radius: 999px; color: var(--ink); white-space: nowrap; }
.pd-chip i { font-style: normal; color: var(--g-muted); font-weight: 400; margin-left: 3px; }
.pd-chip.activo { background: var(--ink); color: var(--g-bg); border-color: var(--ink); }
.pd-chip.activo i { color: var(--g-bg); opacity: .75; }
/* Pastillas de estado: rellenas, con los colores de la paleta (valen en claro y en oscuro). */
.pd-pill { display: inline-flex; gap: 4px; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; line-height: 1.5; }
.pd-pill.gris { background: var(--surface2); color: var(--g-muted); } .pd-pill.azul { background: var(--bot-bg); color: var(--bot-fg); }
.pd-pill.amb { background: var(--hum-bg); color: var(--hum-fg); } .pd-pill.verde { background: var(--ok-bg); color: var(--ok-fg); }
.pd-pill.pur { background: var(--pur-bg); color: var(--pur-fg); } .pd-pill.rojo { background: var(--bad-bg); color: var(--g-danger); }
/* Tabla: cada columna del ancho de su contenido; sólo el cliente y el motivo cortan renglón. */
.pd-marco { background: var(--surface); border: 1px solid var(--line); width: fit-content; max-width: 100%; overflow-x: auto; }
.pd-tab { border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink); }
.pd-tab th { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--g-muted); text-align: left; padding: 9px 10px 7px; border-bottom: 1px solid var(--line); vertical-align: bottom; }
.pd-tab td { padding: 8px 10px; border-bottom: 1px solid var(--line2); white-space: nowrap; vertical-align: middle; }
.pd-tab tr:last-child td { border-bottom: 0; }
.pd-tab .num { text-align: right; }
.pd-tab th.num { padding-left: 0; } /* título numérico (alineado a la derecha): sin aire a la izquierda, para que no ensanche una columna de 1 o 2 cifras */
.pd-tab .tenue { color: var(--g-muted); }
.pd-tab td.cli { white-space: normal; min-width: 150px; max-width: 280px; }
.pd-tab td.cli b { font-weight: 800; }
.pd-tab td.texto { white-space: normal; min-width: 180px; max-width: 360px; color: var(--g-muted); font-size: 12px; }
.pd-tab td.ent { max-width: 210px; overflow: hidden; text-overflow: ellipsis; }
.pd-tab td.tot { font-weight: 900; }
.pd-tab td.avisos { white-space: normal; }
.pd-avs { display: flex; flex-wrap: wrap; gap: 3px; max-width: 210px; }
.pd-tab td.flecha { padding-right: 0; color: var(--g-muted); font-size: 11px; width: 1px; }
.pd-tab tr.pd-fila { cursor: pointer; }
.pd-tab tr.pd-fila:hover td { background: var(--sel); }
.pd-tab tr.pd-fila.abierta td { background: var(--sel); border-bottom-color: transparent; }
.pd-tab tr.pd-fila.abierta td.flecha { color: var(--ink); }
.pd-tab tr.pd-det > td { white-space: normal; padding: 0 10px 14px 28px; background: var(--sel); max-width: 0; } /* max-width 0: el detalle abierto no ensancha las columnas de la tabla */
.pd-cod { display: inline-block; font-size: 11px; font-weight: 700; color: var(--g-muted); border: 1px solid var(--line); padding: 0 5px; margin-left: 6px; white-space: nowrap; vertical-align: 1px; }
.pd-hora { color: var(--g-muted); }
/* Detalle desplegado */
.pd-det-box { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); padding: 12px 14px; width: fit-content; max-width: 100%; }
.pd-det-box h5 { margin: 0 0 4px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--g-muted); }
.pd-items { border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.pd-items th { font-size: 11px; font-weight: 700; color: var(--g-muted); text-align: left; padding: 2px 12px 4px 0; border-bottom: 1px solid var(--line); vertical-align: bottom; }
.pd-items td { padding: 4px 12px 4px 0; border-bottom: 1px solid var(--line2); white-space: nowrap; }
.pd-items .num { text-align: right; }
.pd-cuenta { display: inline-grid; grid-template-columns: auto auto; gap: 3px 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.pd-cuenta span:nth-child(odd) { color: var(--g-muted); }
.pd-cuenta span:nth-child(even) { text-align: right; white-space: nowrap; padding-left: 24px; }
.pd-cuenta .tot { font-weight: 900; font-size: 15px; color: var(--ink) !important; border-top: 1px solid var(--line); padding-top: 4px; }
.pd-datos { display: grid; grid-template-columns: max-content minmax(0, 340px); gap: 3px 12px; font-size: 13px; }
.pd-datos span:nth-child(odd) { color: var(--g-muted); }
.pd-avisos { display: flex; flex-direction: column; gap: 6px; flex-basis: 100%; }
.pd-aviso { background: var(--amb-bg); color: var(--ink); border-left: 3px solid var(--warn); padding: 7px 10px; font-size: 12.5px; line-height: 1.4; max-width: 700px; }
.pd-aviso.rojo { background: var(--bad-bg); border-left-color: var(--g-danger); }
.pd-acc { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex-basis: 100%; padding-top: 2px; }
.pd-acc .g-btn { min-height: 36px; padding: 0 14px; font-size: 13px; }
.pd-acc .efecto { font-size: 12px; color: var(--g-muted); }
@media (max-width: 760px) { .pd-kpi { min-width: 0; flex: 1 1 40%; } .pd-kpi b { font-size: 19px; } .pd-barra input[type=search] { min-width: 0; flex: 1; }
  .pd-flecha { display: none; } .pd-tab tr.pd-det > td { padding-left: 10px; } }

/* ── Redes (v0.32.0, D087): misma bandeja + charla que Conversaciones (.cm), sólo lectura ─────────── */
#pageRedes.active { display: flex; min-width: 0; }
.rs-per { margin-left: auto; padding: 3px 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 2px; font-size: 12px; }

/* ── Facturas por aprobar y Salientes › En revisión (D129, v0.35.0): columnas del ancho de su contenido ── */
.fa-tab { width: auto; }
.fa-tab td.nw, .fa-tab td.num { white-space: nowrap; }
.fa-tab th, .fa-tab td { text-align: left; vertical-align: middle; }
.fa-tab td.num, .fa-tab th.num { text-align: right; }
.fa-tab td.fa-texto { white-space: normal; min-width: 240px; max-width: 520px; font-size: 12px; line-height: 1.4; }
/* Razón social y estado con motivo: tope de ancho y parten renglón, para que la tabla entre sin scroll horizontal. */
.fa-tab td.fa-cli, .fa-tab td.fa-est { white-space: normal; max-width: 260px; }
.fa-tab tr.fa-det td { background: var(--g-soft, rgba(0,0,0,.03)); white-space: normal; }
.fa-tab .g-btn + .g-btn { margin-left: 4px; }
.fa-tab td.fa-acc .g-btn { min-height: 28px; padding: 0 8px; font-size: 12px; }
.fa-tab td { padding-left: 6px; padding-right: 6px; }
.fa-msg h5 { margin: 4px 0 6px; font-size: 12px; }
.fa-texto-largo { white-space: pre-wrap; font-size: 13px; line-height: 1.45; max-width: 640px; padding: 8px 10px; border-radius: 8px; background: var(--card, #fff); border: 1px solid var(--g-line, rgba(0,0,0,.08)); }
.fa-datos { margin-top: 6px; font-size: 12px; color: var(--g-muted); }

/* Agenda (Pablo, 23/10, D158): sin ancho de más. La columna de acciones tiene que verse entera y el lápiz del vendedor es chico (no un botón). */
#agdRoot.pd { max-width: none; }
.agd-tab .g-btn { min-height: 28px; padding: 0 8px; font-size: 12px; }
.agd-tab td:last-child { text-align: right; }
.agd-mini { border: 0; background: transparent; color: var(--g-muted); cursor: pointer; padding: 0 3px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.agd-mini:hover { color: var(--accent); }
.agd-barra { margin: 8px 0; align-items: center; justify-content: flex-start; gap: 8px; }
.agd-cuenta { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--g-muted); font-variant-numeric: tabular-nums; }
.agd-tab th.agd-ord { cursor: pointer; user-select: none; }
.agd-tab th.agd-ord:hover { color: var(--ink); }
.agd-tab th.agd-ord i { font-style: normal; margin-left: 4px; font-size: 10px; opacity: .35; }
.agd-tab th.agd-ord.act { color: var(--ink); }
.agd-tab th.agd-ord.act i { opacity: 1; color: var(--accent); }
.agd-tab tr:hover td { background: var(--sel); }
.agd-tab td.cli b { font-weight: 800; }
.agd-barra .rs-per { margin-left: 8px; }

/* D295 Revisión diaria (v0.35.59: las 5 columnas entran en pantalla; antes heredaba white-space: nowrap de .pd-tab y las dos respuestas quedaban afuera) */
.rv-marco { width: 100%; }
#rvRoot.pd, #rvRoot.sl { max-width: none; } /* Pablo, 12/11: «usá toda la pantalla» */
.rv-tab { width: 100%; table-layout: fixed; }
.rv-tab col.rv-c-h { width: 58px; } .rv-tab col.rv-c-cli { width: 15%; } .rv-tab col.rv-c-m { width: 23%; } .rv-tab col.rv-c-r { width: 29%; } .rv-tab col.rv-c-p { width: auto; }
.rv-tab th, .rv-tab td { white-space: normal; vertical-align: top; overflow-wrap: anywhere; }
/* D348: dos hojas, Pruebas y Clientes */
.rv-hojas { display: flex; gap: 6px; margin: 6px 0; }
.rv-titulo { font-size: 18px; margin: 4px 0 6px; }
.rv-tab td { font-size: 13px; line-height: 1.35; }
.rv-tab td.rv-h { white-space: nowrap; }
.rv-tab .pd-cod { display: inline-block; margin: 3px 4px 0 0; }
.rv-tab td.rv-h .pd-cod { white-space: normal; }
.rv-hr { border: 0; border-top: 1px dashed var(--g-line, #555); margin: 4px 0; }
.rv-barra { display: flex; gap: 14px; align-items: center; margin: 0 0 8px; font-size: 13px; }
.rv-check, .rv-ver { display: flex; gap: 4px; align-items: center; font-size: 12px; margin-top: 6px; cursor: pointer; white-space: nowrap; }
.rv-ver { margin-top: 0; }
.rv-tab tr.rv-ok td { opacity: .55; }
.rv-prop { width: 100%; box-sizing: border-box; font: inherit; resize: vertical; min-height: 64px; }
/* D297 Constitución */
.ct-doc { max-width: 960px; line-height: 1.45; }
.ct-doc h2 { font-size: 18px; margin: 18px 0 6px; } .ct-doc h3, .ct-doc h4 { font-size: 15px; margin: 14px 0 4px; }
.ct-doc p { margin: 0 0 8px; } .ct-doc blockquote { margin: 0 0 8px; padding-left: 10px; border-left: 2px solid var(--g-line, #555); }
.ct-doc ul { margin: 0 0 8px 18px; padding: 0; }
.ct-tab { border-collapse: collapse; margin: 0 0 10px; } .ct-tab th, .ct-tab td { border: 1px solid var(--g-line, #555); padding: 4px 6px; vertical-align: top; text-align: left; font-size: 13px; }

/* D357 (13/11/2026): tira de pestañas de una entrada del menú que junta varias pantallas (Ajustes › Bot, Condiciones comerciales, Avanzado). */
.mod-pest { flex: none; display: flex; gap: 6px; overflow-x: auto; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.mod-pest button { background: var(--surface2); border: 1px solid var(--line); color: var(--ink); border-radius: 14px; padding: 4px 11px; font-size: 12px;
  font-weight: 700; cursor: pointer; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.mod-pest button.activa { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.mod-pest .g-badge { margin-left: 0; }

/* D429 (13/11): ¿contesta el agente o la persona? Tarjeta fija con cuenta regresiva de 10 s. */
.g-eleccion { position: fixed; right: 16px; bottom: 40px; z-index: 9998; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.g-eleccion-item { background: var(--surface); border: 2px solid var(--accent); color: var(--ink); padding: 10px 12px; box-shadow: 0 4px 16px rgba(0,0,0,.25); font-size: 13px; }
.g-eleccion-tit { margin-bottom: 4px; }
.g-eleccion-txt { color: var(--g-muted); margin-bottom: 8px; overflow-wrap: anywhere; }
.g-eleccion-fila { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.g-eleccion-seg { color: var(--g-muted); font-size: 12px; margin-left: auto; }


/* ── v0.38.0 (Luis Rial, 17/11): logo que vuelve al Inicio, barra de celular y explicación de Tareas ── */
.sb2 .sb-logo .sb-logo-ir { display: block; cursor: pointer; border-radius: 2px; }
.sb2 .sb-logo .sb-logo-ir:focus-visible { outline: 2px solid #f7efdc; outline-offset: 3px; }
.sb2 .sb-logo img { width: 180px; }
.mob-bar { display: none; }
@media (max-width: 1100px) {
  .mob-bar { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #212122; }
  .mob-bar .mob-logo { display: block; flex: 0 1 auto; min-width: 0; }
  .mob-bar .mob-logo img { display: block; height: 36px; width: auto; max-width: 100%; }
  .mob-bar .mob-ini { margin-left: auto; flex: none; min-height: 40px; padding: 0 12px; background: transparent; color: #f1ead8;
    border: 1px solid #4a4a4d; border-radius: 2px; font-weight: 700; font-size: 13px; cursor: pointer; }
  .mob-bar .mob-ini.activo { display: none; }
  .mod-select { min-height: 40px; }
}
@media (max-width: 400px) { .mob-bar .mob-logo img { height: 30px; } }
.tk-que { margin: 0 0 8px; font-size: 12px; line-height: 1.45; color: var(--g-muted); }
.tk-que summary { cursor: pointer; list-style-position: inside; }
.tk-que b { color: var(--ink); }
.tk-que ul { margin: 6px 0 4px 18px; padding: 0; }
.tk-que li { margin: 2px 0; }
.tk-que p { margin: 4px 0 0; }

/* ── v0.38.1 · D617 (Luis Rial, 17/11): fase 1 del plan de UI/UX ── */
/* El título dice dónde estás: módulo › sección › pestaña. */
.mod-head h1 .mod-donde { font-weight: 700; color: var(--g-muted); }
/* Las tres pruebas son pestañas de Ajustes › Avanzado: la fila vieja de pestañas no se muestra. */
#chatTabBar { display: none !important; }
@media (max-width: 760px) {
  .mod-head h1 { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .mod-head h1 .mod-donde:not(:last-child) { display: none; }
  /* Tamaño táctil: 44 px (Apple) en lo que se toca con el dedo. */
  .mod-head .mod-tab, .mod-pest button, .cm-chip, .g-btn, .config-btn, .config-btn.small, .tk-resumen .g-btn, .tk .cm-acciones .g-btn,
  .mod-select, .cm-buscar, select { min-height: 44px; }
  .cm-chip { padding-left: 12px; padding-right: 12px; }
  /* La tira de pestañas avisa que hay más hacia el costado. */
  .mod-head .mod-tabs, .mod-pest { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); padding-right: 28px; }
}
/* v0.38.2 (Luis Rial, 17/11: «optimicemos espacio y UI»): barra lateral sin el aviso de esperas ni el subtítulo; el botón de plegar
   baja al pie para no tapar el logo. En celular, título, módulo y tema en un solo renglón. */
.sb2 .sb-logo { padding: 16px 16px 10px; }
.sb2 .sb-logo .sb-nombre { display: none; }
.sb2 .sb-plegar { top: auto; bottom: 10px; }
.sb2 .user-info { padding-right: 44px; }
@media (max-width: 760px) {
  .mod-head { flex-wrap: wrap; row-gap: 0; }
  .mod-head h1 { flex: 1 1 0; }
  .mod-head .mod-der { margin: 0; gap: 6px; }
  .mod-head .mod-select { max-width: 132px; }
  #btnTema { font-size: 0; width: 44px; padding: 0; }
  #btnTema::before { content: "◐"; font-size: 18px; }
}
.sb2 .sb-logo .sb-logo-ir { padding: 0; margin: 0; width: auto; background: none; }
.sb2 .sb-logo img { width: 100%; max-width: 180px; }

/* ── v0.39.0 · D618 (Luis Rial, 17/11): Ajustes como índice agrupado ── */
.aj-indice { display: none; }
.aj-volver { display: none; }
.app.en-ajustes .aj-indice { display: flex; flex-direction: column; flex: none; width: 272px; min-height: 0; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--line); padding: 12px 10px 24px; gap: 4px; }
.aj-indice .aj-buscar { width: 100%; margin: 0 0 6px; box-sizing: border-box; }
.aj-indice .aj-grupo h3 { margin: 12px 8px 4px; font-size: 11px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: var(--g-muted); }
.aj-indice .aj-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left; background: none; border: 0;
  border-radius: 2px; padding: 7px 8px; cursor: pointer; color: var(--ink); }
.aj-indice .aj-item b { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.aj-indice .aj-item b .g-badge { margin-left: 0; background: var(--accent); color: var(--accent-fg); }
.aj-indice .aj-item span { font-size: 11.5px; line-height: 1.35; color: var(--g-muted); }
.aj-indice .aj-item:hover { background: var(--surface2); }
.aj-indice .aj-item.activa { background: #661317; }
.aj-indice .aj-item.activa b, .aj-indice .aj-item.activa span { color: #f7efdc; }
/* Celular: el índice solo; al elegir, la opción a pantalla completa con «‹ Ajustes». */
@media (max-width: 760px) {
  .app.en-ajustes .aj-indice { width: 100%; border-right: 0; padding: 12px 16px 24px; }
  .app.en-ajustes:not(.aj-solo-indice) .aj-indice { display: none; }
  .app.aj-solo-indice .pages > .page { display: none !important; }
  .app.en-ajustes:not(.aj-solo-indice) .aj-volver { display: inline-flex; align-items: center; }
  .aj-indice .aj-item { padding: 10px 8px; min-height: 44px; }
  .aj-indice .aj-item b { font-size: 15px; }
  .aj-indice .aj-item span { font-size: 13px; }
}
@media (max-width: 760px) {
  /* Dentro de una opción de Ajustes: «‹ Ajustes» + el nombre de la opción, sin el módulo ni el selector. */
  .app.en-ajustes:not(.aj-solo-indice) .mod-head h1 .mod-mod, .app.en-ajustes:not(.aj-solo-indice) .mod-head h1 .mod-donde i,
  .app.en-ajustes:not(.aj-solo-indice) .mod-head .mod-select { display: none; }
  .app.en-ajustes:not(.aj-solo-indice) .mod-head h1 .mod-donde { color: var(--ink); }
}

/* ── v0.40.0 · D619 (Luis Rial, 17/11): Inicio = «para hacer ahora» ── */
.ini-lista h4 { display: flex; align-items: center; gap: 8px; }
.ini-lista h4 .g-badge { margin-left: 0; background: var(--accent); color: var(--accent-fg); }
.ini-hacer { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 9px 2px; border-top: 1px solid var(--line); }
.ini-hacer:first-of-type { border-top: 0; }
.ini-hacer .tk-dot { margin: 0; }
.ini-hacer .q { min-width: 0; font-size: 13px; }
.ini-hacer .q span { display: block; color: var(--g-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ini-hacer .t { font-size: 12px; white-space: nowrap; }
.ini-hacer .g-btn { white-space: nowrap; }
.ini-mas { margin-top: 8px; }
.ini-vacio { padding: 14px 2px; font-weight: 700; }
.ini-aldia { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--g-muted); }
/* Celular: el botón baja debajo del texto, a todo el ancho de la fila; el tiempo queda arriba a la derecha. */
.ini-hacer { cursor: pointer; }
.ini-hacer:hover { background: var(--surface2); }
.ini-hacer .ir { display: none; }
/* Celular: sin botón, la fila entera se toca; el tiempo debajo del texto y una flecha a la derecha. */
@media (max-width: 760px) {
  .ini-hacer { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "dot q ir" "dot t ir"; row-gap: 2px; padding: 12px 2px; min-height: 44px; }
  .ini-hacer .tk-dot { grid-area: dot; align-self: start; margin-top: 5px; }
  .ini-hacer .q { grid-area: q; }
  .ini-hacer .t { grid-area: t; }
  .ini-hacer .g-btn { display: none; }
  .ini-hacer .ir { display: block; grid-area: ir; font-style: normal; font-size: 22px; color: var(--g-muted); }
  .ini-hacer .q span { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}

/* ── v0.41.0 · D616 (Luis Rial, 17/11): fase 4, el celular con presentación propia ── */
.mob-nav, .mas-fondo { display: none; }
@media (max-width: 760px) {
  /* Barra inferior: 5 destinos, al pie de la columna (no tapa el contenido). */
  .mob-nav { flex: none; display: flex; background: var(--surface); border-top: 1px solid var(--line); padding: 0 0 env(safe-area-inset-bottom); }
  .mob-nav:empty { display: none; }
  .mob-nav button { flex: 1 1 0; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    min-height: 56px; background: none; border: 0; color: var(--g-muted); font-size: 11px; font-weight: 700; cursor: pointer; }
  .mob-nav button .ic { font-size: 19px; line-height: 1; }
  .mob-nav button.activa { color: var(--accent); }
  .mob-nav button.activa::before { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; background: var(--accent); }
  .mob-nav button .g-badge { position: absolute; top: 5px; left: calc(50% + 6px); margin: 0; background: var(--accent); color: var(--accent-fg); font-size: 10px; line-height: 15px; min-width: 15px; }
  /* Dentro de una charla, una tarea abierta o con el teclado: sin barra (como WhatsApp). */
  .app:has(#pageConv.active #cmRoot.con-charla) .mob-nav, .app:has(#pageTareas.active #tkRoot.con-detalle) .mob-nav,
  .app:has(#pageRedes.active #rsRoot.con-charla) .mob-nav, .app:has(#pageCobranzas.active #cbRoot.con-charla) .mob-nav,
  body.escribiendo .mob-nav { display: none; }
  /* La barra reemplaza el selector de módulo y el botón «⌂ Inicio» de arriba. */
  .app:has(.mob-nav:not(:empty)) .mod-head .mod-select, .app:has(.mob-nav:not(:empty)) .mob-bar .mob-ini { display: none; }
  .mob-bar { padding: 8px 16px; }
  /* Hoja «Más» desde abajo. */
  .mas-fondo:not([hidden]) { display: flex; position: fixed; inset: 0; z-index: 1600; background: rgba(0,0,0,0); align-items: flex-end; transition: background .18s; }
  .mas-fondo.abierta { background: rgba(0,0,0,.4); }
  .mas-hoja { width: 100%; background: var(--surface); border-radius: 12px 12px 0 0; padding: 6px 16px calc(16px + env(safe-area-inset-bottom));
    transform: translateY(100%); transition: transform .18s ease; max-height: 80vh; overflow-y: auto; }
  .mas-fondo.abierta .mas-hoja { transform: none; }
  .mas-asa { width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 8px; }
  .mas-fila { display: grid; grid-template-columns: minmax(0, 1fr) auto; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line);
    padding: 12px 2px; min-height: 52px; color: var(--ink); cursor: pointer; }
  .mas-fila b { font-size: 15px; }
  .mas-fila span { grid-column: 1; font-size: 12px; color: var(--g-muted); }
  .mas-fila i { grid-column: 2; grid-row: 1 / 3; align-self: center; font-style: normal; font-size: 22px; color: var(--g-muted); }
  .mas-pie { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; }
  /* Chips en una sola fila que se desliza (como Gmail), en vez de 3 renglones. */
  .cm-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .cm-chips::-webkit-scrollbar { display: none; }
  .cm-chip { flex: none; white-space: nowrap; }
  /* Tablas como tarjetas: cada fila una tarjeta, cada dato con el título de su columna; sin desplazar de costado. */
  .pd-marco { overflow-x: visible; }
  .pd-tab, .pd-tab tbody, .pd-tab tr, .pd-tab td { display: block; width: 100%; box-sizing: border-box; }
  .pd-tab tr:has(> th) { display: none; }
  .pd-tab tr { border: 1px solid var(--line); background: var(--surface); margin: 0 0 8px; padding: 6px 10px; }
  .pd-tab td { display: flex; justify-content: flex-end; align-items: baseline; gap: 6px; padding: 4px 0; border: 0; white-space: normal; text-align: right; }
  .pd-tab td[data-l]::before { margin-right: auto; }
  .pd-tab td[data-l]::before { content: attr(data-l); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--g-muted); text-align: left; flex: none; }
  .pd-tab td.cli { display: block; text-align: left; }
  .pd-tab td.cli::before { display: block; margin-bottom: 2px; }
  .pd-tab td:empty { display: none; }
  /* La acción principal de una tarea o charla queda fija abajo. */
  .tk-detalle .cm-acciones { position: sticky; bottom: 0; z-index: 2; background: var(--surface); padding: 8px 0; border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  /* Con la barra inferior, las pestañas de Mensajes son sólo Clientes · Internos · Vendedores (Tareas va en la barra; Enviados, Agenda y
     Redes en «Más»); en esas pantallas la tira no se muestra. */
  .app:has(.mob-nav:not(:empty)) .mod-head .mod-tab:is([data-s=tareas], [data-s=salientes], [data-s=agenda], [data-s=redes]) { display: none; }
  .app:has(.mob-nav:not(:empty)):has(.mod-tab.activa:is([data-s=tareas], [data-s=salientes], [data-s=agenda], [data-s=redes])) .mod-head .mod-tabs { display: none; }
  .pd-marco { display: block; width: 100%; }
  #verBadge { bottom: calc(64px + env(safe-area-inset-bottom)) !important; }
  body.escribiendo #verBadge { display: none; }
}

/* ── v0.42.0 · D621 (Luis Rial, 17/11): buscador global (Ctrl+K) ── */
.bus-btn { display: inline-flex; align-items: center; gap: 6px; }
.bus-btn kbd { font: 700 10px/1 inherit; padding: 3px 5px; border: 1px solid var(--line); border-radius: 3px; color: var(--g-muted); background: var(--surface); }
.bus-fondo:not([hidden]) { position: fixed; inset: 0; z-index: 1700; background: rgba(0,0,0,.4); display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; }
.bus-caja { width: min(560px, calc(100% - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.35); overflow: hidden; display: flex; flex-direction: column; max-height: 70vh; }
.bus-caja input { border: 0; border-bottom: 1px solid var(--line); padding: 14px 16px; font-size: 16px; background: var(--surface); color: var(--ink); outline: none; }
.bus-res { overflow-y: auto; padding: 6px; }
.bus-grupo { padding: 8px 10px 4px; font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--g-muted); }
.bus-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left; background: none; border: 0; border-radius: 4px; padding: 8px 10px; cursor: pointer; color: var(--ink); }
.bus-item b { font-size: 14px; }
.bus-item span { font-size: 12px; color: var(--g-muted); }
.bus-item.sel { background: #661317; }
.bus-item.sel b, .bus-item.sel span { color: #f7efdc; }
.bus-pie { padding: 8px 14px; border-top: 1px solid var(--line); font-size: 11px; color: var(--g-muted); }
@media (max-width: 760px) {
  .bus-btn { width: 44px; padding: 0; justify-content: center; }
  .bus-btn span, .bus-btn kbd { display: none; }
  .bus-fondo:not([hidden]) { padding-top: 0; align-items: stretch; }
  .bus-caja { width: 100%; max-height: none; border-radius: 0; border: 0; }
  .bus-item { min-height: 48px; justify-content: center; }
  .bus-pie { display: none; }
}

/* ── v0.43.0 · D625 (Luis Rial, 17/11): menos botones, menos texto a la vista, urgencia clara ── */
/* Encabezado: lupa y menú ☰, cuadrados. */
.ico-btn { width: 40px; height: 40px; min-height: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; }
.hdr-menu, .cm-mas { position: relative; }
.hdr-menu > summary, .cm-mas > summary { list-style: none; cursor: pointer; }
.hdr-menu > summary::-webkit-details-marker, .cm-mas > summary::-webkit-details-marker { display: none; }
.hdr-menu-lista, .cm-mas-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 1500; min-width: 210px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 12px 32px rgba(0,0,0,.18); padding: 4px; display: flex; flex-direction: column; }
.hdr-menu-lista button, .cm-mas-menu > button { text-align: left; background: none; border: 0; padding: 9px 12px; border-radius: 4px; font: 600 13px/1.2 inherit;
  color: var(--ink); cursor: pointer; white-space: nowrap; min-height: 40px; }
.hdr-menu-lista button:hover, .cm-mas-menu > button:hover { background: var(--surface2); }
.hdr-menu-lista #btnTema { font-size: 13px !important; width: auto !important; }
.hdr-menu-lista #btnTema::before { content: none !important; }
.cm-mas-nc { padding: 6px 8px; border-top: 1px solid var(--line); margin-top: 4px; }
.cm-mas-nc select { width: 100%; }
/* Charla: «👤 Perfil» y «⋯» a la derecha del encabezado. */
.cm-chat-head .cm-acciones { justify-content: flex-start; }
.cm-perfil { white-space: nowrap; }
.cm.ficha-abierta .cm-perfil { background: var(--ink); color: var(--surface); border-color: var(--ink); }
/* Ficha del cliente cerrada salvo que se pida (en ancho, columna; si no, por encima). */
.cm-ficha-plegar { display: none !important; }
.g-btn.cm-ficha-cerrar { display: inline-flex !important; }
@media (min-width: 1320px) {
  .cm:not(.ficha-abierta) .cm-ficha { display: none; }
  .cm.ficha-plegada .cm-ficha { width: 300px; }
  .cm.ficha-plegada #cmFicha { display: block; }
}
/* Charla esperando a una persona: franja roja, fondo tenue y «Responder». */
.cm-fila.urg { box-shadow: inset 4px 0 0 #c62828; background: color-mix(in srgb, #c62828 7%, var(--surface)); }
.cm-fila.urg.sel { background: color-mix(in srgb, #c62828 14%, var(--surface)); }
.cm-urg { flex: none; margin-right: 6px; padding: 1px 7px; border-radius: 10px; background: #c62828; color: #fff; font-size: 11px; font-weight: 900;
  letter-spacing: .02em; line-height: 17px; }
.cm-fila .l1 { align-items: center; }
@media (max-width: 760px) {
  /* En celular, tema y sesión ya están en «Más»: el ☰ sobra. */
  .app:has(.mob-nav:not(:empty)) .hdr-menu { display: none; }
  .cm-perfil { padding: 0 10px; }
}
.cm-fila .l1 .cm-urg { color: #fff; font-size: 11px; }
.cm-fila .l1 > b, .cm-fila .l1 > i { margin-right: auto; min-width: 0; }
.cm-filtros { display: flex; gap: 6px; flex-wrap: wrap; }
.cm-filtros select { flex: 1 1 120px; min-width: 0; }
/* Encabezado de la charla en una franja: nombre y datos a la izquierda, «Perfil» y «⋯» a la derecha (menos alto). */
.cm-chat-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: center; }
.cm-chat-head > * { grid-column: 1; }
.cm-chat-head > .cm-acciones { grid-column: 2; grid-row: 1 / span 3; margin: 0; flex-wrap: nowrap; }
@media (min-width: 1101px) { #verBadge { right: auto !important; left: 8px; } }
@media (max-width: 760px) { .cm-perfil span { display: none; } }

/* ── v0.44.0 · D627 (Luis Rial, 17/11: «revisión integral y mejora»; revisión pantalla por pantalla) ── */
/* El título de cada pantalla ya está arriba (Módulo › Sección): sin el h2 ni la oración de abajo. Lo que tiene id (dato vivo) queda. */
.pd-cab > h2, .pd-cab > .sub:not([id]) { display: none; }
.pd-cab { justify-content: flex-end; }
.pd-cab:has(> h2) > .g-btn:first-of-type { margin-left: auto; }
/* La versión visible va en el menú ☰ / «Más»: sin cartel flotante. */
#verBadge { display: none !important; }
.hdr-ver { padding: 8px 12px 4px; font-size: 11px; color: var(--g-muted); border-top: 1px solid var(--line); margin-top: 4px; }
.mas-pie .hdr-ver { border: 0; margin: 0; padding: 0; }
/* Barra lateral: sólo módulos, con su globito. */
.sb2 .sb-mod .g-badge { margin-left: auto; }
.sb2 .sb-mods { gap: 4px; padding-top: 10px; }
.sb2 .sb-mod { padding: 10px 12px; font-size: 14px; }
/* Índice de Ajustes con una opción abierta: sólo nombres (la descripción, en el globo) y la de la opción abierta. */
@media (min-width: 761px) {
  .app.en-ajustes:not(.aj-solo-indice) .aj-indice .aj-item:not(.activa) span { display: none; }
  .app.en-ajustes:not(.aj-solo-indice) .aj-indice .aj-item { padding: 6px 8px; }
}
/* Tarjetas de tabla en celular: sin flechas de ordenar. */
@media (max-width: 760px) { .pd-tab td[data-l]::before { content: attr(data-l); } .pd-tab th i, .agd-ord i { display: none; } }
/* Charla: el globo del agente sin rótulo; el de una persona conserva su nombre. */
.bb.bot { padding-top: 7px; }
/* Inicio: la fila sin botón muestra «›» también en escritorio. */
.ini-hacer .ir { display: block; font-style: normal; font-size: 20px; color: var(--g-muted); }
.ini-hacer:has(.g-btn) .ir { display: none; }
@media (max-width: 760px) { .ini-hacer:has(.g-btn) .ir { display: block; } }
/* Sin stock: los títulos de cada tabla separados de la tabla de arriba. */
.pd-tit { margin: 14px 0 6px !important; }
.pd-pasos[hidden] { display: none; }

/* ── v0.45.0 · D628 (Luis Rial, 17/11): la franja de la llave pasa a una pastilla en el encabezado ── */
.llave-pill { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 16px; border: 0; cursor: pointer;
  font: 800 12px/1 inherit; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.llave-pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.llave-pill.m-0 { background: #4a4a4d; color: #f1ead8; }
.llave-pill.m-prueba { background: #e2b13c; color: #212122; }
.llave-pill.m-1 { background: #2f5a37; color: #f1ead8; }
.llave-pill.m-1 i { background: #7ee08a; box-shadow: 0 0 0 3px rgba(126,224,138,.25); }
@media (max-width: 760px) { .llave-pill { height: 30px; padding: 0 10px; font-size: 11px; } }
/* Enviados: estadísticas en un desplegable cerrado; sin avisos en revisión, una línea. */
.sl-stats { margin-top: 12px; }
.sl-stats > summary { cursor: pointer; font-weight: 800; font-size: 13px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); list-style-position: inside; }
.sl-stats > summary span { font-weight: 400; color: var(--g-muted); margin-left: 6px; }
.sl-stats[open] > summary { margin-bottom: 10px; }
.sl-sin-rev { margin: 0 0 10px; font-size: 13px; }
.tk-card .cm-acciones { align-items: center; }

/* ── v0.46.0 · D629 (Luis Rial, 17/11): Gasto de IA y Circuito de facturas, cada uno sólo lo suyo, sin pliegues ── */
#pageDash[data-vista="ia"] .dash-section:not([data-vista="ia"]),
#pageDash[data-vista="facturas"] .dash-section:not([data-vista="facturas"]) { display: none; }
#pageDash[data-vista] .dash-section > summary { pointer-events: none; cursor: default; }
#pageDash[data-vista] .dash-section > summary::before { content: none; }
#pageDash[data-vista] .dash-section > summary * { pointer-events: auto; }
/* Mensajes: buscador y «⚙ Filtros» en un renglón; adentro, estado, tipo, tema y espera. Escritorio: desplegable; celular: hoja desde abajo. */
#pageConv .cm-top { flex-direction: row; flex-wrap: wrap; align-items: center; }
#pageConv .cm-top > .cm-prio { flex: 1 1 100%; }
#pageConv .cm-top > .cm-buscar { flex: 1 1 0; min-width: 0; }
.cm-fbox { position: relative; flex: none; }
.cm-fsum { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; height: 36px; border: 1px solid var(--line);
  background: var(--surface); border-radius: 2px; font-weight: 700; font-size: 13px; color: var(--ink); white-space: nowrap; }
.cm-fsum::-webkit-details-marker { display: none; }
.cm-fsum.activo { border-color: var(--accent); color: var(--accent); }
.cm-fsum .g-badge { margin: 0; background: var(--accent); color: var(--accent-fg); }
.cm-fbox-in { position: absolute; right: 0; top: calc(100% + 6px); z-index: 1500; width: 320px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 6px; box-shadow: 0 12px 32px rgba(0,0,0,.18); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.cm-fbox-cab { display: flex; align-items: center; gap: 8px; }
.cm-fbox-cab b { margin-right: auto; }
.cm-fbox-in .cm-chips { flex-wrap: wrap; }
.cm-fbox-in .cm-filtros { display: flex; flex-direction: column; }
.cm-fbox-in .cm-filtros select { width: 100%; flex: none; }
@media (max-width: 760px) {
  .cm-fsum { height: 44px; }
  .cm-fbox[open]::before { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1599; }
  .cm-fbox-in { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; z-index: 1600; border-radius: 12px 12px 0 0;
    padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 80vh; overflow-y: auto; }
  .cm-fbox-in .cm-chips { flex-wrap: wrap; overflow: visible; }
}
/* La pastilla de envíos sin dato (vendedor, o mientras carga) no se muestra (auditoría 1910). */
.llave-pill[hidden] { display: none; }

/* ── v0.47.0 · D632 (Luis Rial, 17/11): desglose en la barra lateral y el menú ☰ al pie de la barra ── */
.sb2 .sb-pie { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.sb2 .sb-pie button { text-align: left; background: none; border: 0; color: #c9c2b3; font: 600 12px/1.2 inherit; padding: 6px 8px; margin: 0 -8px;
  border-radius: 2px; cursor: pointer; }
.sb2 .sb-pie button:hover { background: #2c2c2e; color: #f7efdc; }
.sb2 .sb-ver { font-size: 11px; color: #7d776c; padding: 6px 0 0; }
.sb2 .user-info { padding-right: 16px; }
.sb2 .sb-plegar { top: 12px; bottom: auto; }
.sb2 .sb-logo { padding-right: 44px; }
@media (min-width: 1101px) {
  /* Con la barra lateral a la vista, las secciones ya están ahí: sin la tira de pestañas ni el ☰ arriba. */
  .mod-head .mod-tabs, #modPest { display: none !important; }
  .mod-head .hdr-menu { display: none; }
  .mod-head { padding-bottom: 10px; align-items: center; }
  .mod-head h1 { margin: 0; }
}

/* ── v0.48.1 · D635 (Luis Rial, 17/11): revisión del modo oscuro y del celular pantalla por pantalla ── */
@media (max-width: 760px) {
  /* El detalle desplegado de una fila (pedido por confirmar, factura) ocupa la tarjeta entera, no una fila angosta (auditoría 1914). */
  .pd-tab td[colspan] { display: block; padding: 8px 0; text-align: left; }
  .pd-tab tr.pd-det, .pd-tab tr.fa-det { margin-top: -9px; border-top: 0; }
  .pd-tab tr.fa-det > td:empty { display: none; }
  /* Números de arriba: sin el casillero gris vacío cuando la última fila queda incompleta. */
  .sl-kpis { background: transparent; border: 0; gap: 6px; }
  .sl-kpis > .sl-kpi { border: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .pd-tab tr.pd-det > td { max-width: none; padding: 8px; }
  .pd-det-box { width: auto; flex-direction: column; gap: 12px; }
}
@media (max-width: 760px) {
  /* En tarjeta, cada dato ocupa el ancho entero (los topes de ancho de la tabla dejaban un hueco del color de la tarjeta). */
  .pd-tab td { max-width: none !important; min-width: 0 !important; }
}
@media (max-width: 760px) {
  /* La tablita de artículos dentro del detalle desplegado sigue siendo tabla (es corta y entra a lo ancho). */
  .pd-det-box table { display: table !important; width: 100%; }
  .pd-det-box tbody, .pd-det-box thead { display: table-row-group !important; }
  .pd-det-box tr, .pd-det-box tr:has(> th) { display: table-row !important; border: 0; margin: 0; padding: 0; background: none; }
  .pd-det-box td, .pd-det-box th { display: table-cell !important; padding: 3px 6px; white-space: normal; }
  .pd-det-box td::before { content: none !important; }
}

/* ── v0.49.0 · D636 (Luis Rial, 17/11): respuestas rápidas con «/» ── */
.rr-menu { position: fixed; z-index: 1700; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 12px 32px rgba(0,0,0,.22);
  padding: 4px; display: flex; flex-direction: column; max-height: 50vh; overflow-y: auto; }
.rr-menu[hidden] { display: none; }
.rr-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; background: none; border: 0; border-radius: 4px; padding: 7px 10px;
  cursor: pointer; color: var(--ink); min-height: 40px; }
.rr-item b { font-size: 13px; }
.rr-item span { font-size: 12px; color: var(--g-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rr-item.sel, .rr-item:hover { background: var(--surface2); }
.rr-item.rr-admin { border-top: 1px solid var(--line); border-radius: 0 0 4px 4px; color: var(--g-muted); font-size: 12px; font-weight: 700; min-height: 36px; justify-content: center; }
.rr-vacio { padding: 10px; font-size: 12px; color: var(--g-muted); }
.rr-adm { display: flex; flex-direction: column; gap: 6px; max-height: 40vh; overflow-y: auto; }
.rr-fila { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 6px; align-items: center; border: 1px solid var(--line); padding: 6px 8px; }
.rr-fila b { display: block; font-size: 13px; }
.rr-fila span { display: block; font-size: 12px; color: var(--g-muted); white-space: pre-wrap; }
#rrAtajo { width: 100%; box-sizing: border-box; }
.cm-caja .fila { gap: 8px; }

/* ── Módulo «Cobranzas» (D690): misma bandeja y charla que Mensajes, sin ficha. ── */
#pageCobranzas.active { display: flex; min-width: 0; }
#pageCobranzas .cm-top { flex-direction: row; flex-wrap: wrap; align-items: center; }
#pageCobranzas .cm-top > .cm-prio { flex: 1 1 100%; }
#pageCobranzas .cm-top > .cm-buscar { flex: 1 1 100%; min-width: 0; }
#cbChips { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cb-seg { display: inline-flex; gap: 0; }
.cb-seg .cm-chip { border-radius: 0; margin-left: -1px; }
.cb-seg .cm-chip:first-child { border-radius: 2px 0 0 2px; margin-left: 0; }
.cb-seg .cm-chip:last-child { border-radius: 0 2px 2px 0; }
.cb-est { padding: 3px 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 2px; font-size: 12px; min-width: 0; }
.cb-otra { opacity: .55; }
.cb-mas { display: flex; justify-content: center; padding: 4px 0 8px; }
.cb-otras { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--g-muted); cursor: pointer; }

/* ── «Enviar plantilla» del módulo Cobranzas (D731): elegir, completar con vista previa, confirmar. ── */
.cb-botones { display: inline-flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.cb-pl-lista { display: flex; flex-direction: column; gap: 6px; }
.g-modal .cb-pl-op { width: 100%; box-sizing: border-box; justify-content: space-between; min-height: 44px; font: inherit; }
.g-modal .cb-pl-op.off { opacity: .6; cursor: not-allowed; }
.cb-pl-uso { font-size: 12px; font-weight: 400; color: var(--g-muted); }
.cb-pl-est { font-size: 12px; font-weight: 700; white-space: nowrap; padding: 2px 8px; border-radius: 2px; background: var(--hum-bg); color: var(--hum-fg); text-align: right; }
.cb-pl-est.ok { background: var(--ok-bg); color: var(--ok-fg); }
.cb-pl-hint { font-size: 12px; color: var(--g-muted); }
.cb-pl-campos { display: flex; flex-direction: column; gap: 8px; }
.cb-pl-campo { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--g-muted); }
.g-modal .cb-pl-campo input[type=text] { width: 100%; box-sizing: border-box; font-size: 14px; }
.g-modal .cb-pl-campo input[readonly] { background: var(--surface2); }
.cb-pl-prevtit { font-size: 12px; font-weight: 700; color: var(--g-muted); margin-bottom: -6px; }
.cb-pl-prev { background: var(--chat); color: var(--ink); border: 1px solid var(--line); border-radius: 2px; padding: 10px 12px; white-space: pre-wrap; line-height: 1.45; font-size: 13px; max-height: 40vh; overflow-y: auto; }
@media (max-width: 600px) { .g-modal .cb-pl-campo input[type=text] { font-size: 16px; } }

/* Rendimiento de Loki (D759, Thomas 18/11/2026): tabla día contra día con números centrados, gráfico de líneas y cambios del agente. */
.rl-tab th { text-align: center; padding: 8px 6px 6px; }
.rl-tab th:first-child { text-align: left; }
.rl-tab td { text-align: center; padding: 6px 6px; }
.rl-tab td.rl-dia { text-align: left; }
.rl-tab tr.rl-nota td { white-space: normal; text-align: left; font-size: 12px; color: var(--g-muted); max-width: 720px; padding-top: 0; }
.rl-ayuda { font-size: 12px; margin-top: 4px; }
.rl-graf { padding: 6px 8px; }
.rl-graf svg { display: block; font-family: inherit; }
.rl-graf .rl-g { stroke: var(--line); stroke-width: 1; }
.rl-graf .rl-ax { fill: var(--g-muted); font-size: 12px; }
.rl-graf .rl-st { fill: var(--ink); font-size: 13px; font-weight: 700; }
.rl-graf .rl-et { font-size: 12px; font-weight: 700; }
.rl-graf .rl-l1, .rl-graf .rl-l2, .rl-graf .rl-l3 { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.rl-graf .rl-l1 { stroke: var(--accent-tx); }
.rl-graf .rl-l1-p { fill: var(--accent-tx); } .rl-graf .rl-l1-t { fill: var(--accent-tx); }
.rl-graf .rl-l2 { stroke: var(--ink); stroke-dasharray: 6 4; }
.rl-graf .rl-l2-p { fill: var(--ink); } .rl-graf .rl-l2-t { fill: var(--ink); }
.rl-graf .rl-l3 { stroke: var(--g-muted); }
.rl-graf .rl-l3-p { fill: var(--g-muted); } .rl-graf .rl-l3-t { fill: var(--g-muted); }
.rl-cdia { max-width: 900px; font-size: 13px; margin: 6px 0; }
.rl-cdia ul { margin: 4px 0 0 18px; padding: 0; }
.rl-cdia li { margin: 2px 0; }
.rl-md { max-width: 980px; }
.rl-cdia summary { cursor: pointer; }

/* D764: quién tiene el teléfono de Ventas / Cobranzas (barra lateral) y el autor de lo que sale de la app en cada burbuja. */
.sb2 #sbLinea { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.sb2 .sb-linea { display: grid; grid-template-columns: 1fr auto; gap: 1px 8px; align-items: center; }
.sb2 .sb-linea .t { grid-column: 1 / 3; font-size: 11px; color: #8f897c; }
.sb2 .sb-linea .q { font-size: 12px; color: #e3dccb; min-width: 0; overflow-wrap: anywhere; }
.sb2 .sb-linea .q strong { color: #f1ead8; font-weight: 700; }
.sb2 .sb-linea .q .sin { color: #8f897c; }
.sb2 .sb-linea button { background: #2c2c2e; border: 1px solid #4a4a4d; color: #f1ead8; font: 600 11px/1 inherit; padding: 5px 8px; border-radius: 3px; cursor: pointer; white-space: nowrap; }
.sb2 .sb-linea button:hover { background: #38383b; }
.bb .et .au-sin { color: var(--muted, #8a8579); font-weight: 600; text-transform: none; letter-spacing: 0; }

/* ── v0.54.0 · Línea de WhatsApp: VENTAS | COBRANZAS (Thomas Loekemeyer, 19/11/2026) ─────────────────────────────────────────────────
   Un solo estilo de chip por línea, definido acá una vez: azul = Ventas, violeta = Cobranzas, gris con borde = sin línea.
   Texto blanco sobre fondo sólido (contraste mayor a 5:1 en claro y oscuro). */
:root { --ln-v: #1d63d6; --ln-c: #6d3fc4; --ln-t: #4a4a52; --ln-v-txt: #1d63d6; --ln-c-txt: #6d3fc4; }
html.dark { --ln-v-txt: #7fb0ff; --ln-c-txt: #bfa6ff; --ln-t: #6a6a72; }
/* Interruptor: tres botones iguales, de 44 px de alto, que entran en 390 px sin scroll horizontal. */
.ln-sw { display: flex; gap: 6px; width: 100%; }
.ln-op { flex: 1 1 0; min-width: 0; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 0 3px; cursor: pointer;
  background: var(--surface); border: 2px solid var(--line); border-radius: 8px; font: inherit; }
.ln-op b { font-size: 12.5px; font-weight: 900; letter-spacing: 0; white-space: nowrap; }
.ln-op i { font-style: normal; font-size: 12px; font-weight: 900; min-width: 20px; padding: 0 4px; border-radius: 10px; background: #c62828; color: #fff; line-height: 20px; text-align: center; }
.ln-op.v { border-color: var(--ln-v); color: var(--ln-v-txt); }
.ln-op.c { border-color: var(--ln-c); color: var(--ln-c-txt); }
.ln-op.t { color: var(--ink); }
.ln-op.v.on { background: var(--ln-v); color: #fff; }
.ln-op.c.on { background: var(--ln-c); color: #fff; }
.ln-op.t.on { background: var(--ln-t); border-color: var(--ln-t); color: #fff; }
.ln-op.on i { background: #fff; color: #c62828; }
.ln-bar { flex: none; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
@media (min-width: 761px) { .ln-bar .ln-sw { max-width: 460px; } .ln-op { min-height: 36px; } }
.mas-linea { padding: 8px 0 12px; border-bottom: 1px solid var(--line); }
.mas-ln-tit { display: block; font-size: 12px; color: var(--g-muted); margin: 0 0 6px; }
/* Chip de línea al principio de cada fila: mismo lugar, mismo ancho, mayúsculas. */
.cm-fila .l1 .ln-chip { flex: none; width: 96px; box-sizing: border-box; text-align: center; padding: 0 2px; border-radius: 4px; color: #fff;
  font-size: 13px; font-weight: 900; letter-spacing: .02em; line-height: 20px; white-space: nowrap; overflow: hidden; }
.cm-fila .l1 .ln-chip.v { background: var(--ln-v); }
.cm-fila .l1 .ln-chip.c { background: var(--ln-c); }
.cm-fila .l1 .ln-chip.s { background: transparent; border: 1px solid var(--line); color: var(--g-muted); line-height: 18px; }
/* «Responder» pasa al renglón de abajo (sin agregar altura); en Cobranzas es un «Ver» neutro. */
.cm-fila .l3 .cm-urg { margin-right: 0; line-height: 15px; padding: 0 7px; }
.cm-fila .l3 .cm-urg.ver { background: var(--surface2); color: var(--ink); border: 1px solid var(--line); line-height: 13px; }
.cm-fila .l1 > i.posible { color: var(--ln-v-txt); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Banner rojo: cuántas esperan en cada línea y la más vieja de cada una. */
#cmPrio { flex-direction: column; align-items: stretch; gap: 4px; }
#cmPrio .pr-1 { display: flex; align-items: center; gap: 8px; }
#cmPrio .pr-2 { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; }
#cmPrio .ln-mini b { font-size: 12px; font-weight: 900; letter-spacing: .02em; }
/* Encabezado de la charla: la línea, en grande y con su color. */
.cm-chat-head > .ln-cab { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: -10px -14px 4px; padding: 6px 14px; color: #fff; }
.cm-chat-head > .cm-acciones { grid-row: 2 / span 3; }
.ln-cab b { font-size: 16px; font-weight: 900; letter-spacing: .03em; }
.ln-cab span { font-size: 12px; opacity: .9; }
.ln-cab.v { background: var(--ln-v); }
.ln-cab.c { background: var(--ln-c); }
.ln-cab.s { background: var(--ln-t); }
.ln-posible-det { color: var(--ink); }
.ln-posible-det .g-btn { margin-left: 6px; }

/* D819: Ajustes › Agente › Casos resueltos (gestop2.js crPintar). Tarjetas a lo ancho del texto, no de la pantalla. */
.cr-caso { max-width: 880px; border: 1px solid var(--line); border-left: 4px solid var(--line); background: var(--surface); padding: 10px 14px; margin: 0 0 10px; }
.cr-caso.aprobado { border-left-color: var(--ok-fg); }
.cr-caso.borrador { border-left-color: var(--warn, #9a6b00); }
.cr-caso.descartado { opacity: .55; }
.cr-cab { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.cr-est { font-size: 12px; font-weight: 700; }
.cr-meta { font-size: 12px; color: var(--g-muted); }
.cr-sit { margin: 6px 0; line-height: 1.4; }
.cr-pasos { margin: 4px 0 8px; padding-left: 22px; line-height: 1.45; }
.cr-kv { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; font-size: 13px; }
.cr-kv span:nth-child(odd) { color: var(--g-muted); white-space: nowrap; }
.cr-bot { display: flex; gap: 6px; margin-top: 8px; }
.cr-campo { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--g-muted); }
.cr-campo input, .cr-campo textarea { font: inherit; font-size: 13px; color: var(--ink); width: 100%; box-sizing: border-box; }

/* Devoluciones por artículo (D832, Thomas 20/11/2026): filtros en una fila, tabla al ancho del dato, títulos partidos en dos renglones. */
.dv-filtros { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 13px; color: var(--g-muted); margin: 8px 0 4px; }
.dv-filtros select { margin-left: 4px; }
.dv-vista { display: inline-flex; gap: 0; align-self: center; }
.dv-vista .g-btn.sel { background: var(--ink); color: var(--surface); }
.dv-tab td.dv-art { white-space: normal; min-width: 140px; max-width: 280px; }
.dv-tab .dv-cod { width: 5.5em; font-size: 13px; }
.dv-tab .dv-bots { display: flex; flex-direction: column; gap: 4px; }
.dv-tab td.texto { max-width: 200px; min-width: 140px; }
.dv-tab select { max-width: 9.5em; }
.dv-aviso { background: var(--amb-bg); margin: 6px 0; max-width: 880px; padding: 6px 10px; font-size: 12px; border-radius: 2px; }
.dv-ayuda { font-size: 12px; margin-top: 4px; max-width: 880px; }
@media (max-width: 600px) { .dv-tab .dv-cod { font-size: 16px; } }
.dv-filtros[hidden] { display: none; }
